-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQ11.asm
239 lines (175 loc) · 2.59 KB
/
Q11.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
org 0x7c00
jmp 0x0000:start
cor db'BlackBlueGreenCyanRedMagentaBrownLightGrayDarkGrayLightBlueLightGreenLightCyanLightRed'
tam db'!&*/36=BKS\fow'
cor2 db'LightMagentaYellowWhite'
tam2 db'!-38'
start:
xor ax, ax
mov ds, ax
xor ax, ax
mov ds, ax
xor ch,ch
xor dh,dh
ler1:
mov ah,0h
int 16h
mov ah, 0Eh
int 10h
xor ah, ah
mov cx, ax
sub cx,'0'
cmp cx, 9
jg ehhexa1
jmp ler2
ehhexa1:
sub cx, 7
jmp ler2
ler2:
mov ah,0h
int 16h
mov ah, 0Eh
int 10h
xor ah, ah
mov dx, ax
sub dx,'0'
cmp dx, 9
jg ehhexa2
jmp indice_string1
ehhexa2:
sub dx, 7
indice_string1:
push cx
push dx
cmp cx,dx
je fim
cmp cx,12
jg indice_print1_string2
mov al, byte[tam+ecx]
sub al,'!'
mov si, ax
mov bl, byte[tam+ecx+1]
sub bl, '!'
mov di, bx
mov bx, cx ;cor: backgroundFonte
imul bx, 16
add bx, dx
jmp print1_string1
indice_string2:
xor si, si
xor di, di
cmp dx, 12
jg indice_print2_string2
xor ah,ah
mov al, byte[tam+edx]
sub al, '!'
mov si, ax
xor bh,bh
mov bl, byte[tam+edx+1]
sub bl, '!'
mov di, bx
pop dx
pop cx
mov bx, cx ;cor: backgroundFonte
imul bx, 16
add bx, dx
jmp print2_string1
indice_print2_string2:
mov si, dx
sub si, 13
xor ah,ah
mov al, byte[tam2+esi]
sub al, '!'
xor bh,bh
mov bl, byte[tam2+esi+1]
sub bl, '!'
mov edi, ebx
mov si, ax
pop dx
pop cx
mov bx, cx ;cor: backgroundFonte
imul bx, 16
add bx, dx
jmp print2_string2
indice_print1_string2:
sub ecx, 13
mov al, byte[tam2+ecx]
sub al, '!'
mov si, ax
mov bl, byte[tam2+ecx+1]
sub bl, '!'
mov di, bx
add cx, 13
mov bx, cx
imul bx, 16
add bx, dx
jmp print1_string2
print1_string2:
cmp si, di
je ecomm
xor bh,bh
mov ah, 09h
mov cx, 1
int 10h
mov al, byte[cor2+si]
mov ah, 0Eh
int 10h
inc si
jmp print1_string2
print2_string1:
cmp si, di
je loopzar
xor bh,bh
mov ah, 09h
mov cx, 1
int 10h
mov al, byte[cor+si]
mov ah, 0Eh
int 10h
inc si
jmp print2_string1
print2_string2:
cmp si, di
je loopzar
xor bh,bh
mov ah, 09h
mov cx, 1
int 10h
mov al, byte[cor2+si]
mov ah, 0Eh
int 10h
inc si
jmp print2_string2
print1_string1:
cmp si, di
je ecomm
xor bh,bh
mov ah, 09h ; tem que ter
mov cx, 1 ;numero caracteres pra printar
int 10h
mov al, byte[cor+si]
mov ah, 0Eh
int 10h
inc si
jmp print1_string1
ecomm:
xor bh,bh
mov ah, 09h
mov cx, 1
int 10h
mov al, '&'
mov ah, 0Eh
int 10h
jmp indice_string2
loopzar:
mov al, 10
mov ah, 0Eh
int 10h
mov al, 13
mov ah, 0Eh
int 10h
jmp start
fim:
times 510-($-$$) db 0
dw 0xaa55
;seu código pode ter, no máximo, 512 bytes, do org ao dw 0xaa55