Re: A89: recursion question


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

Re: A89: recursion question




So, since programs move around in memory, must all commands refer to
relative addresses, unless they are changing things like video memory or
other things fixed in specific positions?

Justin Bosch
justin-b@juno.com

On Mon, 30 Nov 1998 02:28:14 +0100 Olle Hedman <oh@hem.passagen.se>
writes:
>
>This is very wrong.
>the PC is the programcounter, and it is _always_ containing the 
>address of the
>instrunction carried out at the moment if you load anything onnto PC, 
>that would
>be a jump.. (in fact, what bra and thoose instructions really do, is 
>to load the
>address of the label specified, into PC)
>what xxx(PC) does, is that it indicates a _relative_ address, relative 
>to where
>in the memory you are executing now.. (yes it is a bit advanced) 
>You do this, to be able to have code that can be executed anywhere in 
>memory..
>you must remember that when the program is compiled, all the processor 
>have to
>go on is memorypositions.. if you putted a fixed position here, then 
>if you
>moved the program (and data in the program) to a new position, it 
>wouldn't be
>able to find the data again because you are still pointing to the sama 
>area in
>memory, where the data no longer is..  therefor you use this relative 
>method.
>
>it is like "the data you need is stored 234bytes away from this 
>position"
>instead of "the data is stored _here_."
>
>//Olle
>
>
>BLoWh0Le@aol.com wrote:
>> 
>> In a message dated 11/29/98 3:09:38 PM Pacific Standard Time,
>> m_rayman@bigfoot.com writes:
>> 
>> << Can you explain the xxx(pc) thing to me again?  I didn't catch it 
>the first
>> time around. >>
>> 
>> I'm no expert, but from what I've gathered from looking at other 
>people's
>> code, the xxx(pc) loads the effective address of xxx into the 
>Program Counter
>> (PC).  Thus, when the appropriate ROM call is called, it looks to 
>the PC for
>> the address of xxx.
>

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]


References: