You should use jr z,$+20 (so skip over the next 18 bytes). The hex code for that would be 2812. Using 28A2 jumps back 94 bytes since A2 is -94 in signed hexadecimal. Also, 7E corresponds to ld a,(hl) (ld a,hl implies something different). Also, in assembly syntax, your first line would be ld hl,$9DA9.
Here is my rendition:
ld de,$9DAA ;11AA9D
ld hl,curCol ;214C84
ld a,(de) ;1A
or a ;B7
jr nz,$+6 ;2004 jump if zflag is not set
bcall(_PutC) ;EF0445 TI's documentation says it destroys no registers :)
inc de ;13
inc (hl) ;34 increment the byte at HL. Since HL points to curCol, this incrementes (curCol)
jr $-13 ;18F1
.db "Hey¿",0 ;486579B900
According to TI's documentation, _PutC does not output anything in any of the registers, nor does it destroy anything, which is excellent for this purpose. I took advantage of this by making HL always point to curCol, so using inc (hl)
could be used instead of ld a,(curCol) \ inc a \ ld (curCol),a
, saving several bytes.
As a note to syntax:
ld a,7 ;3E07 makes a=0
ld a,(7) ;3A0700 makes a equal to the value at byte 7 of addressable memory
inc hl ;23 adds one to the register pair HL
inc (hl) ;34 increments the byte that HL points to.
I hope I got to share something new for you! :)