2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 27.09.1998
|
|
|
|
;
|
|
|
|
; CC65 runtime: modulo operation for long unsigned ints
|
|
|
|
;
|
|
|
|
|
2009-08-15 20:58:35 +00:00
|
|
|
.export tosumod0ax, tosumodeax
|
2000-05-28 13:40:48 +00:00
|
|
|
.import getlop, udiv32
|
|
|
|
.importzp sreg, tmp3, tmp4, ptr2
|
|
|
|
|
2009-08-15 20:58:35 +00:00
|
|
|
tosumod0ax:
|
|
|
|
ldy #$00
|
|
|
|
sty sreg
|
|
|
|
sty sreg+1
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
tosumodeax:
|
|
|
|
jsr getlop ; Get the paramameters
|
|
|
|
jsr udiv32 ; Do the division
|
|
|
|
lda tmp3 ; Remainder is in ptr2:tmp3:tmp4
|
|
|
|
sta sreg
|
|
|
|
lda tmp4
|
2007-08-26 17:25:21 +00:00
|
|
|
sta sreg+1
|
2000-05-28 13:40:48 +00:00
|
|
|
lda ptr2
|
|
|
|
ldx ptr2+1
|
|
|
|
rts
|
|
|
|
|