A word on assembler code

The example below uses assembler code for intel type CPUs generated by the GNU assembler. Unlike most Intel assembler this tools moves things from the left side to the right side in an expression. Some things to know for reading the output:

.text

like .date or .bss this statement simply tells where the linker finally has to put the following code or data. In our case we will see that sometimes even data (e.g. a string "hello") might go into the non-writeable text segment.

.globl

A statement that makes stuff included here available for public access (linker can use it to resolve externals)

eax, ebx...

The register names of Intel CPUs. eax is really the workhorse of those CPUs (accumulator). As you can see a typical access goes like this: move something from stack into eax. Move it from eax somewhere else on the stack. This is also the way function parameters are accessed and assigned to local variables