<<< The atoi and itoa Macros | Index | ATOI_ITOA_DEMO.ASM >>> |
Sample program ATOI_ITOA_DEMO.ASM ( download ) demonstrates usage of atoi and itoa Macros:
.DATA ; Begin initialized data segment
buffer BYTE 8 DUP (?)
..
.CODE ; Code segment
..
input buffer, 8 ; Read zero to 6 ASCII characters
atoi buffer ; Convert string to 2's complement number
jno @F ; Check the overflow flag
; Handle input error:
..
@@:
; Success: result of conversion is in AX
itoa buffer, ax ; Convert 16-bit signed integer to string
..
<<< The atoi and itoa Macros | Index | ATOI_ITOA_DEMO.ASM >>> |