Subversion Repositories Kolibri OS

Rev

Rev 1151 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1151 Rev 2288
1
; Copyright (c) 2009, 
1
; Copyright (c) 2009, 
2
; All rights reserved.
2
; All rights reserved.
3
;
3
;
4
; Redistribution and use in source and binary forms, with or without
4
; Redistribution and use in source and binary forms, with or without
5
; modification, are permitted provided that the following conditions are met:
5
; modification, are permitted provided that the following conditions are met:
6
;       * Redistributions of source code must retain the above copyright
6
;       * Redistributions of source code must retain the above copyright
7
;       notice, this list of conditions and the following disclaimer.
7
;       notice, this list of conditions and the following disclaimer.
8
;       * Redistributions in binary form must reproduce the above copyright
8
;       * Redistributions in binary form must reproduce the above copyright
9
;       notice, this list of conditions and the following disclaimer in the
9
;       notice, this list of conditions and the following disclaimer in the
10
;       documentation and/or other materials provided with the distribution.
10
;       documentation and/or other materials provided with the distribution.
11
;       * Neither the name of the  nor the
11
;       * Neither the name of the  nor the
12
;       names of its contributors may be used to endorse or promote products
12
;       names of its contributors may be used to endorse or promote products
13
;       derived from this software without specific prior written permission.
13
;       derived from this software without specific prior written permission.
14
;
14
;
15
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname  ''AS IS'' AND ANY
15
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname  ''AS IS'' AND ANY
16
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
; DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
18
; DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
19
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
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
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
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
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.
24
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
;*****************************************************************************
25
;*****************************************************************************
26
 
26
 
27
;áëîê ìàêðîñîâ ïî îáðàáîòêå ñåêöèè [loader]
27
;áëîê ìàêðîñîâ ïî îáðàáîòêå ñåêöèè [loader]
28
;âõîäíûå äàííûå:
28
;âõîäíûå äàííûå:
29
;es:di - óêàçàòåëü íà ñåêöèþ íà÷èíàþùèþñÿ ñ '[' âñòå÷àþùèþñÿ ïîñëå 0õa
29
;es:di - óêàçàòåëü íà ñåêöèþ íà÷èíàþùèþñÿ ñ '[' âñòå÷àþùèþñÿ ïîñëå 0õa
30
;cx - ñ÷åò÷èê êîë-âî áàéò äëÿ ïðîâåðêå â êàäðå
30
;cx - ñ÷åò÷èê êîë-âî áàéò äëÿ ïðîâåðêå â êàäðå
31
;
31
;
32
macro use_parse_loader
32
macro use_parse_loader
33
{
33
{
34
.parse_loader:
34
.parse_loader:
35
;//////////////////
35
;//////////////////
36
;/ parse  [loader]
36
;/ parse  [loader]
37
;//////////////////
37
;//////////////////
38
        mov     bx,cx 	;cîõðàíèì â ðåãèñòðû çíà÷åíèÿ ñ÷åò÷èêà è óêàçàòåëÿ
38
        mov     bx, cx  ;cîõðàíèì â ðåãèñòðû çíà÷åíèÿ ñ÷åò÷èêà è óêàçàòåëÿ
39
        mov     ax,di
39
        mov     ax, di
40
 
40
 
41
;	mov	word [bp-4],.start  ;is alredy set, see up
41
;       mov     word [bp-4],.start  ;is alredy set, see up
42
        mov     si,parse_loader
42
        mov     si, parse_loader
43
        mov     cx,parse_loader_e - parse_loader
43
        mov     cx, parse_loader_e - parse_loader
44
        repe    cmpsb
44
        repe cmpsb
45
        jnz     error.rest_value        ;öåïî÷êà íå ñîâïàëà :( ïåðåéäåì äàëåå  ò.å. áóäåì ñíîâà èñêàòü)) 
45
        jnz     error.rest_value        ;öåïî÷êà íå ñîâïàëà :( ïåðåéäåì äàëåå  ò.å. áóäåì ñíîâà èñêàòü)) 
46
 
46
 
