Question

using Assembly Language Write a code that gives the following output :- * ** *** ****...

using Assembly Language Write a code that gives the following output :-
*
**
***
****
*****
using registers and counters only.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

.model tiny

.486

.data

.code

.startup



mov cx,1 ; registers used are cx,bx and si. dl and ah used for character printing.

mov bx,5

mov si,cx ; si is used to control the number of stars in each line, since cx keeps changing in x1 loop

x2:

x1:

mov dl, '*'   ; prints character

mov ah,02h

int 21h

dec cx

jnz x1

mov dl,0ah ;prints new line.

mov ah,02

int 21h

inc si

mov cx,si

dec bx

jnz x2

Add a comment
Know the answer?
Add Answer to:
using Assembly Language Write a code that gives the following output :- * ** *** ****...
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