org 100h
mov ah,09h
lea dx,kal0
int 21h
mov ah,01h
int 21h
mov bl,al
mov ah,09h
lea dx,ln
int 21h
mov ah,09h
lea dx,kal1
int 21h
mov ah,09h
lea dx,ln
int 21h
mov ah,09h
lea dx,ln
int 21h
sub bl,30h
mov cl,bl
lea bh,cl
mulai:
cmp cl,1
ja cetak
je satu
jb exit
satu:
mov ah,02h
mov dl,'*'
int 21h
jmp exit
cetak:
mov ah,09h
lea dx,baris
int 21h
loop cetak
mov ah,09h
lea dx,a
int 21h
sub bl,02h
mov cl,bl
dua:
cmp bl,0
je pindah
jne kosong
kosong:
cmp cl,0
jne tambah1
je tambah2
tambah1:
mov ah,09h
lea dx,spasi
int 21h
loop kosong
tambah2:
mov ah,09h
lea dx,baris2
int 21h
mov ah,09h
lea dx,a
int 21h
cmp bl,0
je banding
sub bl,01h
banding:
cmp bl,0
je pindah
lea dl,bh
sub dl,01h
mov cl,dl
loop kosong
pindah:
sub bh,01h
mov cl,bh
bawah:
cmp cl,0
jne akhir
jmp exit
akhir:
mov ah,09h
lea dx,baris2
int 21h
loop bawah
exit:ret
kal0 db 'Masukan jumlah titik sisinya : $'
kal1 db 13,10,13,10,09, 'Kotaknya menjadi$'
a db 13,10, '*$'
ln db 13,10, '$'
baris db '* $'
spasi db ' $'
baris2 db ' *$'
0 komentar:
Post a Comment
Please correct and comment