47
	;ñîõðàíèì óêàçàòåëüíà loader, ÷òî áû ïîòîì áîëüøå åãî íå èñêàòü
47
        ;ñîõðàíèì óêàçàòåëüíà loader, ÷òî áû ïîòîì áîëüøå åãî íå èñêàòü
48
	mov	point_loader,ax
48
        mov     point_loader, ax
49
        sub     bx,parse_loader_e - parse_loader ;correct cx
49
        sub     bx, parse_loader_e - parse_loader;correct cx
50
        add     bx,cx
50
        add     bx, cx
51
        mov     cx,bx
51
        mov     cx, bx
52
 
52
 
53
if DEBUG        
53
if DEBUG        
54
        pusha
54
        pusha
55
        mov     si,lm_l_found
55
        mov     si, lm_l_found
56
        call    printplain
56
        call    printplain
57
        popa
57
        popa
58
end if  
58
end if  
59
;/////////////////end check [loader]. [loader] is found
59
;/////////////////end check [loader]. [loader] is found
60
;parsing section [loader]
60
;parsing section [loader]
61
;first found end section,let's found '[' -it's start next section
61
;first found end section,let's found '[' -it's start next section
62
;in previosly steep bx =cx we are not need save cx, save only di - point 
62
;in previosly steep bx =cx we are not need save cx, save only di - point 
63
	mov	dx,di
63
        mov     dx, di
64
@@:
64
@@:
65
        call	get_firs_sym
65
        call    get_firs_sym
66
        jcxz	.loader_f_end ;.end_loader         ; end äàæå åñëè ìû íå íàøëè ñåêöèþ ïðåäïîëîæèì ÷òî ñåêöèÿ [loader] ñòîèò â êîíöå
66
        jcxz    .loader_f_end ;.end_loader         ; end äàæå åñëè ìû íå íàøëè ñåêöèþ ïðåäïîëîæèì ÷òî ñåêöèÿ [loader] ñòîèò â êîíöå
67
	cmp	al,'['
67
        cmp     al, '['
68
	jnz	@b
68
        jnz     @b
69
 
69
 
70
.loader_f_end:
70
.loader_f_end:
71
	sub	bx,cx	;bx = n byte presend in section [loader]
71
        sub     bx, cx  ;bx = n byte presend in section [loader]
72
	mov	di,dx	;restore di 
72
        mov     di, dx  ;restore di 
73
;////////////////parse parametrs in section [loader]
73
;////////////////parse parametrs in section [loader]
74
;//timeout=5
74
;//timeout=5
75
;//default=main
75
;//default=main
76
;        mov	di,dx	;set pointer on section [loader]   i think it's not need
76
;        mov    di,dx   ;set pointer on section [loader]   i think it's not need
77
	mov	cx,bx	;set counter for parsing section [loader] cx= êîë-âó ñèìâîëîâ â ñåêöèè [loader]
77
        mov     cx, bx  ;set counter for parsing section [loader] cx= êîë-âó ñèìâîëîâ â ñåêöèè [loader]
78
	mov	ret_on_ch,.get_next_str	; return point 
78
        mov     ret_on_ch, .get_next_str; return point 
79
;;;;;;; parse timeout & default
79
;;;;;;; parse timeout & default
80
.get_next_str:
80
.get_next_str:
81
	call	get_firs_sym	;get first symbol on new line
81
        call    get_firs_sym    ;get first symbol on new line
82
 
82
 
83
	test	cx,cx
83
        test    cx, cx
84
	jz	.end_loader
84
        jz      .end_loader
85
;        jcxz	.end_loader	;çàâåðøåíèå ïàðñèíãà çíà÷åíèé timeout & default 
85
;        jcxz   .end_loader     ;çàâåðøåíèå ïàðñèíãà çíà÷åíèé timeout & default 
86
        cmp	al,'t'
86
        cmp     al, 't'
87
	jz	.loader_timeout
87
        jz      .loader_timeout
88
	cmp	al,'d'
88
        cmp     al, 'd'
89
	jnz     .get_next_str
89
        jnz     .get_next_str
90
;//////[loader].default 
90
;//////[loader].default 
91
;input di point to data cx=size [loader]
91
;input di point to data cx=size [loader]
92
        mov     bx,cx
92
        mov     bx, cx
93
        mov     ax,di
93
        mov     ax, di
94
 
94
 
95
        mov     si,parse_l_default
95
        mov     si, parse_l_default
96
        mov     cx,parse_l_default_e - parse_l_default
96
        mov     cx, parse_l_default_e - parse_l_default
97
        repe    cmpsb
97
        repe cmpsb
98
 
98
 
99
	jnz	error.rest_value      ;is not compare öåïî÷êà íå ñîâïàëà
99
        jnz     error.rest_value      ;is not compare öåïî÷êà íå ñîâïàëà
100
 
100
 
101
        sub     bx,parse_l_default_e - parse_l_default ;correct cx
101
        sub     bx, parse_l_default_e - parse_l_default;correct cx
102
        add     bx,cx
102
        add     bx, cx
103
        mov     cx,bx
103
        mov     cx, bx
104
 
104
 
105
	test	status_flag,flag_found_default
105
        test    status_flag, flag_found_default
106
	jz	.correct_is_not_set          
106
        jz      .correct_is_not_set
107
 
107
 
108
	mov	si,found_equal_default                          ;ìû íàøëè ÷òî ôëàã óæå óñòàíîâëåí, èíôîðìèðóåì
108
        mov     si, found_equal_default                         ;ìû íàøëè ÷òî ôëàã óæå óñòàíîâëåí, èíôîðìèðóåì
109
	call	printplain
109
        call    printplain
110
	jmp	.get_next_str
110
        jmp     .get_next_str
111
 
111
 
112
.correct_is_not_set:
112
.correct_is_not_set:
113
	mov	ax,0x3d20	   ;cut al=' ' ah='='
113
        mov     ax, 0x3d20         ;cut al=' ' ah='='
114
	repe    scasb 
114
        repe scasb
115
	test	cx,cx
115
        test    cx, cx
116
	jz	.end_loader
116
        jz      .end_loader
117
        
117
        
118
        cmp	ah,byte [es:di-1]    ;find '='
118
        cmp     ah, byte [es:di-1]   ;find '='
119
	jnz	.get_next_str
119
        jnz     .get_next_str
120
	
120
        
121
	repe    scasb              ;cut ' '
121
        repe scasb                 ;cut ' '
122
	inc	cx
122
        inc     cx
123
	dec	di
123
        dec     di
124
;ñåé÷àñ es:di óêàçûâàþò íà íàçâàíèå ñåêöèè, èìÿ ñåêöèè ïî äåôîëòó íå äîëæíî áûòü loader ò.å. èíà÷å âîçìîæíî çàöèêëèâàíèå
124
;ñåé÷àñ es:di óêàçûâàþò íà íàçâàíèå ñåêöèè, èìÿ ñåêöèè ïî äåôîëòó íå äîëæíî áûòü loader ò.å. èíà÷å âîçìîæíî çàöèêëèâàíèå
125
;óñòàíîâèì óêàçàòåëü si íà ýòî çíà÷åíèå è ñíà÷àëà ïðîâåðèì
125
;óñòàíîâèì óêàçàòåëü si íà ýòî çíà÷åíèå è ñíà÷àëà ïðîâåðèì
126
 
126
 
127
;ïîëó÷åíèå äëèííû ñåêöèè
127
;ïîëó÷åíèå äëèííû ñåêöèè
128
; cx=bx ñîäåðæèò äëèííó îñòàòêà ñåêöèè
128
; cx=bx ñîäåðæèò äëèííó îñòàòêà ñåêöèè
129
; di=ax óêàçàòåëü íà òåêóùèþ ñåêöèþ
129
; di=ax óêàçàòåëü íà òåêóùèþ ñåêöèþ
130
        mov     bx,cx
130
        mov     bx, cx
131
        mov     dx,di
131
        mov     dx, di
-
 
132
 
132
 
133
@@:
133
@@:	mov	al,byte [es:di]
134
        mov     al, byte [es:di]
134
	inc	di
135
        inc     di
135
	dec 	cx
136
        dec     cx
136
	test	cx,cx
137
        test    cx, cx
137
	jz	error.error_get_size_d_sect  ;ïåðåõîä íà îáðàáîòêó îøèáêè ïî íàõîæäåíèþ äëèíû äåôîëòíîé ñåêöèè
138
        jz      error.error_get_size_d_sect  ;ïåðåõîä íà îáðàáîòêó îøèáêè ïî íàõîæäåíèþ äëèíû äåôîëòíîé ñåêöèè
138
	cmp	al,' '
139
        cmp     al, ' '
139
	jz      @b
140
        jz      @b
140
	cmp	al,0xd
141
        cmp     al, 0xd
141
	jz	.found_size_d_sect
142
        jz      .found_size_d_sect
142
	cmp	al,0xa
143
        cmp     al, 0xa
143
	jnz	@b
144
        jnz     @b
144
.found_size_d_sect:
145
.found_size_d_sect:
145
;
146
;
146
	inc	cx	;correct cx
147
        inc     cx      ;correct cx
147
	mov	ax,bx
148
        mov     ax, bx
148
	sub	bx,cx	; â bx äëèíà ñåêöèè êîòîðàÿ îïðåäåëåíà ïî äåôîëòó
149
        sub     bx, cx  ; â bx äëèíà ñåêöèè êîòîðàÿ îïðåäåëåíà ïî äåôîëòó
149
	mov	save_cx_d,bx
150
        mov     save_cx_d, bx
150
	mov	di,dx
151
        mov     di, dx
151
 
152
 
152
	mov	cx,bx	;set size default section
153
        mov     cx, bx  ;set size default section
153
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ïðîâåðêà íà =loader
154
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ïðîâåðêà íà =loader
154
;save in reg point and ñ÷åò÷èê
155
;save in reg point and ñ÷åò÷èê
155
;check on loader 
156
;check on loader 
156
        mov     bx,ax
157
        mov     bx, ax
157
        mov     ax,dx
158
        mov     ax, dx
158
 
159
 
159
        mov     si,parse_loader
160
        mov     si, parse_loader
160
	inc	si	;set only loader and 6 char in counter
161
        inc     si      ;set only loader and 6 char in counter
161
        repe    cmpsb
162
        repe cmpsb
162
        jnz     .check_section        ;öåïî÷êà íå ñîâïàëà :( ïåðåéäåì äàëåå )) çíà÷èò íå èñêëþ÷åíèå
163
        jnz     .check_section        ;öåïî÷êà íå ñîâïàëà :( ïåðåéäåì äàëåå )) çíà÷èò íå èñêëþ÷åíèå
