February 24th, 2007, 11:21 AM
Registers in assembly
What are they exactly and how do they work? I can't seem to find any tutorial that goes in depth about it. For example, I have this Hello World program:
hello: db 'Hello world!',10
helloLen: equ $-hello
That's about as far as every tutorial will take me, but I have no idea what's going on here. Can anyone explain to me or link me to something that can help?
February 24th, 2007, 11:32 AM
Spend some time in the architecture section where all the registers are described.
Intel Programmer Manual
Assembler syntax varies from one assembler to another in the Intel world, but once you understand the underlying processor architecture, those differences degenerate to just an annoyance.
February 24th, 2007, 01:08 PM
To answer your question briefly, a register is a piece of data (typically 32 bits) that the processor has immediate access to. There are very few of them (on the x86 platform, there are 8 general-purpose registers). To manipulate other data in memory, it's therefore customary to move the data into registers, do whatever you want with it there, and then move it back to memory. On some architectures (e. g. SPARC, if I recall), this is the only way to manipulate data in main memory, since the instruction set has no instructions to operate directly on main memory except to move data to and from registers. However, Intel is different, since many instructions can operate on memory directly.
Take a look at Schol-R-Lea's long list of assembly resources: http://forums.devshed.com/showpost.p...60&postcount=6
I'm not saying it's the best, but this helped me when I was starting out with x86 assembly: http://www.drpaulcarter.com/pcasm/
To fully understand the code you posted, you'll need to delve into Linux assembly, since the "int 80h" system call protocol is specific to Linux.