◄Map► ◄Up► ◄Contents► ◄Index► ◄Back► ──────────────────────────────────────────────────────────────────────────── ;* IntToAsc - Converts integer to ASCII string. This procedure is useful ;* only for assembly language, and is not intended to be C-callable. ;* ;* Shows: Instructions - aam xchg ;* ;* Entry: AX = integer (9999 max) ;* ;* Return: DX:AX = 4-digit ASCII number IntToAsc PROC cwd ; Zero DX register mov cx, 100 ; Divide AX by 100, yields div cx ; AX=quotient, DX=remainder aam ; Make digits unpacked BCD or ax, "00" ; Convert to ASCII xchg ax, dx ; Do same thing for DX aam or ax, "00" ret ; Return DX:AX = ASCII number IntToAsc ENDP -♦-