163
 
164
 
164
	jmp	error.default_eq_loader    ;error êðèòè÷åñêàÿ îøèáêà ò.å. â äåôîëòå ïðèñóòñòâóåò èìÿ [loader]
165
        jmp     error.default_eq_loader    ;error êðèòè÷åñêàÿ îøèáêà ò.å. â äåôîëòå ïðèñóòñòâóåò èìÿ [loader]
165
 
166
 
166
.check_section:		;ïîèñê ñîîòâåòñòâóþùåé ñåêöèè íàì íóæíî áóäåò óçíàòü àäðåñ ýòîé ñåêöèè
167
.check_section:         ;ïîèñê ñîîòâåòñòâóþùåé ñåêöèè íàì íóæíî áóäåò óçíàòü àäðåñ ýòîé ñåêöèè
167
        mov	cx,bx
168
        mov     cx, bx
168
	mov	di,ax
169
        mov     di, ax
169
 
170
 
170
;/////////////////////////////
171
;/////////////////////////////
171
;	mov	ret_on_ch,.start_d     ;set return 
172
;       mov     ret_on_ch,.start_d     ;set return 
172
	mov	si,di   ;óñòàíîâèì óêàçàòåëü íà íàøó ñåêöèþ, êîòîðàÿ ïî äåôîëòó
