	zpage r0
	zpage r1
	zpage r2
	zpage r3
	zpage r4
	zpage r5
	global ___divuint16
	zpage ___m65mathptr

	section text
___divuint16:
	lda	#$70
	sta	___m65mathptr
	ldy	#0
	ldz	#0
	ldx	r1
	lda	r0
	stq	[___m65mathptr]
	lda	#$74
	sta	___m65mathptr
	lda	r2
	ldx	r3
	ldy	#0
	ldz	#0
	stq	[___m65mathptr]
	lda	#$6c
	sta	___m65mathptr
	ldz	#0
	lda	[___m65mathptr],z ; more delay needed?
        ldq     [___m65mathptr],z
	ldz	#0
	rts

