Hello,
So I was working on a very lame application to practice using assembly and I got the application working and doing what I want it to, but at the application endpoint it prints out the welcome greeting string and I only have one section that calls that greet (in the beginning). Does anyone know why this could be happening? Any help is appreciated!
PS - I took a screenshot of the output for you guys to see what I mean.
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: ', '$'
result_prompt db 10, 13, 'The age you entered is: ', '$'
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
mov AH, 9h ; DOS command to print a string
int 21h
lea DX, age_prompt ; prompts the user for their age
mov AH, 9h
int 21h
mov AH, 1h ; 1h is a DOS command to read in a char
int 21h
mov AGE, AL
lea DX, result_prompt ; prints the result message
mov AH, 9h
int 21h
lea DX, AGE ; prints resulting age
mov AH, 9h
int 21h
mov AH, 04ch ; exits the DOS application
int 21h
main ENDp
end main