I would like to be able to have the user input a 1 or 0 and have whatever was inputted into an array. Here is what I have so far.

.model small

.stack 100h

.code

start:
my_arr db ?
mov dl, [my_arr]
mov [my_arr], al
add dl, '0'
mov ah, 2h
int 21h

end start

Basically I'm trying to get it to input into the array, then testing if the it worked by outputting the first element in the array. Right now all it outputs is N..which I'm assuming stands for null meaning nothing is being inputted in the array based on this code. Can somebody help me out?

start:
my_arr db ? ; the instruction pointer is running into junk!!!
mov dl, [my_arr] ; you didn't read any char from the keyboard
mov [my_arr], al
add dl, '0' 
mov ah, 2h
int 21h

change to:

.data
my_arr db ?
.code
start:
mov dx, seg my_arr
mov ds, dx

Check out MS-DOS INT 21h functions 01/06/07/08/0A/3F
for reading from the keyboard.

And it is printing an 'N' to the screen cuz your are printing
out the character specified in DL it doesn't mean NULL.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.