LIB2 / FILE VIEW

mod_u32_u16.inc

DOWNLOAD ORIGINAL ↓

; CLARITAS TIP u32/1 - mod_u32_u16.inc
; Public: UMOD3216NZ

;
; Thin unsigned u32/u16 remainder adapter.
;
; Precondition:
;   divisor != 0
;
; Input:
;   $15-$18  unsigned 32-bit dividend
;   $5-$6    unsigned 16-bit divisor
;   $7-$8    ignored on entry
;
; Output:
;   $15-$16  unsigned 16-bit remainder
;   $17-$18  zero
;
; The adapter reuses UDIV3216NZ, then moves the low remainder word into the
; primary result registers and explicitly clears the high word.
;
; No division-by-zero check is performed.

#LIST

UMOD3216NZ:
        CAL     UDIV3216NZ
        LDW     $15,$10
        SBW     $17,$17
        RTN