bnot16.asm 384 B

12345678910111213141516171819202122
  1. ; vim:ts=4:et:
  2. ; FASTCALL bitwise or 16 version.
  3. ; result in HL
  4. ; __FASTCALL__ version (operands: A, H)
  5. ; Performs 16bit NEGATION
  6. ; Input: HL
  7. ; Output: HL <- NOT HL
  8. ;
  9. __BNOT16:
  10. lda z80_h ;- ld a,h
  11. sta z80_a
  12. eor #$ff ;- cpl
  13. lda z80_a ;- ld h,a
  14. sta z80_h
  15. lda z80_l ;- ld a,l
  16. sta z80_a
  17. eor #$ff ;- cpl
  18. lda z80_a ;- ld l,a
  19. sta z80_l
  20. rts ;- ret