-3
.model small
.stack 100h
.data
space db 10,"$"
asteric db "*$"
.code
start:
mov cl,5
mov ax,@data
mov ds,ax
mov bl,0
mov al,0
l1:
mov ah,09
lea dx,space
int 21h
inc bl
cmp bl,cl
je exit
l2:
lea dx,asteric
int 21h
cmp al,bl
jl l2
inc al
jnl l1
exit:
mov ah,4ch
int 21h
end start

i don't know what i'm doing wrong here but it is giving me output like this OUTPUT:

*
*
*
*

i want output like this: OUTPUT:

*
**
***
****

instead of what i'm getting please help

tadman
  • 208,517
  • 23
  • 234
  • 262

1 Answers1

-3

you need to put zero in al before you go into l2 loop(before the lable l2) because if not it will count all of the times you printed before. you also need to inc al before you do jl to l2 because you need to count how many times you printed in this line and in the way you did it it count lines.

Tomer Shinar
  • 415
  • 3
  • 13