Rev 2664 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2664 | Rev 2665 | ||
---|---|---|---|
Line 50... | Line 50... | ||
50 | je calculate_sub |
50 | je calculate_sub |
51 | mov ah,[ebx+12] |
51 | mov ah,[ebx+12] |
52 | or ah,[edi+12] |
52 | or ah,[edi+12] |
53 | jz absolute_values_calculation |
53 | jz absolute_values_calculation |
54 | cmp [error_line],0 |
54 | call recoverable_misuse |
55 | jne absolute_values_calculation |
55 | absolute_values_calculation: |
56 | mov eax,[current_line] |
- | |
57 | mov [error_line],eax |
- | |
58 | mov [error],invalid_use_of_symbol |
- | |
59 | absolute_values_calculation: |
- | |
60 | cmp al,90h |
56 | cmp al,90h |
61 | je calculate_mul |
57 | je calculate_mul |
62 | cmp al,91h |
58 | cmp al,91h |
63 | je calculate_div |
59 | je calculate_div |
64 | or dx,dx |
60 | or dx,dx |
Line 82... | Line 78... | ||
82 | je expression_value_ok |
78 | je expression_value_ok |
83 | xor eax,eax |
79 | xor eax,eax |
84 | mov [edi],eax |
80 | mov [edi],eax |
85 | mov [edi+4],eax |
81 | mov [edi+4],eax |
86 | mov [edi+12],al |
82 | mov [edi+12],eax |
87 | expression_value_ok: |
83 | expression_value_ok: |
88 | ret |
84 | ret |
89 | get_byte_number: |
85 | get_byte_number: |
90 | xor eax,eax |
86 | xor eax,eax |
91 | lods byte [esi] |
87 | lods byte [esi] |
92 | stos dword [edi] |
88 | stos dword [edi] |
93 | xor al,al |
89 | xor al,al |
94 | stos dword [edi] |
90 | stos dword [edi] |
95 | got_number: |
91 | got_number: |
96 | mov word [edi-8+8],0 |
92 | and word [edi-8+8],0 |
97 | mov byte [edi-8+12],0 |
93 | and word [edi-8+12],0 |
98 | mov dword [edi-8+16],0 |
94 | and dword [edi-8+16],0 |
99 | add edi,0Ch |
95 | add edi,0Ch |
100 | jmp calculation_loop |
96 | jmp calculation_loop |
101 | get_word_number: |
97 | get_word_number: |
102 | xor eax,eax |
98 | xor eax,eax |
103 | lods word [esi] |
99 | lods word [esi] |
104 | stos dword [edi] |
100 | stos dword [edi] |
Line 115... | Line 111... | ||
115 | movs dword [edi],[esi] |
111 | movs dword [edi],[esi] |
116 | jmp got_number |
112 | jmp got_number |
117 | get_register: |
113 | get_register: |
118 | mov byte [edi+9],0 |
114 | mov byte [edi+9],0 |
119 | mov byte [edi+12],0 |
115 | and word [edi+12],0 |
120 | lods byte [esi] |
116 | lods byte [esi] |
121 | mov [edi+8],al |
117 | mov [edi+8],al |
122 | mov byte [edi+10],1 |
118 | mov byte [edi+10],1 |
123 | xor eax,eax |
119 | xor eax,eax |
124 | mov [edi+16],eax |
120 | mov [edi+16],eax |
125 | stos dword [edi] |
121 | stos dword [edi] |
Line 128... | Line 124... | ||
128 | jmp calculation_loop |
124 | jmp calculation_loop |
129 | get_label: |
125 | get_label: |
130 | xor eax,eax |
126 | xor eax,eax |
131 | mov [edi+8],eax |
127 | mov [edi+8],eax |
132 | mov [edi+12],al |
128 | mov [edi+12],eax |
133 | mov [edi+20],eax |
129 | mov [edi+20],eax |
134 | lods dword [esi] |
130 | lods dword [esi] |
135 | cmp eax,0Fh |
131 | cmp eax,0Fh |
136 | jb predefined_label |
132 | jb predefined_label |
137 | je reserved_word_used_as_symbol |
133 | je reserved_word_used_as_symbol |
138 | mov ebx,eax |
134 | mov ebx,eax |
139 | mov ax,[current_pass] |
135 | mov ax,[current_pass] |
140 | mov [ebx+18],ax |
136 | mov [ebx+18],ax |
141 | or byte [ebx+8],8 |
137 | mov cl,[ebx+9] |
- | 138 | shr cl,1 |
|
- | 139 | and cl,1 |
|
- | 140 | neg cl |
|
- | 141 | or byte [ebx+8],8 |
|
142 | test byte [ebx+8],1 |
142 | test byte [ebx+8],1 |
143 | jz label_undefined |
143 | jz label_undefined |
144 | cmp ax,[ebx+16] |
144 | cmp ax,[ebx+16] |
145 | je label_defined |
145 | je unadjusted_label |
146 | test byte [ebx+8],4 |
146 | test byte [ebx+8],4 |
147 | jnz label_out_of_scope |
147 | jnz label_out_of_scope |
148 | test byte [ebx+9],1 |
148 | test byte [ebx+9],1 |
149 | jz label_defined |
149 | jz unadjusted_label |
150 | mov eax,[ebx] |
150 | mov eax,[ebx] |
151 | sub eax,dword [adjustment] |
151 | sub eax,dword [adjustment] |
152 | stos dword [edi] |
152 | stos dword [edi] |
153 | mov eax,[ebx+4] |
153 | mov eax,[ebx+4] |
154 | sbb eax,dword [adjustment+4] |
154 | sbb eax,dword [adjustment+4] |
155 | stos dword [edi] |
155 | stos dword [edi] |
156 | mov eax,dword [adjustment] |
156 | sbb cl,[adjustment_sign] |
- | 157 | mov [edi-8+13],cl |
|
- | 158 | mov eax,dword [adjustment] |
|
157 | or eax,dword [adjustment+4] |
159 | or al,[adjustment_sign] |
- | 160 | or eax,dword [adjustment+4] |
|
158 | jz got_label |
161 | jz got_label |
159 | or [next_pass_needed],-1 |
162 | or [next_pass_needed],-1 |
160 | jmp got_label |
163 | jmp got_label |
161 | label_defined: |
164 | unadjusted_label: |
162 | mov eax,[ebx] |
165 | mov eax,[ebx] |
163 | stos dword [edi] |
166 | stos dword [edi] |
164 | mov eax,[ebx+4] |
167 | mov eax,[ebx+4] |
165 | stos dword [edi] |
168 | stos dword [edi] |
166 | got_label: |
169 | mov [edi-8+13],cl |
- | 170 | got_label: |
|
167 | mov al,[ebx+11] |
171 | cmp [symbols_file],0 |
- | 172 | je label_reference_ok |
|
- | 173 | cmp [next_pass_needed],0 |
|
- | 174 | jne label_reference_ok |
|
- | 175 | call store_label_reference |
|
- | 176 | label_reference_ok: |
|
- | 177 | mov al,[ebx+11] |
|
168 | mov [edi-8+12],al |
178 | mov [edi-8+12],al |
169 | mov eax,[ebx+12] |
179 | mov eax,[ebx+12] |
170 | mov [edi-8+8],eax |
180 | mov [edi-8+8],eax |
171 | mov eax,[ebx+20] |
181 | cmp al,ah |
- | 182 | jne labeled_registers_ok |
|
- | 183 | shr eax,16 |
|
- | 184 | add al,ah |
|
- | 185 | jo labeled_registers_ok |
|
- | 186 | xor ah,ah |
|
- | 187 | mov [edi-8+10],ax |
|
- | 188 | mov [edi-8+9],ah |
|
- | 189 | labeled_registers_ok: |
|
- | 190 | mov eax,[ebx+20] |
|
172 | mov [edi-8+16],eax |
191 | mov [edi-8+16],eax |
173 | add edi,0Ch |
192 | add edi,0Ch |
174 | mov al,[ebx+10] |
193 | mov al,[ebx+10] |
175 | or al,al |
194 | or al,al |
176 | jz calculation_loop |
195 | jz calculation_loop |
Line 192... | Line 211... | ||
192 | current_offset_label: |
211 | current_offset_label: |
193 | mov eax,[current_offset] |
212 | mov eax,[current_offset] |
194 | make_current_offset_label: |
213 | make_current_offset_label: |
195 | xor edx,edx |
214 | xor edx,edx |
196 | sub eax,dword [org_origin] |
215 | xor ch,ch |
- | 216 | sub eax,dword [org_origin] |
|
197 | sbb edx,dword [org_origin+4] |
217 | sbb edx,dword [org_origin+4] |
198 | stos dword [edi] |
218 | sbb ch,[org_origin_sign] |
- | 219 | jp current_offset_label_ok |
|
- | 220 | call recoverable_overflow |
|
- | 221 | current_offset_label_ok: |
|
- | 222 | stos dword [edi] |
|
199 | mov eax,edx |
223 | mov eax,edx |
200 | stos dword [edi] |
224 | stos dword [edi] |
201 | mov eax,[org_registers] |
225 | mov eax,[org_registers] |
202 | stos dword [edi] |
226 | stos dword [edi] |
203 | mov al,[labels_type] |
227 | mov cl,[labels_type] |
204 | mov [edi-12+12],al |
228 | mov [edi-12+12],cx |
205 | mov eax,[org_symbol] |
229 | mov eax,[org_symbol] |
206 | mov [edi-12+16],eax |
230 | mov [edi-12+16],eax |
207 | add edi,8 |
231 | add edi,8 |
208 | jmp calculation_loop |
232 | jmp calculation_loop |
209 | org_origin_label: |
233 | org_origin_label: |
210 | mov eax,[org_start] |
234 | mov eax,[org_start] |
Line 237... | Line 261... | ||
237 | mov edx,invalid_value |
261 | mov edx,invalid_value |
238 | jmp error_undefined |
262 | jmp error_undefined |
239 | label_out_of_scope: |
263 | label_out_of_scope: |
240 | mov edx,symbol_out_of_scope |
264 | mov edx,symbol_out_of_scope |
241 | cmp [error_line],0 |
265 | jmp error_undefined |
242 | jne error_undefined |
- | |
243 | mov [error_info],ebx |
- | |
244 | jmp error_undefined |
- | |
245 | label_undefined: |
266 | label_undefined: |
246 | mov edx,undefined_symbol |
267 | mov edx,undefined_symbol |
247 | cmp [error_line],0 |
268 | error_undefined: |
248 | jne error_undefined |
- | |
249 | mov [error_info],ebx |
- | |
250 | error_undefined: |
- | |
251 | cmp [current_pass],1 |
269 | cmp [current_pass],1 |
252 | ja undefined_value |
270 | ja undefined_value |
253 | force_next_pass: |
271 | force_next_pass: |
254 | or [next_pass_needed],-1 |
272 | or [next_pass_needed],-1 |
255 | undefined_value: |
273 | undefined_value: |
256 | mov byte [edi+12],0 |
274 | or [value_undefined],-1 |
257 | or [value_undefined],-1 |
- | |
258 | xor eax,eax |
275 | and word [edi+12],0 |
- | 276 | xor eax,eax |
|
259 | stos dword [edi] |
277 | stos dword [edi] |
260 | stos dword [edi] |
278 | stos dword [edi] |
261 | add edi,0Ch |
279 | add edi,0Ch |
262 | cmp [error_line],0 |
280 | cmp [error_line],0 |
263 | jne calculation_loop |
281 | jne calculation_loop |
264 | mov eax,[current_line] |
282 | mov eax,[current_line] |
265 | mov [error_line],eax |
283 | mov [error_line],eax |
266 | mov [error],edx |
284 | mov [error],edx |
267 | jmp calculation_loop |
285 | mov [error_info],ebx |
- | 286 | jmp calculation_loop |
|
268 | calculate_add: |
287 | calculate_add: |
269 | mov ecx,[ebx+16] |
288 | mov ecx,[ebx+16] |
270 | cmp byte [edi+12],0 |
289 | cmp byte [edi+12],0 |
271 | je add_values |
290 | je add_values |
272 | mov ecx,[edi+16] |
291 | mov ecx,[edi+16] |
273 | cmp byte [ebx+12],0 |
292 | cmp byte [ebx+12],0 |
274 | je add_values |
293 | je add_values |
275 | cmp [error_line],0 |
294 | call recoverable_misuse |
276 | jne add_values |
295 | add_values: |
277 | mov eax,[current_line] |
- | |
278 | mov [error_line],eax |
- | |
279 | mov [error],invalid_use_of_symbol |
- | |
280 | add_values: |
- | |
281 | mov al,[edi+12] |
296 | mov al,[edi+12] |
282 | or [ebx+12],al |
297 | or [ebx+12],al |
283 | mov [ebx+16],ecx |
298 | mov [ebx+16],ecx |
284 | mov eax,[edi] |
299 | mov eax,[edi] |
285 | add [ebx],eax |
300 | add [ebx],eax |
286 | mov eax,[edi+4] |
301 | mov eax,[edi+4] |
287 | adc [ebx+4],eax |
302 | adc [ebx+4],eax |
288 | or dx,dx |
303 | mov al,[edi+13] |
- | 304 | adc [ebx+13],al |
|
- | 305 | jp add_sign_ok |
|
- | 306 | call recoverable_overflow |
|
- | 307 | add_sign_ok: |
|
- | 308 | or dx,dx |
|
289 | jz calculation_loop |
309 | jz calculation_loop |
290 | push esi |
310 | push esi |
291 | mov esi,ebx |
311 | mov esi,ebx |
292 | lea ebx,[edi+10] |
312 | lea ebx,[edi+10] |
293 | mov cl,[edi+8] |
313 | mov cl,[edi+8] |
Line 304... | Line 324... | ||
304 | cmp [esi+8],cl |
324 | cmp [esi+8],cl |
305 | jne add_in_second_slot |
325 | jne add_in_second_slot |
306 | mov al,[ebx] |
326 | mov al,[ebx] |
307 | add [esi+10],al |
327 | add [esi+10],al |
308 | jnz add_register_done |
328 | jo value_out_of_range |
- | 329 | jnz add_register_done |
|
309 | mov byte [esi+8],0 |
330 | mov byte [esi+8],0 |
310 | ret |
331 | ret |
311 | add_in_second_slot: |
332 | add_in_second_slot: |
312 | cmp [esi+9],cl |
333 | cmp [esi+9],cl |
313 | jne create_in_first_slot |
334 | jne create_in_first_slot |
314 | mov al,[ebx] |
335 | mov al,[ebx] |
315 | add [esi+11],al |
336 | add [esi+11],al |
316 | jnz add_register_done |
337 | jo value_out_of_range |
- | 338 | jnz add_register_done |
|
317 | mov byte [esi+9],0 |
339 | mov byte [esi+9],0 |
318 | ret |
340 | ret |
319 | create_in_first_slot: |
341 | create_in_first_slot: |
320 | cmp byte [esi+8],0 |
342 | cmp byte [esi+8],0 |
321 | jne create_in_second_slot |
343 | jne create_in_second_slot |
Line 330... | Line 352... | ||
330 | mov al,[ebx] |
352 | mov al,[ebx] |
331 | mov [esi+11],al |
353 | mov [esi+11],al |
332 | add_register_done: |
354 | add_register_done: |
333 | ret |
355 | ret |
334 | calculate_sub: |
356 | out_of_range: |
- | 357 | jmp calculation_loop |
|
- | 358 | calculate_sub: |
|
335 | xor ah,ah |
359 | xor ah,ah |
336 | mov ah,[ebx+12] |
360 | mov ah,[ebx+12] |
337 | mov al,[edi+12] |
361 | mov al,[edi+12] |
338 | or al,al |
362 | or al,al |
339 | jz sub_values |
363 | jz sub_values |
Line 341... | Line 365... | ||
341 | jne invalid_sub |
365 | jne invalid_sub |
342 | xor ah,ah |
366 | xor ah,ah |
343 | mov ecx,[edi+16] |
367 | mov ecx,[edi+16] |
344 | cmp ecx,[ebx+16] |
368 | cmp ecx,[ebx+16] |
345 | jne invalid_sub |
369 | je sub_values |
- | 370 | invalid_sub: |
|
346 | sub_values: |
371 | call recoverable_misuse |
- | 372 | sub_values: |
|
347 | mov [ebx+12],ah |
373 | mov [ebx+12],ah |
348 | mov eax,[edi] |
374 | mov eax,[edi] |
349 | sub [ebx],eax |
375 | sub [ebx],eax |
350 | mov eax,[edi+4] |
376 | mov eax,[edi+4] |
351 | sbb [ebx+4],eax |
377 | sbb [ebx+4],eax |
352 | or dx,dx |
378 | mov al,[edi+13] |
- | 379 | sbb [ebx+13],al |
|
- | 380 | jp sub_sign_ok |
|
- | 381 | cmp [error_line],0 |
|
- | 382 | jne sub_sign_ok |
|
- | 383 | call recoverable_overflow |
|
- | 384 | sub_sign_ok: |
|
- | 385 | or dx,dx |
|
353 | jz calculation_loop |
386 | jz calculation_loop |
354 | push esi |
387 | push esi |
355 | mov esi,ebx |
388 | mov esi,ebx |
356 | lea ebx,[edi+10] |
389 | lea ebx,[edi+10] |
357 | mov cl,[edi+8] |
390 | mov cl,[edi+8] |
Line 360... | Line 393... | ||
360 | mov cl,[edi+9] |
393 | mov cl,[edi+9] |
361 | call sub_register |
394 | call sub_register |
362 | pop esi |
395 | pop esi |
363 | jmp calculation_loop |
396 | jmp calculation_loop |
364 | invalid_sub: |
397 | sub_register: |
365 | cmp [error_line],0 |
- | |
366 | jne sub_values |
- | |
367 | mov eax,[current_line] |
- | |
368 | mov [error_line],eax |
- | |
369 | mov [error],invalid_use_of_symbol |
- | |
370 | jmp sub_values |
- | |
371 | sub_register: |
- | |
372 | or cl,cl |
398 | or cl,cl |
373 | jz add_register_done |
399 | jz add_register_done |
374 | neg byte [ebx] |
400 | neg byte [ebx] |
375 | jmp add_register_start |
401 | jo value_out_of_range |
- | 402 | jmp add_register_start |
|
376 | calculate_mul: |
403 | calculate_mul: |
377 | or dx,dx |
404 | or dx,dx |
378 | jz mul_start |
405 | jz mul_start |
379 | cmp word [ebx+8],0 |
406 | cmp word [ebx+8],0 |
380 | jne mul_start |
407 | jne mul_start |
381 | mov eax,[ebx] |
408 | xor ecx,ecx |
382 | xchg eax,[edi] |
- | |
383 | mov [ebx],eax |
- | |
384 | mov eax,[ebx+4] |
409 | swap_values: |
385 | xchg eax,[edi+4] |
- | |
386 | mov [ebx+4],eax |
410 | mov eax,[ebx+ecx] |
387 | mov eax,[ebx+8] |
- | |
388 | xchg eax,[edi+8] |
411 | xchg eax,[edi+ecx] |
389 | mov [ebx+8],eax |
412 | mov [ebx+ecx],eax |
390 | mov eax,[ebx+12] |
413 | add ecx,4 |
391 | xchg eax,[edi+12] |
414 | cmp ecx,16 |
392 | mov [ebx+12],eax |
415 | jb swap_values |
393 | mul_start: |
416 | mul_start: |
394 | push esi edx |
417 | push esi edx |
395 | mov esi,ebx |
418 | mov esi,ebx |
396 | xor bl,bl |
419 | xor bl,bl |
397 | bt dword [esi+4],31 |
420 | cmp byte [esi+13],0 |
398 | jnc mul_first_sign_ok |
421 | je mul_first_sign_ok |
399 | not dword [esi] |
422 | mov eax,[esi] |
400 | not dword [esi+4] |
423 | mov edx,[esi+4] |
401 | add dword [esi],1 |
424 | not eax |
- | 425 | not edx |
|
- | 426 | add eax,1 |
|
402 | adc dword [esi+4],0 |
427 | adc edx,0 |
- | 428 | mov [esi],eax |
|
- | 429 | mov [esi+4],edx |
|
403 | not bl |
430 | or eax,edx |
- | 431 | jz mul_overflow |
|
- | 432 | xor bl,-1 |
|
404 | mul_first_sign_ok: |
433 | mul_first_sign_ok: |
405 | bt dword [edi+4],31 |
434 | cmp byte [edi+13],0 |
406 | jnc mul_second_sign_ok |
435 | je mul_second_sign_ok |
407 | not dword [edi] |
436 | mov eax,[edi] |
408 | not dword [edi+4] |
437 | mov edx,[edi+4] |
409 | add dword [edi],1 |
438 | not eax |
- | 439 | not edx |
|
- | 440 | add eax,1 |
|
410 | adc dword [edi+4],0 |
441 | adc edx,0 |
- | 442 | mov [edi],eax |
|
- | 443 | mov [edi+4],edx |
|
411 | not bl |
444 | or eax,edx |
- | 445 | jz mul_overflow |
|
- | 446 | xor bl,-1 |
|
412 | mul_second_sign_ok: |
447 | mul_second_sign_ok: |
413 | cmp dword [esi+4],0 |
448 | cmp dword [esi+4],0 |
414 | jz mul_numbers |
449 | jz mul_numbers |
415 | cmp dword [edi+4],0 |
450 | cmp dword [edi+4],0 |
416 | jnz value_out_of_range |
451 | jz mul_numbers |
- | 452 | jnz mul_overflow |
|
417 | mul_numbers: |
453 | mul_numbers: |
418 | mov eax,[esi+4] |
454 | mov eax,[esi+4] |
419 | mul dword [edi] |
455 | mul dword [edi] |
420 | or edx,edx |
456 | or edx,edx |
421 | jnz value_out_of_range |
457 | jnz mul_overflow |
422 | mov ecx,eax |
458 | mov ecx,eax |
423 | mov eax,[esi] |
459 | mov eax,[esi] |
424 | mul dword [edi+4] |
460 | mul dword [edi+4] |
425 | or edx,edx |
461 | or edx,edx |
426 | jnz value_out_of_range |
462 | jnz mul_overflow |
427 | add ecx,eax |
463 | add ecx,eax |
428 | jc value_out_of_range |
464 | jc mul_overflow |
429 | mov eax,[esi] |
465 | mov eax,[esi] |
430 | mul dword [edi] |
466 | mul dword [edi] |
431 | add edx,ecx |
467 | add edx,ecx |
432 | jc value_out_of_range |
468 | jc mul_overflow |
433 | test edx,1 shl 31 |
469 | mov [esi],eax |
434 | jnz value_out_of_range |
- | |
435 | mov [esi],eax |
- | |
436 | mov [esi+4],edx |
470 | mov [esi+4],edx |
437 | or bl,bl |
471 | or bl,bl |
438 | jz mul_ok |
472 | jz mul_ok |
439 | not dword [esi] |
473 | not eax |
440 | not dword [esi+4] |
474 | not edx |
441 | add dword [esi],1 |
475 | add eax,1 |
442 | adc dword [esi+4],0 |
476 | adc edx,0 |
- | 477 | mov [esi],eax |
|
- | 478 | mov [esi+4],edx |
|
443 | mul_ok: |
479 | or eax,edx |
- | 480 | jnz mul_ok |
|
- | 481 | not bl |
|
- | 482 | mul_ok: |
|
444 | pop edx |
483 | mov [esi+13],bl |
- | 484 | pop edx |
|
445 | or dx,dx |
485 | or dx,dx |
446 | jz mul_calculated |
486 | jz mul_calculated |
447 | cmp word [edi+8],0 |
487 | cmp word [edi+8],0 |
448 | jne invalid_value |
488 | jne invalid_value |
449 | cmp byte [esi+8],0 |
489 | cmp byte [esi+8],0 |
450 | je mul_first_register_ok |
490 | je mul_first_register_ok |
451 | mov al,[edi] |
491 | call get_byte_scale |
452 | cbw |
- | |
453 | cwde |
- | |
454 | cdq |
- | |
455 | cmp edx,[edi+4] |
- | |
456 | jne value_out_of_range |
492 | imul byte [esi+10] |
457 | cmp eax,[edi] |
- | |
458 | jne value_out_of_range |
- | |
459 | imul byte [esi+10] |
- | |
460 | mov dl,ah |
493 | mov dl,ah |
461 | cbw |
494 | cbw |
462 | cmp ah,dl |
495 | cmp ah,dl |
463 | jne value_out_of_range |
496 | jne value_out_of_range |
464 | mov [esi+10],al |
497 | mov [esi+10],al |
Line 467... | Line 500... | ||
467 | mov [esi+8],al |
500 | mov [esi+8],al |
468 | mul_first_register_ok: |
501 | mul_first_register_ok: |
469 | cmp byte [esi+9],0 |
502 | cmp byte [esi+9],0 |
470 | je mul_calculated |
503 | je mul_calculated |
471 | mov al,[edi] |
504 | call get_byte_scale |
472 | cbw |
- | |
473 | cwde |
- | |
474 | cdq |
- | |
475 | cmp edx,[edi+4] |
- | |
476 | jne value_out_of_range |
505 | imul byte [esi+11] |
477 | cmp eax,[edi] |
- | |
478 | jne value_out_of_range |
- | |
479 | imul byte [esi+11] |
- | |
480 | mov dl,ah |
506 | mov dl,ah |
481 | cbw |
507 | cbw |
482 | cmp ah,dl |
508 | cmp ah,dl |
483 | jne value_out_of_range |
509 | jne value_out_of_range |
484 | mov [esi+11],al |
510 | mov [esi+11],al |
Line 487... | Line 513... | ||
487 | mov [esi+9],al |
513 | mov [esi+9],al |
488 | mul_calculated: |
514 | mul_calculated: |
489 | pop esi |
515 | pop esi |
490 | jmp calculation_loop |
516 | jmp calculation_loop |
491 | calculate_div: |
517 | mul_overflow: |
- | 518 | pop edx esi |
|
- | 519 | call recoverable_overflow |
|
- | 520 | jmp calculation_loop |
|
- | 521 | get_byte_scale: |
|
- | 522 | mov al,[edi] |
|
- | 523 | cbw |
|
- | 524 | cwde |
|
- | 525 | cdq |
|
- | 526 | cmp edx,[edi+4] |
|
- | 527 | jne value_out_of_range |
|
- | 528 | cmp eax,[edi] |
|
- | 529 | jne value_out_of_range |
|
- | 530 | ret |
|
- | 531 | calculate_div: |
|
492 | push esi edx |
532 | push esi edx |
493 | mov esi,ebx |
533 | mov esi,ebx |
494 | call div_64 |
534 | call div_64 |
495 | pop edx |
535 | pop edx |
496 | or dx,dx |
536 | or dx,dx |
497 | jz div_calculated |
537 | jz div_calculated |
498 | cmp byte [esi+8],0 |
538 | cmp byte [esi+8],0 |
499 | je div_first_register_ok |
539 | je div_first_register_ok |
500 | mov al,[edi] |
540 | call get_byte_scale |
501 | cbw |
- | |
502 | cwde |
- | |
503 | cdq |
- | |
504 | cmp edx,[edi+4] |
- | |
505 | jne value_out_of_range |
541 | or al,al |
506 | cmp eax,[edi] |
- | |
507 | jne value_out_of_range |
- | |
508 | or al,al |
- | |
509 | jz value_out_of_range |
542 | jz value_out_of_range |
510 | mov al,[esi+10] |
543 | mov al,[esi+10] |
511 | cbw |
544 | cbw |
512 | idiv byte [edi] |
545 | idiv byte [edi] |
513 | or ah,ah |
546 | or ah,ah |
Line 515... | Line 548... | ||
515 | mov [esi+10],al |
548 | mov [esi+10],al |
516 | div_first_register_ok: |
549 | div_first_register_ok: |
517 | cmp byte [esi+9],0 |
550 | cmp byte [esi+9],0 |
518 | je div_calculated |
551 | je div_calculated |
519 | mov al,[edi] |
552 | call get_byte_scale |
520 | cbw |
- | |
521 | cwde |
- | |
522 | cdq |
- | |
523 | cmp edx,[edi+4] |
- | |
524 | jne value_out_of_range |
553 | or al,al |
525 | cmp eax,[edi] |
- | |
526 | jne value_out_of_range |
- | |
527 | or al,al |
- | |
528 | jz value_out_of_range |
554 | jz value_out_of_range |
529 | mov al,[esi+11] |
555 | mov al,[esi+11] |
530 | cbw |
556 | cbw |
531 | idiv byte [edi] |
557 | idiv byte [edi] |
532 | or ah,ah |
558 | or ah,ah |
Line 540... | Line 566... | ||
540 | mov esi,ebx |
566 | mov esi,ebx |
541 | call div_64 |
567 | call div_64 |
542 | mov [esi],eax |
568 | mov [esi],eax |
543 | mov [esi+4],edx |
569 | mov [esi+4],edx |
544 | pop esi |
570 | mov [esi+13],bh |
- | 571 | pop esi |
|
545 | jmp calculation_loop |
572 | jmp calculation_loop |
546 | calculate_and: |
573 | calculate_and: |
547 | mov eax,[edi] |
574 | mov eax,[edi] |
548 | and [ebx],eax |
575 | mov edx,[edi+4] |
- | 576 | mov cl,[edi+13] |
|
- | 577 | and [ebx],eax |
|
549 | mov eax,[edi+4] |
578 | and [ebx+4],edx |
550 | and [ebx+4],eax |
579 | and [ebx+13],cl |
551 | jmp calculation_loop |
580 | jmp calculation_loop |
552 | calculate_or: |
581 | calculate_or: |
553 | mov eax,[edi] |
582 | mov eax,[edi] |
554 | or [ebx],eax |
583 | mov edx,[edi+4] |
- | 584 | mov cl,[edi+13] |
|
- | 585 | or [ebx],eax |
|
555 | mov eax,[edi+4] |
586 | or [ebx+4],edx |
556 | or [ebx+4],eax |
587 | or [ebx+13],cl |
557 | jmp calculation_loop |
588 | jmp calculation_loop |
558 | calculate_xor: |
589 | calculate_xor: |
559 | mov eax,[edi] |
590 | mov eax,[edi] |
560 | xor [ebx],eax |
591 | mov edx,[edi+4] |
561 | mov edx,[edi+4] |
- | |
562 | xor [ebx+4],edx |
592 | mov cl,[edi+13] |
- | 593 | xor [ebx],eax |
|
- | 594 | xor [ebx+4],edx |
|
563 | cmp [value_size],1 |
595 | xor [ebx+13],cl |
564 | je xor_byte |
- | |
565 | cmp [value_size],2 |
- | |
566 | je xor_word |
- | |
567 | cmp [value_size],4 |
- | |
568 | je xor_dword |
- | |
569 | cmp [value_size],6 |
- | |
570 | je xor_pword |
596 | jz calculation_loop |
571 | xor_calculated: |
- | |
572 | jmp calculation_loop |
- | |
573 | prepare_xor_check: |
597 | or cl,cl |
574 | cmp edx,-1 |
- | |
575 | je xor_check_ready |
- | |
576 | xor edx,[ebx+4] |
- | |
577 | xor eax,[ebx] |
- | |
578 | cmp edx,-1 |
598 | jz xor_size_check |
579 | xor_check_ready: |
- | |
580 | ret |
- | |
581 | xor_byte: |
- | |
582 | call prepare_xor_check |
- | |
583 | jne xor_calculated |
- | |
584 | xor edx,[ebx+4] |
- | |
585 | jnz xor_calculated |
- | |
586 | cmp eax,0FFFFFF80h |
599 | xor eax,[ebx] |
587 | jb xor_calculated |
- | |
588 | xor eax,[ebx] |
- | |
589 | cmp eax,0FFh |
600 | xor edx,[ebx+4] |
590 | ja xor_calculated |
- | |
591 | mov [ebx+4],edx |
- | |
592 | and dword [ebx],0FFh |
- | |
593 | jmp xor_calculated |
- | |
594 | xor_word: |
- | |
595 | call prepare_xor_check |
- | |
596 | jne xor_calculated |
- | |
597 | xor edx,[ebx+4] |
- | |
598 | jnz xor_calculated |
601 | xor_size_check: |
599 | cmp eax,0FFFF8000h |
602 | mov cl,[value_size] |
600 | jb xor_calculated |
- | |
601 | xor eax,[ebx] |
603 | cmp cl,1 |
602 | cmp eax,0FFFFh |
- | |
603 | ja xor_calculated |
604 | je xor_byte_result |
604 | mov [ebx+4],edx |
605 | cmp cl,2 |
605 | and dword [ebx],0FFFFh |
- | |
606 | jmp xor_calculated |
- | |
607 | xor_dword: |
606 | je xor_word_result |
608 | call prepare_xor_check |
- | |
609 | jne xor_calculated |
- | |
610 | xor edx,[ebx+4] |
607 | cmp cl,4 |
611 | jnz xor_calculated |
- | |
612 | cmp eax,80000000h |
- | |
613 | jb xor_calculated |
608 | je xor_dword_result |
614 | mov [ebx+4],edx |
609 | cmp cl,6 |
615 | jmp xor_calculated |
- | |
616 | xor_pword: |
610 | je xor_pword_result |
617 | cmp edx,0FFFF8000h |
611 | cmp cl,8 |
618 | jae xor_pword_check |
612 | jne calculation_loop |
619 | xor edx,[ebx+4] |
613 | xor edx,[ebx+4] |
620 | xor eax,[ebx] |
614 | js xor_result_truncated |
- | 615 | jmp calculation_loop |
|
- | 616 | xor_pword_result: |
|
- | 617 | test edx,0FFFF0000h |
|
- | 618 | jnz calculation_loop |
|
- | 619 | cmp word [ebx+6],-1 |
|
- | 620 | jne calculation_loop |
|
- | 621 | xor dx,[ebx+4] |
|
- | 622 | jns calculation_loop |
|
- | 623 | not word [ebx+6] |
|
- | 624 | jmp xor_result_truncated |
|
- | 625 | xor_dword_result: |
|
- | 626 | test edx,edx |
|
- | 627 | jnz calculation_loop |
|
- | 628 | cmp dword [ebx+4],-1 |
|
- | 629 | jne calculation_loop |
|
- | 630 | xor eax,[ebx] |
|
621 | cmp edx,0FFFF8000h |
631 | jns calculation_loop |
- | 632 | not dword [ebx+4] |
|
- | 633 | jmp xor_result_truncated |
|
- | 634 | xor_word_result: |
|
- | 635 | test edx,edx |
|
- | 636 | jnz calculation_loop |
|
- | 637 | test eax,0FFFF0000h |
|
622 | jb xor_calculated |
638 | jnz calculation_loop |
- | 639 | cmp dword [ebx+4],-1 |
|
- | 640 | jne calculation_loop |
|
- | 641 | cmp word [ebx+2],-1 |
|
- | 642 | jne calculation_loop |
|
- | 643 | xor ax,[ebx] |
|
- | 644 | jns calculation_loop |
|
- | 645 | not dword [ebx+4] |
|
- | 646 | not word [ebx+2] |
|
- | 647 | jmp xor_result_truncated |
|
623 | xor_pword_check: |
648 | xor_byte_result: |
624 | xor edx,[ebx+4] |
649 | test edx,edx |
625 | cmp edx,0FFFFh |
650 | jnz calculation_loop |
- | 651 | test eax,0FFFFFF00h |
|
626 | ja xor_calculated |
652 | jnz calculation_loop |
627 | and dword [ebx+4],0FFFFh |
653 | cmp dword [ebx+4],-1 |
628 | jmp xor_calculated |
654 | jne calculation_loop |
- | 655 | cmp word [ebx+2],-1 |
|
- | 656 | jne calculation_loop |
|
- | 657 | cmp byte [ebx+1],-1 |
|
- | 658 | jne calculation_loop |
|
- | 659 | xor al,[ebx] |
|
- | 660 | jns calculation_loop |
|
- | 661 | not dword [ebx+4] |
|
- | 662 | not word [ebx+2] |
|
- | 663 | not byte [ebx+1] |
|
- | 664 | xor_result_truncated: |
|
- | 665 | mov byte [ebx+13],0 |
|
- | 666 | jmp calculation_loop |
|
629 | shr_negative: |
667 | shr_negative: |
630 | not dword [edi] |
668 | mov byte [edi+13],0 |
- | 669 | not dword [edi] |
|
631 | not dword [edi+4] |
670 | not dword [edi+4] |
632 | add dword [edi],1 |
671 | add dword [edi],1 |
633 | adc dword [edi+4],0 |
672 | adc dword [edi+4],0 |
634 | calculate_shl: |
673 | jc shl_over |
- | 674 | calculate_shl: |
|
635 | mov eax,dword [edi+4] |
675 | cmp byte [edi+13],0 |
636 | bt eax,31 |
676 | jne shl_negative |
637 | jc shl_negative |
- | |
638 | or eax,eax |
677 | mov edx,[ebx+4] |
639 | jnz zero_value |
- | |
640 | mov ecx,[edi] |
- | |
641 | cmp ecx,64 |
- | |
642 | jae zero_value |
- | |
643 | mov edx,[ebx+4] |
- | |
644 | mov eax,[ebx] |
678 | mov eax,[ebx] |
645 | cmp ecx,32 |
679 | cmp dword [edi+4],0 |
- | 680 | jne shl_over |
|
- | 681 | movsx ecx,byte [ebx+13] |
|
- | 682 | xchg ecx,[edi] |
|
- | 683 | cmp ecx,64 |
|
- | 684 | je shl_max |
|
- | 685 | ja shl_over |
|
- | 686 | cmp ecx,32 |
|
646 | jae shl_high |
687 | jae shl_high |
647 | shld edx,eax,cl |
688 | shld [edi],edx,cl |
- | 689 | shld edx,eax,cl |
|
648 | shl eax,cl |
690 | shl eax,cl |
649 | mov [ebx],eax |
691 | mov [ebx],eax |
650 | mov [ebx+4],edx |
692 | mov [ebx+4],edx |
651 | jmp calculation_loop |
693 | jmp shl_done |
- | 694 | shl_over: |
|
- | 695 | cmp byte [ebx+13],0 |
|
- | 696 | jne shl_overflow |
|
- | 697 | shl_max: |
|
- | 698 | movsx ecx,byte [ebx+13] |
|
- | 699 | cmp eax,ecx |
|
- | 700 | jne shl_overflow |
|
- | 701 | cmp edx,ecx |
|
- | 702 | jne shl_overflow |
|
- | 703 | xor eax,eax |
|
- | 704 | mov [ebx],eax |
|
- | 705 | mov [ebx+4],eax |
|
- | 706 | jmp calculation_loop |
|
652 | shl_high: |
707 | shl_high: |
653 | sub cl,32 |
708 | sub cl,32 |
654 | shl eax,cl |
709 | shld [edi],edx,cl |
- | 710 | shld edx,eax,cl |
|
- | 711 | shl eax,cl |
|
655 | mov [ebx+4],eax |
712 | mov [ebx+4],eax |
656 | mov dword [ebx],0 |
713 | and dword [ebx],0 |
657 | jmp calculation_loop |
714 | cmp edx,[edi] |
- | 715 | jne shl_overflow |
|
- | 716 | shl_done: |
|
- | 717 | movsx eax,byte [ebx+13] |
|
- | 718 | cmp eax,[edi] |
|
- | 719 | je calculation_loop |
|
- | 720 | shl_overflow: |
|
- | 721 | call recoverable_overflow |
|
- | 722 | jmp calculation_loop |
|
658 | shl_negative: |
723 | shl_negative: |
659 | not dword [edi] |
724 | mov byte [edi+13],0 |
- | 725 | not dword [edi] |
|
660 | not dword [edi+4] |
726 | not dword [edi+4] |
661 | add dword [edi],1 |
727 | add dword [edi],1 |
662 | adc dword [edi+4],0 |
728 | adc dword [edi+4],0 |
663 | calculate_shr: |
729 | jnc calculate_shr |
- | 730 | dec dword [edi+4] |
|
- | 731 | calculate_shr: |
|
664 | mov eax,dword [edi+4] |
732 | cmp byte [edi+13],0 |
- | 733 | jne shr_negative |
|
- | 734 | cmp byte [ebx+13],0 |
|
- | 735 | je do_shr |
|
- | 736 | mov al,[value_size] |
|
665 | bt eax,31 |
737 | cmp al,1 |
666 | jc shr_negative |
738 | je shr_negative_byte |
667 | or eax,eax |
739 | cmp al,2 |
668 | jnz zero_value |
740 | je shr_negative_word |
669 | mov ecx,[edi] |
741 | cmp al,4 |
670 | cmp ecx,64 |
742 | je shr_negative_dword |
- | 743 | cmp al,6 |
|
671 | jae zero_value |
744 | je shr_negative_pword |
- | 745 | cmp al,8 |
|
- | 746 | jne do_shr |
|
672 | mov edx,[ebx+4] |
747 | shr_negative_qword: |
- | 748 | test byte [ebx+7],80h |
|
- | 749 | jz do_shr |
|
- | 750 | shr_truncated: |
|
- | 751 | mov byte [ebx+13],0 |
|
- | 752 | do_shr: |
|
- | 753 | mov edx,[ebx+4] |
|
673 | mov eax,[ebx] |
754 | mov eax,[ebx] |
674 | cmp ecx,32 |
755 | cmp dword [edi+4],0 |
- | 756 | jne shr_over |
|
- | 757 | mov ecx,[edi] |
|
- | 758 | cmp ecx,64 |
|
- | 759 | jae shr_over |
|
- | 760 | push esi |
|
- | 761 | movsx esi,byte [ebx+13] |
|
- | 762 | cmp ecx,32 |
|
675 | jae shr_high |
763 | jae shr_high |
676 | cmp [value_size],1 |
764 | shrd eax,edx,cl |
677 | je shr_byte |
- | |
678 | cmp [value_size],2 |
- | |
679 | je shr_word |
- | |
680 | cmp [value_size],4 |
- | |
681 | je shr_dword |
- | |
682 | cmp [value_size],6 |
- | |
683 | je shr_pword |
- | |
684 | shr_regular: |
- | |
685 | shrd eax,edx,cl |
- | |
686 | shr edx,cl |
765 | shrd edx,esi,cl |
687 | mov [ebx],eax |
766 | mov [ebx],eax |
688 | mov [ebx+4],edx |
767 | mov [ebx+4],edx |
689 | jmp calculation_loop |
768 | pop esi |
- | 769 | jmp calculation_loop |
|
690 | shr_byte: |
770 | shr_high: |
691 | cmp edx,-1 |
- | |
692 | jne shr_regular |
- | |
693 | cmp eax,0FFFFFF80h |
- | |
694 | jb shr_regular |
- | |
695 | and eax,0FFh |
- | |
696 | xor edx,edx |
- | |
697 | jmp shr_regular |
- | |
698 | shr_word: |
- | |
699 | cmp edx,-1 |
- | |
700 | jne shr_regular |
- | |
701 | cmp eax,0FFFF8000h |
- | |
702 | jb shr_regular |
- | |
703 | and eax,0FFFFh |
- | |
704 | xor edx,edx |
- | |
705 | jmp shr_regular |
- | |
706 | shr_dword: |
- | |
707 | cmp edx,-1 |
- | |
708 | jne shr_regular |
- | |
709 | cmp eax,80000000h |
- | |
710 | jb shr_regular |
- | |
711 | xor edx,edx |
- | |
712 | jmp shr_regular |
- | |
713 | shr_pword: |
- | |
714 | cmp edx,0FFFF8000h |
- | |
715 | jb shr_regular |
- | |
716 | and edx,0FFFFh |
- | |
717 | jmp shr_regular |
- | |
718 | shr_high: |
- | |
719 | sub cl,32 |
771 | sub cl,32 |
720 | cmp [value_size],1 |
772 | shrd edx,esi,cl |
721 | je shr_byte_32plus |
- | |
722 | cmp [value_size],2 |
- | |
723 | je shr_word_32plus |
- | |
724 | cmp [value_size],4 |
- | |
725 | je shr_dword_32plus |
- | |
726 | cmp [value_size],6 |
- | |
727 | je shr_pword_32plus |
- | |
728 | shr_32plus: |
- | |
729 | shr edx,cl |
- | |
730 | mov [ebx],edx |
773 | mov [ebx],edx |
731 | mov dword [ebx+4],0 |
774 | mov [ebx+4],esi |
732 | jmp calculation_loop |
775 | pop esi |
733 | shr_byte_32plus: |
- | |
734 | cmp edx,-1 |
- | |
735 | jne shr_32plus |
- | |
736 | cmp eax,-80h |
- | |
737 | jb shr_32plus |
- | |
738 | jmp zero_value |
- | |
739 | shr_word_32plus: |
- | |
740 | cmp edx,-1 |
- | |
741 | jne shr_32plus |
776 | jmp calculation_loop |
742 | cmp eax,-8000h |
- | |
743 | jb shr_32plus |
- | |
744 | jmp zero_value |
- | |
745 | shr_dword_32plus: |
- | |
746 | cmp edx,-1 |
- | |
747 | jne shr_32plus |
- | |
748 | cmp eax,-80000000h |
- | |
749 | jb shr_32plus |
- | |
750 | jmp zero_value |
- | |
751 | shr_pword_32plus: |
- | |
752 | cmp edx,-8000h |
- | |
753 | jb shr_32plus |
- | |
754 | and edx,0FFFFh |
- | |
755 | jmp shr_32plus |
- | |
756 | zero_value: |
- | |
757 | mov dword [ebx],0 |
- | |
758 | mov dword [ebx+4],0 |
- | |
759 | jmp calculation_loop |
- | |
760 | calculate_not: |
777 | shr_over: |
- | 778 | movsx eax,byte [ebx+13] |
|
- | 779 | mov dword [ebx],eax |
|
- | 780 | mov dword [ebx+4],eax |
|
- | 781 | jmp calculation_loop |
|
- | 782 | shr_negative_byte: |
|
- | 783 | cmp dword [ebx+4],-1 |
|
- | 784 | jne do_shr |
|
- | 785 | cmp word [ebx+2],-1 |
|
- | 786 | jne do_shr |
|
- | 787 | cmp byte [ebx+1],-1 |
|
- | 788 | jne do_shr |
|
- | 789 | test byte [ebx],80h |
|
- | 790 | jz do_shr |
|
- | 791 | not dword [ebx+4] |
|
- | 792 | not word [ebx+2] |
|
- | 793 | not byte [ebx+1] |
|
- | 794 | jmp shr_truncated |
|
- | 795 | shr_negative_word: |
|
- | 796 | cmp dword [ebx+4],-1 |
|
- | 797 | jne do_shr |
|
- | 798 | cmp word [ebx+2],-1 |
|
- | 799 | jne do_shr |
|
- | 800 | test byte [ebx+1],80h |
|
- | 801 | jz do_shr |
|
- | 802 | not dword [ebx+4] |
|
- | 803 | not word [ebx+2] |
|
- | 804 | jmp shr_truncated |
|
- | 805 | shr_negative_dword: |
|
- | 806 | cmp dword [ebx+4],-1 |
|
- | 807 | jne do_shr |
|
- | 808 | test byte [ebx+3],80h |
|
- | 809 | jz do_shr |
|
- | 810 | not dword [ebx+4] |
|
- | 811 | jmp shr_truncated |
|
- | 812 | shr_negative_pword: |
|
- | 813 | cmp word [ebx+6],-1 |
|
- | 814 | jne do_shr |
|
- | 815 | test byte [ebx+5],80h |
|
- | 816 | jz do_shr |
|
- | 817 | not word [ebx+6] |
|
- | 818 | jmp shr_truncated |
|
- | 819 | calculate_not: |
|
761 | cmp word [edi+8],0 |
820 | cmp word [edi+8],0 |
762 | jne invalid_expression |
821 | jne invalid_expression |
763 | cmp byte [edi+12],0 |
822 | cmp byte [edi+12],0 |
764 | je not_ok |
823 | je not_ok |
765 | cmp [error_line],0 |
824 | call recoverable_misuse |
766 | jne not_ok |
825 | not_ok: |
767 | mov eax,[current_line] |
- | |
768 | mov [error_line],eax |
- | |
769 | mov [error],invalid_use_of_symbol |
- | |
770 | not_ok: |
- | |
771 | cmp [value_size],1 |
826 | mov al,[value_size] |
772 | je not_byte |
827 | cmp al,1 |
- | 828 | je not_byte |
|
773 | cmp [value_size],2 |
829 | cmp al,2 |
774 | je not_word |
830 | je not_word |
775 | cmp [value_size],4 |
831 | cmp al,4 |
776 | je not_dword |
832 | je not_dword |
777 | cmp [value_size],6 |
833 | cmp al,6 |
778 | je not_pword |
834 | je not_pword |
779 | not_qword: |
835 | cmp al,8 |
- | 836 | je not_qword |
|
- | 837 | not dword [edi] |
|
- | 838 | not dword [edi+4] |
|
- | 839 | not byte [edi+13] |
|
- | 840 | add edi,14h |
|
- | 841 | jmp calculation_loop |
|
- | 842 | not_qword: |
|
780 | not dword [edi] |
843 | not dword [edi] |
781 | not dword [edi+4] |
844 | not dword [edi+4] |
782 | add edi,14h |
845 | finish_not: |
- | 846 | mov byte [edi+13],0 |
|
- | 847 | add edi,14h |
|
783 | jmp calculation_loop |
848 | jmp calculation_loop |
784 | not_byte: |
849 | not_byte: |
785 | cmp dword [edi+4],0 |
850 | cmp dword [edi+4],0 |
786 | jne not_qword |
851 | jne not_qword |
787 | cmp word [edi+2],0 |
852 | cmp word [edi+2],0 |
788 | jne not_qword |
853 | jne not_qword |
789 | cmp byte [edi+1],0 |
854 | cmp byte [edi+1],0 |
790 | jne not_qword |
855 | jne not_qword |
791 | not byte [edi] |
856 | not byte [edi] |
792 | add edi,14h |
857 | jmp finish_not |
793 | jmp calculation_loop |
- | |
794 | not_word: |
858 | not_word: |
795 | cmp dword [edi+4],0 |
859 | cmp dword [edi+4],0 |
796 | jne not_qword |
860 | jne not_qword |
797 | cmp word [edi+2],0 |
861 | cmp word [edi+2],0 |
798 | jne not_qword |
862 | jne not_qword |
799 | not word [edi] |
863 | not word [edi] |
800 | add edi,14h |
864 | jmp finish_not |
801 | jmp calculation_loop |
- | |
802 | not_dword: |
865 | not_dword: |
803 | cmp dword [edi+4],0 |
866 | cmp dword [edi+4],0 |
804 | jne not_qword |
867 | jne not_qword |
805 | not dword [edi] |
868 | not dword [edi] |
806 | add edi,14h |
869 | jmp finish_not |
807 | jmp calculation_loop |
- | |
808 | not_pword: |
870 | not_pword: |
809 | cmp word [edi+6],0 |
871 | cmp word [edi+6],0 |
810 | jne not_qword |
872 | jne not_qword |
811 | not dword [edi] |
873 | not word [edi+4] |
812 | not word [edi+4] |
- | |
813 | add edi,14h |
874 | not dword [edi] |
814 | jmp calculation_loop |
875 | jmp finish_not |
815 | calculate_neg: |
876 | calculate_neg: |
816 | cmp word [edi+8],0 |
877 | cmp word [edi+8],0 |
817 | jne invalid_expression |
878 | jne invalid_expression |
818 | cmp byte [edi+12],0 |
879 | cmp byte [edi+12],0 |
819 | je neg_ok |
880 | je neg_ok |
820 | cmp [error_line],0 |
881 | call recoverable_misuse |
821 | jne neg_ok |
882 | neg_ok: |
822 | mov eax,[current_line] |
- | |
823 | mov [error_line],eax |
- | |
824 | mov [error],invalid_use_of_symbol |
- | |
825 | neg_ok: |
- | |
826 | mov eax,[edi] |
883 | xor eax,eax |
827 | mov edx,[edi+4] |
884 | xor edx,edx |
828 | mov dword [edi],0 |
885 | xor cl,cl |
- | 886 | xchg eax,[edi] |
|
829 | mov dword [edi+4],0 |
887 | xchg edx,[edi+4] |
830 | sub [edi],eax |
888 | xchg cl,[edi+13] |
- | 889 | sub [edi],eax |
|
831 | sbb [edi+4],edx |
890 | sbb [edi+4],edx |
832 | add edi,14h |
891 | sbb [edi+13],cl |
- | 892 | jp neg_sign_ok |
|
- | 893 | call recoverable_overflow |
|
- | 894 | neg_sign_ok: |
|
- | 895 | add edi,14h |
|
833 | jmp calculation_loop |
896 | jmp calculation_loop |
834 | calculate_rva: |
897 | calculate_rva: |
835 | cmp word [edi+8],0 |
898 | cmp word [edi+8],0 |
836 | jne invalid_expression |
899 | jne invalid_expression |
837 | cmp [output_format],5 |
900 | mov al,[output_format] |
838 | je calculate_gotoff |
901 | cmp al,5 |
- | 902 | je calculate_gotoff |
|
839 | cmp [output_format],4 |
903 | cmp al,4 |
840 | je calculate_coff_rva |
904 | je calculate_coff_rva |
841 | cmp [output_format],3 |
905 | cmp al,3 |
842 | jne invalid_expression |
906 | jne invalid_expression |
843 | test [format_flags],8 |
907 | test [format_flags],8 |
844 | jnz pe64_rva |
908 | jnz pe64_rva |
845 | mov al,2 |
909 | mov al,2 |
846 | bt [resolver_flags],0 |
910 | bt [resolver_flags],0 |
847 | jc rva_type_ok |
911 | jc rva_type_ok |
848 | xor al,al |
912 | xor al,al |
849 | rva_type_ok: |
913 | rva_type_ok: |
850 | cmp byte [edi+12],al |
914 | cmp byte [edi+12],al |
851 | je rva_ok |
915 | je rva_ok |
852 | cmp [error_line],0 |
916 | call recoverable_misuse |
853 | jne rva_ok |
917 | rva_ok: |
854 | mov eax,[current_line] |
- | |
855 | mov [error_line],eax |
- | |
856 | mov [error],invalid_use_of_symbol |
- | |
857 | rva_ok: |
- | |
858 | mov byte [edi+12],0 |
918 | mov byte [edi+12],0 |
859 | mov eax,[code_start] |
919 | mov eax,[code_start] |
860 | mov eax,[eax+34h] |
920 | mov eax,[eax+34h] |
861 | cdq |
921 | xor edx,edx |
862 | sub [edi],eax |
922 | finish_rva: |
- | 923 | sub [edi],eax |
|
863 | sbb [edi+4],edx |
924 | sbb [edi+4],edx |
864 | add edi,14h |
925 | sbb byte [edi+13],0 |
- | 926 | jp rva_finished |
|
- | 927 | call recoverable_overflow |
|
- | 928 | rva_finished: |
|
- | 929 | add edi,14h |
|
865 | jmp calculation_loop |
930 | jmp calculation_loop |
866 | pe64_rva: |
931 | pe64_rva: |
867 | mov al,4 |
932 | mov al,4 |
868 | bt [resolver_flags],0 |
933 | bt [resolver_flags],0 |
869 | jc pe64_rva_type_ok |
934 | jc pe64_rva_type_ok |
870 | xor al,al |
935 | xor al,al |
871 | pe64_rva_type_ok: |
936 | pe64_rva_type_ok: |
872 | cmp byte [edi+12],al |
937 | cmp byte [edi+12],al |
873 | je pe64_rva_ok |
938 | je pe64_rva_ok |
874 | cmp [error_line],0 |
939 | call recoverable_misuse |
875 | jne pe64_rva_ok |
940 | pe64_rva_ok: |
876 | mov eax,[current_line] |
- | |
877 | mov [error_line],eax |
- | |
878 | mov [error],invalid_use_of_symbol |
- | |
879 | pe64_rva_ok: |
- | |
880 | mov byte [edi+12],0 |
941 | mov byte [edi+12],0 |
881 | mov eax,[code_start] |
942 | mov eax,[code_start] |
882 | mov edx,[eax+34h] |
943 | mov edx,[eax+34h] |
883 | mov eax,[eax+30h] |
944 | mov eax,[eax+30h] |
884 | sub [edi],eax |
945 | jmp finish_rva |
885 | sbb [edi+4],edx |
- | |
886 | add edi,14h |
- | |
887 | jmp calculation_loop |
- | |
888 | calculate_gotoff: |
946 | calculate_gotoff: |
889 | test [format_flags],8+1 |
947 | test [format_flags],8+1 |
890 | jnz invalid_expression |
948 | jnz invalid_expression |
891 | calculate_coff_rva: |
949 | calculate_coff_rva: |
892 | mov dl,5 |
950 | mov dl,5 |
893 | cmp byte [edi+12],2 |
951 | cmp byte [edi+12],2 |
894 | je change_value_type |
952 | je change_value_type |
895 | incorrect_change_of_value_type: |
953 | incorrect_change_of_value_type: |
896 | cmp [error_line],0 |
954 | call recoverable_misuse |
897 | jne change_value_type |
- | |
898 | mov eax,[current_line] |
955 | change_value_type: |
899 | mov [error_line],eax |
- | |
900 | mov [error],invalid_use_of_symbol |
- | |
901 | change_value_type: |
- | |
902 | mov byte [edi+12],dl |
956 | mov byte [edi+12],dl |
903 | add edi,14h |
957 | add edi,14h |
904 | jmp calculation_loop |
958 | jmp calculation_loop |
905 | calculate_plt: |
959 | calculate_plt: |
906 | cmp word [edi+8],0 |
960 | cmp word [edi+8],0 |
Line 933... | Line 987... | ||
933 | cmp [next_pass_needed],0 |
987 | cmp [next_pass_needed],0 |
934 | je value_out_of_range |
988 | je value_out_of_range |
935 | jmp div_done |
989 | jmp div_done |
936 | divider_ok: |
990 | divider_ok: |
937 | bt dword [esi+4],31 |
991 | cmp byte [esi+13],0 |
938 | jnc div_first_sign_ok |
992 | je div_first_sign_ok |
939 | not dword [esi] |
993 | mov eax,[esi] |
940 | not dword [esi+4] |
994 | mov edx,[esi+4] |
941 | add dword [esi],1 |
995 | not eax |
- | 996 | not edx |
|
- | 997 | add eax,1 |
|
942 | adc dword [esi+4],0 |
998 | adc edx,0 |
- | 999 | mov [esi],eax |
|
- | 1000 | mov [esi+4],edx |
|
943 | not bx |
1001 | or eax,edx |
- | 1002 | jz value_out_of_range |
|
- | 1003 | xor bx,-1 |
|
944 | div_first_sign_ok: |
1004 | div_first_sign_ok: |
945 | bt dword [edi+4],31 |
1005 | cmp byte [edi+13],0 |
946 | jnc div_second_sign_ok |
1006 | je div_second_sign_ok |
947 | not dword [edi] |
1007 | mov eax,[edi] |
948 | not dword [edi+4] |
1008 | mov edx,[edi+4] |
949 | add dword [edi],1 |
1009 | not eax |
- | 1010 | not edx |
|
- | 1011 | add eax,1 |
|
950 | adc dword [edi+4],0 |
1012 | adc edx,0 |
- | 1013 | mov [edi],eax |
|
- | 1014 | mov [edi+4],edx |
|
951 | not bl |
1015 | or eax,edx |
- | 1016 | jz value_out_of_range |
|
- | 1017 | xor bl,-1 |
|
952 | div_second_sign_ok: |
1018 | div_second_sign_ok: |
953 | cmp dword [edi+4],0 |
1019 | cmp dword [edi+4],0 |
954 | jne div_high |
1020 | jne div_high |
955 | mov ecx,[edi] |
1021 | mov ecx,[edi] |
956 | mov eax,[esi+4] |
1022 | mov eax,[esi+4] |
957 | xor edx,edx |
1023 | xor edx,edx |
Line 963... | Line 1029... | ||
963 | mov eax,edx |
1029 | mov eax,edx |
964 | xor edx,edx |
1030 | xor edx,edx |
965 | jmp div_done |
1031 | jmp div_done |
966 | div_high: |
1032 | div_high: |
967 | mov eax,[esi+4] |
1033 | push ebx |
- | 1034 | mov eax,[esi+4] |
|
968 | xor edx,edx |
1035 | xor edx,edx |
969 | div dword [edi+4] |
1036 | div dword [edi+4] |
970 | mov ebx,[esi] |
1037 | mov ebx,[esi] |
971 | mov [esi],eax |
1038 | mov [esi],eax |
972 | mov dword [esi+4],0 |
1039 | and dword [esi+4],0 |
973 | mov ecx,edx |
1040 | mov ecx,edx |
974 | mul dword [edi] |
1041 | mul dword [edi] |
975 | div_high_loop: |
1042 | div_high_loop: |
976 | cmp ecx,edx |
1043 | cmp ecx,edx |
977 | ja div_high_done |
1044 | ja div_high_done |
978 | jb div_high_large_correction |
1045 | jb div_high_large_correction |
Line 987... | Line 1054... | ||
987 | sub ebx,eax |
1054 | sub ebx,eax |
988 | sbb ecx,edx |
1055 | sbb ecx,edx |
989 | mov edx,ecx |
1056 | mov edx,ecx |
990 | mov eax,ebx |
1057 | mov eax,ebx |
991 | ret |
1058 | pop ebx |
992 | div_high_large_correction: |
1059 | jmp div_done |
- | 1060 | div_high_large_correction: |
|
993 | push eax edx |
1061 | push eax edx |
994 | mov eax,edx |
1062 | mov eax,edx |
995 | sub eax,ecx |
1063 | sub eax,ecx |
996 | xor edx,edx |
1064 | xor edx,edx |
997 | div dword [edi+4] |
1065 | div dword [edi+4] |
Line 1016... | Line 1084... | ||
1016 | not eax |
1084 | not eax |
1017 | not edx |
1085 | not edx |
1018 | add eax,1 |
1086 | add eax,1 |
1019 | adc edx,0 |
1087 | adc edx,0 |
1020 | remainder_ok: |
1088 | mov ecx,eax |
- | 1089 | or ecx,edx |
|
- | 1090 | jnz remainder_ok |
|
- | 1091 | not bh |
|
- | 1092 | remainder_ok: |
|
1021 | or bl,bl |
1093 | or bl,bl |
1022 | jz div_ok |
1094 | jz div_ok |
1023 | not dword [esi] |
1095 | not dword [esi] |
1024 | not dword [esi+4] |
1096 | not dword [esi+4] |
1025 | add dword [esi],1 |
1097 | add dword [esi],1 |
1026 | adc dword [esi+4],0 |
1098 | adc dword [esi+4],0 |
1027 | div_ok: |
1099 | mov ecx,[esi] |
- | 1100 | or ecx,[esi+4] |
|
- | 1101 | jnz div_ok |
|
- | 1102 | not bl |
|
- | 1103 | div_ok: |
|
1028 | ret |
1104 | mov [esi+13],bl |
- | 1105 | ret |
|
- | 1106 | store_label_reference: |
|
- | 1107 | mov eax,[display_buffer] |
|
- | 1108 | mov dword [eax-4],2 |
|
- | 1109 | mov dword [eax-8],4 |
|
- | 1110 | sub eax,8+4 |
|
- | 1111 | cmp eax,edi |
|
- | 1112 | jbe out_of_memory |
|
- | 1113 | mov [display_buffer],eax |
|
- | 1114 | mov [eax],ebx |
|
- | 1115 | ret |
|
1029 | convert_fp: |
1116 | convert_fp: |
1030 | inc esi |
1117 | inc esi |
1031 | mov word [edi+8],0 |
1118 | and word [edi+8],0 |
1032 | mov byte [edi+12],0 |
1119 | and word [edi+12],0 |
1033 | mov al,[value_size] |
1120 | mov al,[value_size] |
1034 | cmp al,2 |
1121 | cmp al,2 |
1035 | je convert_fp_word |
1122 | je convert_fp_word |
1036 | cmp al,4 |
1123 | cmp al,4 |
1037 | je convert_fp_dword |
1124 | je convert_fp_dword |
1038 | cmp al,8 |
1125 | test al,not 8 |
1039 | je convert_fp_qword |
1126 | jnz invalid_value |
- | 1127 | convert_fp_qword: |
|
1040 | jmp invalid_value |
1128 | xor eax,eax |
- | 1129 | xor edx,edx |
|
- | 1130 | cmp word [esi+8],8000h |
|
- | 1131 | je fp_qword_store |
|
1041 | convert_fp_word: |
1132 | mov bx,[esi+8] |
- | 1133 | mov eax,[esi] |
|
- | 1134 | mov edx,[esi+4] |
|
- | 1135 | add eax,eax |
|
- | 1136 | adc edx,edx |
|
- | 1137 | mov ecx,edx |
|
- | 1138 | shr edx,12 |
|
- | 1139 | shrd eax,ecx,12 |
|
- | 1140 | jnc fp_qword_ok |
|
- | 1141 | add eax,1 |
|
- | 1142 | adc edx,0 |
|
- | 1143 | bt edx,20 |
|
- | 1144 | jnc fp_qword_ok |
|
- | 1145 | and edx,1 shl 20 - 1 |
|
- | 1146 | inc bx |
|
- | 1147 | shr edx,1 |
|
- | 1148 | rcr eax,1 |
|
- | 1149 | fp_qword_ok: |
|
- | 1150 | add bx,3FFh |
|
- | 1151 | cmp bx,7FFh |
|
- | 1152 | jge value_out_of_range |
|
- | 1153 | cmp bx,0 |
|
- | 1154 | jg fp_qword_exp_ok |
|
- | 1155 | or edx,1 shl 20 |
|
- | 1156 | mov cx,bx |
|
- | 1157 | neg cx |
|
- | 1158 | inc cx |
|
- | 1159 | cmp cx,52 |
|
- | 1160 | ja value_out_of_range |
|
- | 1161 | cmp cx,32 |
|
- | 1162 | jbe fp_qword_small_shift |
|
- | 1163 | sub cx,32 |
|
- | 1164 | mov eax,edx |
|
- | 1165 | xor edx,edx |
|
- | 1166 | shr eax,cl |
|
- | 1167 | jmp fp_qword_shift_done |
|
- | 1168 | fp_qword_small_shift: |
|
- | 1169 | mov ebx,edx |
|
- | 1170 | shr edx,cl |
|
- | 1171 | shrd eax,ebx,cl |
|
- | 1172 | fp_qword_shift_done: |
|
- | 1173 | mov bx,0 |
|
- | 1174 | jnc fp_qword_exp_ok |
|
- | 1175 | add eax,1 |
|
- | 1176 | adc edx,0 |
|
- | 1177 | test edx,1 shl 20 |
|
- | 1178 | jz fp_qword_exp_ok |
|
- | 1179 | and edx,1 shl 20 - 1 |
|
- | 1180 | inc bx |
|
- | 1181 | fp_qword_exp_ok: |
|
- | 1182 | shl ebx,20 |
|
- | 1183 | or edx,ebx |
|
- | 1184 | fp_qword_store: |
|
- | 1185 | mov bl,[esi+11] |
|
- | 1186 | shl ebx,31 |
|
- | 1187 | or edx,ebx |
|
- | 1188 | mov [edi],eax |
|
- | 1189 | mov [edi+4],edx |
|
- | 1190 | add esi,13 |
|
- | 1191 | ret |
|
- | 1192 | convert_fp_word: |
|
1042 | xor eax,eax |
1193 | xor eax,eax |
1043 | cmp word [esi+8],8000h |
1194 | cmp word [esi+8],8000h |
1044 | je fp_word_store |
1195 | je fp_word_store |
1045 | mov bx,[esi+8] |
1196 | mov bx,[esi+8] |
1046 | mov ax,[esi+6] |
1197 | mov ax,[esi+6] |
Line 1131... | Line 1282... | ||
1131 | xor eax,eax |
1282 | xor eax,eax |
1132 | mov [edi+4],eax |
1283 | mov [edi+4],eax |
1133 | add esi,13 |
1284 | add esi,13 |
1134 | ret |
1285 | ret |
1135 | convert_fp_qword: |
1286 | get_string_value: |
1136 | xor eax,eax |
- | |
1137 | xor edx,edx |
- | |
1138 | cmp word [esi+8],8000h |
- | |
1139 | je fp_qword_store |
- | |
1140 | mov bx,[esi+8] |
- | |
1141 | mov eax,[esi] |
- | |
1142 | mov edx,[esi+4] |
- | |
1143 | add eax,eax |
- | |
1144 | adc edx,edx |
- | |
1145 | mov ecx,edx |
- | |
1146 | shr edx,12 |
- | |
1147 | shrd eax,ecx,12 |
- | |
1148 | jnc fp_qword_ok |
- | |
1149 | add eax,1 |
- | |
1150 | adc edx,0 |
- | |
1151 | bt edx,20 |
- | |
1152 | jnc fp_qword_ok |
- | |
1153 | and edx,1 shl 20 - 1 |
- | |
1154 | inc bx |
- | |
1155 | shr edx,1 |
- | |
1156 | rcr eax,1 |
- | |
1157 | fp_qword_ok: |
- | |
1158 | add bx,3FFh |
- | |
1159 | cmp bx,7FFh |
- | |
1160 | jge value_out_of_range |
- | |
1161 | cmp bx,0 |
- | |
1162 | jg fp_qword_exp_ok |
- | |
1163 | or edx,1 shl 20 |
- | |
1164 | mov cx,bx |
- | |
1165 | neg cx |
- | |
1166 | inc cx |
- | |
1167 | cmp cx,52 |
- | |
1168 | ja value_out_of_range |
- | |
1169 | cmp cx,32 |
- | |
1170 | jbe fp_qword_small_shift |
- | |
1171 | sub cx,32 |
- | |
1172 | mov eax,edx |
- | |
1173 | xor edx,edx |
- | |
1174 | shr eax,cl |
- | |
1175 | jmp fp_qword_shift_done |
- | |
1176 | fp_qword_small_shift: |
- | |
1177 | mov ebx,edx |
- | |
1178 | shr edx,cl |
- | |
1179 | shrd eax,ebx,cl |
- | |
1180 | fp_qword_shift_done: |
- | |
1181 | mov bx,0 |
- | |
1182 | jnc fp_qword_exp_ok |
- | |
1183 | add eax,1 |
- | |
1184 | adc edx,0 |
- | |
1185 | test edx,1 shl 20 |
- | |
1186 | jz fp_qword_exp_ok |
- | |
1187 | and edx,1 shl 20 - 1 |
- | |
1188 | inc bx |
- | |
1189 | fp_qword_exp_ok: |
- | |
1190 | shl ebx,20 |
- | |
1191 | or edx,ebx |
- | |
1192 | fp_qword_store: |
- | |
1193 | mov bl,[esi+11] |
- | |
1194 | shl ebx,31 |
- | |
1195 | or edx,ebx |
- | |
1196 | mov [edi],eax |
- | |
1197 | mov [edi+4],edx |
- | |
1198 | add esi,13 |
- | |
1199 | ret |
- | |
1200 | get_string_value: |
- | |
1201 | inc esi |
1287 | inc esi |
1202 | lods dword [esi] |
1288 | lods dword [esi] |
1203 | mov ecx,eax |
1289 | mov ecx,eax |
1204 | cmp ecx,8 |
1290 | cmp ecx,8 |
1205 | ja value_out_of_range |
1291 | ja value_out_of_range |
Line 1210... | Line 1296... | ||
1210 | mov edi,edx |
1296 | mov edi,edx |
1211 | rep movs byte [edi],[esi] |
1297 | rep movs byte [edi],[esi] |
1212 | mov edi,edx |
1298 | mov edi,edx |
1213 | inc esi |
1299 | inc esi |
1214 | mov word [edi+8],0 |
1300 | and word [edi+8],0 |
1215 | mov byte [edi+12],0 |
1301 | and word [edi+12],0 |
1216 | ret |
1302 | ret |
1217 | 1303 | ||
Line 1218... | Line 1304... | ||
1218 | get_byte_value: |
1304 | get_byte_value: |
1219 | mov [value_size],1 |
1305 | mov [value_size],1 |
1220 | mov [size_override],-1 |
1306 | mov [size_override],-1 |
1221 | call calculate_expression |
1307 | call calculate_value |
1222 | mov eax,[edi+16] |
- | |
1223 | mov [symbol_identifier],eax |
- | |
1224 | mov [value_type],0 |
- | |
1225 | cmp word [edi+8],0 |
- | |
1226 | jne invalid_value |
1308 | or al,al |
1227 | cmp byte [edi+12],0 |
- | |
1228 | je check_byte_value |
1309 | jz check_byte_value |
1229 | cmp [error_line],0 |
- | |
1230 | jne check_byte_value |
1310 | call recoverable_misuse |
1231 | mov eax,[current_line] |
- | |
1232 | mov [error_line],eax |
- | |
1233 | mov [error],invalid_use_of_symbol |
- | |
1234 | check_byte_value: |
1311 | check_byte_value: |
1235 | mov eax,[edi] |
1312 | mov eax,[edi] |
1236 | mov edx,[edi+4] |
1313 | mov edx,[edi+4] |
1237 | or edx,edx |
1314 | cmp byte [edi+13],0 |
1238 | jz byte_positive |
1315 | je byte_positive |
1239 | cmp edx,-1 |
1316 | cmp edx,-1 |
1240 | jne range_exceeded |
1317 | jne range_exceeded |
1241 | cmp eax,-80h |
1318 | cmp eax,-80h |
1242 | jb range_exceeded |
1319 | jb range_exceeded |
1243 | ret |
1320 | ret |
1244 | byte_positive: |
1321 | byte_positive: |
- | 1322 | test edx,edx |
|
- | 1323 | jnz range_exceeded |
|
1245 | cmp eax,100h |
1324 | cmp eax,100h |
1246 | jae range_exceeded |
1325 | jae range_exceeded |
1247 | return_byte_value: |
1326 | return_byte_value: |
1248 | ret |
1327 | ret |
1249 | range_exceeded: |
1328 | range_exceeded: |
1250 | xor eax,eax |
1329 | xor eax,eax |
1251 | xor edx,edx |
1330 | xor edx,edx |
- | 1331 | recoverable_overflow: |
|
1252 | cmp [error_line],0 |
1332 | cmp [error_line],0 |
1253 | jne return_byte_value |
1333 | jne ignore_overflow |
1254 | mov ecx,[current_line] |
1334 | push [current_line] |
1255 | mov [error_line],ecx |
1335 | pop [error_line] |
1256 | mov [error],value_out_of_range |
1336 | mov [error],value_out_of_range |
- | 1337 | or [value_undefined],-1 |
|
- | 1338 | ignore_overflow: |
|
- | 1339 | ret |
|
- | 1340 | recoverable_misuse: |
|
- | 1341 | cmp [error_line],0 |
|
- | 1342 | jne ignore_misuse |
|
- | 1343 | push [current_line] |
|
- | 1344 | pop [error_line] |
|
- | 1345 | mov [error],invalid_use_of_symbol |
|
- | 1346 | ignore_misuse: |
|
1257 | ret |
1347 | ret |
1258 | get_word_value: |
1348 | get_word_value: |
1259 | mov [value_size],2 |
1349 | mov [value_size],2 |
1260 | mov [size_override],-1 |
1350 | mov [size_override],-1 |
1261 | call calculate_expression |
1351 | call calculate_value |
1262 | cmp word [edi+8],0 |
- | |
1263 | jne invalid_value |
- | |
1264 | mov eax,[edi+16] |
- | |
1265 | mov [symbol_identifier],eax |
- | |
1266 | mov al,[edi+12] |
- | |
1267 | mov [value_type],al |
- | |
1268 | cmp al,2 |
1352 | cmp al,2 |
1269 | jb check_word_value |
1353 | jb check_word_value |
1270 | cmp [error_line],0 |
- | |
1271 | jne check_word_value |
1354 | call recoverable_misuse |
1272 | mov eax,[current_line] |
- | |
1273 | mov [error_line],eax |
- | |
1274 | mov [error],invalid_use_of_symbol |
- | |
1275 | check_word_value: |
1355 | check_word_value: |
1276 | mov eax,[edi] |
1356 | mov eax,[edi] |
1277 | mov edx,[edi+4] |
1357 | mov edx,[edi+4] |
1278 | or edx,edx |
1358 | cmp byte [edi+13],0 |
1279 | jz word_positive |
1359 | je word_positive |
1280 | cmp edx,-1 |
1360 | cmp edx,-1 |
1281 | jne range_exceeded |
1361 | jne range_exceeded |
1282 | cmp eax,-8000h |
1362 | cmp eax,-8000h |
1283 | jb range_exceeded |
1363 | jb range_exceeded |
1284 | ret |
1364 | ret |
1285 | word_positive: |
1365 | word_positive: |
- | 1366 | test edx,edx |
|
- | 1367 | jnz range_exceeded |
|
1286 | cmp eax,10000h |
1368 | cmp eax,10000h |
1287 | jae range_exceeded |
1369 | jae range_exceeded |
1288 | ret |
1370 | ret |
1289 | get_dword_value: |
1371 | get_dword_value: |
1290 | mov [value_size],4 |
1372 | mov [value_size],4 |
1291 | mov [size_override],-1 |
1373 | mov [size_override],-1 |
1292 | call calculate_expression |
1374 | call calculate_value |
1293 | cmp word [edi+8],0 |
- | |
1294 | jne invalid_value |
- | |
1295 | mov eax,[edi+16] |
- | |
1296 | mov [symbol_identifier],eax |
- | |
1297 | mov al,[edi+12] |
- | |
1298 | mov [value_type],al |
- | |
1299 | cmp al,4 |
1375 | cmp al,4 |
1300 | jne check_dword_value |
1376 | jne check_dword_value |
1301 | mov [value_type],2 |
1377 | mov [value_type],2 |
1302 | mov eax,[edi] |
1378 | mov eax,[edi] |
1303 | cdq |
1379 | cdq |
1304 | cmp edx,[edi+4] |
1380 | cmp edx,[edi+4] |
1305 | jne range_exceeded |
1381 | jne range_exceeded |
- | 1382 | mov ecx,edx |
|
- | 1383 | shr ecx,31 |
|
- | 1384 | cmp cl,[value_sign] |
|
- | 1385 | jne range_exceeded |
|
1306 | ret |
1386 | ret |
1307 | check_dword_value: |
1387 | check_dword_value: |
1308 | mov eax,[edi] |
1388 | mov eax,[edi] |
1309 | mov edx,[edi+4] |
1389 | mov edx,[edi+4] |
1310 | or edx,edx |
1390 | cmp byte [edi+13],0 |
1311 | jz dword_positive |
1391 | je dword_positive |
1312 | cmp edx,-1 |
1392 | cmp edx,-1 |
1313 | jne range_exceeded |
1393 | jne range_exceeded |
1314 | bt eax,31 |
1394 | bt eax,31 |
1315 | jnc range_exceeded |
1395 | jnc range_exceeded |
- | 1396 | ret |
|
1316 | dword_positive: |
1397 | dword_positive: |
- | 1398 | test edx,edx |
|
- | 1399 | jne range_exceeded |
|
1317 | ret |
1400 | ret |
1318 | get_pword_value: |
1401 | get_pword_value: |
1319 | mov [value_size],6 |
1402 | mov [value_size],6 |
1320 | mov [size_override],-1 |
1403 | mov [size_override],-1 |
1321 | call calculate_expression |
1404 | call calculate_value |
1322 | mov eax,[edi+16] |
- | |
1323 | mov [symbol_identifier],eax |
- | |
1324 | cmp word [edi+8],0 |
- | |
1325 | jne invalid_value |
- | |
1326 | mov al,[edi+12] |
- | |
1327 | mov [value_type],al |
- | |
1328 | cmp al,4 |
1405 | cmp al,4 |
1329 | jne check_pword_value |
1406 | jne check_pword_value |
1330 | cmp [error_line],0 |
- | |
1331 | jne check_pword_value |
1407 | call recoverable_misuse |
1332 | mov eax,[current_line] |
- | |
1333 | mov [error_line],eax |
- | |
1334 | mov [error],invalid_use_of_symbol |
- | |
1335 | check_pword_value: |
1408 | check_pword_value: |
1336 | mov eax,[edi] |
1409 | mov eax,[edi] |
1337 | mov edx,[edi+4] |
1410 | mov edx,[edi+4] |
1338 | cmp edx,10000h |
1411 | cmp byte [edi+13],0 |
1339 | jge range_exceeded |
1412 | je pword_positive |
1340 | cmp edx,-8000h |
1413 | cmp edx,-8000h |
1341 | jl range_exceeded |
1414 | jb range_exceeded |
- | 1415 | ret |
|
- | 1416 | pword_positive: |
|
- | 1417 | cmp edx,10000h |
|
- | 1418 | jae range_exceeded |
|
1342 | ret |
1419 | ret |
1343 | get_qword_value: |
1420 | get_qword_value: |
1344 | mov [value_size],8 |
1421 | mov [value_size],8 |
1345 | mov [size_override],-1 |
1422 | mov [size_override],-1 |
1346 | call calculate_expression |
1423 | call calculate_value |
1347 | cmp word [edi+8],0 |
- | |
1348 | jne invalid_value |
- | |
1349 | mov eax,[edi+16] |
- | |
1350 | mov [symbol_identifier],eax |
- | |
1351 | mov al,[edi+12] |
- | |
1352 | mov [value_type],al |
- | |
1353 | check_qword_value: |
1424 | check_qword_value: |
1354 | mov eax,[edi] |
1425 | mov eax,[edi] |
1355 | mov edx,[edi+4] |
1426 | mov edx,[edi+4] |
- | 1427 | cmp byte [edi+13],0 |
|
- | 1428 | je qword_positive |
|
- | 1429 | cmp edx,-80000000h |
|
- | 1430 | jb range_exceeded |
|
- | 1431 | qword_positive: |
|
1356 | ret |
1432 | ret |
1357 | get_count_value: |
1433 | get_count_value: |
1358 | mov [value_size],8 |
1434 | mov [value_size],8 |
1359 | mov [size_override],-1 |
1435 | mov [size_override],-1 |
1360 | call calculate_expression |
1436 | call calculate_expression |
1361 | cmp word [edi+8],0 |
1437 | cmp word [edi+8],0 |
1362 | jne invalid_value |
1438 | jne invalid_value |
- | 1439 | mov [value_sign],0 |
|
1363 | mov al,[edi+12] |
1440 | mov al,[edi+12] |
1364 | or al,al |
1441 | or al,al |
1365 | jz check_count_value |
1442 | jz check_count_value |
1366 | cmp [error_line],0 |
- | |
1367 | jne check_count_value |
1443 | call recoverable_misuse |
1368 | mov eax,[current_line] |
- | |
1369 | mov [error_line],eax |
- | |
1370 | mov [error],invalid_use_of_symbol |
- | |
1371 | check_count_value: |
1444 | check_count_value: |
- | 1445 | cmp byte [edi+13],0 |
|
- | 1446 | jne invalid_count_value |
|
1372 | mov eax,[edi] |
1447 | mov eax,[edi] |
1373 | mov edx,[edi+4] |
1448 | mov edx,[edi+4] |
1374 | or edx,edx |
1449 | or edx,edx |
1375 | jnz invalid_count_value |
1450 | jnz invalid_count_value |
1376 | ret |
1451 | ret |
Line 1401... | Line 1476... | ||
1401 | cmp al,8 |
1476 | cmp al,8 |
1402 | je value_qword |
1477 | je value_qword |
1403 | or al,al |
1478 | or al,al |
1404 | jnz invalid_value |
1479 | jnz invalid_value |
1405 | value_qword: |
1480 | mov [value_size],al |
- | 1481 | call calculate_value |
|
- | 1482 | mov eax,[edi] |
|
- | 1483 | mov edx,[edi+4] |
|
- | 1484 | ret |
|
- | 1485 | calculate_value: |
|
- | 1486 | call calculate_expression |
|
- | 1487 | cmp word [edi+8],0 |
|
- | 1488 | jne invalid_value |
|
- | 1489 | mov eax,[edi+16] |
|
- | 1490 | mov [symbol_identifier],eax |
|
- | 1491 | mov al,[edi+13] |
|
- | 1492 | mov [value_sign],al |
|
- | 1493 | mov al,[edi+12] |
|
- | 1494 | mov [value_type],al |
|
- | 1495 | ret |
|
- | 1496 | value_qword: |
|
1406 | call get_qword_value |
1497 | call get_qword_value |
1407 | ret |
1498 | truncated_value: |
- | 1499 | mov [value_sign],0 |
|
- | 1500 | ret |
|
1408 | value_pword: |
1501 | value_pword: |
1409 | call get_pword_value |
1502 | call get_pword_value |
1410 | movzx edx,dx |
1503 | movzx edx,dx |
1411 | ret |
1504 | jmp truncated_value |
1412 | value_dword: |
1505 | value_dword: |
1413 | call get_dword_value |
1506 | call get_dword_value |
1414 | xor edx,edx |
1507 | xor edx,edx |
1415 | ret |
1508 | jmp truncated_value |
1416 | value_word: |
1509 | value_word: |
1417 | call get_word_value |
1510 | call get_word_value |
1418 | xor edx,edx |
1511 | xor edx,edx |
1419 | movzx eax,ax |
1512 | movzx eax,ax |
1420 | ret |
1513 | jmp truncated_value |
1421 | value_byte: |
1514 | value_byte: |
1422 | call get_byte_value |
1515 | call get_byte_value |
1423 | xor edx,edx |
1516 | xor edx,edx |
1424 | movzx eax,al |
1517 | movzx eax,al |
1425 | ret |
1518 | jmp truncated_value |
1426 | get_address_word_value: |
1519 | get_address_word_value: |
1427 | mov [address_size],2 |
1520 | mov [address_size],2 |
1428 | mov [value_size],2 |
1521 | mov [value_size],2 |
1429 | jmp calculate_address |
1522 | jmp calculate_address |
1430 | get_address_dword_value: |
1523 | get_address_dword_value: |
1431 | mov [address_size],4 |
1524 | mov [address_size],4 |
Line 1443... | Line 1536... | ||
1443 | je invalid_address |
1536 | je invalid_address |
1444 | call calculate_expression |
1537 | call calculate_expression |
1445 | mov eax,[edi+16] |
1538 | mov eax,[edi+16] |
1446 | mov [address_symbol],eax |
1539 | mov [address_symbol],eax |
1447 | mov al,[edi+12] |
1540 | mov al,[edi+13] |
- | 1541 | mov [address_sign],al |
|
- | 1542 | mov al,[edi+12] |
|
1448 | mov [value_type],al |
1543 | mov [value_type],al |
1449 | cmp al,6 |
1544 | cmp al,6 |
1450 | je special_address_type_32bit |
1545 | je special_address_type_32bit |
1451 | cmp al,5 |
1546 | cmp al,5 |
1452 | je special_address_type_32bit |
1547 | je special_address_type_32bit |
Line 1478... | Line 1573... | ||
1478 | cmp edx,[edi+4] |
1573 | cmp edx,[edi+4] |
1479 | je address_size_ok |
1574 | je address_size_ok |
1480 | cmp [error_line],0 |
1575 | cmp [error_line],0 |
1481 | jne address_size_ok |
1576 | jne address_size_ok |
1482 | mov ecx,[current_line] |
1577 | call recoverable_overflow |
1483 | mov [error_line],ecx |
- | |
1484 | mov [error],value_out_of_range |
- | |
1485 | address_size_ok: |
1578 | address_size_ok: |
1486 | xor ebx,ebx |
1579 | xor ebx,ebx |
1487 | xor ecx,ecx |
1580 | xor ecx,ecx |
1488 | mov cl,[value_type] |
1581 | mov cl,[value_type] |
1489 | shl ecx,16 |
1582 | shl ecx,16 |
1490 | mov ch,[address_size] |
1583 | mov ch,[address_size] |
Line 1498... | Line 1591... | ||
1498 | call get_address_register |
1591 | call get_address_register |
1499 | mov ax,bx |
1592 | mov ax,bx |
1500 | shr ah,4 |
1593 | shr ah,4 |
1501 | shr al,4 |
1594 | shr al,4 |
1502 | or bh,bh |
1595 | cmp ah,0Ch |
- | 1596 | je check_vsib_address |
|
- | 1597 | cmp ah,0Dh |
|
- | 1598 | je check_vsib_address |
|
- | 1599 | cmp al,0Ch |
|
- | 1600 | je check_vsib_address |
|
- | 1601 | cmp al,0Dh |
|
- | 1602 | je check_vsib_address |
|
- | 1603 | or bh,bh |
|
1503 | jz check_address_registers |
1604 | jz check_address_registers |
1504 | or bl,bl |
1605 | or bl,bl |
1505 | jz check_address_registers |
1606 | jz check_address_registers |
1506 | cmp al,ah |
1607 | cmp al,ah |
1507 | jne invalid_address |
1608 | jne invalid_address |
Line 1531... | Line 1632... | ||
1531 | and al,0Fh |
1632 | and al,0Fh |
1532 | cmp al,ah |
1633 | cmp al,ah |
1533 | jne invalid_address |
1634 | jne invalid_address |
1534 | check_ip_relative_address: |
1635 | check_ip_relative_address: |
1535 | cmp bh,0F4h |
1636 | or bl,bl |
- | 1637 | jnz invalid_address |
|
- | 1638 | cmp bh,0F4h |
|
1536 | je check_dword_value |
1639 | je check_dword_value |
1537 | cmp bh,0F8h |
1640 | cmp bh,0F8h |
1538 | jne invalid_address |
1641 | jne invalid_address |
1539 | mov eax,[edi] |
1642 | mov eax,[edi] |
1540 | cdq |
1643 | cdq |
1541 | cmp edx,[edi+4] |
1644 | cmp edx,[edi+4] |
1542 | jne range_exceeded |
1645 | jne range_exceeded |
1543 | ret |
1646 | cmp dl,[edi+13] |
- | 1647 | jne range_exceeded |
|
- | 1648 | ret |
|
1544 | get_address_register: |
1649 | get_address_register: |
1545 | or al,al |
1650 | or al,al |
1546 | jz address_register_ok |
1651 | jz address_register_ok |
1547 | cmp dl,1 |
1652 | cmp dl,1 |
1548 | jne scaled_register |
1653 | jne scaled_register |
Line 1636... | Line 1741... | ||
1636 | dec al |
1741 | dec al |
1637 | and al,cl |
1742 | and al,cl |
1638 | jz check_immediate_address |
1743 | jz check_immediate_address |
1639 | jmp invalid_address |
1744 | jmp invalid_address |
1640 | calculate_relative_offset: |
1745 | check_vsib_address: |
- | 1746 | cmp ah,0Ch |
|
- | 1747 | je swap_vsib_registers |
|
- | 1748 | cmp ah,0Dh |
|
- | 1749 | jne check_vsib_base |
|
- | 1750 | swap_vsib_registers: |
|
- | 1751 | cmp cl,1 |
|
- | 1752 | ja invalid_address |
|
- | 1753 | xchg bl,bh |
|
- | 1754 | mov cl,1 |
|
- | 1755 | check_vsib_base: |
|
- | 1756 | test bh,bh |
|
- | 1757 | jz vsib_base_ok |
|
- | 1758 | mov al,bh |
|
- | 1759 | shr al,4 |
|
- | 1760 | cmp al,4 |
|
- | 1761 | je vsib_base_ok |
|
- | 1762 | cmp [code_type],64 |
|
- | 1763 | jne invalid_address |
|
- | 1764 | cmp al,8 |
|
- | 1765 | jne invalid_address |
|
- | 1766 | vsib_base_ok: |
|
- | 1767 | mov al,bl |
|
- | 1768 | shr al,4 |
|
- | 1769 | cmp al,0Ch |
|
- | 1770 | je check_index_scale |
|
- | 1771 | cmp al,0Dh |
|
- | 1772 | je check_index_scale |
|
- | 1773 | jmp invalid_address |
|
- | 1774 | ||
- | 1775 | calculate_relative_offset: |
|
1641 | cmp [value_undefined],0 |
1776 | cmp [value_undefined],0 |
1642 | jne relative_offset_ok |
1777 | jne relative_offset_ok |
1643 | test bh,bh |
1778 | test bh,bh |
1644 | setne ch |
1779 | setne ch |
1645 | cmp bx,word [org_registers] |
1780 | cmp bx,word [org_registers] |
Line 1650... | Line 1785... | ||
1650 | jne invalid_value |
1785 | jne invalid_value |
1651 | origin_registers_ok: |
1786 | origin_registers_ok: |
1652 | cmp cx,word [org_registers+2] |
1787 | cmp cx,word [org_registers+2] |
1653 | jne invalid_value |
1788 | jne invalid_value |
1654 | add eax,dword [org_origin] |
1789 | mov bl,[address_sign] |
- | 1790 | add eax,dword [org_origin] |
|
1655 | adc edx,dword [org_origin+4] |
1791 | adc edx,dword [org_origin+4] |
1656 | sub eax,edi |
1792 | adc bl,[org_origin_sign] |
- | 1793 | sub eax,edi |
|
1657 | sbb edx,0 |
1794 | sbb edx,0 |
1658 | mov bl,[value_type] |
1795 | sbb bl,0 |
- | 1796 | mov [value_sign],bl |
|
- | 1797 | mov bl,[value_type] |
|
1659 | or bl,bl |
1798 | mov ecx,[address_symbol] |
1660 | je relative_offset_ok |
- | |
1661 | test bl,1 |
- | |
1662 | jnz invalid_use_of_symbol |
- | |
1663 | mov ecx,[address_symbol] |
- | |
1664 | mov [symbol_identifier],ecx |
1799 | mov [symbol_identifier],ecx |
1665 | cmp bl,6 |
1800 | test bl,1 |
- | 1801 | jnz relative_offset_unallowed |
|
- | 1802 | cmp bl,6 |
|
1666 | je plt_relative_offset |
1803 | je plt_relative_offset |
1667 | cmp bl,[labels_type] |
1804 | cmp bl,[labels_type] |
1668 | jne invalid_use_of_symbol |
1805 | je set_relative_offset_type |
- | 1806 | relative_offset_unallowed: |
|
- | 1807 | call recoverable_misuse |
|
- | 1808 | set_relative_offset_type: |
|
- | 1809 | cmp [value_type],0 |
|
- | 1810 | je relative_offset_ok |
|
1669 | mov [value_type],0 |
1811 | mov [value_type],0 |
1670 | cmp ecx,[org_symbol] |
1812 | cmp ecx,[org_symbol] |
1671 | je relative_offset_ok |
1813 | je relative_offset_ok |
1672 | mov [value_type],3 |
1814 | mov [value_type],3 |
1673 | relative_offset_ok: |
1815 | relative_offset_ok: |
1674 | ret |
1816 | ret |
1675 | plt_relative_offset: |
1817 | plt_relative_offset: |
1676 | mov [value_type],7 |
1818 | mov [value_type],7 |
1677 | ret |
1819 | cmp [labels_type],2 |
- | 1820 | je relative_offset_ok |
|
- | 1821 | cmp [labels_type],4 |
|
- | 1822 | jne recoverable_misuse |
|
- | 1823 | ret |
|
1678 | 1824 | ||
Line 1679... | Line 1825... | ||
1679 | calculate_logical_expression: |
1825 | calculate_logical_expression: |
1680 | xor al,al |
1826 | xor al,al |
1681 | calculate_embedded_logical_expression: |
1827 | calculate_embedded_logical_expression: |
Line 1710... | Line 1856... | ||
1710 | call skip_logical_value |
1856 | call skip_logical_value |
1711 | jc invalid_expression |
1857 | jc invalid_expression |
1712 | pop eax |
1858 | pop eax |
1713 | jmp logical_loop |
1859 | jmp logical_loop |
1714 | get_logical_value: |
1860 | get_value_for_comparison: |
- | 1861 | mov [value_size],8 |
|
- | 1862 | mov [size_override],-1 |
|
- | 1863 | lods byte [esi] |
|
- | 1864 | call calculate_expression |
|
- | 1865 | cmp byte [edi+8],0 |
|
- | 1866 | jne first_register_size_ok |
|
- | 1867 | mov byte [edi+10],0 |
|
- | 1868 | first_register_size_ok: |
|
- | 1869 | cmp byte [edi+9],0 |
|
- | 1870 | jne second_register_size_ok |
|
- | 1871 | mov byte [edi+11],0 |
|
- | 1872 | second_register_size_ok: |
|
- | 1873 | mov eax,[edi+16] |
|
- | 1874 | mov [symbol_identifier],eax |
|
- | 1875 | mov al,[edi+13] |
|
- | 1876 | mov [value_sign],al |
|
- | 1877 | mov bl,[edi+12] |
|
- | 1878 | mov eax,[edi] |
|
- | 1879 | mov edx,[edi+4] |
|
- | 1880 | mov ecx,[edi+8] |
|
- | 1881 | ret |
|
- | 1882 | get_logical_value: |
|
1715 | xor al,al |
1883 | xor al,al |
1716 | check_for_negation: |
1884 | check_for_negation: |
1717 | cmp byte [esi],'~' |
1885 | cmp byte [esi],'~' |
1718 | jne negation_ok |
1886 | jne negation_ok |
1719 | inc esi |
1887 | inc esi |
Line 1733... | Line 1901... | ||
1733 | cmp al,'0' |
1901 | cmp al,'0' |
1734 | je given_false |
1902 | je given_false |
1735 | cmp al,'1' |
1903 | cmp al,'1' |
1736 | je given_true |
1904 | je given_true |
1737 | call get_value |
1905 | call get_value_for_comparison |
1738 | mov bl,[value_type] |
1906 | mov bh,[value_sign] |
1739 | push eax edx ebx |
1907 | push eax edx [symbol_identifier] ebx ecx |
1740 | mov al,[esi] |
1908 | mov al,[esi] |
1741 | or al,al |
1909 | or al,al |
1742 | jz logical_number |
1910 | jz logical_number |
1743 | cmp al,0Fh |
1911 | cmp al,0Fh |
1744 | je logical_number |
1912 | je logical_number |
1745 | cmp al,'}' |
1913 | cmp al,'}' |
Line 1749... | Line 1917... | ||
1749 | cmp al,'|' |
1917 | cmp al,'|' |
1750 | je logical_number |
1918 | je logical_number |
1751 | inc esi |
1919 | inc esi |
1752 | mov [compare_type],al |
1920 | mov [compare_type],al |
1753 | call get_value |
1921 | call get_value_for_comparison |
- | 1922 | cmp bl,[esp+4] |
|
- | 1923 | jne values_not_relative |
|
- | 1924 | or bl,bl |
|
- | 1925 | jz check_values_registers |
|
- | 1926 | mov ebx,[symbol_identifier] |
|
- | 1927 | cmp ebx,[esp+8] |
|
- | 1928 | jne values_not_relative |
|
- | 1929 | check_values_registers: |
|
- | 1930 | cmp ecx,[esp] |
|
- | 1931 | je values_relative |
|
- | 1932 | ror ecx,16 |
|
- | 1933 | xchg ch,cl |
|
- | 1934 | ror ecx,16 |
|
- | 1935 | xchg ch,cl |
|
- | 1936 | cmp ecx,[esp] |
|
- | 1937 | je values_relative |
|
- | 1938 | values_not_relative: |
|
- | 1939 | cmp [compare_type],0F8h |
|
- | 1940 | jne invalid_comparison |
|
- | 1941 | add esp,12+8 |
|
- | 1942 | jmp return_false |
|
1754 | pop ebx |
1943 | invalid_comparison: |
- | 1944 | call recoverable_misuse |
|
- | 1945 | values_relative: |
|
- | 1946 | pop ebx |
|
1755 | cmp [next_pass_needed],0 |
1947 | shl ebx,16 |
1756 | jne values_ok |
- | |
1757 | cmp bl,[value_type] |
1948 | mov bx,[esp] |
1758 | jne invalid_use_of_symbol |
1949 | add esp,8 |
1759 | values_ok: |
- | |
1760 | pop ecx ebx |
1950 | pop ecx ebp |
1761 | cmp [compare_type],'=' |
1951 | cmp [compare_type],'=' |
1762 | je check_equal |
1952 | je check_equal |
1763 | cmp [compare_type],'>' |
1953 | cmp [compare_type],0F1h |
- | 1954 | je check_not_equal |
|
- | 1955 | cmp [compare_type],0F8h |
|
- | 1956 | je return_true |
|
- | 1957 | test ebx,0FFFF0000h |
|
- | 1958 | jz check_less_or_greater |
|
- | 1959 | call recoverable_misuse |
|
- | 1960 | check_less_or_greater: |
|
- | 1961 | cmp [compare_type],'>' |
|
1764 | je check_greater |
1962 | je check_greater |
1765 | cmp [compare_type],'<' |
1963 | cmp [compare_type],'<' |
1766 | je check_less |
1964 | je check_less |
1767 | cmp [compare_type],0F1h |
1965 | cmp [compare_type],0F2h |
1768 | je check_not_equal |
- | |
1769 | cmp [compare_type],0F2h |
- | |
1770 | je check_not_less |
1966 | je check_not_less |
1771 | cmp [compare_type],0F3h |
1967 | cmp [compare_type],0F3h |
1772 | je check_not_greater |
1968 | je check_not_greater |
1773 | jmp invalid_expression |
1969 | jmp invalid_expression |
1774 | check_equal: |
1970 | check_equal: |
1775 | cmp eax,ebx |
1971 | cmp bh,[value_sign] |
- | 1972 | jne return_false |
|
- | 1973 | cmp eax,ebp |
|
1776 | jne return_false |
1974 | jne return_false |
1777 | cmp edx,ecx |
1975 | cmp edx,ecx |
1778 | jne return_false |
1976 | jne return_false |
1779 | jmp return_true |
1977 | jmp return_true |
1780 | check_greater: |
1978 | check_greater: |
1781 | cmp edx,ecx |
1979 | cmp bh,[value_sign] |
- | 1980 | jg return_true |
|
- | 1981 | jl return_false |
|
- | 1982 | cmp edx,ecx |
|
1782 | jl return_true |
1983 | jb return_true |
1783 | jg return_false |
1984 | ja return_false |
1784 | cmp eax,ebx |
1985 | cmp eax,ebp |
1785 | jb return_true |
1986 | jb return_true |
1786 | jae return_false |
1987 | jae return_false |
1787 | check_less: |
1988 | check_less: |
1788 | cmp edx,ecx |
1989 | cmp bh,[value_sign] |
- | 1990 | jg return_false |
|
- | 1991 | jl return_true |
|
- | 1992 | cmp edx,ecx |
|
1789 | jl return_false |
1993 | jb return_false |
1790 | jg return_true |
1994 | ja return_true |
1791 | cmp eax,ebx |
1995 | cmp eax,ebp |
1792 | jbe return_false |
1996 | jbe return_false |
1793 | ja return_true |
1997 | ja return_true |
1794 | check_not_less: |
1998 | check_not_less: |
1795 | cmp edx,ecx |
1999 | cmp bh,[value_sign] |
- | 2000 | jg return_true |
|
- | 2001 | jl return_false |
|
- | 2002 | cmp edx,ecx |
|
1796 | jl return_true |
2003 | jb return_true |
1797 | jg return_false |
2004 | ja return_false |
1798 | cmp eax,ebx |
2005 | cmp eax,ebp |
1799 | jbe return_true |
2006 | jbe return_true |
1800 | ja return_false |
2007 | ja return_false |
1801 | check_not_greater: |
2008 | check_not_greater: |
1802 | cmp edx,ecx |
2009 | cmp bh,[value_sign] |
- | 2010 | jg return_false |
|
- | 2011 | jl return_true |
|
- | 2012 | cmp edx,ecx |
|
1803 | jl return_false |
2013 | jb return_false |
1804 | jg return_true |
2014 | ja return_true |
1805 | cmp eax,ebx |
2015 | cmp eax,ebp |
1806 | jb return_false |
2016 | jb return_false |
1807 | jae return_true |
2017 | jae return_true |
1808 | check_not_equal: |
2018 | check_not_equal: |
1809 | cmp eax,ebx |
2019 | cmp bh,[value_sign] |
- | 2020 | jne return_true |
|
- | 2021 | cmp eax,ebp |
|
1810 | jne return_true |
2022 | jne return_true |
1811 | cmp edx,ecx |
2023 | cmp edx,ecx |
1812 | jne return_true |
2024 | jne return_true |
1813 | jmp return_false |
2025 | jmp return_false |
1814 | logical_number: |
2026 | logical_number: |
1815 | pop ebx edx eax |
2027 | pop ecx ebx eax edx eax |
1816 | or bl,bl |
2028 | or bl,bl |
1817 | jnz invalid_expression |
2029 | jnz invalid_logical_number |
1818 | or eax,edx |
2030 | or cx,cx |
- | 2031 | jz logical_number_ok |
|
- | 2032 | invalid_logical_number: |
|
- | 2033 | call recoverable_misuse |
|
- | 2034 | logical_number_ok: |
|
- | 2035 | test bh,bh |
|
- | 2036 | jnz return_true |
|
- | 2037 | or eax,edx |
|
1819 | jnz return_true |
2038 | jnz return_true |
1820 | jmp return_false |
2039 | jmp return_false |
1821 | check_for_defined: |
2040 | check_for_defined: |
1822 | or bl,-1 |
2041 | or bl,-1 |
1823 | lods word [esi] |
2042 | lods word [esi] |
Line 2014... | Line 2233... | ||
2014 | nothing_to_skip: |
2233 | nothing_to_skip: |
2015 | dec esi |
2234 | dec esi |
2016 | stc |
2235 | stc |
2017 | ret' |
2236 | ret |
2018 | > |
2237 | |
- | 2238 | expand_path: |
|
- | 2239 | lods byte [esi] |
|
- | 2240 | cmp al,'%' |
|
- | 2241 | je environment_variable |
|
- | 2242 | stos byte [edi] |
|
- | 2243 | or al,al |
|
- | 2244 | jnz expand_path |
|
- | 2245 | cmp edi,[memory_end] |
|
- | 2246 | ja out_of_memory |
|
- | 2247 | ret |
|
- | 2248 | environment_variable: |
|
- | 2249 | mov ebx,esi |
|
- | 2250 | find_variable_end: |
|
- | 2251 | lods byte [esi] |
|
- | 2252 | or al,al |
|
- | 2253 | jz not_environment_variable |
|
- | 2254 | cmp al,'%' |
|
- | 2255 | jne find_variable_end |
|
- | 2256 | mov byte [esi-1],0 |
|
- | 2257 | push esi |
|
- | 2258 | mov esi,ebx |
|
- | 2259 | call get_environment_variable |
|
- | 2260 | pop esi |
|
- | 2261 | mov byte [esi-1],'%' |
|
- | 2262 | jmp expand_path |
|
- | 2263 | not_environment_variable: |
|
- | 2264 | mov al,'%' |
|
- | 2265 | stos byte [edi] |
|
- | 2266 | mov esi,ebx |
|
- | 2267 | jmp expand_path |
|
- | 2268 | get_include_directory: |
|
- | 2269 | lods byte [esi] |
|
- | 2270 | cmp al,';' |
|
- | 2271 | je include_directory_ok |
|
- | 2272 | stos byte [edi] |
|
- | 2273 | or al,al |
|
- | 2274 | jnz get_include_directory |
|
- | 2275 | dec esi |
|
- | 2276 | dec edi |
|
- | 2277 | include_directory_ok: |
|
- | 2278 | cmp byte [edi-1],'/' |
|
- | 2279 | je path_separator_ok |
|
- | 2280 | cmp byte [edi-1],'\' |
|
- | 2281 | je path_separator_ok |
|
- | 2282 | mov al,'/' |
|
- | 2283 | stos byte [edi] |
|
- | 2284 | path_separator_ok: |
|
- | 2285 | ret' |
|
- | 2286 | > |