2 ; Ullrich von Bassewitz, 07.08.1998
4 ; CC65 runtime: helper stuff for mod/div/mul with signed ints
7 ; When negating values, we will ignore the possibility here, that one of the
8 ; values if $8000, in which case the negate will fail.
12 .importzp sreg, tmp1, tmp2, ptr4
15 stx tmp2 ; Remember sign
18 jsr negax ; Negate accumulator
20 stx ptr4+1 ; Save right operand
23 stx tmp1 ; Remember sign