Tom Felb wrote:
Hi group!

I have a hardcopy version of "Programming from the Ground up" and I don't understand what's the difference between immediate mode addressing like movl $12, %eax (load eax with number 12) and $variablename, %eax (load the address of variablename into eax)

That's the same syntax with the dollar sign? I'm a little bit confused!??

Thanks for any help!

tfb
------------------------------------------------------------------------

_______________________________________________
Pgubook-readers mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/pgubook-readers

variablename in this case is a label. When the program is assembled, all instances where that label is used is replaced with the memory address of the data under that label. Something like movl variablename, %eax would load the data at that memory address into eax, while using immediate mode moves the actual memory address itself. So movl $variablename, %eax is also immedite mode. Hope that helps.

Brian Scott


_______________________________________________
Pgubook-readers mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/pgubook-readers

Reply via email to