; CLARITAS TIP u32/1 - divmod_u32_u16.inc
; Public: UDIV3216NZ
;
; Thin unsigned adapter over accepted UDIV32NZ.
;
; Precondition:
; divisor != 0
;
; Input:
; $15-$18 unsigned 32-bit dividend, low word first
; $5-$6 unsigned 16-bit divisor
; $7-$8 ignored on entry
;
; Transformation:
; Zero-extend the u16 divisor by setting its upper word to zero, then call
; the accepted u32/u32 divmod core.
;
; Output:
; $15-$18 unsigned 32-bit quotient
; $10-$13 unsigned 32-bit remainder
;
; For a correct u16 divisor operation, $12-$13 must be zero because r < d.
;
; No division-by-zero check is performed. Policy belongs outside this adapter.
#LIST
UDIV3216NZ:
SBW $7,$7
CAL UDIV32NZ
RTN