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

 
Output of file : BIN8OUT contained in archive : ASM-SUBR.ZIP
;-------------------------bin8out routine begins--------------------------+
; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
; page : 43
;
; ROUTINE FOR CONVERSION FROM 8-BIT BINARY TO ASCII BINARY
;
; FUNCTION: This routine accepts an 8-bit binary number in the DL register
; and converts it to ASCII binary form which is sent to the std output
; device.
; INPUT: Upon entry an 8-bit binary is in the DL 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. DL is used for input
; SEGMENTS REFERENCED: None
; ROUTINES CALLED: STDOUT
; SPECIAL NOTES: None
;
; ROUTINE TO CONVERT FROM INTERNAL 8-BIT BINARY TO ASCII BINARY
;
bin8out proc far
;
push cx ; save registers
push ax
;
mov cx,8 ; loop for a count of 8
bin8out1:
rol dl,1 ; rotate DL 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 bin8out1 ; again until cx is 0
;
pop ax ; restore registers
pop cx
ret ; return
;
bin8out endp
;-------------------------bin8out routine ends---------------------------+


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

  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/