Re: LZ: variables
[Prev][Next][Index][Thread]
> to all of the people out there who responded to my earlier
> question, thankyou, I got one of the solutions to work. Now I have a
> rather simple questions having to do with keystrokes: here's my code:
>
>
> Top:
> CALL_(Get) ;in the basic stem of program
> ; 'Get' is called
>
>
> Get: ;a subrotine i made
> call GET_KEY ;get the last keystoke
> cp $37 ; was exit presses
> ret z ; if so exit to zshell menu
> cp $02 ; was left arrow pressed
> CALL_(Left) ; ok run 'Left'
> cp $03 ; was right pressed
> CALL_(Right) ; ok run 'Right'
> JUMP_(Top) ; go back to 'Top'
> Left:
> dec a ;a=a-1
> cp 0 ;compare a to zero
> jr z, L2 ; if zerso jumpto 'L2'
> ret ; if not it will return to 'Get'
> L2:
> ld a, 9 ; a=9
> ret
> Right:
> inc a
> cp 10
> jr z, R2
> ret
> R2:
> ld a, 1
> ret
> -----------------------------------------------------------
> the exit to zshell part works but the left and right commands don't for
> some reason, is there somthing visible here that I'm doing wrong????
They both should work, they just both are called, so it goes right, left
really quick. You should use CALL_Z(...) instead of CALL_(...).
-Doug Melton
http://www.smartlink.net/~dx4/calculat20.html
References: