-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcornice.asm
184 lines (153 loc) · 1.9 KB
/
cornice.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
org 100h
mov ax,0
mov bx,0
mov cx,0
mov dx,0
ix1:
mov dx,0
mov ah,1h
int 21h
cmp al,13
je fine1
mov cl,al
mov ax,bx
mul ten
mov bx,ax
sub cl,48
add bx,cx
jmp ix1
fine1:
mov x1,bl
mov ah,02h
mov dh,0
mov dl,4
int 10h
mov ax,0
mov bx,0
iy1:
mov dx,0
mov ah,1h
int 21h
cmp al,13
je fine2
mov cl,al
mov ax,bx
mul ten
mov bx,ax
sub cl,48
add bx,cx
jmp iy1
fine2:
mov y1,bl
mov ah,02h
mov dh,1
mov dl,0
int 10h
mov ax,0
mov bx,0
ix2:
mov dx,0
mov ah,1h
int 21h
cmp al,13
je fine3
mov cl,al
mov ax,bx
mul ten
mov bx,ax
sub cl,48
add bx,cx
jmp ix2
fine3:
mov x2,bl
mov ah,02h
mov dh,1
mov dl,4
int 10h
mov ax,0
mov bx,0
iy2:
mov dx,0
mov ah,1h
int 21h
cmp al,13
je fine4
mov cl,al
mov ax,bx
mul ten
mov bx,ax
sub cl,48
add bx,cx
jmp iy2
fine4:
mov y2,bl
call draw
ret
draw proc
;stampa riga1
mov ah,02h
mov dh,y1
mov dl,x1
int 10h
mov cl,x2
sub cl,x1
inc cx
mov ah,0ah
mov al,'*'
int 10h
;stampa colonna1
mov ah,02h
mov dh,y1
mov dl,x2
int 10h
mov cl,y2
sub cl,y1
colonna1:
push cx
mov ah,02h
inc dh
mov dl,x2
int 10h
mov ah,0ah
mov cx,1
mov al,'*'
int 10h
pop cx
loop colonna1
;stampa riga2
mov ah,02h
mov dh,y2
mov dl,x1
int 10h
mov cl,x2
sub cl,x1
mov ah,0ah
mov al,'*'
int 10h
;stampa colonna2
mov ah,02h
mov dh,y2
mov dl,x1
int 10h
mov cl,y2
sub cl,y1
dec cl
colonna2:
push cx
mov ah,02h
dec dh
mov dl,x1
int 10h
mov ah,0ah
mov cx,1
mov al,'*'
int 10h
pop cx
loop colonna2
ret
draw endp
x1 db ?
y1 db ?
x2 db ?
y2 db ?
ten db 10