Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .286
- .model small
- .stack 100h
- .data
- podajn db "n=$"
- n dw 0
- .code
- start: mov dx, seg @data
- mov ds,dx
- mov dx,offset podajn
- mov ah,09h
- int 21h
- call wczytaj
- mov n,ax
- call nowalinia
- mov si,1
- petz: cmp si,n
- ja koniec
- mov di,1
- petw: cmp di,n
- ja dalej
- cmp si,1
- je gwiazd
- cmp si,n
- je gwiazd
- cmp di,1
- je gwiazd
- cmp di,n
- je gwiazd
- mov ah,2
- mov dl,' '
- int 21h
- jmp siup
- gwiazd: mov ah,2
- mov dl,'*'
- int 21h
- siup: inc di
- jmp petw
- dalej: call nowalinia
- inc si
- jmp petz
- koniec: mov ax,4c00h
- int 21h
- wczytaj proc
- mov ax,0
- mov cx,0ah
- @@pet: xchg ax,bx
- mov ah,01h
- int 21h
- xchg ax,bx
- cmp bl,'0'
- jb @@kon
- cmp bl,'9'
- ja @@kon
- mul cx
- and bx,0fh
- add ax,bx
- jmp @@pet
- @@kon: ret
- wczytaj endp
- nowalinia proc
- mov ah,02h
- mov dl,0ah
- int 21h
- ret
- nowalinia endp
- wypisz proc
- mov cx,0ah
- mov dx,0
- div cx
- cmp ax,0
- je @@kon
- push dx
- call wypisz
- pop dx
- @@kon: mov ah,02h
- add dl,'0'
- int 21h
- ret
- wypisz endp
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement