Rev 7159 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7159 | Rev 7538 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | ; 0 - not found param |
2 | ; 0 - not found param |
3 | ; 1 - found param |
3 | ; 1 - found param |
4 | ; 2 - error parsing |
4 | ; 2 - error parsing |
Line 5... | Line 5... | ||
5 | 5 | ||
6 | proc getLastParam ;¯®á«¥¤¨© ¯ à ¬¥âà ¯¨è¥â ¢ fInp |
6 | proc getLastParam ;¯®á«¥¤¨© ¯ à ¬¥âà ¯¨è¥â ¢ fInp |
7 | xor al, al ;to end sring |
7 | xor al, al ;to end string |
8 | mov edi, params |
8 | mov edi, params |
9 | mov ecx, 4096 |
9 | mov ecx, 4096 |
10 | repne scasb |
10 | repne scasb |
11 | dec edi |
11 | dec edi |
Line 98... | Line 98... | ||
98 | ret |
98 | ret |
99 | .noparams: |
99 | .noparams: |
100 | xor eax, eax |
100 | xor eax, eax |
101 | endp |
101 | endp |
Line 102... | Line -... | ||
102 | - | ||
- | 102 | ||
103 | 103 | ;§ ¯®«ï¥ pathOut |
|
104 | proc getParam2 |
104 | proc getParamOutPath |
105 | locals |
105 | locals |
106 | retrn rd 0 |
106 | retrn rd 0 |
107 | endl |
107 | endl |
108 | mov [retrn], 0 |
108 | mov [retrn], 0 |
- | 109 | mov ebx, params |
|
109 | mov ebx, params |
110 | |
110 | .find_o: |
111 | .find_o: |
111 | cmp [ebx], word '-o' |
112 | cmp [ebx], word '-o' |
- | 113 | jne .find_o2 |
|
112 | jne .find_o2 |
114 | |
113 | mov edx, ebx |
115 | mov edx, ebx |
- | 116 | lea esi, [ebx+3] |
|
114 | lea esi, [ebx+3] |
117 | |
115 | @@: ;skiping spaces |
118 | @@: ;skiping spaces |
116 | cmp esi, pathOut+1024 |
119 | cmp esi, params+4096 |
117 | jae .errorParsing |
120 | jae .errorParsing |
118 | cmp byte[esi], ' ' |
121 | cmp byte[esi], ' ' |
119 | jne @f |
122 | jne @f |
120 | inc esi |
123 | inc esi |
- | 124 | jmp @b |
|
121 | jmp @b |
125 | @@: |
122 | @@: ;copying ; -o "file" |
126 | ;copying ; -o "file" |
123 | mov ecx, 3 |
127 | mov ecx, 3 |
124 | cmp byte[esi], '"' |
128 | cmp byte[esi], '"' |
125 | jne ._notspace |
129 | jne ._notspace |
126 | inc esi |
130 | inc esi |
Line 130... | Line 134... | ||
130 | @@: lodsb |
134 | @@: lodsb |
131 | cmp al, '"' |
135 | cmp al, '"' |
132 | je .clear |
136 | je .clear |
133 | stosb |
137 | stosb |
134 | inc ecx |
138 | inc ecx |
135 | cmp esi, pathOut+1024 |
139 | cmp esi, params+1024 |
136 | jae errorParsing |
140 | jae errorParsing |
137 | jmp @b |
141 | jmp @b |
Line 138... | Line 142... | ||
138 | 142 | ||
139 | ._notspace: ;copying ; -o file |
143 | ._notspace: ;copying ; -o file |
140 | mov edi, pathOut |
144 | mov edi, pathOut |
141 | @@: lodsb |
145 | @@: lodsb |
142 | stosb |
146 | stosb |
143 | inc ecx |
147 | inc ecx |
144 | cmp al, ' ' |
148 | cmp al, ' ' |
145 | je .clear |
149 | je .clear |
146 | cmp esi, pathOut+1024 |
150 | cmp esi, params+1024 |
147 | jae errorParsing |
151 | jae errorParsing |
Line 148... | Line 152... | ||
148 | jmp @b |
152 | jmp @b |
149 | 153 | ||
Line 157... | Line 161... | ||
157 | loop @b |
161 | loop @b |
158 | jmp @f |
162 | jmp @f |
Line 159... | Line 163... | ||
159 | 163 | ||
160 | .find_o2: |
164 | .find_o2: |
161 | inc ebx |
165 | inc ebx |
162 | cmp ebx, pathOut+1024 |
166 | cmp ebx, params+1024 |
163 | jae @f |
167 | jae @f |
164 | cmp byte[ebx], 0 |
168 | cmp byte[ebx], 0 |
165 | je @f |
169 | je @f |
166 | jmp .find_o |
170 | jmp .find_o |
Line 198... | Line 202... | ||
198 | jne @f |
202 | jne @f |
199 | inc esi |
203 | inc esi |
200 | jmp @b |
204 | jmp @b |
201 | @@: |
205 | @@: |
Line 202... | Line 206... | ||
202 | 206 | ||
203 | ;copying ; -f "file" |
207 | ;variant1: copying ; -f "file" |
204 | mov ecx, 3 |
208 | mov ecx, 3 |
205 | cmp byte[esi], '"' |
209 | cmp byte[esi], '"' |
206 | jne ._notspace |
210 | jne ._notspace |
207 | inc esi |
211 | inc esi |
Line 215... | Line 219... | ||
215 | inc ecx |
219 | inc ecx |
216 | cmp esi, params+4096 |
220 | cmp esi, params+4096 |
217 | jae errorParsing |
221 | jae errorParsing |
218 | jmp @b |
222 | jmp @b |
Line 219... | Line 223... | ||
219 | 223 | ||
220 | ._notspace: ;copying ; -f file |
224 | ._notspace: ;variant2: copying ; -f file |
221 | mov edi, [endPointer] |
225 | mov edi, [endPointer] |
222 | @@: lodsb |
226 | @@: lodsb |
223 | stosb |
227 | stosb |
224 | inc ecx |
228 | inc ecx |