1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-08 06:25:17 +00:00
Files
cc65/libsrc/runtime/absvaludiv.s
2018-05-24 11:31:43 +02:00

23 lines
621 B
ArmAsm

;
; Christian Krueger, 23-May-2018
;
; CC65 runtime: helper call for mod/div with signed ints
;
; When negating values, we will ignore the possibility here, that one of the
; values is $8000, in which case the negate will fail.
.export absvaludiv16
.import _abs, popax, udiv16
.importzp ptr1, ptr4
absvaludiv16:
jsr _abs
sta ptr4
stx ptr4+1 ; Save right absolute operand
jsr popax
jsr _abs
sta ptr1
stx ptr1+1 ; Save left absolute operand
jmp udiv16