Rev 1151 | Rev 3539 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1151 | Rev 2288 | ||
---|---|---|---|
Line 1... | Line -... | ||
1 | ; Copyright (c) 2009, |
- | |
2 | ; All rights reserved. |
- | |
3 | ; |
- | |
4 | ; Redistribution and use in source and binary forms, with or without |
- | |
5 | ; modification, are permitted provided that the following conditions are met: |
- | |
6 | ; * Redistributions of source code must retain the above copyright |
- | |
7 | ; notice, this list of conditions and the following disclaimer. |
- | |
8 | ; * Redistributions in binary form must reproduce the above copyright |
- | |
9 | ; notice, this list of conditions and the following disclaimer in the |
- | |
10 | ; documentation and/or other materials provided with the distribution. |
- | |
11 | ; * Neither the name of the |
- | |
12 | ; names of its contributors may be used to endorse or promote products |
- | |
13 | ; derived from this software without specific prior written permission. |
- | |
14 | ; |
- | |
15 | ; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka |
- | |
16 | ; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
- | |
17 | ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
- | |
18 | ; DISCLAIMED. IN NO EVENT SHALL |
- | |
19 | ; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
- | |
20 | ; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
- | |
21 | ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
- | |
22 | ; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
- | |
23 | ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
- | |
24 | ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- | |
25 | ;***************************************************************************** |
- | |
26 | - | ||
27 | ;òóò ðàñïîëîãàåòñÿ ìîäóëü ñ ïîìîùüþ êîòîðîãî áóäóò ïàðñèòüñÿ âñå îñòàëüíûå ñåêöèè |
- | |
28 | color_sym_black equ 0 |
- | |
29 | color_sym_blue equ 1 |
- | |
30 | color_sym_green equ 2 |
- | |
31 | color_sym_turquoise equ 3 |
- | |
32 | color_sym_red equ 4 |
- | |
33 | - | ||
34 | color_sym_lightgray equ 7 |
- | |
35 | - | ||
36 | color_sym_lightblue equ 9 |
- | |
37 | color_sym_lettuce equ 10 |
- | |
38 | color_sym_pink equ 12 |
- | |
39 | color_sym_yellow equ 14 |
- | |
40 | - | ||
41 | macro use_any_sec |
- | |
42 | { |
- | |
43 | ;óçíàåì ðàáîòó ïðåäûäóùåãî øàãà ò.å. ÷åìó = timeout, åñëè îí 0, òî âèçóàëüíàÿ ÷àñòü íå áóäåò îòîáðàæåíà íà äèñïëåå ñ âûáîðîì çàãðóçî÷íûõ ñåêöèé. |
- | |
44 | ;èíà÷å ìû åå äîëæíû îòîáðàçèòü è æäàòü çàÿâëåíîå âðåìÿ äëÿ âûáîðà è êîíèãóðèðîâàíèÿ ïóêíêòîâ ñåêöèè îò ïîëüçîâàòåëÿ. |
- | |
45 | - | ||
46 | if DEBUG |
- | |
47 | pusha |
- | |
48 | mov ax,word [value_timeout] ;èäåò ïðîâåðêà íà íàëè÷åå çíà÷åíèÿ timeout, äëÿ áîëåå áûñòðîé ðàáîòû, ýòîò ïàðàìåòð äîëæåí áûòü óæå îáðàáîòàí,ò.å. â ýòîì ñëó÷àå ïðè åãî =0 áóäåò ñôîðìèðîâàí óêàçàòåëü òîëüêî íà äåôîëòíóþ ñåêöèþ, èíà÷å èíôîðìàöèÿ áóäåò ñîáðàíà ïî âñåì ñåêöèÿì è ñîñòàâëåíû óêàçàòåëè â áëîêå ïàìÿòè |
- | |
49 | ; mov ax,cx |
- | |
50 | mov cx,0x0a |
- | |
51 | mov di,show_db1 |
- | |
52 | mov dword[ds:di],' ' |
- | |
53 | mov word [ds:di+4],' ' |
- | |
54 | call decode |
- | |
55 | ;Show size |
- | |
56 | mov si,show_db1 |
- | |
57 | call printplain |
- | |
58 | ; |
- | |
59 | popa |
- | |
60 | end if |
- | |
61 | - | ||
62 | test ax,ax |
- | |
63 | jz .parse_run_only |
- | |
64 | - | ||
65 | ;îòîáðàçèì ïîëíûé ñïèñîê âñåõ íàéäåíûõ ñåêöèé. |
- | |
66 | if DEBUG |
- | |
67 | pusha |
- | |
68 | mov si,show_all_sect |
- | |
69 | call printplain |
- | |
70 | popa |
- | |
71 | end if |
- | |
72 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
- | |
73 | mov al, 0xf6 ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå |
- | |
74 | out 0x60, al |
- | |
75 | xor cx, cx |
- | |
76 | .wait_loop: ; variant 2 |
- | |
77 | ; reading state of port of 8042 controller |
- | |
78 | in al, 64h |
- | |
79 | and al, 00000010b ; ready flag |
- | |
80 | ; wait until 8042 controller is ready |
- | |
81 | loopnz .wait_loop |
- | |
82 | - | ||
83 | - | ||
84 | ; set keyboard typematic rate & delay |
- | |
85 | mov al, 0xf3 |
- | |
86 | out 0x60, al |
- | |
87 | xor cx, cx |
- | |
88 | @@: |
- | |
89 | in al, 64h |
- | |
90 | test al, 2 |
- | |
91 | loopnz @b |
- | |
92 | mov al, 0 |
- | |
93 | out 0x60, al |
- | |
94 | xor cx, cx |
- | |
95 | @@: |
- | |
96 | in al, 64h |
- | |
97 | test al, 2 |
- | |
98 | loopnz @b |
- | |
99 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
- | |
100 | ; get start time |
- | |
101 | call gettime |
- | |
102 | mov dword [start_timer],eax |
- | |
103 | mov word [timer_],newtimer |
- | |
104 | mov word [timer_+2],cs |
- | |
105 | ;óñòàíîâèòü ñâîå ïðåðûâàíèå íà òàéìåð ò.å. êîä áóäåò ïåððûâàòüñÿ ~18 ðàç â ñåê è ïåðåõîäèòü íà îáðàáîò÷èê |
- | |
106 | cli |
- | |
107 | push 0 |
- | |
108 | pop es |
- | |
109 | push dword [es:8*4] |
- | |
110 | pop dword [old_timer] |
- | |
111 | push dword [timer_] |
- | |
112 | pop dword [es:8*4] |
- | |
113 | sti |
- | |
114 | - | ||
115 | ;ïðîöåäóðà ôîðìèðîâàíèÿ áóôåðà äëÿ ñêðîëèíãà ñåêöèé |
- | |
116 | ;if DEBUG |
- | |
117 | ; pusha |
- | |
118 | ; mov ax,point_default |
- | |
119 | ; mov ax,cx |
- | |
120 | ; mov cx,0x0a |
- | |
121 | ; mov di,show_db1 |
- | |
122 | ; mov dword[ds:di],' ' |
- | |
123 | ; mov word [ds:di+4],' ' |
- | |
124 | ; call decode |
- | |
125 | ;Show size |
- | |
126 | ; mov si,show_db1 |
- | |
127 | ; call printplain |
- | |
128 | ; |
- | |
129 | ; xor ax,ax |
- | |
130 | ; int 0x16 |
- | |
131 | ; popa |
- | |
132 | ;end if |
- | |
133 | ;;;;;;;;;;;;;ðàçìåð ïðåäûäóùåé ñåöèè óñòàíîâèì =0 |
- | |
134 | mov save_descript_size,18 |
- | |
135 | ;îòîáðàçèòü black screen |
- | |
136 | show_bl_sc ;es=0xb800 |
- | |
137 | .show_all_scr: |
- | |
138 | get_frame_buffer ;es=0x2000 |
- | |
139 | ;îòîáðàæåíèå ñåêöèé |
- | |
140 | call show_bl_sc_sect ;es=0xb800 |
- | |
141 | ;îòîáðàçèòü àêòèâíûé êóðñîð |
- | |
142 | .show_active_cursor: |
- | |
143 | show_act_cursor |
- | |
144 | show_descript ;ìàêðîñ ïî îòîáðàæåíèþ îïèñàíèÿ ñåêöèè |
- | |
145 | - | ||
146 | ;îòîáðàçèòü Press any key .... |
- | |
147 | mov eax,dword [old_timer] |
- | |
148 | cmp eax,dword [timer_] |
- | |
149 | jz .interrupt_16 |
- | |
150 | - | ||
151 | show_timer_message |
- | |
152 | mov word [start_stack],sp |
- | |
153 | .interrupt_16: |
- | |
154 | xor ax,ax ;ïîëó÷èì èíôîðìàöèþ î òîì ÷òî íàæàòî |
- | |
155 | int 0x16 |
- | |
156 | ;check on change |
- | |
157 | mov ebx,dword [old_timer] |
- | |
158 | cmp ebx,dword [timer_] |
- | |
159 | jz @f |
- | |
160 | ;restore timer interrupt |
- | |
161 | cli |
- | |
162 | push 0 |
- | |
163 | pop es |
- | |
164 | ; mov eax,dword [old_timer] ; âîññòàíîâèì ïðåæäíåå ïðåðûâàíèå |
- | |
165 | mov [es:8*4],ebx |
- | |
166 | mov dword [timer_],ebx |
- | |
167 | sti |
- | |
168 | - | ||
169 | push ax |
- | |
170 | clear_timer_msg |
- | |
171 | pop ax |
- | |
172 | @@: |
- | |
173 | call clean_active_cursor ;clean old cursor ;es=0xb800 |
- | |
174 | - | ||
175 | cmp ah,0x48 ;ðåàêöèÿ ñèñòåìû íà ñîáûòèÿ |
- | |
176 | jz .up |
- | |
177 | cmp ah,0x50 |
- | |
178 | jz .down |
- | |
179 | cmp ah,0x49 |
- | |
180 | jz .pgup |
- | |
181 | cmp ah,0x51 |
- | |
182 | jz .pgdown |
- | |
183 | cmp ah,0x47 |
- | |
184 | jz .home |
- | |
185 | cmp ah,0x4f |
- | |
186 | jz .end |
- | |
187 | - | ||
188 | cmp al,0xD |
- | |
189 | jnz .show_active_cursor |
- | |
190 | - | ||
191 | jmp .end_show_all ;ïàðñèíã ñåêöèè êîòîðàÿ óêàçàíà â point_default |
- | |
192 | .up: |
- | |
193 | mov si,point_to_point_def ;çíà÷åíèå óêàçàòåëÿ |
- | |
194 | add si,2 |
- | |
195 | lea ax,point_to_hframe |
- | |
196 | - | ||
197 | cmp si,ax |
- | |
198 | ja @f |
- | |
199 | - | ||
200 | mov point_to_point_def,si |
- | |
201 | mov ax,[si] |
- | |
202 | mov point_default,ax |
- | |
203 | jmp .show_active_cursor |
- | |
204 | @@: |
- | |
205 | call find_before_sect |
- | |
206 | jmp .show_all_scr |
- | |
207 | - | ||
208 | - | ||
209 | - | ||
210 | .down: |
- | |
211 | mov si,point_to_point_def ;çíà÷åíèå óêàçàòåëÿ |
- | |
212 | mov ax,point_to_eframe ;óêàçàòåëü íà ïîñëåäíèé ýëåìåíò |
- | |
213 | sub si,2 |
- | |
214 | cmp si,ax |
- | |
215 | jb @f |
- | |
216 | - | ||
217 | mov point_to_point_def,si |
- | |
218 | mov ax,[si] |
- | |
219 | mov point_default,ax |
- | |
220 | jmp .show_active_cursor |
- | |
221 | - | ||
222 | @@: call find_next_sect |
- | |
223 | jmp .show_all_scr |
- | |
224 | - | ||
225 | .pgup: |
- | |
226 | mov cx,size_show_section |
- | |
227 | @@: |
- | |
228 | push cx |
- | |
229 | call find_before_sect |
- | |
230 | pop cx |
- | |
231 | loop @b |
- | |
232 | jmp .show_all_scr |
- | |
233 | - | ||
234 | - | ||
235 | .pgdown: |
- | |
236 | mov cx,size_show_section |
- | |
237 | @@: |
- | |
238 | push cx |
- | |
239 | call find_next_sect |
- | |
240 | pop cx |
- | |
241 | loop @b |
- | |
242 | jmp .show_all_scr |
- | |
243 | - | ||
244 | .home: |
- | |
245 | xor di,di |
- | |
246 | call find_next_sect.h |
- | |
247 | jmp .show_all_scr |
- | |
248 | - | ||
249 | .end: |
- | |
250 | mov di,save_cx |
- | |
251 | call find_before_sect.e |
- | |
252 | jmp .show_all_scr |
- | |
253 | - | ||
254 | - | ||
255 | - | ||
256 | - | ||
257 | ; òóò ìû áóäåì ïàðñèòü òîëüêî äåôîëòíóþ ñåêöèþ è âûïîëíÿòü åå íè÷åãî íå ïðåäëàãàÿ ïîëüçîâàòåëþ èç äèàëîãîâ. |
- | |
258 | .parse_run_only: |
- | |
259 | if DEBUG |
- | |
260 | pusha |
- | |
261 | mov si,no_show_only_w |
- | |
262 | call printplain |
- | |
263 | popa |
- | |
264 | end if |
- | |
265 | - | ||
266 | - | ||
267 | .end_show_all: |
- | |
268 | } |
- | |
269 | - | ||
270 | - | ||
271 | - | ||
272 | - | ||
273 | - | ||
274 | - | ||
275 | - | ||
276 | - | ||
277 | - | ||
278 | - | ||
279 | - | ||
280 | - | ||
281 | - | ||
282 | - | ||
283 | - | ||
284 | ;show black screen SL |
- | |
285 | macro show_bl_sc |
- | |
286 | { |
- | |
287 | ;;;;;;;;;;;;;;; |
- | |
288 | ;î÷èñòèì ýêðàí è âûâåäåì ìåíþ |
- | |
289 | ; draw frames |
- | |
290 | xor ax,ax |
- | |
291 | if DEBUG |
- | |
292 | mov ax,0x0720 |
- | |
293 | end if |
- | |
294 | push 0xb800 |
- | |
295 | pop es |
- | |
296 | xor di, di |
- | |
297 | ; draw top |
- | |
298 | mov cx, 25 * 80 |
- | |
299 | rep stosw |
- | |
300 | ;;;;;;;;;;;;;;;;;;;;;;; show 'Secondary Loader v0.xxx' |
- | |
301 | mov di,164 |
- | |
302 | mov si,version |
- | |
303 | mov cx,version_end-version |
- | |
304 | mov ah,color_sym_yellow |
- | |
305 | @@: |
- | |
306 | lodsb |
- | |
307 | stosw |
- | |
308 | loop @b |
- | |
309 | ;;;;;;;;;;;;;;;;;;;;;;; show firm )) |
- | |
310 | mov di,(2*160-(2*(soft_mes_end-soft_mes+4))) ;286 |
- | |
311 | mov ah,color_sym_pink;color_sym_red |
- | |
312 | mov al,'K' |
- | |
313 | stosw |
- | |
314 | mov al,' ' |
- | |
315 | stosw |
- | |
316 | mov ah,color_sym_lightgray;color_sym_lightblue;color_sym_pink |
- | |
317 | mov si,soft_mes |
- | |
318 | mov cx,soft_mes_end- soft_mes |
- | |
319 | @@: |
- | |
320 | lodsb |
- | |
321 | stosw |
- | |
322 | loop @b |
- | |
323 | ;;;;;;;;;;;;;;;;;;;;;;; show '__________________________' |
- | |
324 | mov di,480 |
- | |
325 | mov ah,color_sym_yellow |
- | |
326 | mov al,'Ä' |
- | |
327 | mov cx,61 |
- | |
328 | rep stosw |
- | |
329 | ;;;;;;;;;;;;;;;;;;;;;;; show 'Select section' |
- | |
330 | mov di,804 |
- | |
331 | mov si,select_section |
- | |
332 | mov cx,select_section_end - select_section |
- | |
333 | mov ah,color_sym_lightgray |
- | |
334 | @@: |
- | |
335 | lodsb |
- | |
336 | stosw |
- | |
337 | loop @b |
- | |
338 | ;;;;;;;;;;;;;;;;;;;;;;; show 'Section description' |
- | |
339 | mov di,880 |
- | |
340 | mov si,section_description |
- | |
341 | mov cx,section_description_end - section_description |
- | |
342 | ; mov ah,color_sym_lightgray |
- | |
343 | @@: |
- | |
344 | lodsb |
- | |
345 | stosw |
- | |
346 | loop @b |
- | |
347 | - | ||
348 | } |
- | |
349 | - | ||
350 | macro show_timer_message |
- | |
351 | { |
- | |
352 | ;;;;;;;;;;;;;;;;;;;;; show Press any key |
- | |
353 | ;;;;;;;;;;;;;;;;;;;;; show ramk |
- | |
354 | - | ||
355 | xor ax,ax |
- | |
356 | mov di,3360 |
- | |
357 | mov cx,80*4 |
- | |
358 | rep stosw |
- | |
359 | - | ||
360 | mov di,3362 |
- | |
361 | mov ah,color_sym_pink |
- | |
362 | mov al,0xDA |
- | |
363 | stosw |
- | |
364 | mov al,0xc4 |
- | |
365 | mov cx,76 |
- | |
366 | rep stosw |
- | |
367 | mov al,0xBF |
- | |
368 | stosw |
- | |
369 | add di,4 |
- | |
370 | mov al,0xb3 |
- | |
371 | stosw |
- | |
372 | add di,152 |
- | |
373 | stosw |
- | |
374 | add di,4 |
- | |
375 | stosw |
- | |
376 | add di,152 |
- | |
377 | stosw |
- | |
378 | add di,4 |
- | |
379 | mov al,0xc0 |
- | |
380 | stosw |
- | |
381 | mov al,0xc4 |
- | |
382 | mov cx,76 |
- | |
383 | rep stosw |
- | |
384 | mov al,0xd9 |
- | |
385 | stosw |
- | |
386 | ;;;;;;;;;;;;;;;;;;;;;;;;ramk is complete show |
- | |
387 | ;show first message |
- | |
388 | mov si,start_msg |
- | |
389 | mov cx,start_msg_e-start_msg |
- | |
390 | mov di,3526 |
- | |
391 | @@: |
- | |
392 | lodsb |
- | |
393 | stosw |
- | |
394 | loop @b |
- | |
395 | ;;;;;;;;;;;;;;;;;;;; show press Enter to.... |
- | |
396 | add di,44 |
- | |
397 | mov si,time_msg |
- | |
398 | mov cx,time_msg_e-time_msg |
- | |
399 | @@: |
- | |
400 | lodsb |
- | |
401 | stosw |
- | |
402 | loop @b |
- | |
403 | } |
- | |
404 | - | ||
405 | - | ||
406 | - | ||
407 | - | ||
408 | - | ||
409 | - | ||
410 | - | ||
411 | - | ||
412 | macro get_frame_buffer |
- | |
413 | { |
- | |
414 | mov cx,save_cx ;it's placed size of ini file |
- | |
415 | les di,dword [file_data] |
- | |
416 | - | ||
417 | mov si,di ;point frame |
- | |
418 | mov bx,cx |
- | |
419 | mov dx,size_show_section |
- | |
420 | ; mov point_to_hframe,di ; âíåñåì çíà÷åíèå, òàê ïîäñòðàõîâêà íå áîëåå |
- | |
421 | - | ||
422 | mov al,byte [es:di] |
- | |
423 | push word .first_ret_bl_sc |
- | |
424 | cmp al,' ' |
- | |
425 | jz .first_bl_sc |
- | |
426 | jmp get_firs_sym.not_space |
- | |
427 | .first_bl_sc: |
- | |
428 | jmp get_firs_sym.first_sp |
- | |
429 | - | ||
430 | .start_hbl: |
- | |
431 | call get_firs_sym ;get first symbol on new line |
- | |
432 | test cx,cx |
- | |
433 | jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before |
- | |
434 | cmp al,'[' |
- | |
435 | jnz .start_hbl |
- | |
436 | - | ||
437 | mov si,di ;point frame |
- | |
438 | mov bx,cx |
- | |
439 | mov dx,size_show_section |
- | |
440 | jmp .analisist_al |
- | |
441 | - | ||
442 | - | ||
443 | .start_bl: |
- | |
444 | call get_firs_sym ;get first symbol on new line |
- | |
445 | .first_ret_bl_sc: ;ïåðâûé âîçâðàò |
- | |
446 | test cx,cx |
- | |
447 | jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before |
- | |
448 | .analisist_al: |
- | |
449 | cmp al,'[' |
- | |
450 | jnz .start_bl |
- | |
451 | ;ïðîñìàòðèâàåì ini ôàéë ñ íà÷àëà â ïîèñêàõ ñåêöèè óêàçàíîé êàê default |
- | |
452 | ;ïîèñê ôðåéìà â êîòîðîì ñîäåðæèòüñÿ çíà÷åíèå default |
- | |
453 | .found_sect_bl: |
- | |
454 | cmp di,point_loader |
- | |
455 | jz .start_bl |
- | |
456 | cmp di,point_default |
- | |
457 | jz .save_point_def |
- | |
458 | - | ||
459 | dec dx |
- | |
460 | jnz .start_bl |
- | |
461 | - | ||
462 | jmp .start_hbl |
- | |
463 | - | ||
464 | - | ||
465 | .save_point_def: |
- | |
466 | ;èòàê äàëåå ìû äîëæíû çàïîëíèòü frame áóôåð àäðåñîâ ñåêöèé, ÷òî áû ïîòîì ïî íåìó áûñòðî ïåðåìåùàòüñÿ íå âû÷èñëÿÿ ñíîâà àäðåñà |
- | |
467 | mov di,si ;óêàçàòåëü íà íà÷àëî |
- | |
468 | mov cx,bx |
- | |
469 | lea si,point_to_hframe |
- | |
470 | mov dx,size_show_section+1 ;ò.ê. ó íàñ ñòðóêòóðà ñîäåðæèò ðàçìåð ìåæäó ïåðâûì è âòîðûì óêàçàòåëåì, òî íàì íóæíî íà 1 àäðåñ áîëüøå îáñ÷èòàòü ñåêöèé. |
- | |
471 | ;ïåðåõîäèì íà îáðàáîòêó çíà÷åíèÿ óêàçàòåëÿ |
- | |
472 | mov al,byte [es:di] |
- | |
473 | push word .first_ret_mfb |
- | |
474 | cmp al,' ' |
- | |
475 | jz .first_bl_mbf |
- | |
476 | jmp get_firs_sym.not_space |
- | |
477 | .first_bl_mbf: |
- | |
478 | jmp get_firs_sym.first_sp |
- | |
479 | - | ||
480 | .start_mfb: |
- | |
481 | call get_firs_sym ;get first symbol on new line |
- | |
482 | .first_ret_mfb: ;ïåðâûé âîçâðàò |
- | |
483 | jcxz .val_buff_comp ;.end_loader ;found or not found parametrs in section exit in section |
- | |
484 | cmp al,'[' |
- | |
485 | jnz .start_mfb |
- | |
486 | - | ||
487 | .found_sect_mfb: |
- | |
488 | cmp di,point_loader ;if we have section loader |
- | |
489 | jz .start_mfb |
- | |
490 | - | ||
491 | mov [si],di |
- | |
492 | - | ||
493 | sub si,2 |
- | |
494 | dec dx |
- | |
495 | jnz .start_mfb |
- | |
496 | ;bufer is full |
- | |
497 | jmp @f |
- | |
498 | .val_buff_comp: |
- | |
499 | push save_cx |
- | |
500 | pop word [si] |
- | |
501 | sub si,2 |
- | |
502 | @@: |
- | |
503 | - | ||
504 | add si,4 |
- | |
505 | mov point_to_eframe,si |
- | |
506 | - | ||
507 | } |
- | |
508 | - | ||
509 | macro show_act_cursor |
- | |
510 | { |
- | |
511 | ;îòîáðàæåíèå êóðñîðà ïî óìîë÷àíèþ |
- | |
512 | lea si,point_to_hframe |
- | |
513 | mov di,962-160 |
- | |
514 | mov ax,point_default |
- | |
515 | mov cx,size_show_section |
- | |
516 | .home_show_cur: |
- | |
517 | mov bx,[si] |
- | |
518 | add di,160 |
- | |
519 | cmp bx,ax |
- | |
520 | jz .show_cursor_activ |
- | |
521 | sub si,2 |
- | |
522 | loop .home_show_cur |
- | |
523 | - | ||
524 | .show_cursor_activ: |
- | |
525 | ; push 0xb800 |
- | |
526 | ; pop es |
- | |
527 | mov point_to_point_def,si |
- | |
528 | mov ax,(color_sym_red*0x100+0x10) |
- | |
529 | stosw |
- | |
530 | add di,68 |
- | |
531 | inc ax |
- | |
532 | stosw |
- | |
533 | } |
- | |
534 | - | ||
535 | macro clear_timer_msg |
- | |
536 | { |
- | |
537 | push 0xb800 |
- | |
538 | pop es |
- | |
539 | xor ax,ax |
- | |
540 | if DEBUG |
- | |
541 | mov ax,0x0720 |
- | |
542 | end if |
- | |
543 | ;;;;;;;;;;;;;;;;;;;;; show Press any key |
- | |
544 | mov di,3360 |
- | |
545 | mov cx,80*4 |
- | |
546 | rep stosw |
- | |
547 | - | ||
548 | ;show sect |
- | |
549 | push ini_data_ |
- | |
550 | pop es |
- | |
551 | call show_bl_sc_sect ;es=0xb800 |
- | |
552 | - | ||
553 | } |
- | |
554 | - | ||
555 | macro show_descript |
- | |
556 | ;Ýòîò ìàêðîñ ïîêàçûâàåò êðàòêîå îïèñàíèå, åñëè îíî åñòü ó ñåêöèè â ïóíêòå |
- | |
557 | ;Section description |
- | |
558 | { |
- | |
559 | local .start_p_sh_d |
- | |
560 | local .exit |
- | |
561 | local .rest_value_loop_sh_d |
- | |
562 | local .end_sh_desc_sec |
- | |
563 | local .loop_message |
- | |
564 | local .show_mess_prev_eq |
- | |
565 | mov di,point_default |
- | |
566 | push ini_data_ |
- | |
567 | mov si,point_to_point_def |
- | |
568 | pop es |
- | |
569 | sub si,2 |
- | |
570 | mov cx,[si] ;çàãðóçèì óêàçàòåëü íàñëåäóþùèþ ñåêöèþ |
- | |
571 | sub cx,di ;âîò òåïåðü èìååì èñòèíûé ðàçìåð |
- | |
572 | ;di - óêàçàòåëü íà äåôîëòíóþ ñåêöèþ ò.å. âûáðàííóþ cx - ðàçìåð îáëàñòè. äëÿ ïðîñìîòðà |
- | |
573 | - | ||
574 | .start_p_sh_d: |
- | |
575 | call get_firs_sym ;get first symbol on new line |
- | |
576 | test cx,cx |
- | |
577 | jz .exit ;íåòó? íó ëàäíî - ñëåäóþùåå çíà÷åíèå òîãäà ) |
- | |
578 | cmp al,'d' |
- | |
579 | jnz .start_p_sh_d |
- | |
580 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
- | |
581 | - | ||
582 | mov bx,cx |
- | |
583 | mov ax,di |
- | |
584 | - | ||
585 | mov si,parse_descript |
- | |
586 | mov cx,parse_descript_e - parse_descript |
- | |
587 | repe cmpsb |
- | |
588 | jnz .rest_value_loop_sh_d ;is not compare |
- | |
589 | - | ||
590 | sub bx,parse_descript_e - parse_descript ;correct cx |
- | |
591 | add bx,cx |
- | |
592 | mov cx,bx |
- | |
593 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ðàçáîð àëÿ ' = ' |
- | |
594 | mov ax,0x3d20 ;cut al=' ' ah='=' |
- | |
595 | repe scasb |
- | |
596 | jcxz .rest_value_loop_sh_d ;not found param timeout |
- | |
597 | - | ||
598 | cmp ah,byte [es:di-1] ;find '=' |
- | |
599 | jnz .rest_value_loop_sh_d |
- | |
600 | - | ||
601 | repe scasb ;cut ' ' |
- | |
602 | inc cx |
- | |
603 | dec di |
- | |
604 | ;;;;;;;;;;;;;;;;;;;;di óêàçûâàåò íà ñòðî÷êó, êîòîðóþ íàì íóæíî âûâîäèòü. |
- | |
605 | ;ñòðî÷êà áóäåò âûâîäèòüñÿ áëîêàìè ïî 37 ñèìâîëîâ. |
- | |
606 | ;íàñòðîèì êóäà áóäåì âûâîäèòü ò.å. íà÷àëî |
- | |
607 | ;es:di - óêàçûâàþò íà ñòðî÷êó èç êîòîðîé ìû áåðåì ñèìâîë, ds:si êóäà áóäåì âûâîäèòü |
- | |
608 | push di |
- | |
609 | pop si |
- | |
610 | - | ||
611 | push es |
- | |
612 | pop ds |
- | |
613 | - | ||
614 | push 0xb800 |
- | |
615 | pop es |
- | |
616 | - | ||
617 | mov di,1040 |
- | |
618 | mov bx,18 |
- | |
619 | mov find_sec_di,di |
- | |
620 | mov save_cx_d,bx |
- | |
621 | ;;;;;;;;;;;;;;;;;;;;;;;;;; |
- | |
622 | ;clean string |
- | |
623 | - | ||
624 | push di |
- | |
625 | xor ax,ax |
- | |
626 | - | ||
627 | @@: mov cx,38 |
- | |
628 | push di |
- | |
629 | rep stosw |
- | |
630 | pop di |
- | |
631 | - | ||
632 | cmp save_descript_size,bx |
- | |
633 | jz @f |
- | |
634 | - | ||
635 | - | ||
636 | add di,160 |
- | |
637 | dec bx |
- | |
638 | jnz @b |
- | |
639 | - | ||
640 | @@: pop di |
- | |
641 | ;enter in mess |
- | |
642 | .show_mess_prev_eq: |
- | |
643 | lodsb |
- | |
644 | mov ah,color_sym_lettuce;color_sym_turquoise |
- | |
645 | ; sub di,2 |
- | |
646 | cmp al,'"' |
- | |
647 | jz .loop_message |
- | |
648 | cmp al,"'" |
- | |
649 | jnz .end_sh_desc_sec |
- | |
650 | - | ||
651 | .loop_message: |
- | |
652 | mov cx,38 |
- | |
653 | @@: |
- | |
654 | lodsb |
- | |
655 | cmp al,'"' |
- | |
656 | jz .end_sh_desc_sec |
- | |
657 | cmp al,"'" |
- | |
658 | jz .end_sh_desc_sec |
- | |
659 | stosw |
- | |
660 | loop @b |
- | |
661 | - | ||
662 | add find_sec_di,160 |
- | |
663 | mov di,find_sec_di |
- | |
664 | dec save_cx_d |
- | |
665 | cmp save_cx_d,0 |
- | |
666 | jnz .loop_message |
- | |
667 | - | ||
668 | .end_sh_desc_sec: |
- | |
669 | push save_cx_d |
- | |
670 | pop save_descript_size |
- | |
671 | - | ||
672 | push cs |
- | |
673 | pop ds |
- | |
674 | jmp .exit |
- | |
675 | - | ||
676 | - | ||
677 | .rest_value_loop_sh_d: |
- | |
678 | mov di,ax |
- | |
679 | mov cx,bx |
- | |
680 | jmp .start_p_sh_d |
- | |
681 | - | ||
682 | .exit: |
- | |
683 | } |
- | |
684 | 1 | ; Copyright (c) 2009, |
|
- | 2 | ; All rights reserved. |
|
- | 3 | ; |
|
- | 4 | ; Redistribution and use in source and binary forms, with or without |
|
- | 5 | ; modification, are permitted provided that the following conditions are met: |
|
- | 6 | ; * Redistributions of source code must retain the above copyright |
|
- | 7 | ; notice, this list of conditions and the following disclaimer. |
|
- | 8 | ; * Redistributions in binary form must reproduce the above copyright |
|
- | 9 | ; notice, this list of conditions and the following disclaimer in the |
|
- | 10 | ; documentation and/or other materials provided with the distribution. |
|
- | 11 | ; * Neither the name of the |
|
- | 12 | ; names of its contributors may be used to endorse or promote products |
|
- | 13 | ; derived from this software without specific prior written permission. |
|
- | 14 | ; |
|
- | 15 | ; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka |
|
- | 16 | ; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
- | 17 | ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|
- | 18 | ; DISCLAIMED. IN NO EVENT SHALL |
|
- | 19 | ; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
|
- | 20 | ; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
- | 21 | ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
|
- | 22 | ; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
- | 23 | ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
|
- | 24 | ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
- | 25 | ;***************************************************************************** |
|
- | 26 | ||
- | 27 | ;òóò ðàñïîëîãàåòñÿ ìîäóëü ñ ïîìîùüþ êîòîðîãî áóäóò ïàðñèòüñÿ âñå îñòàëüíûå ñåêöèè |
|
- | 28 | color_sym_black equ 0 |
|
- | 29 | color_sym_blue equ 1 |
|
- | 30 | color_sym_green equ 2 |
|
- | 31 | color_sym_turquoise equ 3 |
|
- | 32 | color_sym_red equ 4 |
|
- | 33 | ||
- | 34 | color_sym_lightgray equ 7 |
|
- | 35 | ||
- | 36 | color_sym_lightblue equ 9 |
|
- | 37 | color_sym_lettuce equ 10 |
|
- | 38 | color_sym_pink equ 12 |
|
- | 39 | color_sym_yellow equ 14 |
|
- | 40 | ||
- | 41 | macro use_any_sec |
|
- | 42 | { |
|
- | 43 | ;óçíàåì ðàáîòó ïðåäûäóùåãî øàãà ò.å. ÷åìó = timeout, åñëè îí 0, òî âèçóàëüíàÿ ÷àñòü íå áóäåò îòîáðàæåíà íà äèñïëåå ñ âûáîðîì çàãðóçî÷íûõ ñåêöèé. |
|
- | 44 | ;èíà÷å ìû åå äîëæíû îòîáðàçèòü è æäàòü çàÿâëåíîå âðåìÿ äëÿ âûáîðà è êîíèãóðèðîâàíèÿ ïóêíêòîâ ñåêöèè îò ïîëüçîâàòåëÿ. |
|
- | 45 | ||
- | 46 | if DEBUG |
|
- | 47 | pusha |
|
- | 48 | mov ax, word [value_timeout];èäåò ïðîâåðêà íà íàëè÷åå çíà÷åíèÿ timeout, äëÿ áîëåå áûñòðîé ðàáîòû, ýòîò ïàðàìåòð äîëæåí áûòü óæå îáðàáîòàí,ò.å. â ýòîì ñëó÷àå ïðè åãî =0 áóäåò ñôîðìèðîâàí óêàçàòåëü òîëüêî íà äåôîëòíóþ ñåêöèþ, èíà÷å èíôîðìàöèÿ áóäåò ñîáðàíà ïî âñåì ñåêöèÿì è ñîñòàâëåíû óêàçàòåëè â áëîêå ïàìÿòè |
|
- | 49 | ; mov ax,cx |
|
- | 50 | mov cx, 0x0a |
|
- | 51 | mov di, show_db1 |
|
- | 52 | mov dword[ds:di], ' ' |
|
- | 53 | mov word [ds:di+4], ' ' |
|
- | 54 | call decode |
|
- | 55 | ;Show size |
|
- | 56 | mov si, show_db1 |
|
- | 57 | call printplain |
|
- | 58 | ; |
|
- | 59 | popa |
|
- | 60 | end if |
|
- | 61 | ||
- | 62 | test ax, ax |
|
- | 63 | jz .parse_run_only |
|
- | 64 | ||
- | 65 | ;îòîáðàçèì ïîëíûé ñïèñîê âñåõ íàéäåíûõ ñåêöèé. |
|
- | 66 | if DEBUG |
|
- | 67 | pusha |
|
- | 68 | mov si, show_all_sect |
|
- | 69 | call printplain |
|
- | 70 | popa |
|
- | 71 | end if |
|
- | 72 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
- | 73 | mov al, 0xf6 ; Ñáðîñ êëàâèàòóðû, ðàçðåøèòü ñêàíèðîâàíèå |
|
- | 74 | out 0x60, al |
|
- | 75 | xor cx, cx |
|
- | 76 | .wait_loop: ; variant 2 |
|
- | 77 | ; reading state of port of 8042 controller |
|
- | 78 | in al, 64h |
|
- | 79 | and al, 00000010b ; ready flag |
|
- | 80 | ; wait until 8042 controller is ready |
|
- | 81 | loopnz .wait_loop |
|
- | 82 | ||
- | 83 | ||
- | 84 | ; set keyboard typematic rate & delay |
|
- | 85 | mov al, 0xf3 |
|
- | 86 | out 0x60, al |
|
- | 87 | xor cx, cx |
|
- | 88 | @@: |
|
- | 89 | in al, 64h |
|
- | 90 | test al, 2 |
|
- | 91 | loopnz @b |
|
- | 92 | mov al, 0 |
|
- | 93 | out 0x60, al |
|
- | 94 | xor cx, cx |
|
- | 95 | @@: |
|
- | 96 | in al, 64h |
|
- | 97 | test al, 2 |
|
- | 98 | loopnz @b |
|
- | 99 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
- | 100 | ; get start time |
|
- | 101 | call gettime |
|
- | 102 | mov dword [start_timer], eax |
|
- | 103 | mov word [timer_], newtimer |
|
- | 104 | mov word [timer_+2], cs |
|
- | 105 | ;óñòàíîâèòü ñâîå ïðåðûâàíèå íà òàéìåð ò.å. êîä áóäåò ïåððûâàòüñÿ ~18 ðàç â ñåê è ïåðåõîäèòü íà îáðàáîò÷èê |
|
- | 106 | cli |
|
- | 107 | push 0 |
|
- | 108 | pop es |
|
- | 109 | push dword [es:8*4] |
|
- | 110 | pop dword [old_timer] |
|
- | 111 | push dword [timer_] |
|
- | 112 | pop dword [es:8*4] |
|
- | 113 | sti |
|
- | 114 | ||
- | 115 | ;ïðîöåäóðà ôîðìèðîâàíèÿ áóôåðà äëÿ ñêðîëèíãà ñåêöèé |
|
- | 116 | ;if DEBUG |
|
- | 117 | ; pusha |
|
- | 118 | ; mov ax,point_default |
|
- | 119 | ; mov ax,cx |
|
- | 120 | ; mov cx,0x0a |
|
- | 121 | ; mov di,show_db1 |
|
- | 122 | ; mov dword[ds:di],' ' |
|
- | 123 | ; mov word [ds:di+4],' ' |
|
- | 124 | ; call decode |
|
- | 125 | ;Show size |
|
- | 126 | ; mov si,show_db1 |
|
- | 127 | ; call printplain |
|
- | 128 | ; |
|
- | 129 | ; xor ax,ax |
|
- | 130 | ; int 0x16 |
|
- | 131 | ; popa |
|
- | 132 | ;end if |
|
- | 133 | ;;;;;;;;;;;;;ðàçìåð ïðåäûäóùåé ñåöèè óñòàíîâèì =0 |
|
- | 134 | mov save_descript_size, 18 |
|
- | 135 | ;îòîáðàçèòü black screen |
|
- | 136 | show_bl_sc ;es=0xb800 |
|
- | 137 | .show_all_scr: |
|
- | 138 | get_frame_buffer ;es=0x2000 |
|
- | 139 | ;îòîáðàæåíèå ñåêöèé |
|
- | 140 | call show_bl_sc_sect ;es=0xb800 |
|
- | 141 | ;îòîáðàçèòü àêòèâíûé êóðñîð |
|
- | 142 | .show_active_cursor: |
|
- | 143 | show_act_cursor |
|
- | 144 | show_descript ;ìàêðîñ ïî îòîáðàæåíèþ îïèñàíèÿ ñåêöèè |
|
- | 145 | ||
- | 146 | ;îòîáðàçèòü Press any key .... |
|
- | 147 | mov eax, dword [old_timer] |
|
- | 148 | cmp eax, dword [timer_] |
|
- | 149 | jz .interrupt_16 |
|
- | 150 | ||
- | 151 | show_timer_message |
|
- | 152 | mov word [start_stack], sp |
|
- | 153 | .interrupt_16: |
|
- | 154 | xor ax, ax ;ïîëó÷èì èíôîðìàöèþ î òîì ÷òî íàæàòî |
|
- | 155 | int 0x16 |
|
- | 156 | ;check on change |
|
- | 157 | mov ebx, dword [old_timer] |
|
- | 158 | cmp ebx, dword [timer_] |
|
- | 159 | jz @f |
|
- | 160 | ;restore timer interrupt |
|
- | 161 | cli |
|
- | 162 | push 0 |
|
- | 163 | pop es |
|
- | 164 | ; mov eax,dword [old_timer] ; âîññòàíîâèì ïðåæäíåå ïðåðûâàíèå |
|
- | 165 | mov [es:8*4], ebx |
|
- | 166 | mov dword [timer_], ebx |
|
- | 167 | sti |
|
- | 168 | ||
- | 169 | push ax |
|
- | 170 | clear_timer_msg |
|
- | 171 | pop ax |
|
- | 172 | @@: |
|
- | 173 | call clean_active_cursor ;clean old cursor ;es=0xb800 |
|
- | 174 | ||
- | 175 | cmp ah, 0x48 ;ðåàêöèÿ ñèñòåìû íà ñîáûòèÿ |
|
- | 176 | jz .up |
|
- | 177 | cmp ah, 0x50 |
|
- | 178 | jz .down |
|
- | 179 | cmp ah, 0x49 |
|
- | 180 | jz .pgup |
|
- | 181 | cmp ah, 0x51 |
|
- | 182 | jz .pgdown |
|
- | 183 | cmp ah, 0x47 |
|
- | 184 | jz .home |
|
- | 185 | cmp ah, 0x4f |
|
- | 186 | jz .end |
|
- | 187 | ||
- | 188 | cmp al, 0xD |
|
- | 189 | jnz .show_active_cursor |
|
- | 190 | ||
- | 191 | jmp .end_show_all ;ïàðñèíã ñåêöèè êîòîðàÿ óêàçàíà â point_default |
|
- | 192 | .up: |
|
- | 193 | mov si, point_to_point_def ;çíà÷åíèå óêàçàòåëÿ |
|
- | 194 | add si, 2 |
|
- | 195 | lea ax, point_to_hframe |
|
- | 196 | ||
- | 197 | cmp si, ax |
|
- | 198 | ja @f |
|
- | 199 | ||
- | 200 | mov point_to_point_def, si |
|
- | 201 | mov ax, [si] |
|
- | 202 | mov point_default, ax |
|
- | 203 | jmp .show_active_cursor |
|
- | 204 | @@: |
|
- | 205 | call find_before_sect |
|
- | 206 | jmp .show_all_scr |
|
- | 207 | ||
- | 208 | ||
- | 209 | ||
- | 210 | .down: |
|
- | 211 | mov si, point_to_point_def ;çíà÷åíèå óêàçàòåëÿ |
|
- | 212 | mov ax, point_to_eframe ;óêàçàòåëü íà ïîñëåäíèé ýëåìåíò |
|
- | 213 | sub si, 2 |
|
- | 214 | cmp si, ax |
|
- | 215 | jb @f |
|
- | 216 | ||
- | 217 | mov point_to_point_def, si |
|
- | 218 | mov ax, [si] |
|
- | 219 | mov point_default, ax |
|
- | 220 | jmp .show_active_cursor |
|
- | 221 | ||
- | 222 | @@: |
|
- | 223 | call find_next_sect |
|
- | 224 | jmp .show_all_scr |
|
- | 225 | ||
- | 226 | .pgup: |
|
- | 227 | mov cx, size_show_section |
|
- | 228 | @@: |
|
- | 229 | push cx |
|
- | 230 | call find_before_sect |
|
- | 231 | pop cx |
|
- | 232 | loop @b |
|
- | 233 | jmp .show_all_scr |
|
- | 234 | ||
- | 235 | ||
- | 236 | .pgdown: |
|
- | 237 | mov cx, size_show_section |
|
- | 238 | @@: |
|
- | 239 | push cx |
|
- | 240 | call find_next_sect |
|
- | 241 | pop cx |
|
- | 242 | loop @b |
|
- | 243 | jmp .show_all_scr |
|
- | 244 | ||
- | 245 | .home: |
|
- | 246 | xor di, di |
|
- | 247 | call find_next_sect.h |
|
- | 248 | jmp .show_all_scr |
|
- | 249 | ||
- | 250 | .end: |
|
- | 251 | mov di, save_cx |
|
- | 252 | call find_before_sect.e |
|
- | 253 | jmp .show_all_scr |
|
- | 254 | ||
- | 255 | ||
- | 256 | ||
- | 257 | ||
- | 258 | ; òóò ìû áóäåì ïàðñèòü òîëüêî äåôîëòíóþ ñåêöèþ è âûïîëíÿòü åå íè÷åãî íå ïðåäëàãàÿ ïîëüçîâàòåëþ èç äèàëîãîâ. |
|
- | 259 | .parse_run_only: |
|
- | 260 | if DEBUG |
|
- | 261 | pusha |
|
- | 262 | mov si, no_show_only_w |
|
- | 263 | call printplain |
|
- | 264 | popa |
|
- | 265 | end if |
|
- | 266 | ||
- | 267 | ||
- | 268 | .end_show_all: |
|
- | 269 | } |
|
- | 270 | ||
- | 271 | ||
- | 272 | ||
- | 273 | ||
- | 274 | ||
- | 275 | ||
- | 276 | ||
- | 277 | ||
- | 278 | ||
- | 279 | ||
- | 280 | ||
- | 281 | ||
- | 282 | ||
- | 283 | ||
- | 284 | ||
- | 285 | ;show black screen SL |
|
- | 286 | macro show_bl_sc |
|
- | 287 | { |
|
- | 288 | ;;;;;;;;;;;;;;; |
|
- | 289 | ;î÷èñòèì ýêðàí è âûâåäåì ìåíþ |
|
- | 290 | ; draw frames |
|
- | 291 | xor ax, ax |
|
- | 292 | if DEBUG |
|
- | 293 | mov ax, 0x0720 |
|
- | 294 | end if |
|
- | 295 | push 0xb800 |
|
- | 296 | pop es |
|
- | 297 | xor di, di |
|
- | 298 | ; draw top |
|
- | 299 | mov cx, 25 * 80 |
|
- | 300 | rep stosw |
|
- | 301 | ;;;;;;;;;;;;;;;;;;;;;;; show 'Secondary Loader v0.xxx' |
|
- | 302 | mov di, 164 |
|
- | 303 | mov si, version |
|
- | 304 | mov cx, version_end-version |
|
- | 305 | mov ah, color_sym_yellow |
|
- | 306 | @@: |
|
- | 307 | lodsb |
|
- | 308 | stosw |
|
- | 309 | loop @b |
|
- | 310 | ;;;;;;;;;;;;;;;;;;;;;;; show firm )) |
|
- | 311 | mov di, (2*160-(2*(soft_mes_end-soft_mes+4))) ;286 |
|
- | 312 | mov ah, color_sym_pink;color_sym_red |
|
- | 313 | mov al, 'K' |
|
- | 314 | stosw |
|
- | 315 | mov al, ' ' |
|
- | 316 | stosw |
|
- | 317 | mov ah, color_sym_lightgray;color_sym_lightblue;color_sym_pink |
|
- | 318 | mov si, soft_mes |
|
- | 319 | mov cx, soft_mes_end- soft_mes |
|
- | 320 | @@: |
|
- | 321 | lodsb |
|
- | 322 | stosw |
|
- | 323 | loop @b |
|
- | 324 | ;;;;;;;;;;;;;;;;;;;;;;; show '__________________________' |
|
- | 325 | mov di, 480 |
|
- | 326 | mov ah, color_sym_yellow |
|
- | 327 | mov al, 'Ä' |
|
- | 328 | mov cx, 61 |
|
- | 329 | rep stosw |
|
- | 330 | ;;;;;;;;;;;;;;;;;;;;;;; show 'Select section' |
|
- | 331 | mov di, 804 |
|
- | 332 | mov si, select_section |
|
- | 333 | mov cx, select_section_end - select_section |
|
- | 334 | mov ah, color_sym_lightgray |
|
- | 335 | @@: |
|
- | 336 | lodsb |
|
- | 337 | stosw |
|
- | 338 | loop @b |
|
- | 339 | ;;;;;;;;;;;;;;;;;;;;;;; show 'Section description' |
|
- | 340 | mov di, 880 |
|
- | 341 | mov si, section_description |
|
- | 342 | mov cx, section_description_end - section_description |
|
- | 343 | ; mov ah,color_sym_lightgray |
|
- | 344 | @@: |
|
- | 345 | lodsb |
|
- | 346 | stosw |
|
- | 347 | loop @b |
|
- | 348 | ||
- | 349 | } |
|
- | 350 | ||
- | 351 | macro show_timer_message |
|
- | 352 | { |
|
- | 353 | ;;;;;;;;;;;;;;;;;;;;; show Press any key |
|
- | 354 | ;;;;;;;;;;;;;;;;;;;;; show ramk |
|
- | 355 | ||
- | 356 | xor ax, ax |
|
- | 357 | mov di, 3360 |
|
- | 358 | mov cx, 80*4 |
|
- | 359 | rep stosw |
|
- | 360 | ||
- | 361 | mov di, 3362 |
|
- | 362 | mov ah, color_sym_pink |
|
- | 363 | mov al, 0xDA |
|
- | 364 | stosw |
|
- | 365 | mov al, 0xc4 |
|
- | 366 | mov cx, 76 |
|
- | 367 | rep stosw |
|
- | 368 | mov al, 0xBF |
|
- | 369 | stosw |
|
- | 370 | add di, 4 |
|
- | 371 | mov al, 0xb3 |
|
- | 372 | stosw |
|
- | 373 | add di, 152 |
|
- | 374 | stosw |
|
- | 375 | add di, 4 |
|
- | 376 | stosw |
|
- | 377 | add di, 152 |
|
- | 378 | stosw |
|
- | 379 | add di, 4 |
|
- | 380 | mov al, 0xc0 |
|
- | 381 | stosw |
|
- | 382 | mov al, 0xc4 |
|
- | 383 | mov cx, 76 |
|
- | 384 | rep stosw |
|
- | 385 | mov al, 0xd9 |
|
- | 386 | stosw |
|
- | 387 | ;;;;;;;;;;;;;;;;;;;;;;;;ramk is complete show |
|
- | 388 | ;show first message |
|
- | 389 | mov si, start_msg |
|
- | 390 | mov cx, start_msg_e-start_msg |
|
- | 391 | mov di, 3526 |
|
- | 392 | @@: |
|
- | 393 | lodsb |
|
- | 394 | stosw |
|
- | 395 | loop @b |
|
- | 396 | ;;;;;;;;;;;;;;;;;;;; show press Enter to.... |
|
- | 397 | add di, 44 |
|
- | 398 | mov si, time_msg |
|
- | 399 | mov cx, time_msg_e-time_msg |
|
- | 400 | @@: |
|
- | 401 | lodsb |
|
- | 402 | stosw |
|
- | 403 | loop @b |
|
- | 404 | } |
|
- | 405 | ||
- | 406 | ||
- | 407 | ||
- | 408 | ||
- | 409 | ||
- | 410 | ||
- | 411 | ||
- | 412 | ||
- | 413 | macro get_frame_buffer |
|
- | 414 | { |
|
- | 415 | mov cx, save_cx ;it's placed size of ini file |
|
- | 416 | les di, dword [file_data] |
|
- | 417 | ||
- | 418 | mov si, di ;point frame |
|
- | 419 | mov bx, cx |
|
- | 420 | mov dx, size_show_section |
|
- | 421 | ; mov point_to_hframe,di ; âíåñåì çíà÷åíèå, òàê ïîäñòðàõîâêà íå áîëåå |
|
- | 422 | ||
- | 423 | mov al, byte [es:di] |
|
- | 424 | push word .first_ret_bl_sc |
|
- | 425 | cmp al, ' ' |
|
- | 426 | jz .first_bl_sc |
|
- | 427 | jmp get_firs_sym.not_space |
|
- | 428 | .first_bl_sc: |
|
- | 429 | jmp get_firs_sym.first_sp |
|
- | 430 | ||
- | 431 | .start_hbl: |
|
- | 432 | call get_firs_sym ;get first symbol on new line |
|
- | 433 | test cx, cx |
|
- | 434 | jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before |
|
- | 435 | cmp al, '[' |
|
- | 436 | jnz .start_hbl |
|
- | 437 | ||
- | 438 | mov si, di ;point frame |
|
- | 439 | mov bx, cx |
|
- | 440 | mov dx, size_show_section |
|
- | 441 | jmp .analisist_al |
|
- | 442 | ||
- | 443 | ||
- | 444 | .start_bl: |
|
- | 445 | call get_firs_sym ;get first symbol on new line |
|
- | 446 | .first_ret_bl_sc: ;ïåðâûé âîçâðàò |
|
- | 447 | test cx, cx |
|
- | 448 | jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before |
|
- | 449 | .analisist_al: |
|
- | 450 | cmp al, '[' |
|
- | 451 | jnz .start_bl |
|
- | 452 | ;ïðîñìàòðèâàåì ini ôàéë ñ íà÷àëà â ïîèñêàõ ñåêöèè óêàçàíîé êàê default |
|
- | 453 | ;ïîèñê ôðåéìà â êîòîðîì ñîäåðæèòüñÿ çíà÷åíèå default |
|
- | 454 | .found_sect_bl: |
|
- | 455 | cmp di, point_loader |
|
- | 456 | jz .start_bl |
|
- | 457 | cmp di, point_default |
|
- | 458 | jz .save_point_def |
|
- | 459 | ||
- | 460 | dec dx |
|
- | 461 | jnz .start_bl |
|
- | 462 | ||
- | 463 | jmp .start_hbl |
|
- | 464 | ||
- | 465 | ||
- | 466 | .save_point_def: |
|
- | 467 | ;èòàê äàëåå ìû äîëæíû çàïîëíèòü frame áóôåð àäðåñîâ ñåêöèé, ÷òî áû ïîòîì ïî íåìó áûñòðî ïåðåìåùàòüñÿ íå âû÷èñëÿÿ ñíîâà àäðåñà |
|
- | 468 | mov di, si ;óêàçàòåëü íà íà÷àëî |
|
- | 469 | mov cx, bx |
|
- | 470 | lea si, point_to_hframe |
|
- | 471 | mov dx, size_show_section+1 ;ò.ê. ó íàñ ñòðóêòóðà ñîäåðæèò ðàçìåð ìåæäó ïåðâûì è âòîðûì óêàçàòåëåì, òî íàì íóæíî íà 1 àäðåñ áîëüøå îáñ÷èòàòü ñåêöèé. |
|
- | 472 | ;ïåðåõîäèì íà îáðàáîòêó çíà÷åíèÿ óêàçàòåëÿ |
|
- | 473 | mov al, byte [es:di] |
|
- | 474 | push word .first_ret_mfb |
|
- | 475 | cmp al, ' ' |
|
- | 476 | jz .first_bl_mbf |
|
- | 477 | jmp get_firs_sym.not_space |
|
- | 478 | .first_bl_mbf: |
|
- | 479 | jmp get_firs_sym.first_sp |
|
- | 480 | ||
- | 481 | .start_mfb: |
|
- | 482 | call get_firs_sym ;get first symbol on new line |
|
- | 483 | .first_ret_mfb: ;ïåðâûé âîçâðàò |
|
- | 484 | jcxz .val_buff_comp ;.end_loader ;found or not found parametrs in section exit in section |
|
- | 485 | cmp al, '[' |
|
- | 486 | jnz .start_mfb |
|
- | 487 | ||
- | 488 | .found_sect_mfb: |
|
- | 489 | cmp di, point_loader ;if we have section loader |
|
- | 490 | jz .start_mfb |
|
- | 491 | ||
- | 492 | mov [si], di |
|
- | 493 | ||
- | 494 | sub si, 2 |
|
- | 495 | dec dx |
|
- | 496 | jnz .start_mfb |
|
- | 497 | ;bufer is full |
|
- | 498 | jmp @f |
|
- | 499 | .val_buff_comp: |
|
- | 500 | push save_cx |
|
- | 501 | pop word [si] |
|
- | 502 | sub si, 2 |
|
- | 503 | @@: |
|
- | 504 | ||
- | 505 | add si, 4 |
|
- | 506 | mov point_to_eframe, si |
|
- | 507 | ||
- | 508 | } |
|
- | 509 | ||
- | 510 | macro show_act_cursor |
|
- | 511 | { |
|
- | 512 | ;îòîáðàæåíèå êóðñîðà ïî óìîë÷àíèþ |
|
- | 513 | lea si, point_to_hframe |
|
- | 514 | mov di, 962-160 |
|
- | 515 | mov ax, point_default |
|
- | 516 | mov cx, size_show_section |
|
- | 517 | .home_show_cur: |
|
- | 518 | mov bx, [si] |
|
- | 519 | add di, 160 |
|
- | 520 | cmp bx, ax |
|
- | 521 | jz .show_cursor_activ |
|
- | 522 | sub si, 2 |
|
- | 523 | loop .home_show_cur |
|
- | 524 | ||
- | 525 | .show_cursor_activ: |
|
- | 526 | ; push 0xb800 |
|
- | 527 | ; pop es |
|
- | 528 | mov point_to_point_def, si |
|
- | 529 | mov ax, (color_sym_red*0x100+0x10) |
|
- | 530 | stosw |
|
- | 531 | add di, 68 |
|
- | 532 | inc ax |
|
- | 533 | stosw |
|
- | 534 | } |
|
- | 535 | ||
- | 536 | macro clear_timer_msg |
|
- | 537 | { |
|
- | 538 | push 0xb800 |
|
- | 539 | pop es |
|
- | 540 | xor ax, ax |
|
- | 541 | if DEBUG |
|
- | 542 | mov ax, 0x0720 |
|
- | 543 | end if |
|
- | 544 | ;;;;;;;;;;;;;;;;;;;;; show Press any key |
|
- | 545 | mov di, 3360 |
|
- | 546 | mov cx, 80*4 |
|
- | 547 | rep stosw |
|
- | 548 | ||
- | 549 | ;show sect |
|
- | 550 | push ini_data_ |
|
- | 551 | pop es |
|
- | 552 | call show_bl_sc_sect ;es=0xb800 |
|
- | 553 | ||
- | 554 | } |
|
- | 555 | ||
- | 556 | macro show_descript |
|
- | 557 | ;Ýòîò ìàêðîñ ïîêàçûâàåò êðàòêîå îïèñàíèå, åñëè îíî åñòü ó ñåêöèè â ïóíêòå |
|
- | 558 | ;Section description |
|
- | 559 | { |
|
- | 560 | local .start_p_sh_d |
|
- | 561 | local .exit |
|
- | 562 | local .rest_value_loop_sh_d |
|
- | 563 | local .end_sh_desc_sec |
|
- | 564 | local .loop_message |
|
- | 565 | local .show_mess_prev_eq |
|
- | 566 | mov di, point_default |
|
- | 567 | push ini_data_ |
|
- | 568 | mov si, point_to_point_def |
|
- | 569 | pop es |
|
- | 570 | sub si, 2 |
|
- | 571 | mov cx, [si] ;çàãðóçèì óêàçàòåëü íàñëåäóþùèþ ñåêöèþ |
|
- | 572 | sub cx, di ;âîò òåïåðü èìååì èñòèíûé ðàçìåð |
|
- | 573 | ;di - óêàçàòåëü íà äåôîëòíóþ ñåêöèþ ò.å. âûáðàííóþ cx - ðàçìåð îáëàñòè. äëÿ ïðîñìîòðà |
|
- | 574 | ||
- | 575 | .start_p_sh_d: |
|
- | 576 | call get_firs_sym ;get first symbol on new line |
|
- | 577 | test cx, cx |
|
- | 578 | jz .exit ;íåòó? íó ëàäíî - ñëåäóþùåå çíà÷åíèå òîãäà ) |
|
- | 579 | cmp al, 'd' |
|
- | 580 | jnz .start_p_sh_d |
|
- | 581 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
- | 582 | ||
- | 583 | mov bx, cx |
|
- | 584 | mov ax, di |
|
- | 585 | ||
- | 586 | mov si, parse_descript |
|
- | 587 | mov cx, parse_descript_e - parse_descript |
|
- | 588 | repe cmpsb |
|
- | 589 | jnz .rest_value_loop_sh_d ;is not compare |
|
- | 590 | ||
- | 591 | sub bx, parse_descript_e - parse_descript;correct cx |
|
- | 592 | add bx, cx |
|
- | 593 | mov cx, bx |
|
- | 594 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ðàçáîð àëÿ ' = ' |
|
- | 595 | mov ax, 0x3d20 ;cut al=' ' ah='=' |
|
- | 596 | repe scasb |
|
- | 597 | jcxz .rest_value_loop_sh_d ;not found param timeout |
|
- | 598 | ||
- | 599 | cmp ah, byte [es:di-1] ;find '=' |
|
- | 600 | jnz .rest_value_loop_sh_d |
|
- | 601 | ||
- | 602 | repe scasb ;cut ' ' |
|
- | 603 | inc cx |
|
- | 604 | dec di |
|
- | 605 | ;;;;;;;;;;;;;;;;;;;;di óêàçûâàåò íà ñòðî÷êó, êîòîðóþ íàì íóæíî âûâîäèòü. |
|
- | 606 | ;ñòðî÷êà áóäåò âûâîäèòüñÿ áëîêàìè ïî 37 ñèìâîëîâ. |
|
- | 607 | ;íàñòðîèì êóäà áóäåì âûâîäèòü ò.å. íà÷àëî |
|
- | 608 | ;es:di - óêàçûâàþò íà ñòðî÷êó èç êîòîðîé ìû áåðåì ñèìâîë, ds:si êóäà áóäåì âûâîäèòü |
|
- | 609 | push di |
|
- | 610 | pop si |
|
- | 611 | ||
- | 612 | push es |
|
- | 613 | pop ds |
|
- | 614 | ||
- | 615 | push 0xb800 |
|
- | 616 | pop es |
|
- | 617 | ||
- | 618 | mov di, 1040 |
|
- | 619 | mov bx, 18 |
|
- | 620 | mov find_sec_di, di |
|
- | 621 | mov save_cx_d, bx |
|
- | 622 | ;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
- | 623 | ;clean string |
|
- | 624 | ||
- | 625 | push di |
|
- | 626 | xor ax, ax |
|
- | 627 | ||
- | 628 | @@: |
|
- | 629 | mov cx, 38 |
|
- | 630 | push di |
|
- | 631 | rep stosw |
|
- | 632 | pop di |
|
- | 633 | ||
- | 634 | cmp save_descript_size, bx |
|
- | 635 | jz @f |
|
- | 636 | ||
- | 637 | ||
- | 638 | add di, 160 |
|
- | 639 | dec bx |
|
- | 640 | jnz @b |
|
- | 641 | ||
- | 642 | @@: |
|
- | 643 | pop di |
|
- | 644 | ;enter in mess |
|
- | 645 | .show_mess_prev_eq: |
|
- | 646 | lodsb |
|
- | 647 | mov ah, color_sym_lettuce;color_sym_turquoise |
|
- | 648 | ; sub di,2 |
|
- | 649 | cmp al, '"' |
|
- | 650 | jz .loop_message |
|
- | 651 | cmp al, "'" |
|
- | 652 | jnz .end_sh_desc_sec |
|
- | 653 | ||
- | 654 | .loop_message: |
|
- | 655 | mov cx, 38 |
|
- | 656 | @@: |
|
- | 657 | lodsb |
|
- | 658 | cmp al, '"' |
|
- | 659 | jz .end_sh_desc_sec |
|
- | 660 | cmp al, "'" |
|
- | 661 | jz .end_sh_desc_sec |
|
- | 662 | stosw |
|
- | 663 | loop @b |
|
- | 664 | ||
- | 665 | add find_sec_di, 160 |
|
- | 666 | mov di, find_sec_di |
|
- | 667 | dec save_cx_d |
|
- | 668 | cmp save_cx_d, 0 |
|
- | 669 | jnz .loop_message |
|
- | 670 | ||
- | 671 | .end_sh_desc_sec: |
|
- | 672 | push save_cx_d |
|
- | 673 | pop save_descript_size |
|
- | 674 | ||
- | 675 | push cs |
|
- | 676 | pop ds |
|
- | 677 | jmp .exit |
|
- | 678 | ||
- | 679 | ||
- | 680 | .rest_value_loop_sh_d: |
|
- | 681 | mov di, ax |
|
- | 682 | mov cx, bx |
|
- | 683 | jmp .start_p_sh_d |
|
- | 684 | ||
- | 685 | .exit: |
|
- | 686 | } |
|
- | 687 |