Assembly Language for Beginners
1.25. UNIONS MOV R0, #0 BL time BL my_srand MOV R4, #0x64 ; 'd' loc_78 BL float_rand ; S0=pseudorandom value LDR R0, =aF ; "%f" ...
1.25. UNIONS union uint_float { uint32_t i; float f; }; float calculate_machine_epsilon(float start) { union uint_float v; v.f=s ...
1.26 FSCALE replacement. v.d=start; v.i++; return v.d-start; } void main() { printf ("%g\n", calculate_machine_epsilon(1.0)); }; ...
1.26. FSCALE REPLACEMENT { union uint_float tmp; tmp.i=(N<<23)+0x3f800000; return tmp.f; }; struct float_as_struct { unsig ...
1.27 Pointers to functions. 1.26.1 Fast square root calculation. Another well-known algorithm wherefloatis interpreted as intege ...
1.27. POINTERS TO FUNCTIONS The comparison function can be defined as: int (*compare)(const void *, const void *) Let’s use the ...
1.27. POINTERS TO FUNCTIONS push esi push OFFSET _comp push 4 lea eax, DWORD PTR _numbers$[esp+52] push 10 ; 0000000aH push eax ...
1.27. POINTERS TO FUNCTIONS The second reason is that the callback function types must comply strictly, calling the wrong functi ...
1.27. POINTERS TO FUNCTIONS MSVC + OllyDbg Let’s load our example into OllyDbg and set a breakpoint oncomp(). We can see how the ...
1.27. POINTERS TO FUNCTIONS Bytracing(F8)untiltheRETNinstructionandpressingF8onemoretime,wereturntotheqsort()function: Figure 1. ...
1.27. POINTERS TO FUNCTIONS Here is also a screenshot of the moment of the second call ofcomp()—now values that have to be com- ...
1.27. POINTERS TO FUNCTIONS EAX=0x000000c8 ECX=0x00000005 EAX=0xffffff9e ECX=0x00000005 EAX=0x00000ff7 ECX=0x00000005 EAX=0x0000 ...
1.27. POINTERS TO FUNCTIONS MSVC + tracer (code coverage) We can also use the tracer’s feature to collect all possible register ...
1.27. POINTERS TO FUNCTIONS comp()function: public comp comp proc near arg_0 = dword ptr 8 arg_4 = dword ptr 0Ch push ebp mov eb ...
1.27. POINTERS TO FUNCTIONS (gdb) p a $1 = 1892 (gdb) p b $2 = 45 (gdb) c Continuing. Breakpoint 1, comp (_a=0xbffff104, _b=_b@e ...
1.27. POINTERS TO FUNCTIONS 0x0804847e <+49>: cmp edx,eax 0x08048480 <+51>: jge 0x8048489 <comp+60> 0x08048482 ...
1.28 64-bit values in 32-bit environment. es 0x7b 123 fs 0x0 0 gs 0x33 51 (gdb) bt 0 0x08048469 in comp () 1 0xb7e42872 in msort ...
1.28. 64-BIT VALUES IN 32-BIT ENVIRONMENT Listing 1.370: Optimizing Keil 6/2013 (ARM mode) ||f|| PROC LDR r0,|L0.12| LDR r1,|L0. ...
1.28. 64-BIT VALUES IN 32-BIT ENVIRONMENT mov eax, DWORD PTR _a$[esp-4] add eax, DWORD PTR _b$[esp-4] mov edx, DWORD PTR _a$[esp ...
1.28. 64-BIT VALUES IN 32-BIT ENVIRONMENT GCC code is the same. ARM Listing 1.375: Optimizing Keil 6/2013 (ARM mode) f_add PROC ...
«
16
17
18
19
20
21
22
23
24
25
»
Free download pdf