mader versions of abs() and sgn() returning value in register

This commit is contained in:
Irmen de Jong
2020-10-28 22:56:13 +01:00
parent 44949460ed
commit 3e28ed4fe4
8 changed files with 196 additions and 40 deletions

View File

@@ -259,6 +259,38 @@ abs_w .proc
rts
.pend
abs_b_into_A .proc
; -- A = abs(pop stack byte)
inx
lda P8ESTACK_LO,x
bmi +
rts
+ eor #$ff
clc
adc #1
rts
.pend
abs_w_into_AY .proc
; -- AY = abs(pop stack word)
inx
lda P8ESTACK_LO,x
ldy P8ESTACK_HI,x
bmi +
rts
+ eor #$ff
pha
tya
eor #$ff
tay
pla
clc
adc #1
bcc +
iny
+ rts
.pend
add_w .proc
; -- push word+word / uword+uword
inx