My code was
Code: Select all
LD HL,(x)
JR NZ y
So I think the code could be
Code: Select all
LD HL,(x)
ADC HL,HL
JR NZ y
Code: Select all
LD HL,(x)
JR NZ y
Code: Select all
LD HL,(x)
ADC HL,HL
JR NZ y
Code: Select all
LD HL,(x)
LD DE,FFFF; SET UPPER VALUE
ADC HL,DE ; Add HL+DE
JR C y ; TEST IF <>0 goto y
Code: Select all
ld a,h
or l
jr z,...
A lot of what the Z80 does in relation to flags is because the Z80 was made code compatible with the Intel 8080 CPU.mrtinb wrote: ↑Wed Mar 15, 2017 9:40 am Coming from 6502 it seems like Z80 has a lot fewer instructions that change the flags.
My code wasBut LD HL,(x) does not change the flags. I assumed Z-flag was set if content of address x was $0000.Code: Select all
LD HL,(x) JR NZ y