usub32.inc
Original bytes preserved. This is a browser-readable view.
; ======================================================================
; CS617 NUMERIC LIBRARY
; sub_u32_u32.inc
;
; ROM-independent exact transplant of OM-52C C-ROM routine E990.
;
; Contract:
; input:
; $15-$18 unsigned 32-bit minuend, low word first
; $5-$8 unsigned 32-bit subtrahend, low word first
;
; output:
; $15-$18 ($15-$18 - $5-$8) mod 2^32
;
; arithmetic:
; unsigned wraparound modulo 2^32
;
; Historical donor:
; OM-52C E990..E99A
; length 11 bytes
; SHA-256:
; 991f03968a7059a0ec3848fa6017e2091eaa260ad0abcb388ca69a99f4fb03b0
;
; The donor propagates low-word borrow by subtracting the word value 1 via $SY.
; No underflow/status result is returned.
; ======================================================================
#LIST
USUB32:
SBW $15,$5
JR NC,USUB_HI
SBW $17,$SY
USUB_HI:
SBW $17,$7
RTN