Assembly Language for Beginners
1.20. ARRAYS That’s fine for commutative operations like addition or multiplication (operands may be swapped there without chang ...
1.20. ARRAYS In fact yes, if you represent the list of strings as a two-dimensional array: include <stdio.h> include <a ...
1.20. ARRAYS Listing 1.255: Optimizing GCC 4.9 x64 movsx rdi, edi lea rax, [rdi+rdi*4] lea rax, month2[rax+rax] ret LEAis also u ...
1.20. ARRAYS Listing 1.258: Optimizing Keil 6/2013 (Thumb mode) ; R0 = month MOVS r1,#0xa ; R1 = 10 MULS r0,r1,r0 ; R0 = R1R0 = ...
1.21 By the way. .byte 0, 0 aFebruary: .ascii "February" .byte 0 aMarch: .ascii "March" .byte 0, 0, 0, 0 aApril: .ascii "April" ...
1.22. MANIPULATING SPECIFIC BIT(S) 1.22.1 Specific bit checking x86 Win32 API example: HANDLE fh; fh=CreateFile ("file", GENERIC ...
1.22. MANIPULATING SPECIFIC BIT(S) int handle; handle=open ("file", O_RDWR | O_CREAT); }; We get: Listing 1.265: GCC 4.4.1 publi ...
1.22. MANIPULATING SPECIFIC BIT(S) mov ebx, ecx add ebx, 1 sub esp, 98h mov esi, [ebp+arg_4] ; acc_mode (5th argument) test bl, ...
1.22. MANIPULATING SPECIFIC BIT(S) Here is how the kernel compiled for ARM mode looks inIDA: Listing 1.270: do_last() from vmlin ...
1.22. MANIPULATING SPECIFIC BIT(S) x86 Non-optimizing MSVC We get (MSVC 2010): Listing 1.271: MSVC 2010 _rt$ = -4 ; size = 4 _a$ ...
1.22. MANIPULATING SPECIFIC BIT(S) OllyDbg Let’s try this example in OllyDbg. First, let’s see the binary form of the constants ...
1.22. MANIPULATING SPECIFIC BIT(S) ORgot executed: Figure 1.95:OllyDbg:ORexecuted 15th bit is set:0x1234 4678 (0b10010001101000 ...
1.22. MANIPULATING SPECIFIC BIT(S) The value is reloaded again (because the compiler is not in optimizing mode): Figure 1.96:Oll ...
1.22. MANIPULATING SPECIFIC BIT(S) ANDgot executed: Figure 1.97:OllyDbg:ANDexecuted The 10th bit has been cleared (or, in other ...
1.22. MANIPULATING SPECIFIC BIT(S) leave retn f endp There is a redundant code present, however, it is shorter than the MSVC ver ...
1.22. MANIPULATING SPECIFIC BIT(S) ARM + Optimizing Keil 6/2013 (ARM mode) Listing 1.276: Optimizing Keil 6/2013 (ARM mode) 02 0 ...
1.22. MANIPULATING SPECIFIC BIT(S) f PROC BIC r0,r0,#0x1000 BIC r0,r0,#0x234 BX lr ENDP There are twoBICinstructions, i.e., bits ...
1.22. MANIPULATING SPECIFIC BIT(S) 1.22.3 Shifts Bit shifts in C/C++ are implemented using≪and≫operators. The x86ISAhas the SHL ...
1.22. MANIPULATING SPECIFIC BIT(S) Listing 1.282: Optimizing MSVC 2012 _tmp$ = 8 _i$ = 8 _my_abs PROC and DWORD PTR _i$[esp-4], ...
1.22. MANIPULATING SPECIFIC BIT(S) These instructions are used for resetting (BTR), setting (BTS) and inverting (or complementin ...
«
12
13
14
15
16
17
18
19
20
21
»
Free download pdf