Re: A89: lea


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

Re: A89: lea






S43R80@aol.com wrote:
> i suppose the 1st gives the address and the latter gives the value at the
> address...but i thought when getting the value at an address you are supposed
> to use ()...ie move.l (sprites),a0

the () is not a must, but it is not wrong to have them either. you can have them
or not, it is up to you.

if we take two things that looks similar to the above, and seems to work the
same (your program will work eitherway):

move.l  #sprites,a0

and

lea	sprites(pc),a0


The difference between theese are that in the first, you hardcode what address
you should use, and need relocationcode for it to work (doorsos/ti-os fixes this
for you, without you haveing to bother) wich will make the program useing the
first model, a lot bigger. if you program for ti-os (without shell) it will be
12 bytes longer, I don't know the exact number for doorsos, but it will be
bigger.
8 or 10 is a good guess :)
the other is useing relative addressing, relative to the current position in the
program, and will work without relocation, makeing the program smaller.

//Olle


References: