Hi. Please help... I'm trying to display

*
**
***
****
*****

but it doesn't work.. What could be wrong? Here's my code:

.model small
.stack 100h
.data

	space db " ","$"
	newline db 13,10,"$"
	ast db "*","$"
.code
	mov ax,@data
	mov ds,ax

mov cl,1

again:
	mov bl,cl
	
	back:
		

		mov ah,09h
		lea dx,ast
		int 21h

		dec bl
		jne back

		mov ah, 09
		lea dx, newline
		int 21h

	
inc cl
jne again

	mov ah,4ch
	int 21h
end

Thanks..

try this:

mov bl, 5
mov cl, 1
xor ch, ch
again: 
	back:
		mov ah,09h
		lea dx,ast
		int 21h
                inc ch
		cmp cl, ch
                je  back
 
		mov ah, 09
		lea dx, newline
		int 21h
 
 
xor ch, ch
inc cl
dec bl
cmp bl, 0
jne again

Also, you could do a much more efficient code with loop instruction, i just tried to maintain your initial code scheme... Also, in your original code you weren't using the jumps well, they must go after a comparisson (cmp) or they won't work

     *
    **
   ***
  ****
 *****

how about this?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.