	zpage	btmp0
	zpage	btmp1
	zpage	btmp2
	zpage	r30
	zpage	r31
	zpage	___m65mathptr

	global	___moduint32

	section	text
___moduint32:
	ldq	___m65mathptr
	stq	btmp2
	lda	#$70
	sta	btmp2		; store ptr to op1
	ldq	btmp0
	stq	[btmp2]
	lda	#$74
	sta	___m65mathptr
	ldq	btmp1
	stq	[___m65mathptr]
	lda	#$6c
	sta	___m65mathptr
	ldz	#0
        lda     [___m65mathptr],z ; more delay needed?
	ldq     [___m65mathptr],z
	stq	[btmp2]		; x/y into op1, y still in op2
	lda	#$78
	sta	___m65mathptr
	ldq	btmp0		; x
	sec
	sbcq	[___m65mathptr] ; x-(x/y)*y
	stq	btmp0
	ldz	#0
	rts
