home *** CD-ROM | disk | FTP | other *** search
- Title B2Dec.ASM -- Store Binary (0 - 99) as 2 ASCII Digits
- COMMENT~
- Call With: DS:BX = Pointer to Storage
- AL = Binary Value
-
- Places the Tens Digit (0 - 9) in DS:BX
- and Ones Digit (0 - 9) in DS:BX+1
-
- Returns: DS:BX = Unchanged
- AH = ASCII Tens Digit
- AL = ASCII Ones Digit
- ~
- .MODEL small
- .CODE
- PUBLIC B2Dec
- B2Dec Proc ; Convert Binary Value 0 - 99 in AL
- aam ; Via Division by Decimal Base 10
- add ax,"00" ; Convert to ASCII Decimal Digits
- mov [bx],ah ; Store Tens Digit
- mov [bx+1],al ; Store Ones Digit
- ret
- B2Dec EndP
- END
-