.model small
.stack 100h
.data
bin_prompt DB 'Please input a binary character: ',0
char_prompt DB 'Please input an ASCII character: ',0
out_msg1 DB 'The ASCII code of ’’',0
out_msg2 DB '’’ in binary is ',0
exit_prompt DB 'Do you want to quit (Y/N): ',0
bin_array DW 3 DUP ('?')
.CODE
INCLUDE io.mac
main PROC
.STARTUP
read_char:
mov CX,3
repeat:
PutStr bin_prompt ; request a char. input
GetCh AL ; read input character
mov BX,OFFSET bin_array ;get start of array (array[0])
fill:
mov [BX],AL ;[BX] - what BX points to
add BX,1 ;move BX to next element
;int 21h ;possibly output?
dec CX
jnz repeat
nwln