Solved programming problem

Basic Star Print in Assembly(Nested Loop -1).

Source code

org 100h

.model small

.data

    star db 0

    starcount db 5

       

.code

mov ax,@data

mov ds,ax

main proc

   

    mov star,1 ; i=0

cond:  

    mov dl,starcount ;i<=n

    cmp star,dl

    jle print

    jmp exit

   

print:

      mov ah,2   ;print

      mov dl,'*'

      int 21h    

     

      inc star  ;i++

      jmp cond

exit:

 

     

endp

end main

Output

*****

Join the discussion

Add your comment