Hey everybody,
On Kerm's advice, I decided to post a thread here where I can ask this very knowledgeable community a few random questions about z80. I hope I'm not being rude...
well, anyways, I'm trying to debug this particular snippet of code, and it seems that I can't jump exactly where I want to, when I want to:
Code:
I've stepped through this loop several times with wabbitemu and even if the hl register is 0 after the dec hl instruction, the
jr nz, while still jumps to the while label, even though the zero flag should clearly be set. Is the zero flag not triggered by 16 bit registers?
(this snippet should print 3 u's on the far right side of the screen)
Thanks for any help =)
On Kerm's advice, I decided to post a thread here where I can ask this very knowledgeable community a few random questions about z80. I hope I'm not being rude...
well, anyways, I'm trying to debug this particular snippet of code, and it seems that I can't jump exactly where I want to, when I want to:
Code:
ld a, 15 ;set curcol and currow
ld (CurCol), a
ld a, 4
ld (CurRow), a
ld hl, (AppBackUpScreen+5) ;loads 3 into hl register
while:
ld a, 'u' ;loads 'u' char for printing
push hl ;preserve hl
b_call(_PutC) ;print 'u' char
pop hl
ld a, 15 ;load 15 into curcol,( currow should be auto-incremented by _PutC)
ld (CurCol), a
dec hl ;see if we are ready to leave this while loop
jr nz, while
jp waitkey ;if no jump to while, go back to the getkey loop
I've stepped through this loop several times with wabbitemu and even if the hl register is 0 after the dec hl instruction, the
jr nz, while still jumps to the while label, even though the zero flag should clearly be set. Is the zero flag not triggered by 16 bit registers?
(this snippet should print 3 u's on the far right side of the screen)
Thanks for any help =)