home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / asm / OKTIMDAT.ZIP / B2DEC.ASM < prev    next >
Encoding:
Assembly Source File  |  1988-10-29  |  817 b   |  24 lines

  1. Title   B2Dec.ASM -- Store Binary (0 - 99) as 2 ASCII Digits
  2. COMMENT~
  3.         Call With:  DS:BX = Pointer to Storage
  4.                        AL = Binary Value
  5.  
  6.         Places the Tens Digit (0 - 9) in DS:BX
  7.                and Ones Digit (0 - 9) in DS:BX+1
  8.  
  9.         Returns:    DS:BX = Unchanged
  10.                        AH = ASCII Tens Digit
  11.                        AL = ASCII Ones Digit
  12.         ~
  13.         .MODEL  small
  14.         .CODE
  15.             PUBLIC B2Dec
  16. B2Dec   Proc                    ; Convert Binary Value 0 - 99 in AL
  17.         aam                     ; Via Division by Decimal Base 10
  18.         add     ax,"00"         ; Convert to ASCII Decimal Digits
  19.         mov     [bx],ah         ; Store Tens Digit
  20.         mov     [bx+1],al       ; Store Ones Digit
  21.         ret
  22. B2Dec   EndP
  23.         END
  24.