I've been searching the internet for a good while for this but none of them help me in my solution. What I'm trying to achieve is to read user input and display it starting from a prompt.
For example, the prompt asks the user's age and the user inputs their age, and then the program outputs the user's age in the console. Here is what I have so far:
INCLUDE Irvine32.inc
.data
prompt_name BYTE "Enter your name: ", 0
MAX = 80
name BYTE (MAX + 1) DUP (?)
.code
main PROC
;----------------------------------
call Clrscr
mov edx, OFFSET prompt_name
call WriteString
mov edx, OFFSET name
mov ecx, SIZEOF name
call ReadString
mov edx, OFFSET name
call WriteString
;----------------------------------
exit
main ENDP
END main
I've tried to change the DUP(?) to DUP(0). I've tried multiple solutions from other similar questions but it always give me the same error: Syntax error
for lines mov edx, OFFSET name
and mov ecx, SIZEOF name
. I've also tried mov ecx, MAX
as described in the library but to no avail. I would appreciate any advice, thanks!