Category : Files from Magazines
Archive   : DDJ8_91.ZIP
Filename : DECCONV.ASC
Output of file : DECCONV.ASC contained in archive : DDJ8_91.ZIP
by Don Morgan
[EXAMPLE 1: Fractional Conversion Routine]
mantissa word ?
dec_frac word ?
;
; frac- conversion of decimal fractional part to hex
; enter with packed decimal word in ax
; returns with result in dx\
;DS is assumed to point into the Data Segment
;
frac proc
mov cx,10h ;number of bits in resulting mantissa
cnvt:
add al,al ;could add to self, we will see
daa
mov bl,al
mov al,ah
jnc nc1
add al,al ;could add to self, we will see
daa
inc al
jmp short nc2
nc1:
add al,al ;could add to self, we will see
daa
nc2:
mov ah,al
mov al,bl
rcl dx,1
loop cnvt
sub ax,5000h
jc end_frac
inc dx ;for round off
end_frac:
mov word ptr mantissa,dx
ret
frac end
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
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/