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

	global	___modint32

	section	text
___modint32:
	lda	btmp0+3
	sta	r30
	bpl	a1done
	lda	#0
	tax
	tay
	taz
	sec
	sbcq	btmp0
	stq	btmp0
a1done:
	lda	btmp1+3
	bpl	a2done
	lda	#0
	tax
	tay
	taz
	sec
	sbcq	btmp1
	stq	btmp1
a2done:
	jsr	___moduint32
	lda	r30
	bpl	respos
	lda	#0
	tax
	tay
	taz
	sec
	sbcq	btmp0
	stq	btmp0
respos:
	ldz	#0
	rts