173
        mov     si, di  ;óñòàíîâèì óêàçàòåëü íà íàøó ñåêöèþ, êîòîðàÿ ïî äåôîëòó
173
 
174
 
174
	push	di      ;save point di
175
        push    di      ;save point di
175
 
176
 
176
	push 	cx	;save cx
177
        push    cx      ;save cx
177
;óñòàíîâèì óêàçàòåëü es:di íà íà÷àëî ini ôàéëà
178
;óñòàíîâèì óêàçàòåëü es:di íà íà÷àëî ini ôàéëà
178
	mov	cx,save_cx	;it's placed size of ini file
179
        mov     cx, save_cx     ;it's placed size of ini file
179
        les     di,dword [file_data]
180
        les     di, dword [file_data]
180
 
181
 
181
 
182
 
182
	mov	al,byte [es:di]
183
        mov     al, byte [es:di]
183
	push	word .first_ret_d
184
        push    word .first_ret_d
184
	cmp	al,' '
185
        cmp     al, ' '
185
	jz	.first_sp_1_d
186
        jz      .first_sp_1_d
186
	jmp	get_firs_sym.not_space
187
        jmp     get_firs_sym.not_space
187
.first_sp_1_d:
188
.first_sp_1_d:
188
        jmp	get_firs_sym.first_sp
