Shon Harris, Allen Harper, Chris Eagle, and Jonathan Ness
"Gray Hat Hacking, Second Edition"
call ret call subroutine1 ret call subroutine1 ret inc and dec The inc and dec commands are used to increment or decrement the destination. inc dec inc eax dec eax incl %eax decl %eax lea The lea command is used to load the effective address of the source into the destination. lea , lea eax, [dsi +4] leal 4(%dsi), %eax int The int command is used to throw a system interrupt signal to the processor. The common interrupt you will use is 0x80, which is used to signal a system call to the kernel. int int 0x80 int $0x80 Addressing Modes In assembly, several methods can be used to accomplish the same thing. In particular, there are many ways to indicate the effective address to manipulate in memory. These options are called addressing modes and are summarized in Table 6-5. Assembly File Structure An assembly source file is broken into the following sections: ??? .model The .model directive is used to indicate the size of the .data and .text sections. ??? .stack The .stack directive marks the beginning of the stack segment and is used to indicate the size of the stack in bytes. ??? .data The .data directive marks the beginning of the data segment and is used to define the variables, both initialized and uninitialized.