2011-10-14 23:38:50 +02: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 00:16:00 +02:00
|
|
|
|
;тут распологается модуль с помощью которого будут парситься все остальные секции
|
2011-10-14 23:38:50 +02: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 00:16:00 +02:00
|
|
|
|
;узнаем работу предыдущего шага т.е. чему = timeout, если он 0, то визуальная часть не будет отображена на дисплее с выбором загрузочных секций.
|
|
|
|
|
;иначе мы ее должны отобразить и ждать заявленое время для выбора и конигурирования пукнктов секции от пользователя.
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
2013-05-28 00:16:00 +02:00
|
|
|
|
mov ax, word [value_timeout];идет проверка на наличее значения timeout, для более быстрой работы, этот параметр должен быть уже обработан,т.е. в этом случае при его =0 будет сформирован указатель только на дефолтную секцию, иначе информация будет собрана по всем секциям и составлены указатели в блоке памяти
|
2011-10-14 23:38:50 +02:00
|
|
|
|
; 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
|
|
|
|
|
;
|
|
|
|
|
popa
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
test ax, ax
|
|
|
|
|
jz .parse_run_only
|
|
|
|
|
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;отобразим полный список всех найденых секций.
|
2011-10-14 23:38:50 +02:00
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
|
|
|
|
mov si, show_all_sect
|
|
|
|
|
call printplain
|
|
|
|
|
popa
|
|
|
|
|
end if
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2013-05-28 00:16:00 +02:00
|
|
|
|
mov al, 0xf6 ; Сброс клавиатуры, разрешить сканирование
|
2011-10-14 23:38:50 +02: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
|
|
|
|
|
mov dword [start_timer], eax
|
|
|
|
|
mov word [timer_], newtimer
|
|
|
|
|
mov word [timer_+2], cs
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;установить свое прерывание на таймер т.е. код будет перрываться ~18 раз в сек и переходить на обработчик
|
2011-10-14 23:38:50 +02:00
|
|
|
|
cli
|
|
|
|
|
push 0
|
|
|
|
|
pop es
|
|
|
|
|
push dword [es:8*4]
|
|
|
|
|
pop dword [old_timer]
|
|
|
|
|
push dword [timer_]
|
|
|
|
|
pop dword [es:8*4]
|
|
|
|
|
sti
|
|
|
|
|
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;процедура формирования буфера для скролинга секций
|
2011-10-14 23:38:50 +02: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 00:16:00 +02:00
|
|
|
|
;;;;;;;;;;;;;размер предыдущей сеции установим =0
|
2011-10-14 23:38:50 +02:00
|
|
|
|
mov save_descript_size, 18
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;отобразить black screen
|
2011-10-14 23:38:50 +02:00
|
|
|
|
show_bl_sc ;es=0xb800
|
|
|
|
|
.show_all_scr:
|
|
|
|
|
get_frame_buffer ;es=0x2000
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;отображение секций
|
2011-10-14 23:38:50 +02:00
|
|
|
|
call show_bl_sc_sect ;es=0xb800
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;отобразить активный курсор
|
2011-10-14 23:38:50 +02:00
|
|
|
|
.show_active_cursor:
|
|
|
|
|
show_act_cursor
|
2013-05-28 00:16:00 +02:00
|
|
|
|
show_descript ;макрос по отображению описания секции
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;отобразить Press any key ....
|
2011-10-14 23:38:50 +02:00
|
|
|
|
mov eax, dword [old_timer]
|
|
|
|
|
cmp eax, dword [timer_]
|
|
|
|
|
jz .interrupt_16
|
|
|
|
|
|
|
|
|
|
show_timer_message
|
|
|
|
|
mov word [start_stack], sp
|
|
|
|
|
.interrupt_16:
|
2013-05-28 00:16:00 +02:00
|
|
|
|
xor ax, ax ;получим информацию о том что нажато
|
2011-10-14 23:38:50 +02:00
|
|
|
|
int 0x16
|
|
|
|
|
;check on change
|
|
|
|
|
mov ebx, dword [old_timer]
|
|
|
|
|
cmp ebx, dword [timer_]
|
|
|
|
|
jz @f
|
|
|
|
|
;restore timer interrupt
|
|
|
|
|
cli
|
|
|
|
|
push 0
|
|
|
|
|
pop es
|
2013-05-28 00:16:00 +02:00
|
|
|
|
; mov eax,dword [old_timer] ; восстановим прежднее прерывание
|
2011-10-14 23:38:50 +02:00
|
|
|
|
mov [es:8*4], ebx
|
|
|
|
|
mov dword [timer_], ebx
|
|
|
|
|
sti
|
|
|
|
|
|
|
|
|
|
push ax
|
|
|
|
|
clear_timer_msg
|
|
|
|
|
pop ax
|
|
|
|
|
@@:
|
|
|
|
|
call clean_active_cursor ;clean old cursor ;es=0xb800
|
|
|
|
|
|
2013-05-28 00:16:00 +02:00
|
|
|
|
cmp ah, 0x48 ;реакция системы на события
|
2011-10-14 23:38:50 +02:00
|
|
|
|
jz .up
|
|
|
|
|
cmp ah, 0x50
|
|
|
|
|
jz .down
|
|
|
|
|
cmp ah, 0x49
|
|
|
|
|
jz .pgup
|
|
|
|
|
cmp ah, 0x51
|
|
|
|
|
jz .pgdown
|
|
|
|
|
cmp ah, 0x47
|
|
|
|
|
jz .home
|
|
|
|
|
cmp ah, 0x4f
|
|
|
|
|
jz .end
|
|
|
|
|
|
|
|
|
|
cmp al, 0xD
|
|
|
|
|
jnz .show_active_cursor
|
|
|
|
|
|
2013-05-28 00:16:00 +02:00
|
|
|
|
jmp .end_show_all ;парсинг секции которая указана в point_default
|
2011-10-14 23:38:50 +02:00
|
|
|
|
.up:
|
2013-05-28 00:16:00 +02:00
|
|
|
|
mov si, point_to_point_def ;значение указателя
|
2011-10-14 23:38:50 +02:00
|
|
|
|
add si, 2
|
|
|
|
|
lea ax, point_to_hframe
|
|
|
|
|
|
|
|
|
|
cmp si, ax
|
|
|
|
|
ja @f
|
|
|
|
|
|
|
|
|
|
mov point_to_point_def, si
|
|
|
|
|
mov ax, [si]
|
|
|
|
|
mov point_default, ax
|
|
|
|
|
jmp .show_active_cursor
|
|
|
|
|
@@:
|
|
|
|
|
call find_before_sect
|
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.down:
|
2013-05-28 00:16:00 +02:00
|
|
|
|
mov si, point_to_point_def ;значение указателя
|
|
|
|
|
mov ax, point_to_eframe ;указатель на последний элемент
|
2011-10-14 23:38:50 +02:00
|
|
|
|
sub si, 2
|
|
|
|
|
cmp si, ax
|
|
|
|
|
jb @f
|
|
|
|
|
|
|
|
|
|
mov point_to_point_def, si
|
|
|
|
|
mov ax, [si]
|
|
|
|
|
mov point_default, ax
|
|
|
|
|
jmp .show_active_cursor
|
|
|
|
|
|
|
|
|
|
@@:
|
|
|
|
|
call find_next_sect
|
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
.pgup:
|
|
|
|
|
mov cx, size_show_section
|
|
|
|
|
@@:
|
|
|
|
|
push cx
|
|
|
|
|
call find_before_sect
|
|
|
|
|
pop cx
|
|
|
|
|
loop @b
|
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.pgdown:
|
|
|
|
|
mov cx, size_show_section
|
|
|
|
|
@@:
|
|
|
|
|
push cx
|
|
|
|
|
call find_next_sect
|
|
|
|
|
pop cx
|
|
|
|
|
loop @b
|
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
.home:
|
|
|
|
|
xor di, di
|
|
|
|
|
call find_next_sect.h
|
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
.end:
|
|
|
|
|
mov di, save_cx
|
|
|
|
|
call find_before_sect.e
|
|
|
|
|
jmp .show_all_scr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-05-28 00:16:00 +02:00
|
|
|
|
; тут мы будем парсить только дефолтную секцию и выполнять ее ничего не предлагая пользователю из диалогов.
|
2011-10-14 23:38:50 +02:00
|
|
|
|
.parse_run_only:
|
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
|
|
|
|
mov si, no_show_only_w
|
|
|
|
|
call printplain
|
|
|
|
|
popa
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.end_show_all:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;show black screen SL
|
|
|
|
|
macro show_bl_sc
|
|
|
|
|
{
|
|
|
|
|
;;;;;;;;;;;;;;;
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;очистим экран и выведем меню
|
2011-10-14 23:38:50 +02:00
|
|
|
|
; draw frames
|
|
|
|
|
xor ax, ax
|
|
|
|
|
if DEBUG
|
|
|
|
|
mov ax, 0x0720
|
|
|
|
|
end if
|
|
|
|
|
push 0xb800
|
|
|
|
|
pop es
|
|
|
|
|
xor di, di
|
|
|
|
|
; draw top
|
|
|
|
|
mov cx, 25 * 80
|
|
|
|
|
rep stosw
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; show 'Secondary Loader v0.xxx'
|
|
|
|
|
mov di, 164
|
|
|
|
|
mov si, version
|
|
|
|
|
mov cx, version_end-version
|
|
|
|
|
mov ah, color_sym_yellow
|
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
|
|
|
|
loop @b
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; show firm ))
|
|
|
|
|
mov di, (2*160-(2*(soft_mes_end-soft_mes+4))) ;286
|
|
|
|
|
mov ah, color_sym_pink;color_sym_red
|
|
|
|
|
mov al, 'K'
|
|
|
|
|
stosw
|
|
|
|
|
mov al, ' '
|
|
|
|
|
stosw
|
|
|
|
|
mov ah, color_sym_lightgray;color_sym_lightblue;color_sym_pink
|
|
|
|
|
mov si, soft_mes
|
|
|
|
|
mov cx, soft_mes_end- soft_mes
|
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
|
|
|
|
loop @b
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; show '__________________________'
|
|
|
|
|
mov di, 480
|
|
|
|
|
mov ah, color_sym_yellow
|
2013-05-28 19:12:19 +02:00
|
|
|
|
mov al, 0xC4 ; '─'
|
2011-10-14 23:38:50 +02:00
|
|
|
|
mov cx, 61
|
|
|
|
|
rep stosw
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; show 'Select section'
|
|
|
|
|
mov di, 804
|
|
|
|
|
mov si, select_section
|
|
|
|
|
mov cx, select_section_end - select_section
|
|
|
|
|
mov ah, color_sym_lightgray
|
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
|
|
|
|
loop @b
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;; show 'Section description'
|
|
|
|
|
mov di, 880
|
|
|
|
|
mov si, section_description
|
|
|
|
|
mov cx, section_description_end - section_description
|
|
|
|
|
; mov ah,color_sym_lightgray
|
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
|
|
|
|
loop @b
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro show_timer_message
|
|
|
|
|
{
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;; show Press any key
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;; show ramk
|
|
|
|
|
|
|
|
|
|
xor ax, ax
|
|
|
|
|
mov di, 3360
|
|
|
|
|
mov cx, 80*4
|
|
|
|
|
rep stosw
|
|
|
|
|
|
|
|
|
|
mov di, 3362
|
|
|
|
|
mov ah, color_sym_pink
|
|
|
|
|
mov al, 0xDA
|
|
|
|
|
stosw
|
|
|
|
|
mov al, 0xc4
|
|
|
|
|
mov cx, 76
|
|
|
|
|
rep stosw
|
|
|
|
|
mov al, 0xBF
|
|
|
|
|
stosw
|
|
|
|
|
add di, 4
|
|
|
|
|
mov al, 0xb3
|
|
|
|
|
stosw
|
|
|
|
|
add di, 152
|
|
|
|
|
stosw
|
|
|
|
|
add di, 4
|
|
|
|
|
stosw
|
|
|
|
|
add di, 152
|
|
|
|
|
stosw
|
|
|
|
|
add di, 4
|
|
|
|
|
mov al, 0xc0
|
|
|
|
|
stosw
|
|
|
|
|
mov al, 0xc4
|
|
|
|
|
mov cx, 76
|
|
|
|
|
rep stosw
|
|
|
|
|
mov al, 0xd9
|
|
|
|
|
stosw
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;ramk is complete show
|
|
|
|
|
;show first message
|
|
|
|
|
mov si, start_msg
|
|
|
|
|
mov cx, start_msg_e-start_msg
|
|
|
|
|
mov di, 3526
|
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
|
|
|
|
loop @b
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;; show press Enter to....
|
|
|
|
|
add di, 44
|
|
|
|
|
mov si, time_msg
|
|
|
|
|
mov cx, time_msg_e-time_msg
|
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosw
|
|
|
|
|
loop @b
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
macro get_frame_buffer
|
|
|
|
|
{
|
|
|
|
|
mov cx, save_cx ;it's placed size of ini file
|
|
|
|
|
les di, dword [file_data]
|
|
|
|
|
|
|
|
|
|
mov si, di ;point frame
|
|
|
|
|
mov bx, cx
|
|
|
|
|
mov dx, size_show_section
|
2013-05-28 00:16:00 +02:00
|
|
|
|
; mov point_to_hframe,di ; внесем значение, так подстраховка не более
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
|
|
mov al, byte [es:di]
|
|
|
|
|
push word .first_ret_bl_sc
|
|
|
|
|
cmp al, ' '
|
|
|
|
|
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
|
|
|
|
|
test cx, cx
|
|
|
|
|
jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before
|
|
|
|
|
cmp al, '['
|
|
|
|
|
jnz .start_hbl
|
|
|
|
|
|
|
|
|
|
mov si, di ;point frame
|
|
|
|
|
mov bx, cx
|
|
|
|
|
mov dx, size_show_section
|
|
|
|
|
jmp .analisist_al
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.start_bl:
|
|
|
|
|
call get_firs_sym ;get first symbol on new line
|
2013-05-28 00:16:00 +02:00
|
|
|
|
.first_ret_bl_sc: ;первый возврат
|
2011-10-14 23:38:50 +02:00
|
|
|
|
test cx, cx
|
|
|
|
|
jz error.correct_exit_bl ;critical error not found default point it's not possible because it's param chacking before
|
|
|
|
|
.analisist_al:
|
|
|
|
|
cmp al, '['
|
|
|
|
|
jnz .start_bl
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;просматриваем ini файл с начала в поисках секции указаной как default
|
|
|
|
|
;поиск фрейма в котором содержиться значение default
|
2011-10-14 23:38:50 +02:00
|
|
|
|
.found_sect_bl:
|
|
|
|
|
cmp di, point_loader
|
|
|
|
|
jz .start_bl
|
|
|
|
|
cmp di, point_default
|
|
|
|
|
jz .save_point_def
|
|
|
|
|
|
|
|
|
|
dec dx
|
|
|
|
|
jnz .start_bl
|
|
|
|
|
|
|
|
|
|
jmp .start_hbl
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.save_point_def:
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;итак далее мы должны заполнить frame буфер адресов секций, что бы потом по нему быстро перемещаться не вычисляя снова адреса
|
|
|
|
|
mov di, si ;указатель на начало
|
2011-10-14 23:38:50 +02:00
|
|
|
|
mov cx, bx
|
|
|
|
|
lea si, point_to_hframe
|
2013-05-28 00:16:00 +02:00
|
|
|
|
mov dx, size_show_section+1 ;т.к. у нас структура содержит размер между первым и вторым указателем, то нам нужно на 1 адрес больше обсчитать секций.
|
|
|
|
|
;переходим на обработку значения указателя
|
2011-10-14 23:38:50 +02:00
|
|
|
|
mov al, byte [es:di]
|
|
|
|
|
push word .first_ret_mfb
|
|
|
|
|
cmp al, ' '
|
|
|
|
|
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 00:16:00 +02:00
|
|
|
|
.first_ret_mfb: ;первый возврат
|
2011-10-14 23:38:50 +02:00
|
|
|
|
jcxz .val_buff_comp ;.end_loader ;found or not found parametrs in section exit in section
|
|
|
|
|
cmp al, '['
|
|
|
|
|
jnz .start_mfb
|
|
|
|
|
|
|
|
|
|
.found_sect_mfb:
|
|
|
|
|
cmp di, point_loader ;if we have section loader
|
|
|
|
|
jz .start_mfb
|
|
|
|
|
|
|
|
|
|
mov [si], di
|
|
|
|
|
|
|
|
|
|
sub si, 2
|
|
|
|
|
dec dx
|
|
|
|
|
jnz .start_mfb
|
|
|
|
|
;bufer is full
|
|
|
|
|
jmp @f
|
|
|
|
|
.val_buff_comp:
|
|
|
|
|
push save_cx
|
|
|
|
|
pop word [si]
|
|
|
|
|
sub si, 2
|
|
|
|
|
@@:
|
|
|
|
|
|
|
|
|
|
add si, 4
|
|
|
|
|
mov point_to_eframe, si
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro show_act_cursor
|
|
|
|
|
{
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;отображение курсора по умолчанию
|
2011-10-14 23:38:50 +02:00
|
|
|
|
lea si, point_to_hframe
|
|
|
|
|
mov di, 962-160
|
|
|
|
|
mov ax, point_default
|
|
|
|
|
mov cx, size_show_section
|
|
|
|
|
.home_show_cur:
|
|
|
|
|
mov bx, [si]
|
|
|
|
|
add di, 160
|
|
|
|
|
cmp bx, ax
|
|
|
|
|
jz .show_cursor_activ
|
|
|
|
|
sub si, 2
|
|
|
|
|
loop .home_show_cur
|
|
|
|
|
|
|
|
|
|
.show_cursor_activ:
|
|
|
|
|
; push 0xb800
|
|
|
|
|
; pop es
|
|
|
|
|
mov point_to_point_def, si
|
|
|
|
|
mov ax, (color_sym_red*0x100+0x10)
|
|
|
|
|
stosw
|
|
|
|
|
add di, 68
|
|
|
|
|
inc ax
|
|
|
|
|
stosw
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro clear_timer_msg
|
|
|
|
|
{
|
|
|
|
|
push 0xb800
|
|
|
|
|
pop es
|
|
|
|
|
xor ax, ax
|
|
|
|
|
if DEBUG
|
|
|
|
|
mov ax, 0x0720
|
|
|
|
|
end if
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;; show Press any key
|
|
|
|
|
mov di, 3360
|
|
|
|
|
mov cx, 80*4
|
|
|
|
|
rep stosw
|
|
|
|
|
|
|
|
|
|
;show sect
|
|
|
|
|
push ini_data_
|
|
|
|
|
pop es
|
|
|
|
|
call show_bl_sc_sect ;es=0xb800
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
macro show_descript
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;Этот макрос показывает краткое описание, если оно есть у секции в пункте
|
2011-10-14 23:38:50 +02: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
|
|
|
|
|
mov di, point_default
|
|
|
|
|
push ini_data_
|
|
|
|
|
mov si, point_to_point_def
|
|
|
|
|
pop es
|
|
|
|
|
sub si, 2
|
2013-05-28 00:16:00 +02:00
|
|
|
|
mov cx, [si] ;загрузим указатель наследующию секцию
|
|
|
|
|
sub cx, di ;вот теперь имеем истиный размер
|
|
|
|
|
;di - указатель на дефолтную секцию т.е. выбранную cx - размер области. для просмотра
|
2011-10-14 23:38:50 +02:00
|
|
|
|
|
|
|
|
|
.start_p_sh_d:
|
|
|
|
|
call get_firs_sym ;get first symbol on new line
|
|
|
|
|
test cx, cx
|
2013-05-28 00:16:00 +02:00
|
|
|
|
jz .exit ;нету? ну ладно - следующее значение тогда )
|
2011-10-14 23:38:50 +02:00
|
|
|
|
cmp al, 'd'
|
|
|
|
|
jnz .start_p_sh_d
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
|
|
mov bx, cx
|
|
|
|
|
mov ax, di
|
|
|
|
|
|
|
|
|
|
mov si, parse_descript
|
|
|
|
|
mov cx, parse_descript_e - parse_descript
|
|
|
|
|
repe cmpsb
|
|
|
|
|
jnz .rest_value_loop_sh_d ;is not compare
|
|
|
|
|
|
|
|
|
|
sub bx, parse_descript_e - parse_descript;correct cx
|
|
|
|
|
add bx, cx
|
|
|
|
|
mov cx, bx
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; разбор аля ' = '
|
2011-10-14 23:38:50 +02:00
|
|
|
|
mov ax, 0x3d20 ;cut al=' ' ah='='
|
|
|
|
|
repe scasb
|
|
|
|
|
jcxz .rest_value_loop_sh_d ;not found param timeout
|
|
|
|
|
|
|
|
|
|
cmp ah, byte [es:di-1] ;find '='
|
|
|
|
|
jnz .rest_value_loop_sh_d
|
|
|
|
|
|
|
|
|
|
repe scasb ;cut ' '
|
|
|
|
|
inc cx
|
|
|
|
|
dec di
|
2013-05-28 00:16:00 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;di указывает на строчку, которую нам нужно выводить.
|
|
|
|
|
;строчка будет выводиться блоками по 37 символов.
|
|
|
|
|
;настроим куда будем выводить т.е. начало
|
|
|
|
|
;es:di - указывают на строчку из которой мы берем символ, ds:si куда будем выводить
|
2011-10-14 23:38:50 +02:00
|
|
|
|
push di
|
|
|
|
|
pop si
|
|
|
|
|
|
|
|
|
|
push es
|
|
|
|
|
pop ds
|
|
|
|
|
|
|
|
|
|
push 0xb800
|
|
|
|
|
pop es
|
|
|
|
|
|
|
|
|
|
mov di, 1040
|
|
|
|
|
mov bx, 18
|
|
|
|
|
mov find_sec_di, di
|
|
|
|
|
mov save_cx_d, bx
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;clean string
|
|
|
|
|
|
|
|
|
|
push di
|
|
|
|
|
xor ax, ax
|
|
|
|
|
|
|
|
|
|
@@:
|
|
|
|
|
mov cx, 38
|
|
|
|
|
push di
|
|
|
|
|
rep stosw
|
|
|
|
|
pop di
|
|
|
|
|
|
|
|
|
|
cmp save_descript_size, bx
|
|
|
|
|
jz @f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add di, 160
|
|
|
|
|
dec bx
|
|
|
|
|
jnz @b
|
|
|
|
|
|
|
|
|
|
@@:
|
|
|
|
|
pop di
|
|
|
|
|
;enter in mess
|
|
|
|
|
.show_mess_prev_eq:
|
|
|
|
|
lodsb
|
|
|
|
|
mov ah, color_sym_lettuce;color_sym_turquoise
|
|
|
|
|
; sub di,2
|
|
|
|
|
cmp al, '"'
|
|
|
|
|
jz .loop_message
|
|
|
|
|
cmp al, "'"
|
|
|
|
|
jnz .end_sh_desc_sec
|
|
|
|
|
|
|
|
|
|
.loop_message:
|
|
|
|
|
mov cx, 38
|
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
cmp al, '"'
|
|
|
|
|
jz .end_sh_desc_sec
|
|
|
|
|
cmp al, "'"
|
|
|
|
|
jz .end_sh_desc_sec
|
|
|
|
|
stosw
|
|
|
|
|
loop @b
|
|
|
|
|
|
|
|
|
|
add find_sec_di, 160
|
|
|
|
|
mov di, find_sec_di
|
|
|
|
|
dec save_cx_d
|
|
|
|
|
cmp save_cx_d, 0
|
|
|
|
|
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:
|
|
|
|
|
mov di, ax
|
|
|
|
|
mov cx, bx
|
|
|
|
|
jmp .start_p_sh_d
|
|
|
|
|
|
|
|
|
|
.exit:
|
|
|
|
|
}
|