Once again, a seemingly simple programming task has me baffled... The program below should make the message "Hello!" display diagonally down and right on the screen, starting from the top-left corner. When I run the program on an emulator, it does successfully output the text, however the text doesn't start in the top-left, and some extra pixels get activated in a pattern that means nothing to me. What's more, the emulator seems to go into an endless loop, and I can't understand why my loop structures never work. Suggestions please!!
Code:
Code:
;Display the text "Hello!" diagonally across the screen
#include "ti83plus.inc"
.org $9D93
.db $BB, $6D
bcall(_clrlcdfull) ;Clear screen
ld hl, curRow ;initialize curRow and curCol to 0
ld (hl), $0000
ld b, msg ;b will point to the next character of the string
loop:
ld a, (b)
bcall(_putC) ;Display the character in msg at location a
inc b ;increment the character counter
inc (hl) ;increment the row counter
cp 0 ;if the null-character at the end of msg is reached, end program
jr nz, loop
ret
msg:
.db "Hello!",0
.end