Re: A89: Re: Stupid Question
[Prev][Next][Index][Thread]
Re: A89: Re: Stupid Question
In a message dated 99-02-22 22:50:04 EST, you write:
<<
It depends on how much to push to the stack...
>>
Elaborating...If you push a byte then you add 1...If you pust a word then you
add 2...If you push a longword/doubleword then you add 4...
Taken from helloworld: //you should have a look
move.w #4,-(a7) ; move the first param to the stack
lea string(pc),a0 ; move adress of string to the stack
move.l a0,-(a7)
move.w #0,-(a7) ; push position
move.w #0,-(a7) ; push position
jsr tios::DrawStrXY ; call the DrawStrXY ROM function
add.l #10,a7 ; restore the stack pointer
First a word is pushed then a longword then two words are
pushed//2+4+2+2=10 so you have to add 10 to the stack...you could also do it
the other way: lea 10(a7),a7 which i think is like 1 byte shorter or something
Follow-Ups: