I am trying to create a program that greets the user with their name. The user enters their name after a prompt and the they are greeted along with their name. I have already tried using this code but it fails and throws error on line 21.
The error message states: (21) wrong parameters: LEA Dx,name (21) probably no zero prefix for hex; or no 'h' suffix; or wrong addressing; or undefined var: name
Here's the code
.MODEL SMALL
.STACK 100
.DATA
msg db "Hello! Please enter your name:$"
newline db 13,10,'$'
greeting db "Wellcome!$"
name db 80, 0, 78 DUP('$')
.CODE
main PROC
; Prompt
MOV Ax,@DATA
MOV Ds,Ax
LEA Dx,msg
MOV Ah,09h
INT 21h
; Input
LEA Dx,name (throws error)
MOV AH,0AH
INT 21h
; Check if ENTER is pressed
CMP Al,13
JE Display
; Newline
LEA Dx,newline
MOV Ah,09h
INT 21h
; Print Greeting
Display: MOV AH,09h
LEA Dx,name+2
;MOV Dl,Al
INT 21H
Exit:
MOV Ah,4Ch
INT 21h
main ENDP
END main