Assembly Language for Beginners
1.15. SWITCH()/CASE/DEFAULT There we get an index for the second table of code pointers and we jump to it (line 14). What is als ...
1.15. SWITCH()/CASE/DEFAULT .byte (.L3 - .Lrtx4) / 4 ; case 10 .byte (.L2 - .Lrtx4) / 4 ; case 11 .byte (.L2 - .Lrtx4) / 4 ; cas ...
1.15. SWITCH()/CASE/DEFAULT .rodata:0000000000000077 DCB 3 ; case 20 .rodata:0000000000000078 DCB 3 ; case 21 .rodata:0000000000 ...
1.15. SWITCH()/CASE/DEFAULT Listing 1.161: Optimizing GCC 5.4.0 x86 1 .LC0: 2 .string "IF=%d KHz is not supportted, 3250 assumed ...
1.16 Loops 1.16 Loops 1.16.1 Simple example x86 There is a specialLOOPinstruction in x86 instruction set for checking the value ...
1.16. LOOPS pop ebp ret 0 _main ENDP As we see, nothing special. GCC 4.4.1 emits almost the same code, with one subtle differenc ...
1.16. LOOPS push ebp mov ebp, esp and esp, 0FFFFFFF0h sub esp, 10h mov [esp+10h+var_10], 2 call printing_function mov [esp+10h+v ...
1.16. LOOPS It is quite similar to what MSVC 2010 with optimization (/Ox) produce, with the exception that theEBX register is al ...
1.16. LOOPS x86: OllyDbg Let’s compile our example in MSVC 2010 with/Oxand/Ob0options and load it into OllyDbg. It seems that Ol ...
1.16. LOOPS Figure 1.56:OllyDbg:ESI= 10, loop end x86: tracer As we might see, it is not very convenient to trace manually in th ...
1.16. LOOPS EIP=0x00331026 FLAGS=CF AF SF IF (0) loops_2.exe!0x401026 EAX=0x00000005 EBX=0x00000000 ECX=0x6f0a5617 EDX=0x000ee18 ...
1.16. LOOPS We loadloops_2.exe.idcintoIDAand see: Figure 1.57:IDAwith .idc-script loaded We see thatESIcan be from 2 to 9 at the ...
1.16. LOOPS CMP R4, #0xA BLT loc_35C MOV R0, #0 LDMFD SP!, {R4,PC} Iteration counteriis to be stored in theR4register. TheMOV R4 ...
1.16. LOOPS void printing_function(int i) { printf ("%d\n", i); }; So, LLVM not justunrolledthe loop, but alsoinlinedmy very sim ...
1.16. LOOPS main: ; save FP and LR in the local stack: stp x29, x30, [sp, -32]! ; set up stack frame: add x29, sp, 0 ; save cont ...
1.16. LOOPS lw $v0, 0x28+i($fp) or $at, $zero ; NOP slti $v0, 0xA ; if it is less than 10, jump to loc_80 (loop body begin): bne ...
1.16. LOOPS ; all bytes copied? exit then: cmp rax, rdx je .L5 ; load byte at RSI+i: mov cl, BYTE PTR [rsi+rax] ; store byte at ...
1.16. LOOPS ; R0 = destination address ; R1 = source address ; R2 = size of block ; initialize counter (i) at 0 MOV r3,#0 |L0.4| ...
1.16. LOOPS SBjust writes a byte from lowest 8 bits of register to memory. Vectorization Optimizing GCC can do much more on this ...
1.16. LOOPS } } In this case,do/while()can be replaced byfor()without any doubt, and the first check can be removed. 1.16.4 Conc ...
«
6
7
8
9
10
11
12
13
14
15
»
Free download pdf