Category : Assembly Language Source Code
Archive   : JED.ZIP
Filename : BYTE2STR.SRC

 
Output of file : BYTE2STR.SRC contained in archive : JED.ZIP
;---------------------------------------------------------------
; Byte2Str -- Converts a byte passed in AL to a string at
; DS:SI
; Last update 3/8/89
;
; 1 entry point:
;
; Byte2Str:
; Caller must pass:
; AL : Byte to be converted
; DS : Segment of destination string
; SI : Offset of destination string
;
; This routine converts 8-bit values to 2-digit hexadecimal
; string representations at DS:SI. The "H" specifier is
; *not* included. Four separate output examples:
; 02 B7 FF 6C
;---------------------------------------------------------------

Byte2Str PROC
mov DI,AX ; Duplicate byte in DI
and DI,000FH ; Mask out high 12 bits of DI
mov BX,OFFSET Digits ; Load offset of Digits into DI
mov AH,BYTE PTR [BX+DI] ; Load digit from table into AH
mov [SI+1],AH ; and store digit into string
xor AH,AH ; Zero out AH
mov DI,AX ; And move byte into DI
shr DI,1 ; Shift high nybble of byte to
shr DI,1 ; low nybble
shr DI,1
shr DI,1
mov AH,BYTE PTR [BX+DI] ; Load digit from table into AH
mov [SI],AH ; and store digit into string
ret ; We're done--go home!
Byte2Str ENDP

  3 Responses to “Category : Assembly Language Source Code
Archive   : JED.ZIP
Filename : BYTE2STR.SRC

  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/