Assembly Language for Beginners
1.17 More about strings. Usually the condition is checkedbeforeloop body, but the compiler may rearrange it in a way that the co ...
1.17. MORE ABOUT STRINGS int my_strlen (const char str) { const char eos = str; while( *eos++ ) ; return( eos - str - 1 ); } in ...
1.17. MORE ABOUT STRINGS You can also read about it in “Signed number representations” section (2.2 on page 452). It’s hard to s ...
1.17. MORE ABOUT STRINGS mov edx, DWORD PTR _str$[esp-4] ; EDX -> pointer to the string mov eax, edx ; move to EAX $LL2@strle ...
1.17. MORE ABOUT STRINGS Optimizing MSVC + OllyDbg We can try this (optimized) example in OllyDbg. Here is the first iteration: ...
1.17. MORE ABOUT STRINGS Let’s press F8 (step over) a few times, to get to the start of the body of the loop: Figure 1.59:OllyDb ...
1.17. MORE ABOUT STRINGS We have to press F8 enough number of times in order to escape from the loop: Figure 1.60:OllyDbg: point ...
1.17. MORE ABOUT STRINGS TheSUBinstruction just got executed: Figure 1.61:OllyDbg:EAXto be decremented now The difference of poi ...
1.17. MORE ABOUT STRINGS Perhaps it is simpler for GCC’s code generator torememberthe whole 32-bitEDXregister is allocated for a ...
1.17. MORE ABOUT STRINGS The first instructions just saves the input values into bothstrandeos. The body of the loop starts at l ...
1.17. MORE ABOUT STRINGS MVNS^106 (inverts all bits, likeNOTin x86) andADDinstructions computeeos−str− 1. In fact, these two ins ...
1.17. MORE ABOUT STRINGS Non-optimizing GCC (Linaro) 4.9 my_strlen: ; function prologue sub sp, sp, #32 ; first argument (str) w ...
1.18 Replacing arithmetic instructions to other ones Onboard Software and Satellite Operations: An Introduction, (2011)]. But NO ...
1.18. REPLACING ARITHMETIC INSTRUCTIONS TO OTHER ONES ; File c:\polygon\c\2.c mov eax, DWORD PTR _a$[esp-4] add eax, eax add eax ...
1.18. REPLACING ARITHMETIC INSTRUCTIONS TO OTHER ONES 32-bit include <stdint.h> int f1(int a) { return a*7; }; int f2(int ...
1.18. REPLACING ARITHMETIC INSTRUCTIONS TO OTHER ONES Listing 1.193: Optimizing Keil 6/2013 (ARM mode) ; a7 ||f1|| PROC RSB r0,r ...
1.18. REPLACING ARITHMETIC INSTRUCTIONS TO OTHER ONES ; $v0 = $a0<<5 = $a032 sll $a0, 2 ; $a0 = $a0<<2 = $a04 jr $ra ...
1.18. REPLACING ARITHMETIC INSTRUCTIONS TO OTHER ONES ARM64 GCC 4.9 for ARM64 is also terse, thanks to the shift modifiers: List ...
1.19 Floating-point unit 7 6 5 4 3 2 1 0 0 7 6 5 4 3 2 1 0 CF It is easy to understand if you imagine the number 23 in the decim ...
1.19. FLOATING-POINT UNIT The FPU has a stack capable to holding 8 80-bit registers, and each register can hold a number in the ...
«
7
8
9
10
11
12
13
14
15
16
»
Free download pdf