2010-10-01 13:21:55 +04:00
|
|
|
|
; Copyright (c) 2009, <Lrz>
|
|
|
|
|
; All rights reserved.
|
|
|
|
|
;
|
|
|
|
|
; Redistribution and use in source and binary forms, with or without
|
|
|
|
|
; modification, are permitted provided that the following conditions are met:
|
|
|
|
|
; * Redistributions of source code must retain the above copyright
|
|
|
|
|
; notice, this list of conditions and the following disclaimer.
|
|
|
|
|
; * Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
; notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
; documentation and/or other materials provided with the distribution.
|
|
|
|
|
; * Neither the name of the <organization> nor the
|
|
|
|
|
; names of its contributors may be used to endorse or promote products
|
|
|
|
|
; derived from this software without specific prior written permission.
|
|
|
|
|
;
|
|
|
|
|
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov aka <Lrz> ''AS IS'' AND ANY
|
|
|
|
|
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
|
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
|
|
|
|
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
|
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
|
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
|
|
|
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
|
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
|
|
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
;*****************************************************************************
|
|
|
|
|
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;тут распологается модуль с помощью которого будут парситься все остальные секции
|
2010-10-01 13:21:55 +04:00
|
|
|
|
color_sym_black equ 0
|
|
|
|
|
color_sym_blue equ 1
|
|
|
|
|
color_sym_green equ 2
|
|
|
|
|
color_sym_turquoise equ 3
|
|
|
|
|
color_sym_red equ 4
|
|
|
|
|
|
|
|
|
|
color_sym_lightgray equ 7
|
|
|
|
|
|
|
|
|
|
color_sym_lightblue equ 9
|
|
|
|
|
color_sym_lettuce equ 10
|
|
|
|
|
color_sym_pink equ 12
|
|
|
|
|
color_sym_yellow equ 14
|
|
|
|
|
|
|
|
|
|
macro use_any_sec
|
|
|
|
|
{
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;узнаем работу предыдущего шага т.е. чему = timeout, если он 0, то визуальная часть не будет отображена на дисплее с выбором загрузочных секций.
|
|
|
|
|
;иначе мы ее должны отобразить и ждать заявленое время для выбора и конигурирования пукнктов секции от пользователя.
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov ax, word [value_timeout];идет проверка на наличее значения timeout, для более быстрой работы, этот параметр должен быть уже обработан,т.е. в этом случае при его =0 будет сформирован указатель только на дефолтную секцию, иначе информация будет собрана по всем секциям и составлены указатели в блоке памяти
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; mov ax,cx
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov cx, 0x0a
|
|
|
|
|
mov di, show_db1
|
|
|
|
|
mov dword[ds:di], ' '
|
|
|
|
|
mov word [ds:di+4], ' '
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call decode
|
|
|
|
|
;Show size
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov si, show_db1
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call printplain
|
|
|
|
|
;
|
|
|
|
|
popa
|
|
|
|
|
end if
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test ax, ax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .parse_run_only
|
|
|
|
|
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;отобразим полный список всех найденых секций.
|
2010-10-01 13:21:55 +04:00
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov si, show_all_sect
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call printplain
|
|
|
|
|
popa
|
|
|
|
|
end if
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov al, 0xf6 ; Сброс клавиатуры, разрешить сканирование
|
2010-10-01 13:21:55 +04:00
|
|
|
|
out 0x60, al
|
|
|
|
|
xor cx, cx
|
|
|
|
|
.wait_loop: ; variant 2
|
|
|
|
|
; reading state of port of 8042 controller
|
|
|
|
|
in al, 64h
|
|
|
|
|
and al, 00000010b ; ready flag
|
|
|
|
|
; wait until 8042 controller is ready
|
|
|
|
|
loopnz .wait_loop
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; set keyboard typematic rate & delay
|
|
|
|
|
mov al, 0xf3
|
|
|
|
|
out 0x60, al
|
|
|
|
|
xor cx, cx
|
|
|
|
|
@@:
|
|
|
|
|
in al, 64h
|
|
|
|
|
test al, 2
|
|
|
|
|
loopnz @b
|
|
|
|
|
mov al, 0
|
|
|
|
|
out 0x60, al
|
|
|
|
|
xor cx, cx
|
|
|
|
|
@@:
|
|
|
|
|
in al, 64h
|
|
|
|
|
test al, 2
|
|
|
|
|
loopnz @b
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
; get start time
|
|
|
|
|
call gettime
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov dword [start_timer], eax
|
|
|
|
|
mov word [timer_], newtimer
|
|
|
|
|
mov word [timer_+2], cs
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;установить свое прерывание на таймер т.е. код будет перрываться ~18 раз в сек и переходить на обработчик
|
2010-10-01 13:21:55 +04:00
|
|
|
|
cli
|
|
|
|
|
push 0
|
|
|
|
|
pop es
|
|
|
|
|
push dword [es:8*4]
|
|
|
|
|
pop dword [old_timer]
|
|
|
|
|
push dword [timer_]
|
2012-03-08 12:33:38 +04:00
|
|
|
|
pop dword [es:8*4]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
sti
|
|
|
|
|
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;процедура формирования буфера для скролинга секций
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;if DEBUG
|
|
|
|
|
; pusha
|
|
|
|
|
; mov ax,point_default
|
|
|
|
|
; mov ax,cx
|
|
|
|
|
; mov cx,0x0a
|
|
|
|
|
; mov di,show_db1
|
|
|
|
|
; mov dword[ds:di],' '
|
|
|
|
|
; mov word [ds:di+4],' '
|
|
|
|
|
; call decode
|
|
|
|
|
;Show size
|
|
|
|
|
; mov si,show_db1
|
|
|
|
|
; call printplain
|
|
|
|
|
;
|
|
|
|
|
; xor ax,ax
|
|
|
|
|
; int 0x16
|
|
|
|
|
; popa
|
|
|
|
|
;end if
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;;;;;;;;;;;;;размер предыдущей сеции установим =0
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov save_descript_size, 18
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;отобразить black screen
|
2010-10-01 13:21:55 +04:00
|
|
|
|
show_bl_sc ;es=0xb800
|
|
|
|
|
.show_all_scr:
|
|
|
|
|
get_frame_buffer ;es=0x2000
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;отображение секций
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call show_bl_sc_sect ;es=0xb800
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;отобразить активный курсор
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.show_active_cursor:
|
|
|
|
|
show_act_cursor
|
2013-05-28 23:09:31 +04:00
|
|
|
|
show_descript ;макрос по отображению описания секции
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;отобразить Press any key ....
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov eax, dword [old_timer]
|
|
|
|
|
cmp eax, dword [timer_]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .interrupt_16
|
|
|
|
|
|
|
|
|
|
show_timer_message
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov word [start_stack], sp
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.interrupt_16:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
xor ax, ax ;получим информацию о том что нажато
|
2010-10-01 13:21:55 +04:00
|
|
|
|
int 0x16
|
|
|
|
|
;check on change
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ebx, dword [old_timer]
|
|
|
|
|
cmp ebx, dword [timer_]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz @f
|
|
|
|
|
;restore timer interrupt
|
|
|
|
|
cli
|
|
|
|
|
push 0
|
|
|
|
|
pop es
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; mov eax,dword [old_timer] ; восстановим прежднее прерывание
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [es:8*4], ebx
|
|
|
|
|
mov dword [timer_], ebx
|
2010-10-01 13:21:55 +04:00
|
|
|
|
sti
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
push ax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
clear_timer_msg
|
|
|
|
|
pop ax
|
|
|
|
|
@@:
|
|
|
|
|
call clean_active_cursor ;clean old cursor ;es=0xb800
|
|
|
|
|
|
2013-05-28 23:09:31 +04:00
|
|
|
|
cmp ah, 0x48 ;реакция системы на события
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .up
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp ah, 0x50
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .down
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp ah, 0x49
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .pgup
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp ah, 0x51
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .pgdown
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp ah, 0x47
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .home
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp ah, 0x4f
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .end
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, 0xD
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz .show_active_cursor
|
|
|
|
|
|
2013-05-28 23:09:31 +04:00
|
|
|
|
jmp .end_show_all ;парсинг секции которая указана в point_default
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.up:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov si, point_to_point_def ;значение указателя
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add si, 2
|
|
|
|
|
lea ax, point_to_hframe
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp si, ax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
ja @f
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov point_to_point_def, si
|
|
|
|
|
mov ax, [si]
|
|
|
|
|
mov point_default, ax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp .show_active_cursor
|
|
|
|
|
@@:
|
|
|
|
|
call find_before_sect
|
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.down:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov si, point_to_point_def ;значение указателя
|
|
|
|
|
mov ax, point_to_eframe ;указатель на последний элемент
|
2012-03-08 12:33:38 +04:00
|
|
|
|
sub si, 2
|
|
|
|
|
cmp si, ax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jb @f
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov point_to_point_def, si
|
|
|
|
|
mov ax, [si]
|
|
|
|
|
mov point_default, ax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp .show_active_cursor
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
@@:
|
|
|
|
|
call find_next_sect
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
.pgup:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov cx, size_show_section
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
|
|
|
|
push cx
|
|
|
|
|
call find_before_sect
|
|
|
|
|
pop cx
|
|
|
|
|
loop @b
|
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.pgdown:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov cx, size_show_section
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
|
|
|
|
push cx
|
|
|
|
|
call find_next_sect
|
|
|
|
|
pop cx
|
|
|
|
|
loop @b
|
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
.home:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
xor di, di
|
|
|
|
|
call find_next_sect.h
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
.end:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, save_cx
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call find_before_sect.e
|
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; тут мы будем парсить только дефолтную секцию и выполнять ее ничего не предлагая пользователю из диалогов.
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.parse_run_only:
|
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov si, no_show_only_w
|
2010-10-01 13:21:55 +04:00
|
|
|
|
call printplain
|
|
|
|
|
popa
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.end_show_all:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;show black screen SL
|
|
|
|
|
macro show_bl_sc
|
|
|
|
|
{
|
|
|
|
|
;;;;;;;;;;;;;;;
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;очистим экран и выведем меню
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; draw frames
|
2012-03-08 12:33:38 +04:00
|
|
|
|
xor ax, ax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
if DEBUG
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ax, 0x0720
|
2010-10-01 13:21:55 +04:00
|
|
|
|
end if
|
|
|
|
|
push 0xb800
|
|
|
|
|
pop es
|
|
|
|
|
xor di, di
|
|
|
|
|
; draw top
|
|
|
|
|
mov cx, 25 * 80
|
2012-03-08 12:33:38 +04:00
|
|
|
|
rep stosw
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; show 'Secondary Loader v0.xxx'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, 164
|
|
|
|
|
mov si, version
|
|
|
|
|
mov cx, version_end-version
|
|
|
|
|
mov ah, color_sym_yellow
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
loop @b
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; show firm ))
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, (2*160-(2*(soft_mes_end-soft_mes+4))) ;286
|
|
|
|
|
mov ah, color_sym_pink;color_sym_red
|
|
|
|
|
mov al, 'K'
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, ' '
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ah, color_sym_lightgray;color_sym_lightblue;color_sym_pink
|
|
|
|
|
mov si, soft_mes
|
|
|
|
|
mov cx, soft_mes_end- soft_mes
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
loop @b
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; show '__________________________'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, 480
|
|
|
|
|
mov ah, color_sym_yellow
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov al, 0xC4 ; '─'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov cx, 61
|
|
|
|
|
rep stosw
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; show 'Select section'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, 804
|
|
|
|
|
mov si, select_section
|
|
|
|
|
mov cx, select_section_end - select_section
|
|
|
|
|
mov ah, color_sym_lightgray
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
loop @b
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; show 'Section description'
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, 880
|
|
|
|
|
mov si, section_description
|
|
|
|
|
mov cx, section_description_end - section_description
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; mov ah,color_sym_lightgray
|
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
loop @b
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro show_timer_message
|
|
|
|
|
{
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;; show Press any key
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;; show ramk
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
xor ax, ax
|
|
|
|
|
mov di, 3360
|
|
|
|
|
mov cx, 80*4
|
|
|
|
|
rep stosw
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, 3362
|
|
|
|
|
mov ah, color_sym_pink
|
|
|
|
|
mov al, 0xDA
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, 0xc4
|
|
|
|
|
mov cx, 76
|
|
|
|
|
rep stosw
|
|
|
|
|
mov al, 0xBF
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add di, 4
|
|
|
|
|
mov al, 0xb3
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add di, 152
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add di, 4
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add di, 152
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add di, 4
|
|
|
|
|
mov al, 0xc0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, 0xc4
|
|
|
|
|
mov cx, 76
|
|
|
|
|
rep stosw
|
|
|
|
|
mov al, 0xd9
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;ramk is complete show
|
|
|
|
|
;show first message
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov si, start_msg
|
|
|
|
|
mov cx, start_msg_e-start_msg
|
|
|
|
|
mov di, 3526
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
loop @b
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;; show press Enter to....
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add di, 44
|
|
|
|
|
mov si, time_msg
|
|
|
|
|
mov cx, time_msg_e-time_msg
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
loop @b
|
2010-10-01 13:21:55 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
macro get_frame_buffer
|
|
|
|
|
{
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov cx, save_cx ;it's placed size of ini file
|
|
|
|
|
les di, dword [file_data]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov si, di ;point frame
|
|
|
|
|
mov bx, cx
|
|
|
|
|
mov dx, size_show_section
|
2013-05-28 23:09:31 +04:00
|
|
|
|
; mov point_to_hframe,di ; внесем значение, так подстраховка не более
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, byte [es:di]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
push word .first_ret_bl_sc
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, ' '
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .first_bl_sc
|
|
|
|
|
jmp get_firs_sym.not_space
|
|
|
|
|
.first_bl_sc:
|
|
|
|
|
jmp get_firs_sym.first_sp
|
|
|
|
|
|
|
|
|
|
.start_hbl:
|
|
|
|
|
call get_firs_sym ;get first symbol on new line
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test cx, cx
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, '['
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz .start_hbl
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov si, di ;point frame
|
|
|
|
|
mov bx, cx
|
|
|
|
|
mov dx, size_show_section
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp .analisist_al
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.start_bl:
|
|
|
|
|
call get_firs_sym ;get first symbol on new line
|
2013-05-28 23:09:31 +04:00
|
|
|
|
.first_ret_bl_sc: ;первый возврат
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test cx, cx
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before
|
|
|
|
|
.analisist_al:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, '['
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz .start_bl
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;просматриваем ini файл с начала в поисках секции указаной как default
|
|
|
|
|
;поиск фрейма в котором содержиться значение default
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.found_sect_bl:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp di, point_loader
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .start_bl
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp di, point_default
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .save_point_def
|
|
|
|
|
|
|
|
|
|
dec dx
|
|
|
|
|
jnz .start_bl
|
|
|
|
|
|
|
|
|
|
jmp .start_hbl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.save_point_def:
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;итак далее мы должны заполнить frame буфер адресов секций, что бы потом по нему быстро перемещаться не вычисляя снова адреса
|
|
|
|
|
mov di, si ;указатель на начало
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov cx, bx
|
|
|
|
|
lea si, point_to_hframe
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov dx, size_show_section+1 ;т.к. у нас структура содержит размер между первым и вторым указателем, то нам нужно на 1 адрес больше обсчитать секций.
|
|
|
|
|
;переходим на обработку значения указателя
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov al, byte [es:di]
|
2010-10-01 13:21:55 +04:00
|
|
|
|
push word .first_ret_mfb
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, ' '
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .first_bl_mbf
|
|
|
|
|
jmp get_firs_sym.not_space
|
|
|
|
|
.first_bl_mbf:
|
|
|
|
|
jmp get_firs_sym.first_sp
|
|
|
|
|
|
|
|
|
|
.start_mfb:
|
|
|
|
|
call get_firs_sym ;get first symbol on new line
|
2013-05-28 23:09:31 +04:00
|
|
|
|
.first_ret_mfb: ;первый возврат
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jcxz .val_buff_comp ;.end_loader ;found or not found parametrs in section exit in section
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, '['
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz .start_mfb
|
|
|
|
|
|
|
|
|
|
.found_sect_mfb:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp di, point_loader ;if we have section loader
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .start_mfb
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov [si], di
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
sub si, 2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
dec dx
|
|
|
|
|
jnz .start_mfb
|
|
|
|
|
;bufer is full
|
|
|
|
|
jmp @f
|
|
|
|
|
.val_buff_comp:
|
|
|
|
|
push save_cx
|
|
|
|
|
pop word [si]
|
2012-03-08 12:33:38 +04:00
|
|
|
|
sub si, 2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add si, 4
|
|
|
|
|
mov point_to_eframe, si
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro show_act_cursor
|
|
|
|
|
{
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;отображение курсора по умолчанию
|
2012-03-08 12:33:38 +04:00
|
|
|
|
lea si, point_to_hframe
|
|
|
|
|
mov di, 962-160
|
|
|
|
|
mov ax, point_default
|
|
|
|
|
mov cx, size_show_section
|
2010-10-01 13:21:55 +04:00
|
|
|
|
.home_show_cur:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov bx, [si]
|
|
|
|
|
add di, 160
|
|
|
|
|
cmp bx, ax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .show_cursor_activ
|
2012-03-08 12:33:38 +04:00
|
|
|
|
sub si, 2
|
2010-10-01 13:21:55 +04:00
|
|
|
|
loop .home_show_cur
|
|
|
|
|
|
|
|
|
|
.show_cursor_activ:
|
|
|
|
|
; push 0xb800
|
|
|
|
|
; pop es
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov point_to_point_def, si
|
|
|
|
|
mov ax, (color_sym_red*0x100+0x10)
|
2010-10-01 13:21:55 +04:00
|
|
|
|
stosw
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add di, 68
|
2010-10-01 13:21:55 +04:00
|
|
|
|
inc ax
|
|
|
|
|
stosw
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro clear_timer_msg
|
|
|
|
|
{
|
|
|
|
|
push 0xb800
|
|
|
|
|
pop es
|
2012-03-08 12:33:38 +04:00
|
|
|
|
xor ax, ax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
if DEBUG
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ax, 0x0720
|
2010-10-01 13:21:55 +04:00
|
|
|
|
end if
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;; show Press any key
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, 3360
|
|
|
|
|
mov cx, 80*4
|
|
|
|
|
rep stosw
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
;show sect
|
|
|
|
|
push ini_data_
|
|
|
|
|
pop es
|
|
|
|
|
call show_bl_sc_sect ;es=0xb800
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro show_descript
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;Этот макрос показывает краткое описание, если оно есть у секции в пункте
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;Section description
|
|
|
|
|
{
|
|
|
|
|
local .start_p_sh_d
|
|
|
|
|
local .exit
|
|
|
|
|
local .rest_value_loop_sh_d
|
|
|
|
|
local .end_sh_desc_sec
|
|
|
|
|
local .loop_message
|
|
|
|
|
local .show_mess_prev_eq
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, point_default
|
2010-10-01 13:21:55 +04:00
|
|
|
|
push ini_data_
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov si, point_to_point_def
|
2010-10-01 13:21:55 +04:00
|
|
|
|
pop es
|
2012-03-08 12:33:38 +04:00
|
|
|
|
sub si, 2
|
2013-05-28 23:09:31 +04:00
|
|
|
|
mov cx, [si] ;загрузим указатель наследующию секцию
|
|
|
|
|
sub cx, di ;вот теперь имеем истиный размер
|
|
|
|
|
;di - указатель на дефолтную секцию т.е. выбранную cx - размер области. для просмотра
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
|
|
|
|
.start_p_sh_d:
|
|
|
|
|
call get_firs_sym ;get first symbol on new line
|
2012-03-08 12:33:38 +04:00
|
|
|
|
test cx, cx
|
2013-05-28 23:09:31 +04:00
|
|
|
|
jz .exit ;нету? ну ладно - следующее значение тогда )
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, 'd'
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz .start_p_sh_d
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov bx, cx
|
|
|
|
|
mov ax, di
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov si, parse_descript
|
|
|
|
|
mov cx, parse_descript_e - parse_descript
|
|
|
|
|
repe cmpsb
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz .rest_value_loop_sh_d ;is not compare
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
sub bx, parse_descript_e - parse_descript;correct cx
|
|
|
|
|
add bx, cx
|
|
|
|
|
mov cx, bx
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; разбор аля ' = '
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ax, 0x3d20 ;cut al=' ' ah='='
|
|
|
|
|
repe scasb
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jcxz .rest_value_loop_sh_d ;not found param timeout
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp ah, byte [es:di-1] ;find '='
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz .rest_value_loop_sh_d
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
repe scasb ;cut ' '
|
2010-10-01 13:21:55 +04:00
|
|
|
|
inc cx
|
|
|
|
|
dec di
|
2013-05-28 23:09:31 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;di указывает на строчку, которую нам нужно выводить.
|
|
|
|
|
;строчка будет выводиться блоками по 37 символов.
|
|
|
|
|
;настроим куда будем выводить т.е. начало
|
|
|
|
|
;es:di - указывают на строчку из которой мы берем символ, ds:si куда будем выводить
|
2010-10-01 13:21:55 +04:00
|
|
|
|
push di
|
|
|
|
|
pop si
|
|
|
|
|
|
|
|
|
|
push es
|
|
|
|
|
pop ds
|
|
|
|
|
|
|
|
|
|
push 0xb800
|
|
|
|
|
pop es
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, 1040
|
|
|
|
|
mov bx, 18
|
|
|
|
|
mov find_sec_di, di
|
|
|
|
|
mov save_cx_d, bx
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;clean string
|
|
|
|
|
|
|
|
|
|
push di
|
2012-03-08 12:33:38 +04:00
|
|
|
|
xor ax, ax
|
2010-10-01 13:21:55 +04:00
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
@@:
|
|
|
|
|
mov cx, 38
|
2010-10-01 13:21:55 +04:00
|
|
|
|
push di
|
2012-03-08 12:33:38 +04:00
|
|
|
|
rep stosw
|
2010-10-01 13:21:55 +04:00
|
|
|
|
pop di
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp save_descript_size, bx
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz @f
|
|
|
|
|
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add di, 160
|
2010-10-01 13:21:55 +04:00
|
|
|
|
dec bx
|
|
|
|
|
jnz @b
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
@@:
|
|
|
|
|
pop di
|
2010-10-01 13:21:55 +04:00
|
|
|
|
;enter in mess
|
|
|
|
|
.show_mess_prev_eq:
|
|
|
|
|
lodsb
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov ah, color_sym_lettuce;color_sym_turquoise
|
2010-10-01 13:21:55 +04:00
|
|
|
|
; sub di,2
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, '"'
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .loop_message
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, "'"
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz .end_sh_desc_sec
|
|
|
|
|
|
|
|
|
|
.loop_message:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov cx, 38
|
2010-10-01 13:21:55 +04:00
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, '"'
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .end_sh_desc_sec
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp al, "'"
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jz .end_sh_desc_sec
|
|
|
|
|
stosw
|
|
|
|
|
loop @b
|
|
|
|
|
|
2012-03-08 12:33:38 +04:00
|
|
|
|
add find_sec_di, 160
|
|
|
|
|
mov di, find_sec_di
|
2010-10-01 13:21:55 +04:00
|
|
|
|
dec save_cx_d
|
2012-03-08 12:33:38 +04:00
|
|
|
|
cmp save_cx_d, 0
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jnz .loop_message
|
|
|
|
|
|
|
|
|
|
.end_sh_desc_sec:
|
|
|
|
|
push save_cx_d
|
|
|
|
|
pop save_descript_size
|
|
|
|
|
|
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
|
|
|
|
jmp .exit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.rest_value_loop_sh_d:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
mov di, ax
|
|
|
|
|
mov cx, bx
|
2010-10-01 13:21:55 +04:00
|
|
|
|
jmp .start_p_sh_d
|
|
|
|
|
|
|
|
|
|
.exit:
|
2012-03-08 12:33:38 +04:00
|
|
|
|
}
|