Question: . model small . stack 1 0 0 h . data id _ number db ' 2 0 2 0 1 0 3 3 3
model small
stack h
data
idnumber db $
name db 'Yasmeen Ahmad Fathi$
charprompt db 'Enter a character: $
charoutput db 'You entered: $
code
main proc
mov ax @data
mov ds ax
; Task : Display ID number's digits one at each line
mov si offset idnumber
call printstringnewline
; Task : Read a character from the user and display it
mov dx offset charprompt
mov ahh
int h
mov ahh
int h ; Read character from keyboard
mov dl al ; Move character to dl register
mov ahh
int h ; Print character
mov dlAh ; Move to next line
mov ahh
int h
mov dlDh
mov ahh
int h
; Task : Display full name terminated by $
mov si offset name
call printstringnewline
; End of program
mov ahCh ; Exit program
int h
main endp
printstringnewline proc
mov ahh ; Print character function
mov dlAh ; Move to next line
int h
mov dlDh ; Carriage return
int h
nextchar:
mov alsi ; Load character from memory
cmp al$ ; Check if end of string
je endprint ; If $ is found, terminate
mov ahh ; Print character function
int h ; Print character
inc si ; Move to next character
jmp nextchar ; Repeat for next character
endprint:
ret
printstringnewline endp
end main
model small
stack h
data
idnumber db $
name db 'Yasmeen Ahmad Fathi$
charprompt db 'Enter a character: $
charoutput db 'You entered: $
code
main proc
mov ax @data
mov ds ax
; Task : Display ID number's digits one at each line
mov si offset idnumber
call printstringnewline
; Task : Read a character from the user and display it
mov dx offset charprompt
mov ahh
int h
mov ahh
int h ; Read character from keyboard
mov dl al ; Move character to dl register
mov ahh
int h ; Print character
mov dlAh ; Move to next line
mov ahh
int h
mov dlDh
mov ahh
int h
; Task : Display full name terminated by $
mov si offset name
call printstringnewline
; End of program
mov ahCh ; Exit program
int h
main endp
printstringnewline proc
mov ahh ; Print character function
mov dlAh ; Move to next line
int h
mov dlDh ; Carriage return
int h
nextchar:
mov alsi ; Load character from memory
cmp al$ ; Check if end of string
je endprint ; If $ is found, terminate
mov ahh ; Print character function
int h ; Print character
inc si ; Move to next character
jmp nextchar ; Repeat for next character
endprint:
ret
printstringnewline endp
end main
no one of this two codes is work it give me an error on offset name i use emu and i dont wont to call any procedure in my code
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
