neg32.asm 657 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. __ABS32:
  2. lda #$80 ;- bit 7,d
  3. cmp z80_d
  4. bne *+3 ;- ret z
  5. rts
  6. __NEG32: ; Negates DEHL (Two's complement)
  7. lda z80_l ;- ld a,l
  8. sta z80_a
  9. eor #$ff ;- cpl
  10. lda z80_a ;- ld l,a
  11. sta z80_l
  12. lda z80_h ;- ld a,h
  13. sta z80_a
  14. eor #$ff ;- cpl
  15. lda z80_a ;- ld h,a
  16. sta z80_h
  17. lda z80_e ;- ld a,e
  18. sta z80_a
  19. eor #$ff ;- cpl
  20. lda z80_a ;- ld e,a
  21. sta z80_e
  22. lda z80_d ;- ld a,d
  23. sta z80_a
  24. eor #$ff ;- cpl
  25. lda z80_a ;- ld d,a
  26. sta z80_d
  27. inc z80_l ;- inc l
  28. beq *+3 ;- ret nz
  29. rts
  30. inc z80_h ;- inc h
  31. beq *+3 ;- ret nz
  32. rts
  33. inc z80_e ;- inc de
  34. bne *+4
  35. inc z80_d
  36. rts ;- ret