Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Counting
- org 100h
- .stack 100h
- .data
- line db 0
- linecount db 4
- str db "*$"
- nl db 0dh, 0ah, '$'
- starcount db 0
- star db 0
- .code
- main proc
- mov dx,@data
- mov ds,dx
- mov line,1 ;i=0
- condition:
- mov al,linecount ;
- cmp line,al
- jl iter
- jmp exitloop
- iter:
- ;starcount=linecount-line
- mov al,line
- ;sub al,line
- mov starcount,al
- add starcount,1
- mov star,1
- condstar:
- mov bl,starcount
- cmp star,bl
- jl iterstar
- jmp exitstar
- iterstar:
- ;lea dx,str
- ;mov ah,9
- ;int 21h
- mov dl,star
- add dl,'0'
- mov ah,2
- int 21h
- inc star
- jmp condstar
- exitstar:
- mov ah,9
- lea dx,nl
- int 21h
- inc line
- jmp condition
- exitloop:
- endp main
- end main
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement