Adapted div & mod for popptr1.

This commit is contained in:
IrgendwerA8
2018-05-24 03:55:40 +02:00
parent 746e3d1454
commit dd411efd1c
9 changed files with 92 additions and 122 deletions

26
libsrc/runtime/negabs.s Normal file
View File

@@ -0,0 +1,26 @@
;
; Ullrich von Bassewitz, 05.08.1998
;
; int abs (int x);
; and
; CC65 runtime: negation on ints
;
.export negax
.export _abs
_abs: cpx #$00 ; test hi byte
bpl L1 ; don't touch if positive
negax: clc
eor #$FF
adc #1
pha
txa
eor #$FF
adc #0
tax
pla
L1: rts