189
        jmp     get_firs_sym.first_sp
189
 
190
 
190
.start_d:
191
.start_d:
191
	call	get_firs_sym	;get first symbol on new line
192
        call    get_firs_sym    ;get first symbol on new line
192
.first_ret_d:                     ;ïåðâûé âîçâðàò
193
.first_ret_d:                     ;ïåðâûé âîçâðàò
193
        jcxz	.correct_exit	;.end_loader     ;found or not found parametrs in section  exit in section
194
        jcxz    .correct_exit   ;.end_loader     ;found or not found parametrs in section  exit in section
194
        cmp	al,'['
195
        cmp     al, '['
195
        jz	.found_sect_d
196
        jz      .found_sect_d
196
	jmp	.start_d
197
        jmp     .start_d
197
;ïðîñìàòðèâàåì ini ôàéë ñ íà÷àëà â ïîèñêàõ ñåêöèè óêàçàíîé êàê default
198
;ïðîñìàòðèâàåì ini ôàéë ñ íà÷àëà â ïîèñêàõ ñåêöèè óêàçàíîé êàê default
198
;èäåò ïðîâåðêà íà íàëè÷åå çíà÷åíèÿ timeout, äëÿ áîëåå áûñòðîé ðàáîòû, ýòîò ïàðàìåòð äîëæåí áûòü óæå îáðàáîòàí,ò.å. â ýòîì ñëó÷àå ïðè åãî =0 áóäåò ñôîðìèðîâàí óêàçàòåëü òîëüêî íà äåôîëòíóþ ñåêöèþ, èíà÷å èíôîðìàöèÿ áóäåò ñîáðàíà ïî âñåì ñåêöèÿì è ñîñòàâëåíû óêàçàòåëè â áëîêå ïàìÿòè	
199
;èäåò ïðîâåðêà íà íàëè÷åå çíà÷åíèÿ timeout, äëÿ áîëåå áûñòðîé ðàáîòû, ýòîò ïàðàìåòð äîëæåí áûòü óæå îáðàáîòàí,ò.å. â ýòîì ñëó÷àå ïðè åãî =0 áóäåò ñôîðìèðîâàí óêàçàòåëü òîëüêî íà äåôîëòíóþ ñåêöèþ, èíà÷å èíôîðìàöèÿ áóäåò ñîáðàíà ïî âñåì ñåêöèÿì è ñîñòàâëåíû óêàçàòåëè â áëîêå ïàìÿòè        
199
.found_sect_d:
200
.found_sect_d:
200
 
201
 
201
;check on name section
202
;check on name section
202
        mov     bx,cx
203
        mov     bx, cx
203
        mov     ax,di
204
        mov     ax, di
204
	push	si	;save point
205
        push    si      ;save point
205
	
206
        
206
;        mov     si,parse_loader
207
;        mov     si,parse_loader
207
        mov     cx,save_cx_d ;load size section
