Hello,
So I am currently learning MASM 8086 Assembly right now I am have trouble with an application I am attempting to mess around with and create for practice. Not sure what the errors I am getting mean (I am extremely new to assembly). Can someone please help me understand what I am doing wrong? I have attached the screenshot of the error messages and the source code. ANY help would be greatly appreciated!
age.asm
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Name: Brandon ;
; Date: 2/6/2015 ;
; Desc: Simply asks the user for their age ;
; and then greets the user with the ;
; age value they entered in ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.model small
.stack 100h
.data
age db ?
welcome_greet db 'Welcome to the GREATEST application EVER!!!', 10, 13, '$'
age_prompt db 'Please enter your age: ', 10, 13, '$'
result_prompt db 'The age you entered is: ', 10, 13, '$'
exit_prompt db 'Goodbye, hope you enjoyed this AMAZING application!', 10, 13, '$'
.code
main proc
mov AX, @DATA ; must do everytime
mov DS, AX ; must also do everytime as well
lea DX, welcome_greet ; loads the welcome_greet into the DX registery
mov AH, 9h ; DOS command to print a string
int 21h
lea DX, age_prompt
move AH, 9h
int 21h
move AH, 1h ; 1h is a DOS command to read in a char
int 21h
sub AL, '0' ; converts to an integar
move AGE, AL ; saves the value into AGE
move AH, 9h
lea DX, result_prompt
int 21h
move AH, 2h ; prints a char
int 21h
move AH, 04ch ; exits the DOS application
int 21h
main endp
end main
Also, I have a few questions about the code I have. Is the DX registery only used for loading output messages into?
lea DX, welcome_greet ; loads the welcome_greet into the DX registery
mov AH, 9h ; DOS command to print a string
int 21h
Like I said, I am extreme beginner to assembly so any explinations/corrections would be awesome!