pgubook-readers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pgubook-readers] immediate mode addressing vs address


From: Brian Scott
Subject: Re: [Pgubook-readers] immediate mode addressing vs address
Date: Mon, 13 Jul 2009 16:57:43 -0500
User-agent: Thunderbird 2.0.0.22 (X11/20090608)

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
address@hidden
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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]