2010-10-01 11:21:55 +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 nickname <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.
|
|
|
|
|
;*****************************************************************************
|
|
|
|
|
|
|
|
|
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [loader]
|
|
|
|
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
|
|
|
|
;es:di - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> '[' <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0<EFBFBD>a
|
|
|
|
|
;cx - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;
|
|
|
|
|
macro use_parse_loader
|
|
|
|
|
{
|
|
|
|
|
.parse_loader:
|
|
|
|
|
;//////////////////
|
|
|
|
|
;/ parse [loader]
|
|
|
|
|
;//////////////////
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov bx, cx ;c<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ax, di
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
; mov word [bp-4],.start ;is alredy set, see up
|
|
|
|
|
mov si, parse_loader
|
|
|
|
|
mov cx, parse_loader_e - parse_loader
|
|
|
|
|
repe cmpsb
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz error.rest_value ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :( <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>.<EFBFBD>. <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>))
|
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> loader, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov point_loader, ax
|
|
|
|
|
sub bx, parse_loader_e - parse_loader;correct cx
|
|
|
|
|
add bx, cx
|
|
|
|
|
mov cx, bx
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov si, lm_l_found
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call printplain
|
|
|
|
|
popa
|
|
|
|
|
end if
|
|
|
|
|
;/////////////////end check [loader]. [loader] is found
|
|
|
|
|
;parsing section [loader]
|
|
|
|
|
;first found end section,let's found '[' -it's start next section
|
|
|
|
|
;in previosly steep bx =cx we are not need save cx, save only di - point
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov dx, di
|
2010-10-01 11:21:55 +02:00
|
|
|
|
@@:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
call get_firs_sym
|
|
|
|
|
jcxz .loader_f_end ;.end_loader ; end <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [loader] <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cmp al, '['
|
|
|
|
|
jnz @b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
.loader_f_end:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
sub bx, cx ;bx = n byte presend in section [loader]
|
|
|
|
|
mov di, dx ;restore di
|
2010-10-01 11:21:55 +02:00
|
|
|
|
;////////////////parse parametrs in section [loader]
|
|
|
|
|
;//timeout=5
|
|
|
|
|
;//default=main
|
2012-03-08 09:33:38 +01:00
|
|
|
|
; mov di,dx ;set pointer on section [loader] i think it's not need
|
|
|
|
|
mov cx, bx ;set counter for parsing section [loader] cx= <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [loader]
|
|
|
|
|
mov ret_on_ch, .get_next_str; return point
|
2010-10-01 11:21:55 +02:00
|
|
|
|
;;;;;;; parse timeout & default
|
|
|
|
|
.get_next_str:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
call get_firs_sym ;get first symbol on new line
|
|
|
|
|
|
|
|
|
|
test cx, cx
|
|
|
|
|
jz .end_loader
|
|
|
|
|
; jcxz .end_loader ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> timeout & default
|
|
|
|
|
cmp al, 't'
|
|
|
|
|
jz .loader_timeout
|
|
|
|
|
cmp al, 'd'
|
|
|
|
|
jnz .get_next_str
|
2010-10-01 11:21:55 +02:00
|
|
|
|
;//////[loader].default
|
|
|
|
|
;input di point to data cx=size [loader]
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov bx, cx
|
|
|
|
|
mov ax, di
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov si, parse_l_default
|
|
|
|
|
mov cx, parse_l_default_e - parse_l_default
|
|
|
|
|
repe cmpsb
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
jnz error.rest_value ;is not compare <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
sub bx, parse_l_default_e - parse_l_default;correct cx
|
|
|
|
|
add bx, cx
|
|
|
|
|
mov cx, bx
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test status_flag, flag_found_default
|
|
|
|
|
jz .correct_is_not_set
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov si, found_equal_default ;<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call printplain
|
|
|
|
|
jmp .get_next_str
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
.correct_is_not_set:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov ax, 0x3d20 ;cut al=' ' ah='='
|
|
|
|
|
repe scasb
|
|
|
|
|
test cx, cx
|
|
|
|
|
jz .end_loader
|
|
|
|
|
|
|
|
|
|
cmp ah, byte [es:di-1] ;find '='
|
|
|
|
|
jnz .get_next_str
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
repe scasb ;cut ' '
|
|
|
|
|
inc cx
|
|
|
|
|
dec di
|
2010-10-01 11:21:55 +02:00
|
|
|
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> es:di <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> loader <EFBFBD>.<EFBFBD>. <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> si <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; cx=bx <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; di=ax <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov bx, cx
|
|
|
|
|
mov dx, di
|
|
|
|
|
|
|
|
|
|
@@:
|
|
|
|
|
mov al, byte [es:di]
|
|
|
|
|
inc di
|
|
|
|
|
dec cx
|
|
|
|
|
test cx, cx
|
|
|
|
|
jz error.error_get_size_d_sect ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cmp al, ' '
|
|
|
|
|
jz @b
|
|
|
|
|
cmp al, 0xd
|
|
|
|
|
jz .found_size_d_sect
|
|
|
|
|
cmp al, 0xa
|
|
|
|
|
jnz @b
|
2010-10-01 11:21:55 +02:00
|
|
|
|
.found_size_d_sect:
|
|
|
|
|
;
|
2012-03-08 09:33:38 +01:00
|
|
|
|
inc cx ;correct cx
|
|
|
|
|
mov ax, bx
|
|
|
|
|
sub bx, cx ; <EFBFBD> bx <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov save_cx_d, bx
|
|
|
|
|
mov di, dx
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov cx, bx ;set size default section
|
2010-10-01 11:21:55 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> =loader
|
|
|
|
|
;save in reg point and <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
;check on loader
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov bx, ax
|
|
|
|
|
mov ax, dx
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov si, parse_loader
|
|
|
|
|
inc si ;set only loader and 6 char in counter
|
|
|
|
|
repe cmpsb
|
2010-10-01 11:21:55 +02:00
|
|
|
|
jnz .check_section ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :( <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> )) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
jmp error.default_eq_loader ;error <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>.<EFBFBD>. <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> [loader]
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
.check_section: ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov cx, bx
|
|
|
|
|
mov di, ax
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
;/////////////////////////////
|
2012-03-08 09:33:38 +01:00
|
|
|
|
; mov ret_on_ch,.start_d ;set return
|
|
|
|
|
mov si, di ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
push di ;save point di
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
push cx ;save cx
|
2010-10-01 11:21:55 +02:00
|
|
|
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> es:di <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ini <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov cx, save_cx ;it's placed size of ini file
|
|
|
|
|
les di, dword [file_data]
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov al, byte [es:di]
|
|
|
|
|
push word .first_ret_d
|
|
|
|
|
cmp al, ' '
|
|
|
|
|
jz .first_sp_1_d
|
|
|
|
|
jmp get_firs_sym.not_space
|
2010-10-01 11:21:55 +02:00
|
|
|
|
.first_sp_1_d:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
jmp get_firs_sym.first_sp
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
.start_d:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
call get_firs_sym ;get first symbol on new line
|
2010-10-01 11:21:55 +02:00
|
|
|
|
.first_ret_d: ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
jcxz .correct_exit ;.end_loader ;found or not found parametrs in section exit in section
|
|
|
|
|
cmp al, '['
|
|
|
|
|
jz .found_sect_d
|
|
|
|
|
jmp .start_d
|
2010-10-01 11:21:55 +02:00
|
|
|
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ini <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> default
|
2012-03-08 09:33:38 +01:00
|
|
|
|
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> timeout, <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<EFBFBD>.<EFBFBD>. <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> =0 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-01 11:21:55 +02:00
|
|
|
|
.found_sect_d:
|
|
|
|
|
|
|
|
|
|
;check on name section
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov bx, cx
|
|
|
|
|
mov ax, di
|
|
|
|
|
push si ;save point
|
|
|
|
|
|
2010-10-01 11:21:55 +02:00
|
|
|
|
; mov si,parse_loader
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov cx, save_cx_d;load size section
|
|
|
|
|
push es
|
|
|
|
|
pop ds
|
|
|
|
|
|
|
|
|
|
inc di
|
|
|
|
|
repe cmpsb
|
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
|
|
|
|
pop si
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
jnz .not_compare_d_s ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :( <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> )) <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
cmp byte[es:di], ']'
|
|
|
|
|
jnz .not_compare_d_s ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :(
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;set flag -we have found default -not enter again in this prosedure
|
2012-03-08 09:33:38 +01:00
|
|
|
|
or status_flag, flag_found_default
|
|
|
|
|
pop cx
|
|
|
|
|
pop di
|
|
|
|
|
mov point_default, ax ;point to [
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov si, lm_lf_default_f
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call printplain
|
|
|
|
|
popa
|
|
|
|
|
end if
|
2012-03-08 09:33:38 +01:00
|
|
|
|
|
|
|
|
|
jmp .get_next_str
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
.not_compare_d_s:
|
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov cx, bx
|
|
|
|
|
mov di, ax
|
|
|
|
|
jmp .start_d
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
.correct_exit:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
pop cx ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
pop di
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov si, lm_lf_default
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call printplain
|
|
|
|
|
popa
|
|
|
|
|
end if
|
2012-03-08 09:33:38 +01:00
|
|
|
|
jmp .get_next_str
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
;//////////[loader].timeout
|
|
|
|
|
.loader_timeout:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov bx, cx
|
|
|
|
|
mov ax, di
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov si, parse_l_timeout
|
|
|
|
|
mov cx, parse_l_timeout_e - parse_l_timeout
|
|
|
|
|
repe cmpsb
|
|
|
|
|
jnz error.rest_value ;is not compare
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
sub bx, parse_l_timeout_e - parse_l_timeout;correct cx
|
|
|
|
|
add bx, cx
|
|
|
|
|
mov cx, bx
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
test status_flag, flag_found_timeout
|
|
|
|
|
jz .correct_is_not_set_t
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov si, found_equal_timeout ;<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call printplain
|
|
|
|
|
jmp .get_next_str
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
.correct_is_not_set_t:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov ax, 0x3d20 ;cut al=' ' ah='='
|
|
|
|
|
repe scasb
|
|
|
|
|
jcxz .timeout_sec_end_d ;not found param timeout
|
|
|
|
|
|
|
|
|
|
cmp ah, byte [es:di-1] ;find '='
|
|
|
|
|
jnz .get_next_str
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
repe scasb ;cut ' '
|
|
|
|
|
inc cx
|
|
|
|
|
dec di
|
2010-10-01 11:21:55 +02:00
|
|
|
|
;get timeout value
|
|
|
|
|
;2 <EFBFBD><EFBFBD><EFBFBD><EFBFBD>a <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>.<EFBFBD>. <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 0 <EFBFBD><EFBFBD> 99 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-03-08 09:33:38 +01:00
|
|
|
|
push cx
|
|
|
|
|
xor bx, bx
|
|
|
|
|
mov cx, 2
|
|
|
|
|
@@:
|
|
|
|
|
mov al, byte [es:di]
|
|
|
|
|
cmp al, '0'
|
|
|
|
|
jb .end_get_val_t
|
|
|
|
|
cmp al, '9'
|
|
|
|
|
ja .end_get_val_t
|
|
|
|
|
imul bx, 10
|
|
|
|
|
xor al, 0x30
|
|
|
|
|
add bl, al
|
2010-10-01 11:21:55 +02:00
|
|
|
|
.end_get_val_t:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
inc di
|
|
|
|
|
loop @b
|
|
|
|
|
mov word [value_timeout], bx
|
|
|
|
|
; pop cx
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov si, lm_lf_timeout
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call printplain
|
|
|
|
|
popa
|
|
|
|
|
end if
|
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
jmp @f
|
2010-10-01 11:21:55 +02:00
|
|
|
|
.timeout_sec_end_d:
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov word [value_timeout], default_timeout_value
|
|
|
|
|
mov si, set_default_timeout_val
|
|
|
|
|
call printplain
|
|
|
|
|
@@:
|
|
|
|
|
pop cx
|
|
|
|
|
jmp .get_next_str
|
2010-10-01 11:21:55 +02:00
|
|
|
|
|
|
|
|
|
;///////here end block loader
|
|
|
|
|
.end_loader:
|
|
|
|
|
if DEBUG
|
|
|
|
|
pusha
|
2012-03-08 09:33:38 +01:00
|
|
|
|
mov si, lm_l_end
|
2010-10-01 11:21:55 +02:00
|
|
|
|
call printplain
|
|
|
|
|
popa
|
|
|
|
|
end if
|
|
|
|
|
|
2012-03-08 09:33:38 +01:00
|
|
|
|
}
|