[A89] help understanding this code


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

[A89] help understanding this code




I took this code from technoplaza's assembly lessons:

lea -3840(sp),sp
pea 3840
pea $4C00
pea 8(sp)

so if I'm not misunderstanding this the first line substracts 3840 
from the current address that's stored in sp and stores it in sp 
(saving 3840 bytes for us). The second line pushes 3840 (as a number) 
to the stack, increasing sp by 4, the third line pushes $4C00 to the 
stack and adds 4 to sp, the last line pushes the current sp address 
plus 8 bytes, that is, the address that was loaded in the first line. 
All this are passed as arguments to memcpy. So... Would this also 
work?

lea -3840(sp),a0
pea 3840
pea $4C00
pea (a0)

if this works, what's the best approach and why?
thanks a lot,
ra.-



Follow-Ups: