Re: A86: beginner Quesion


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

Re: A86: beginner Quesion




>  down:
>  call _clrLCD
>  ld a,(_curRow)
>  inc a
>  ld (_curRow),a
>  ld hl,string
>  call _puts
>  jr loop

I can see two possible problems with this:
1) no protection against (_curRow) going above $3F (last row 63)
2) might be too far away from "loop" for a jr to work

Here's what I would do:
down:
   call _clrLCD
   ld a,(_curRow)
   cp $3F   ; if a = 63
   jp z,loop    ; then go back to the loop
   inc a
   ld (_curRow),a
   ld hl,string
   call _puts
   jp loop  ; jp instead of jr

That should fix the problem. You'll need to do something similar to the "up" 
handler (cp $00 & jp z,loop) and to the left (same thing) and right (cp $7F & 
jp z,loop).

-- Jonathan Marcus
Appelkore@aol.com