Re: A89: Line 1111 Emulator


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

Re: A89: Line 1111 Emulator




At 23:16 1998-12-28 EST, you wrote:
>
> lea 10(a7),a7
>
>What EXACTLY does this do? What does it mean to have a number outside a
>register in parenthesis? I copied this from another Hello World program. It
>has something to do with the stack, from the comments in the other program.
>Yet, the other program is getting this error more than mine. Any ideas?
´

10(a7) points to the address stored in a7 added with 10. that is what a
number outside a parthesis means..
so 

lea 10(a7),a7 	

is calculating this address and stores it in a7, in this case it is
identical to add.l #10,a7
another example...
lets say you have an address stored in a0.. the address is $4c00.
you want to access a byte stored 12 bytes away from a0, then you write this:

move.b 12(a0),d0

this will put the byte stored at $4c0c into d0..
you can also do like this,

move.b	2(a0,d1),d0

if you have 10 in d1, you will access the same byte again..
hope this helps..

//Olle
btw..  get yourself a Programmers Reference from Motorola, and look stuff
like this up by yourself..   or read Jimmy Mårdells file..


References: