ld b,20 ;row 20 in b
ld c,4 ;column 4 in c
ld hl,stupid_string ;string address
call _vputs ;put string
ret ;return
stupid_string: .db "Stupid",0 ;string to put
There are two errors in this one. The first error is that
there you don't need to load in the coordinates separately, you can
load them into the bc register all at once. The second
error is that if you have a call (call _vptus ) followed
by a return instruction (ret ), you can change the call to
a jump and take out the return. This uses that call's own
return as yours. It's like jumping to another part of your code
from which you will return out of your routine. Remember that you
have to use an absolute jump (jp ) instead of a relative
jump (jr ).
|
ld bc,256*20+4 ;20 in b, 4 in c
ld (_penCol),bc ;load those coordinates
ld hl,stupid_string ;string address
jp _vputs ;put string & return
stupid_string: .db "Stupid",0 ;string to put
| |