208
        mov     cx, save_cx_d;load size section
208
	push	es
209
        push    es
209
	pop	ds	
210
        pop     ds
210
 
211
 
211
	inc	di
212
        inc     di
212
        repe    cmpsb
213
        repe cmpsb
213
        push	cs
214
        push    cs
214
	pop	ds
215
        pop     ds
215
	pop	si
216
        pop     si
216
 
217
 
217
        jnz     .not_compare_d_s        ;öåïî÷êà íå ñîâïàëà :( ïåðåéäåì äàëåå )) çíà÷èò íå èñêëþ÷åíèå
218
        jnz     .not_compare_d_s        ;öåïî÷êà íå ñîâïàëà :( ïåðåéäåì äàëåå )) çíà÷èò íå èñêëþ÷åíèå
218
	cmp	byte[es:di],']'
219
        cmp     byte[es:di], ']'
219
	jnz	.not_compare_d_s	;íåò â êîíöå íàøåé ñåêöèè çàâåðøàþùåãî ñèìâîëà :(
220
        jnz     .not_compare_d_s        ;íåò â êîíöå íàøåé ñåêöèè çàâåðøàþùåãî ñèìâîëà :(
220
 
221
 
221
 
222
 
222
 
223
 
223
;set flag -we have found default -not enter again in this prosedure
224
;set flag -we have found default -not enter again in this prosedure
224
	or	status_flag,flag_found_default
225
        or      status_flag, flag_found_default
225
	pop	cx
226
        pop     cx
226
	pop	di
227
        pop     di
227
	mov	point_default,ax	;point to [
228
        mov     point_default, ax       ;point to [
228
 
229
 
229
if DEBUG        
230
if DEBUG        
230
        pusha
231
        pusha
231
        mov     si,lm_lf_default_f
232
        mov     si, lm_lf_default_f
232
        call    printplain
233
        call    printplain
233
        popa
234
        popa
234
end if  
235
end if  
235
	
236
        
236
	jmp	.get_next_str
237
        jmp     .get_next_str
237
 
238
 
238
.not_compare_d_s:
239
.not_compare_d_s:
239
 
240
 
240
        mov     cx,bx
241
        mov     cx, bx
241
        mov     di,ax
242
        mov     di, ax
242
	jmp	.start_d	
243
        jmp     .start_d
243
 
244
 
244
.correct_exit:
245
.correct_exit:
245
        pop	cx ;âîññòàíîâèì çíà÷åíèå ñ÷åò÷èêà
246
        pop     cx ;âîññòàíîâèì çíà÷åíèå ñ÷åò÷èêà
246
        pop	di
247
        pop     di
247
 
248
 
248
 
249
 
249
if DEBUG        
250
if DEBUG        
250
        pusha
251
        pusha
251
        mov     si,lm_lf_default
252
        mov     si, lm_lf_default
252
        call    printplain
253
        call    printplain
253
        popa
254
        popa
254
end if  
255
end if  
255
	jmp	.get_next_str
256
        jmp     .get_next_str
256
 
257
 
257
;//////////[loader].timeout
258
;//////////[loader].timeout
258
.loader_timeout:
259
.loader_timeout:
259
        mov     bx,cx
260
        mov     bx, cx
260
        mov     ax,di
261
        mov     ax, di
261
 
262
 
262
        mov     si,parse_l_timeout
263
        mov     si, parse_l_timeout
263
        mov     cx,parse_l_timeout_e - parse_l_timeout
264
        mov     cx, parse_l_timeout_e - parse_l_timeout
264
        repe    cmpsb
265
        repe cmpsb
265
	jnz	error.rest_value	   ;is not compare
266
        jnz     error.rest_value           ;is not compare
266
 
267
 
267
        sub     bx,parse_l_timeout_e - parse_l_timeout ;correct cx
268
        sub     bx, parse_l_timeout_e - parse_l_timeout;correct cx
268
        add     bx,cx
269
        add     bx, cx
269
        mov     cx,bx
270
        mov     cx, bx
270
 
271
 
271
	test	status_flag,flag_found_timeout
272
        test    status_flag, flag_found_timeout
272
	jz	.correct_is_not_set_t          
273
        jz      .correct_is_not_set_t
273
 
274
 
274
	mov	si,found_equal_timeout                          ;ìû íàøëè ÷òî ôëàã óæå óñòàíîâëåí, èíôîðìèðóåì
275
        mov     si, found_equal_timeout                         ;ìû íàøëè ÷òî ôëàã óæå óñòàíîâëåí, èíôîðìèðóåì
275
	call	printplain
276
        call    printplain
276
	jmp	.get_next_str
277
        jmp     .get_next_str
277
 
278
 
278
.correct_is_not_set_t:
279
.correct_is_not_set_t:
279
	mov	ax,0x3d20	   ;cut al=' ' ah='='
280
        mov     ax, 0x3d20         ;cut al=' ' ah='='
280
	repe    scasb 
281
        repe scasb
281
	jcxz	.timeout_sec_end_d          ;not found param timeout
282
        jcxz    .timeout_sec_end_d          ;not found param timeout
282
        
283
        
283
        cmp	ah,byte [es:di-1]    ;find '='
284
        cmp     ah, byte [es:di-1]   ;find '='
284
	jnz	.get_next_str
285
        jnz     .get_next_str
285
	
286
        
286
	repe    scasb              ;cut ' '
287
        repe scasb                 ;cut ' '
287
	inc	cx
288
        inc     cx
288
	dec	di
289
        dec     di
289
;get timeout value
290
;get timeout value
290
;2 çíàêa ìîæåò áûòü îáðàáîòàíî ò.å. çíà÷åíèå îò 0 äî 99 ñåêóíä
291
;2 çíàêa ìîæåò áûòü îáðàáîòàíî ò.å. çíà÷åíèå îò 0 äî 99 ñåêóíä
291
	push	cx
292
        push    cx
292
	xor	bx,bx
293
        xor     bx, bx
293
        mov	cx,2
294
        mov     cx, 2
-
 
295
@@:
294
@@:	mov	al,byte [es:di]
296
        mov     al, byte [es:di]
295
        cmp	al,'0'
297
        cmp     al, '0'
296
	jb	.end_get_val_t
298
        jb      .end_get_val_t
297
	cmp	al,'9'
299
        cmp     al, '9'
298
	ja	.end_get_val_t
300
        ja      .end_get_val_t
299
	imul	bx,10
301
        imul    bx, 10
300
	xor 	al,0x30
302
        xor     al, 0x30
301
        add	bl,al
303
        add     bl, al
302
.end_get_val_t:
304
.end_get_val_t:
303
	inc	di
305
        inc     di
304
        loop	@b
306
        loop    @b
305
	mov	word [value_timeout],bx
307
        mov     word [value_timeout], bx
306
;	pop 	cx
308
;       pop     cx
307
 
309
 
308
if DEBUG        
310
if DEBUG        
309
        pusha
311
        pusha
310
        mov     si,lm_lf_timeout
312
        mov     si, lm_lf_timeout
311
        call    printplain
313
        call    printplain
312
        popa
314
        popa
313
end if  
315
end if  
314
 
316
 
315
	jmp	@f
317
        jmp     @f
316
.timeout_sec_end_d:
318
.timeout_sec_end_d:
317
	mov	word [value_timeout],default_timeout_value
319
        mov     word [value_timeout], default_timeout_value
318
	mov	si,set_default_timeout_val
320
        mov     si, set_default_timeout_val
319
	call	printplain
321
        call    printplain
-
 
322
@@:
320
@@:	pop	cx
323
        pop     cx
321
	jmp	.get_next_str
324
        jmp     .get_next_str
322
 
325
 
323
;///////here end block loader
326
;///////here end block loader
324
.end_loader:
327
.end_loader:
325
if DEBUG        
328
if DEBUG        
326
        pusha
329
        pusha
327
        mov     si,lm_l_end
330
        mov     si, lm_l_end
328
        call    printplain
331
        call    printplain
329
        popa
332
        popa
330
end if  
333
end if  
331
 
334
 
332
}
335
}