Assembly Language for Beginners
1.19. FLOATING-POINT UNIT 22 0x080484b0 <+16>: ret 23 End of assembler dump. 24 (gdb) ni 25 0x080484a8 in d_max () 26 (gdb ...
1.19. FLOATING-POINT UNIT 92 es 0x7b 123 93 fs 0x0 0 94 gs 0x33 51 95 (gdb) ni 96 0x080484ae in d_max () 97 (gdb) info float 98 ...
1.19. FLOATING-POINT UNIT You can also see theTOPregister contents inStatus Word(line 44)—it is 6 now, so the stack top is now p ...
1.19. FLOATING-POINT UNIT In fact, the usualVMOVis encoded there, butIDAadds the-GTsuffix to it, since there is aIT GTinstructio ...
1.19. FLOATING-POINT UNIT Compilers usually don’t generate all possible combinations. For example, in the mentioned Angry Birds ...
1.19. FLOATING-POINT UNIT POP {R3-R7,PC} loc_1C0 MOVS R0, R4 MOVS R1, R5 POP {R3-R7,PC} Keil doesn’t generate FPU-instructions s ...
1.19. FLOATING-POINT UNIT Non-optimizing GCC is more verbose. First, the function saves its input argument values in the local s ...
1.20 Arrays C.LT.Dcompares two values.LTis the condition “Less Than”.Dimplies values of typedouble. Depending on the result of t ...
1.20. ARRAYS 1.20.1 Simple example include <stdio.h> int main() { int a[20]; int i; for (i=0; i<20; i++) a[i]=i*2; for ...
1.20. ARRAYS xor eax, eax mov esp, ebp pop ebp ret 0 _main ENDP Nothing very special, just two loops: the first is a filling loo ...
1.20. ARRAYS Let’s try this example in OllyDbg. We see how the array gets filled: each element is 32-bit word ofinttype and its ...
1.20. ARRAYS and esp, 0FFFFFFF0h sub esp, 70h mov [esp+70h+i], 0 ; i=0 jmp short loc_804840A loc_80483F7: mov eax, [esp+70h+i] m ...
1.20. ARRAYS loc_4A0 CMP R4, #20 ; i<20? BLT loc_494 ; yes, run loop body again ; second loop MOV R4, #0 ; i B loc_4C4 loc_4B ...
1.20. ARRAYS LSLS R0, R4, #2 ; R0=i<<2 (same as i4) LDR R2, [R5,R0] ; load from (R5+R0) (same as R5+i*4) MOVS R1, R4 ADR R ...
1.20. ARRAYS ; load address of the "a[%d]=%d\n" string: adrp x0, .LC0 add x0, x0, :lo12:.LC0 ; load "i" variable to W1 and pass ...
1.20. ARRAYS la $s3, $LC0 # "a[%d]=%d\n" ; "i" variable will reside in $s0: move $s0, $zero li $s2, 0x14 loc_54: # CODE XREF: ma ...
1.20. ARRAYS Listing 1.228: Non-optimizing MSVC 2008 $SG2474 DB 'a[20]=%d', 0aH, 00H _i$ = -84 ; size = 4 _a$ = -80 ; size = 80 ...
1.20. ARRAYS Let’s try to find out where did this value come from, using OllyDbg. Let’s load and find the value located right af ...
1.20. ARRAYS Let’s trace further and see how it gets restored: Figure 1.89:OllyDbg: restoring value of EBP Indeed, how it could ...
1.20. ARRAYS MSVC And what we get: Listing 1.230: Non-optimizing MSVC 2008 _TEXT SEGMENT _i$ = -84 ; size = 4 _a$ = -80 ; size = ...
«
10
11
12
13
14
15
16
17
18
19
»
Free download pdf