journal of all scince V.1. NO.1 | Page 47
.
Pushall macro
Push ax
Push bx
Push cx
Push dx
Push si
Push di
endm
Popall macro
Pop di
Pop si
Pop dx
Pop cx
Pop bx
Pop ax
endm
writech macro x
pushall
mov al,x
mov bh,0
mov cx,1
mov ah,0ah
int 10h
popall
Endm
getch macro
pushall
mov ah,0
int 16h
writech proc
mov bh,0
mov cx,1
mov ah,0ah
int 10h
ret
Writech Endp
getch proc
mov ah,0
int 16h
endp
getch endp
theend proc
mov ah,4CH
int 21h
ret
theend endp
seg1 segment
assume cs:seg1
l: mov bh,0
mov dh,12
mov dl,40
start:mov ah,2
8
popall
endm
theend macro
pushall
mov ah,4CH
int 21h
popall
Endm
seg1 segment
assume cs:seg1
l: mov bh,0
mov dh,12
mov dl,40
start:mov ah,2
int 10h
writech ' *'
getch
cmp ah,1
je exit
cmp ah,4bh
jne R
writech ' '
dec dl
cmp dl,-1
jne start
mov dl,79
jmp start
int 10h
Mov al,’*’
Call writech
Call getch
cmp ah,1
je exit
cmp ah,4bh
jne R
writech ' '
dec dl
cmp dl,-1
jne start
mov dl,79
jmp start
R:
cmp ah,4dh
jne U
writech ' '
inc dl
cmp dl,80
jne start
mov dl,0
?
|82 ,
2B 1
%
$
:V `
:
R:
cmp ah,4dh
jne U
writech ' '
inc dl
cmp dl,80
jne start
mov dl,0
jmp start
U:
cmp ah,48h
jne D
writech ' '
dec dh
cmp dh,-1
jne start
mov dh,24
jmp start
D:
cmp ah,50h
jne start
writech ' '
inc dh
cmp dh,25
jne start
mov dh,0
jmp start
exit: theend
seg1 ends
end l
%
J %
:
jmp start
U:
cmp ah,48h
jne D
writech ' '
dec dh
cmp dh,-1
jne start
mov dh,24
jmp start
D:
cmp ah,50h
jne start
writech ' '
inc dh
cmp dh,25
jne start
mov dh,0
jmp start
exit: call theend
seg1 ends
end l
%
J %