abs8.asm 161 B

123456789101112
  1. ; Returns absolute value for 8 bit signed integer
  2. ;
  3. __ABS8:
  4. eor z80_a ;- or a
  5. bmi *+3 ;- ret p
  6. rts
  7. eor #$ff ;- neg
  8. clc
  9. adc #$01
  10. rts ;- ret