Re: A92: Re: Quitting ASM or not -- please answer these q
[Prev][Next][Index][Thread]
Re: A92: Re: Quitting ASM or not -- please answer these q
>here's a good example of the documentation in Romfunc.htm:
> void tios::DrawTo(WORD x,WORD y)
> Draws a line from the graphics cursor to (x,y), moving the graphics
> cursor to the new position.
>it doesn't say what registers you have to put data into for x and y!!!
The parameters to these functions aren't put into any registers, they are
pushed onto the stack, and, this is very important, THEY ARE PUSHED IN
REVERSE ORDER.
Here's an example using
void tios::DrawStrXY(WORD x,WORD y,BYTE *string,WORD color)
move.w #4,-(a7) ; push fourth parameter, WORD color
move.l mylabel,-(a7) ; push third parameter, BYTE *string
move.w #64,-(a7) ; push second parameter, WORD y
move.w #10,-(a7) ; push first parameter, WORD x
jsr tios::DrawStrXY ; call rom function
lea 10(a7),a7 ; update stack pointer (2+4+2+2 = 10)
....
; your data section
mylabel dc.b "This is a string",0
This will write a string at coordinates (10,64), using color 4 (black).
Structures such as point, color, etc. are described in types.txt, which is
part of the Fargo toolkit.
-Don
----
Donald R Barnes
don.barnes@wmich.edu
http://www.geocities.com/SiliconValley/Park/1809/