Category : Assembly Language Source Code
Archive   : ASM-SUBR.ZIP
Filename : DECNORM

 
Output of file : DECNORM contained in archive : ASM-SUBR.ZIP
;-------------------------decnorm routine begins--------------------------+
; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
; page : 99
;
; NAME DECNORM
;
; ROUTINE FOR Normalization of Temporary Decimal Floating Point
;
; FUNCTION: This routine normalizes a temporary decimal floating point
; nuumber.
;
; INPUT: Upon entry DS:DI points to a temporary decimal floating point
; number.
;
; OUTPUT: Upon exit the temporary floating point number is normalized.
;
; REGISTERS USED: AX, CX, and DI are modified.
;
; SEGMENTS REFERENCED: The data segment contains storage for a temporary
; decimal floating point number
;
; ROUTINES CALLED: None
;
; SPECIAL NOTES: Equates are used to shorten address fields.
;
decnorm proc near
;
; check top + 1 digit
cmp dibyte+22,0 ; is it already zero ?
je decnorm2 ; if so exit
;
; round up starting with bottom digit
mov al,[di] ; first digit
add al,al ; double it for roundup
mov ah,0 ; prepare carry
aaa ; adjust for decimal
;
; now shift the rest
mov cx,24 ; for a count of 24
decnorm1:
mov al,[di+1] ; get next digit
add al,ah ; add carry
mov ah,0 ; prepare next carry
aaa ; adjust for decimal
mov [di],al ; put digit into place
inc di ; point to next digit
loop decnorm1
;
inc deexp ; incrememt decimal exponent
;
decnorm2:
;
ret ; return
;
decnorm endp
;-------------------------decnorm routine ends---------------------------+


  3 Responses to “Category : Assembly Language Source Code
Archive   : ASM-SUBR.ZIP
Filename : DECNORM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/