Question

Question: use only int 21h Write the assembly codes that work as shown below: 5 ↲...

Question: use only int 21h Write the assembly codes that work as shown below: 5 ↲ 543210

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please find the code below:


.model small
.stack 100h
.data
.code
main proc
  
  
mov ah,1 ; get input
int 21h
mov bl,al ;move value to dl


mov dx,10 ;print \n
mov ah,2
int 21h
mov dx,13 ; cursor at first position
mov ah,2
int 21h

mov al,bl
mov dl,al
sub al,48 ;convert character to number
add al,1
mov cl,al   
mov ch,0

loopHere:


mov ah,2
int 21h   
sub dl,1

loop loopHere
  
  

mov ah,4ch
int 21h
main endp
end main

output:

Add a comment
Know the answer?
Add Answer to:
Question: use only int 21h Write the assembly codes that work as shown below: 5 ↲...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT