Category : Assembly Language Source Code
Archive   : ASM_SUBR.ZIP
Filename : BIN16OUT

 
Output of file : BIN16OUT contained in archive : ASM_SUBR.ZIP
;-------------------------bin16out routine begins--------------------------+
; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
; page : 44
;
; ROUTINE FOR CONVERSION FROM 16-BIT BINARY TO ASCII BINARY
;
; FUNCTION: This routine accepts an 16-bit binary number in the DX register
; and converts it to ASCII binary form which is sent to the std output
; device.
; INPUT: Upon entry an 16-bit binary is in the DX register
; OUTPUT: A string of ASCII digits representing a binary number is sent
; out through the std output device.
; REGISTERS USED: No registers are modified. DX is used for input
; SEGMENTS REFERENCED: None
; ROUTINES CALLED: STDOUT
; SPECIAL NOTES: None
;
; ROUTINE TO CONVERT FROM INTERNAL 16-BIT BINARY TO ASCII BINARY
;
bin16out proc far
;
; a binary number is in DX
;
push cx ; save registers
push ax
;
mov cx,16 ; loop for a count of 16
bin16out1:
rol dx,1 ; rotate DX left once
mov al,dl ; move into AL
and al,1 ; just keep digit
add al,30h ; adjust AL to ASCII
call stdout ; output to console
loop bin16out1 ; again until cx is 0
;
pop ax ; restore registers
pop cx
ret ; return
;
bin16out endp
;-------------------------bin16out routine ends---------------------------+


  3 Responses to “Category : Assembly Language Source Code
Archive   : ASM_SUBR.ZIP
Filename : BIN16OUT

  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/