Question

Microprocessor - Please solve it with deatials !!

19. Write an assembly program that will: a. Read any character from the user. b. Read a number in the range 0-9 from the user. (There is no need to check the range) Display on the screen the character number of times equal to the number from stepb c. Lah The figure below shows a few sample runs ?× C:WIND0WS system32 cmd exe ENTER ANY CHARACTER+ ENTER A NUMBER <0-9 8 D NA86 testi com ENTER ANY CHARACTER A ENTER B NUMBER O-9 3 ENTERANY CHARACTER & ENTER A NUMBER <0-9 9 6 DENA8

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

code:

.model small
.data  
b db "enter the character$"
a db "enter the number$"
.code
start:
mov ax,@data
mov ds,ax
mov dx,offset b               ;print 1st string
mov ah,09h
int 21h

mov ah,01h                    ;scan for the character
int 21h

mov bl,al

mov dl,10
mov ah,02h                    ; print new line
int 21h
mov dl,0dh
mov ah,02h
int 21h


mov dx,offset a
mov ah,09h
int 21h                      ;print 2nd string

mov ah,01h                   ;scan the number
int 21h

sub al,30h                   ;mov counter in cl
mov cl,al

mov dl,10
mov ah,02h
int 21h                      ;new line
mov dl,0dh                 
mov ah,02h
int 21h


l:
mov dl,bl
mov ah,02h
int 21h                      ; print the character count no of times
loop l


end start

output:

SE emulator screen (80x25 chars) nter the characterA nter the number3SERI emulator screen (80x25 chars) enter the character& enter the number 9SERI emulator screen (80x25 chars) enter the character+ enter the number8

Add a comment
Know the answer?
Add Answer to:
Microprocessor - Please solve it with deatials !! 19. Write an assembly program that will: a....
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