eq16.asm 386 B

12345678910111213141516171819
  1. __EQ16: ; Test if 16bit values HL == DE
  2. ; Returns result in A: 0 = False, FF = True
  3. ora z80_a ;- or a ;- Reset carry flag
  4. lda z80_l ;- sbc hl,de
  5. sbc z80_e
  6. sta z80_l
  7. lda z80_h
  8. sbc z80_d
  9. sta z80_h
  10. lda z80_h ;- ld a,h
  11. sta z80_a
  12. ora z80_l ;- or l
  13. sec ;- sub 1 ;- sets carry flag only if a = 0
  14. sbc #1
  15. lda #$00 ;- sbc a,a
  16. sec
  17. rts ;- ret