Rev 2664 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2664 | Rev 2665 | ||
---|---|---|---|
Line 74... | Line 74... | ||
74 | ja invalid_operand_size |
74 | ja invalid_operand_size |
75 | cmp al,'(' |
75 | cmp al,'(' |
76 | jne invalid_operand |
76 | jne invalid_operand |
77 | call get_byte_value |
77 | call get_byte_value |
78 | cmp [next_pass_needed],0 |
78 | test eax,eax |
79 | jne int_imm_ok |
- | |
80 | test eax,eax |
- | |
81 | js value_out_of_range |
79 | jns int_imm_ok |
- | 80 | call recoverable_overflow |
|
82 | int_imm_ok: |
81 | int_imm_ok: |
83 | mov ah,al |
82 | mov ah,al |
84 | mov al,0CDh |
83 | mov al,0CDh |
85 | stos word [edi] |
84 | stos word [edi] |
86 | jmp instruction_assembled |
85 | jmp instruction_assembled |
87 | aa_instruction: |
86 | aa_instruction: |
Line 158... | Line 157... | ||
158 | cmp [value_type],4 |
157 | cmp [value_type],4 |
159 | jae long_immediate_not_encodable |
158 | jae long_immediate_not_encodable |
160 | jmp basic_mem_imm_32bit_ok |
159 | jmp basic_mem_imm_32bit_ok |
161 | basic_mem_imm_nosize: |
160 | basic_mem_imm_nosize: |
162 | cmp [error_line],0 |
161 | call recoverable_unknown_size |
163 | jne basic_mem_imm_8bit |
- | |
164 | mov eax,[current_line] |
- | |
165 | mov [error_line],eax |
- | |
166 | mov [error],operand_size_not_specified |
- | |
167 | basic_mem_imm_8bit: |
162 | basic_mem_imm_8bit: |
168 | call get_byte_value |
163 | call get_byte_value |
169 | mov byte [value],al |
164 | mov byte [value],al |
170 | mov al,[base_code] |
165 | mov al,[base_code] |
171 | shr al,3 |
166 | shr al,3 |
172 | mov [postbyte_register],al |
167 | mov [postbyte_register],al |
Line 371... | Line 366... | ||
371 | basic_eax_imm: |
366 | basic_eax_imm: |
372 | add [base_code],5 |
367 | add [base_code],5 |
373 | call store_instruction_code |
368 | call store_instruction_code |
374 | jmp basic_store_imm_32bit |
369 | jmp basic_store_imm_32bit |
375 | single_operand_instruction: |
370 | recoverable_unknown_size: |
- | 371 | cmp [error_line],0 |
|
- | 372 | jne ignore_unknown_size |
|
- | 373 | push [current_line] |
|
- | 374 | pop [error_line] |
|
- | 375 | mov [error],operand_size_not_specified |
|
- | 376 | ignore_unknown_size: |
|
- | 377 | ret |
|
- | 378 | single_operand_instruction: |
|
376 | mov [base_code],0F6h |
379 | mov [base_code],0F6h |
377 | mov [postbyte_register],al |
380 | mov [postbyte_register],al |
378 | lods byte [esi] |
381 | lods byte [esi] |
379 | call get_size_operator |
382 | call get_size_operator |
380 | cmp al,10h |
383 | cmp al,10h |
Line 390... | Line 393... | ||
390 | call operand_autodetect |
393 | call operand_autodetect |
391 | inc [base_code] |
394 | inc [base_code] |
392 | jmp instruction_ready |
395 | jmp instruction_ready |
393 | single_mem_nosize: |
396 | single_mem_nosize: |
394 | cmp [error_line],0 |
397 | call recoverable_unknown_size |
395 | jne single_mem_8bit |
- | |
396 | mov eax,[current_line] |
- | |
397 | mov [error_line],eax |
- | |
398 | mov [error],operand_size_not_specified |
- | |
399 | single_mem_8bit: |
398 | single_mem_8bit: |
400 | jmp instruction_ready |
399 | jmp instruction_ready |
401 | single_reg: |
400 | single_reg: |
402 | lods byte [esi] |
401 | lods byte [esi] |
403 | call convert_register |
402 | call convert_register |
404 | mov bl,al |
403 | mov bl,al |
Line 573... | Line 572... | ||
573 | pop ecx ebx edx |
572 | pop ecx ebx edx |
574 | call store_instruction_with_imm16 |
573 | call store_instruction_with_imm16 |
575 | jmp instruction_assembled |
574 | jmp instruction_assembled |
576 | mov_mem_imm_nosize: |
575 | mov_mem_imm_nosize: |
577 | cmp [error_line],0 |
576 | call recoverable_unknown_size |
578 | jne mov_mem_imm_32bit |
- | |
579 | mov eax,[current_line] |
- | |
580 | mov [error_line],eax |
- | |
581 | mov [error],operand_size_not_specified |
- | |
582 | mov_mem_imm_32bit: |
577 | mov_mem_imm_32bit: |
583 | call operand_32bit |
578 | call operand_32bit |
584 | call get_dword_value |
579 | call get_dword_value |
585 | mov_mem_imm_32bit_store: |
580 | mov_mem_imm_32bit_store: |
586 | mov dword [value],eax |
581 | mov dword [value],eax |
587 | mov [postbyte_register],0 |
582 | mov [postbyte_register],0 |
Line 918... | Line 913... | ||
918 | mov_xrx_64bit: |
913 | mov_xrx_64bit: |
919 | cmp ah,8 |
914 | cmp ah,8 |
920 | je mov_xrx_store |
915 | je mov_xrx_store |
921 | jmp invalid_operand_size |
916 | jmp invalid_operand_size |
922 | cmov_instruction: |
917 | test_instruction: |
923 | mov [base_code],0Fh |
- | |
924 | mov [extended_code],al |
- | |
925 | lods byte [esi] |
- | |
926 | call get_size_operator |
- | |
927 | cmp al,10h |
- | |
928 | jne invalid_operand |
- | |
929 | lods byte [esi] |
- | |
930 | call convert_register |
- | |
931 | mov [postbyte_register],al |
- | |
932 | lods byte [esi] |
- | |
933 | cmp al,',' |
- | |
934 | jne invalid_operand |
- | |
935 | lods byte [esi] |
- | |
936 | call get_size_operator |
- | |
937 | cmp al,'[' |
- | |
938 | je cmov_reg_mem |
- | |
939 | cmp al,10h |
- | |
940 | jne invalid_operand |
- | |
941 | cmov_reg_reg: |
- | |
942 | lods byte [esi] |
- | |
943 | call convert_register |
- | |
944 | mov bl,al |
- | |
945 | mov al,ah |
- | |
946 | call operand_autodetect |
- | |
947 | jmp nomem_instruction_ready |
- | |
948 | cmov_reg_mem: |
- | |
949 | call get_address |
- | |
950 | mov al,[operand_size] |
- | |
951 | call operand_autodetect |
- | |
952 | jmp instruction_ready |
- | |
953 | test_instruction: |
- | |
954 | mov [base_code],84h |
918 | mov [base_code],84h |
955 | lods byte [esi] |
919 | lods byte [esi] |
956 | call get_size_operator |
920 | call get_size_operator |
957 | cmp al,10h |
921 | cmp al,10h |
958 | je test_reg |
922 | je test_reg |
Line 1018... | Line 982... | ||
1018 | pop ecx ebx edx |
982 | pop ecx ebx edx |
1019 | call store_instruction_with_imm16 |
983 | call store_instruction_with_imm16 |
1020 | jmp instruction_assembled |
984 | jmp instruction_assembled |
1021 | test_mem_imm_nosize: |
985 | test_mem_imm_nosize: |
1022 | cmp [error_line],0 |
986 | call recoverable_unknown_size |
1023 | jne test_mem_imm_32bit |
- | |
1024 | mov eax,[current_line] |
- | |
1025 | mov [error_line],eax |
- | |
1026 | mov [error],operand_size_not_specified |
- | |
1027 | test_mem_imm_32bit: |
987 | test_mem_imm_32bit: |
1028 | call operand_32bit |
988 | call operand_32bit |
1029 | call get_dword_value |
989 | call get_dword_value |
1030 | test_mem_imm_32bit_store: |
990 | test_mem_imm_32bit_store: |
1031 | mov dword [value],eax |
991 | mov dword [value],eax |
1032 | mov [postbyte_register],0 |
992 | mov [postbyte_register],0 |
Line 1241... | Line 1201... | ||
1241 | cmp ah,4 |
1201 | cmp ah,4 |
1242 | je push_mem_32bit |
1202 | je push_mem_32bit |
1243 | cmp ah,8 |
1203 | cmp ah,8 |
1244 | je push_mem_64bit |
1204 | je push_mem_64bit |
1245 | cmp [error_line],0 |
1205 | call recoverable_unknown_size |
1246 | jne push_mem_store |
- | |
1247 | mov eax,[current_line] |
- | |
1248 | mov [error_line],eax |
- | |
1249 | mov [error],operand_size_not_specified |
- | |
1250 | jmp push_mem_store |
1206 | jmp push_mem_store |
1251 | push_mem_16bit: |
1207 | push_mem_16bit: |
1252 | test ah,not 2 |
1208 | test ah,not 2 |
1253 | jnz invalid_operand_size |
1209 | jnz invalid_operand_size |
1254 | call operand_16bit |
1210 | call operand_16bit |
1255 | jmp push_mem_store |
1211 | jmp push_mem_store |
Line 1507... | Line 1463... | ||
1507 | cmp ah,4 |
1463 | cmp ah,4 |
1508 | je pop_mem_32bit |
1464 | je pop_mem_32bit |
1509 | cmp ah,8 |
1465 | cmp ah,8 |
1510 | je pop_mem_64bit |
1466 | je pop_mem_64bit |
1511 | cmp [error_line],0 |
1467 | call recoverable_unknown_size |
1512 | jne pop_mem_store |
- | |
1513 | mov eax,[current_line] |
- | |
1514 | mov [error_line],eax |
- | |
1515 | mov [error],operand_size_not_specified |
- | |
1516 | jmp pop_mem_store |
1468 | jmp pop_mem_store |
1517 | pop_mem_16bit: |
1469 | pop_mem_16bit: |
1518 | test ah,not 2 |
1470 | test ah,not 2 |
1519 | jnz invalid_operand_size |
1471 | jnz invalid_operand_size |
1520 | call operand_16bit |
1472 | call operand_16bit |
1521 | jmp pop_mem_store |
1473 | jmp pop_mem_store |
Line 1687... | Line 1639... | ||
1687 | xchg al,[base_code] |
1639 | xchg al,[base_code] |
1688 | mov [postbyte_register],al |
1640 | mov [postbyte_register],al |
1689 | jmp instruction_ready |
1641 | jmp instruction_ready |
1690 | inc_mem_nosize: |
1642 | inc_mem_nosize: |
1691 | cmp [error_line],0 |
1643 | call recoverable_unknown_size |
1692 | jne inc_mem_8bit |
- | |
1693 | mov eax,[current_line] |
- | |
1694 | mov [error_line],eax |
- | |
1695 | mov [error],operand_size_not_specified |
- | |
1696 | inc_mem_8bit: |
1644 | inc_mem_8bit: |
1697 | mov al,0FEh |
1645 | mov al,0FEh |
1698 | xchg al,[base_code] |
1646 | xchg al,[base_code] |
1699 | mov [postbyte_register],al |
1647 | mov [postbyte_register],al |
1700 | jmp instruction_ready |
1648 | jmp instruction_ready |
1701 | inc_reg: |
1649 | inc_reg: |
Line 2026... | Line 1974... | ||
2026 | call operand_autodetect |
1974 | call operand_autodetect |
2027 | mov [base_code],0D3h |
1975 | mov [base_code],0D3h |
2028 | jmp instruction_ready |
1976 | jmp instruction_ready |
2029 | sh_mem_cl_nosize: |
1977 | sh_mem_cl_nosize: |
2030 | cmp [error_line],0 |
1978 | call recoverable_unknown_size |
2031 | jne sh_mem_cl_8bit |
- | |
2032 | mov eax,[current_line] |
- | |
2033 | mov [error_line],eax |
- | |
2034 | mov [error],operand_size_not_specified |
- | |
2035 | sh_mem_cl_8bit: |
1979 | sh_mem_cl_8bit: |
2036 | mov [base_code],0D2h |
1980 | mov [base_code],0D2h |
2037 | jmp instruction_ready |
1981 | jmp instruction_ready |
2038 | sh_mem_imm: |
1982 | sh_mem_imm: |
2039 | mov al,[operand_size] |
1983 | mov al,[operand_size] |
2040 | or al,al |
1984 | or al,al |
Line 2057... | Line 2001... | ||
2057 | sh_mem_1: |
2001 | sh_mem_1: |
2058 | mov [base_code],0D1h |
2002 | mov [base_code],0D1h |
2059 | jmp instruction_ready |
2003 | jmp instruction_ready |
2060 | sh_mem_imm_nosize: |
2004 | sh_mem_imm_nosize: |
2061 | cmp [error_line],0 |
2005 | call recoverable_unknown_size |
2062 | jne sh_mem_imm_8bit |
- | |
2063 | mov eax,[current_line] |
- | |
2064 | mov [error_line],eax |
- | |
2065 | mov [error],operand_size_not_specified |
- | |
2066 | sh_mem_imm_8bit: |
2006 | sh_mem_imm_8bit: |
2067 | cmp byte [value],1 |
2007 | cmp byte [value],1 |
2068 | je sh_mem_1_8bit |
2008 | je sh_mem_1_8bit |
2069 | mov [base_code],0C0h |
2009 | mov [base_code],0C0h |
2070 | call store_instruction_with_imm8 |
2010 | call store_instruction_with_imm8 |
2071 | jmp instruction_assembled |
2011 | jmp instruction_assembled |
Line 2275... | Line 2215... | ||
2275 | movx_mem_store: |
2215 | movx_mem_store: |
2276 | call operand_autodetect |
2216 | call operand_autodetect |
2277 | jmp instruction_ready |
2217 | jmp instruction_ready |
2278 | movx_unknown_size: |
2218 | movx_unknown_size: |
2279 | cmp [error_line],0 |
2219 | call recoverable_unknown_size |
2280 | jne movx_mem_store |
- | |
2281 | mov eax,[current_line] |
- | |
2282 | mov [error_line],eax |
- | |
2283 | mov [error],operand_size_not_specified |
- | |
2284 | jmp movx_mem_store |
2220 | jmp movx_mem_store |
2285 | movx_reg: |
2221 | movx_reg: |
2286 | lods byte [esi] |
2222 | lods byte [esi] |
2287 | call convert_register |
2223 | call convert_register |
2288 | pop ebx |
2224 | pop ebx |
2289 | xchg bl,al |
2225 | xchg bl,al |
Line 2398... | Line 2334... | ||
2398 | mov [extended_code],0BAh |
2334 | mov [extended_code],0BAh |
2399 | call store_instruction_with_imm8 |
2335 | call store_instruction_with_imm8 |
2400 | jmp instruction_assembled |
2336 | jmp instruction_assembled |
2401 | bt_mem_imm_nosize: |
2337 | bt_mem_imm_nosize: |
2402 | cmp [error_line],0 |
2338 | call recoverable_unknown_size |
2403 | jne bt_mem_imm_store |
- | |
2404 | mov eax,[current_line] |
- | |
2405 | mov [error_line],eax |
- | |
2406 | mov [error],operand_size_not_specified |
- | |
2407 | jmp bt_mem_imm_store |
2339 | jmp bt_mem_imm_store |
2408 | bt_reg: |
2340 | bt_reg: |
2409 | lods byte [esi] |
2341 | lods byte [esi] |
2410 | call convert_register |
2342 | call convert_register |
2411 | mov bl,al |
2343 | mov bl,al |
2412 | lods byte [esi] |
2344 | lods byte [esi] |
Line 2455... | Line 2387... | ||
2455 | jmp instruction_assembled |
2387 | jmp instruction_assembled |
2456 | bs_instruction: |
2388 | bs_instruction: |
2457 | mov [extended_code],al |
2389 | mov [extended_code],al |
2458 | mov [base_code],0Fh |
2390 | mov [base_code],0Fh |
2459 | lods byte [esi] |
2391 | call get_reg_mem |
- | 2392 | jc bs_reg_reg |
|
- | 2393 | mov al,[operand_size] |
|
- | 2394 | call operand_autodetect |
|
- | 2395 | jmp instruction_ready |
|
- | 2396 | bs_reg_reg: |
|
- | 2397 | mov al,ah |
|
- | 2398 | call operand_autodetect |
|
- | 2399 | jmp nomem_instruction_ready |
|
- | 2400 | get_reg_mem: |
|
- | 2401 | lods byte [esi] |
|
2460 | call get_size_operator |
2402 | call get_size_operator |
2461 | cmp al,10h |
2403 | cmp al,10h |
2462 | jne invalid_operand |
2404 | jne invalid_operand |
2463 | lods byte [esi] |
2405 | lods byte [esi] |
2464 | call convert_register |
2406 | call convert_register |
Line 2468... | Line 2410... | ||
2468 | jne invalid_operand |
2410 | jne invalid_operand |
2469 | lods byte [esi] |
2411 | lods byte [esi] |
2470 | call get_size_operator |
2412 | call get_size_operator |
2471 | cmp al,10h |
2413 | cmp al,10h |
2472 | je bs_reg_reg |
2414 | je get_reg_reg |
2473 | cmp al,'[' |
2415 | cmp al,'[' |
2474 | jne invalid_argument |
2416 | jne invalid_argument |
2475 | call get_address |
2417 | call get_address |
2476 | mov al,[operand_size] |
2418 | clc |
2477 | call operand_autodetect |
- | |
2478 | jmp instruction_ready |
2419 | ret |
2479 | bs_reg_reg: |
2420 | get_reg_reg: |
2480 | lods byte [esi] |
2421 | lods byte [esi] |
2481 | call convert_register |
2422 | call convert_register |
2482 | mov bl,al |
2423 | mov bl,al |
2483 | mov al,ah |
2424 | stc |
2484 | call operand_autodetect |
2425 | ret |
2485 | jmp nomem_instruction_ready |
2426 | |
2486 | imul_instruction: |
- | |
- | 2427 | imul_instruction: |
|
2487 | mov [base_code],0F6h |
2428 | mov [base_code],0F6h |
2488 | mov [postbyte_register],5 |
2429 | mov [postbyte_register],5 |
2489 | lods byte [esi] |
2430 | lods byte [esi] |
2490 | call get_size_operator |
2431 | call get_size_operator |
2491 | cmp al,10h |
2432 | cmp al,10h |
Line 2501... | Line 2442... | ||
2501 | call operand_autodetect |
2442 | call operand_autodetect |
2502 | inc [base_code] |
2443 | inc [base_code] |
2503 | jmp instruction_ready |
2444 | jmp instruction_ready |
2504 | imul_mem_nosize: |
2445 | imul_mem_nosize: |
2505 | cmp [error_line],0 |
2446 | call recoverable_unknown_size |
2506 | jne imul_mem_8bit |
- | |
2507 | mov eax,[current_line] |
- | |
2508 | mov [error_line],eax |
- | |
2509 | mov [error],operand_size_not_specified |
- | |
2510 | imul_mem_8bit: |
2447 | imul_mem_8bit: |
2511 | jmp instruction_ready |
2448 | jmp instruction_ready |
2512 | imul_reg: |
2449 | imul_reg: |
2513 | lods byte [esi] |
2450 | lods byte [esi] |
2514 | call convert_register |
2451 | call convert_register |
2515 | cmp byte [esi],',' |
2452 | cmp byte [esi],',' |
Line 2890... | Line 2827... | ||
2890 | cmp [jump_type],3 |
2827 | cmp [jump_type],3 |
2891 | je jmp_mem_far |
2828 | je jmp_mem_far |
2892 | cmp [jump_type],2 |
2829 | cmp [jump_type],2 |
2893 | je jmp_mem_near |
2830 | je jmp_mem_near |
2894 | cmp [error_line],0 |
2831 | call recoverable_unknown_size |
2895 | jne jmp_mem_near |
- | |
2896 | mov eax,[current_line] |
- | |
2897 | mov [error_line],eax |
- | |
2898 | mov [error],operand_size_not_specified |
- | |
2899 | jmp_mem_near: |
2832 | jmp_mem_near: |
2900 | cmp [code_type],16 |
2833 | cmp [code_type],16 |
2901 | je jmp_mem_16bit |
2834 | je jmp_mem_16bit |
2902 | cmp [code_type],32 |
2835 | cmp [code_type],32 |
2903 | je jmp_mem_near_32bit |
2836 | je jmp_mem_near_32bit |
2904 | jmp_mem_64bit: |
2837 | jmp_mem_64bit: |
Line 3005... | Line 2938... | ||
3005 | jc jmp_short |
2938 | jc jmp_short |
3006 | jmp_imm_32bit_store: |
2939 | jmp_imm_32bit_store: |
3007 | mov edx,eax |
2940 | mov edx,eax |
3008 | sub edx,3 |
2941 | sub edx,3 |
3009 | mov al,[base_code] |
2942 | jno jmp_imm_32bit_ok |
- | 2943 | cmp [code_type],64 |
|
- | 2944 | je relative_jump_out_of_range |
|
- | 2945 | jmp_imm_32bit_ok: |
|
- | 2946 | mov al,[base_code] |
|
3010 | stos byte [edi] |
2947 | stos byte [edi] |
3011 | mov eax,edx |
2948 | mov eax,edx |
3012 | call mark_relocation |
2949 | call mark_relocation |
3013 | stos dword [edi] |
2950 | stos dword [edi] |
3014 | jmp instruction_assembled |
2951 | jmp instruction_assembled |
Line 3019... | Line 2956... | ||
3019 | call calculate_jump_offset |
2956 | call calculate_jump_offset |
3020 | mov ecx,edx |
2957 | mov ecx,edx |
3021 | cdq |
2958 | cdq |
3022 | cmp edx,ecx |
2959 | cmp edx,ecx |
3023 | jne value_out_of_range |
2960 | jne relative_jump_out_of_range |
3024 | call check_for_short_jump |
2961 | call check_for_short_jump |
3025 | jnc jmp_imm_32bit_store |
2962 | jnc jmp_imm_32bit_store |
3026 | jmp_short: |
2963 | jmp_short: |
3027 | mov ah,al |
2964 | mov ah,al |
3028 | mov al,0EBh |
2965 | mov al,0EBh |
3029 | stos word [edi] |
2966 | stos word [edi] |
Line 3200... | Line 3137... | ||
3200 | call calculate_jump_offset |
3137 | call calculate_jump_offset |
3201 | mov ecx,edx |
3138 | mov ecx,edx |
3202 | cdq |
3139 | cdq |
3203 | cmp edx,ecx |
3140 | cmp edx,ecx |
3204 | jne value_out_of_range |
3141 | jne relative_jump_out_of_range |
3205 | call check_for_short_jump |
3142 | call check_for_short_jump |
3206 | jnc conditional_jump_32bit_store |
3143 | jnc conditional_jump_32bit_store |
3207 | conditional_jump_short: |
3144 | conditional_jump_short: |
3208 | mov ah,al |
3145 | mov ah,al |
3209 | mov al,[base_code] |
3146 | mov al,[base_code] |
3210 | stos word [edi] |
3147 | stos word [edi] |
Line 3305... | Line 3242... | ||
3305 | call calculate_jump_offset |
3242 | call calculate_jump_offset |
3306 | mov ecx,edx |
3243 | mov ecx,edx |
3307 | cdq |
3244 | cdq |
3308 | cmp edx,ecx |
3245 | cmp edx,ecx |
3309 | jne value_out_of_range |
3246 | jne relative_jump_out_of_range |
3310 | jmp make_loop_jump |
3247 | jmp make_loop_jump |
3311 | loop_jump_16bit: |
3248 | loop_jump_16bit: |
3312 | call get_address_word_value |
3249 | call get_address_word_value |
3313 | cmp [code_type],16 |
3250 | cmp [code_type],16 |
3314 | je loop_jump_16bit_prefix_ok |
3251 | je loop_jump_16bit_prefix_ok |
3315 | mov byte [edi],66h |
3252 | mov byte [edi],66h |
Line 3391... | Line 3328... | ||
3391 | cmp bl,8 |
3328 | cmp bl,8 |
3392 | je simple_instruction_64bit |
3329 | je simple_instruction_64bit |
3393 | or bl,bl |
3330 | or bl,bl |
3394 | jnz invalid_operand_size |
3331 | jnz invalid_operand_size |
3395 | cmp [error_line],0 |
3332 | call recoverable_unknown_size |
3396 | jne simple_instruction |
- | |
3397 | mov ebx,[current_line] |
- | |
3398 | mov [error_line],ebx |
- | |
3399 | mov [error],operand_size_not_specified |
- | |
3400 | jmp simple_instruction |
3333 | jmp simple_instruction |
3401 | lods_instruction: |
3334 | lods_instruction: |
3402 | lods byte [esi] |
3335 | lods byte [esi] |
3403 | call get_size_operator |
3336 | call get_size_operator |
3404 | cmp al,'[' |
3337 | cmp al,'[' |
3405 | jne invalid_operand |
3338 | jne invalid_operand |
Line 3933... | Line 3866... | ||
3933 | cmp al,8 |
3866 | cmp al,8 |
3934 | je basic_fpu_mem_64bit |
3867 | je basic_fpu_mem_64bit |
3935 | or al,al |
3868 | or al,al |
3936 | jnz invalid_operand_size |
3869 | jnz invalid_operand_size |
3937 | cmp [error_line],0 |
3870 | call recoverable_unknown_size |
3938 | jne basic_fpu_mem_32bit |
- | |
3939 | mov eax,[current_line] |
- | |
3940 | mov [error_line],eax |
- | |
3941 | mov [error],operand_size_not_specified |
- | |
3942 | basic_fpu_mem_32bit: |
3871 | basic_fpu_mem_32bit: |
3943 | jmp instruction_ready |
3872 | jmp instruction_ready |
3944 | basic_fpu_mem_64bit: |
3873 | basic_fpu_mem_64bit: |
3945 | mov [base_code],0DCh |
3874 | mov [base_code],0DCh |
3946 | jmp instruction_ready |
3875 | jmp instruction_ready |
3947 | basic_fpu_streg: |
3876 | basic_fpu_streg: |
Line 4005... | Line 3934... | ||
4005 | cmp al,4 |
3934 | cmp al,4 |
4006 | je fi_mem_32bit |
3935 | je fi_mem_32bit |
4007 | or al,al |
3936 | or al,al |
4008 | jnz invalid_operand_size |
3937 | jnz invalid_operand_size |
4009 | cmp [error_line],0 |
3938 | call recoverable_unknown_size |
4010 | jne fi_mem_32bit |
- | |
4011 | mov eax,[current_line] |
- | |
4012 | mov [error_line],eax |
- | |
4013 | mov [error],operand_size_not_specified |
- | |
4014 | fi_mem_32bit: |
3939 | fi_mem_32bit: |
4015 | mov [base_code],0DAh |
3940 | mov [base_code],0DAh |
4016 | jmp instruction_ready |
3941 | jmp instruction_ready |
4017 | fi_mem_16bit: |
3942 | fi_mem_16bit: |
4018 | mov [base_code],0DEh |
3943 | mov [base_code],0DEh |
4019 | jmp instruction_ready |
3944 | jmp instruction_ready |
Line 4034... | Line 3959... | ||
4034 | cmp al,10 |
3959 | cmp al,10 |
4035 | je fld_mem_80bit |
3960 | je fld_mem_80bit |
4036 | or al,al |
3961 | or al,al |
4037 | jnz invalid_operand_size |
3962 | jnz invalid_operand_size |
4038 | cmp [error_line],0 |
3963 | call recoverable_unknown_size |
4039 | jne fld_mem_32bit |
- | |
4040 | mov eax,[current_line] |
- | |
4041 | mov [error_line],eax |
- | |
4042 | mov [error],operand_size_not_specified |
- | |
4043 | fld_mem_32bit: |
3964 | fld_mem_32bit: |
4044 | mov [base_code],0D9h |
3965 | mov [base_code],0D9h |
4045 | jmp instruction_ready |
3966 | jmp instruction_ready |
4046 | fld_mem_64bit: |
3967 | fld_mem_64bit: |
4047 | mov [base_code],0DDh |
3968 | mov [base_code],0DDh |
4048 | jmp instruction_ready |
3969 | jmp instruction_ready |
Line 4084... | Line 4005... | ||
4084 | cmp al,8 |
4005 | cmp al,8 |
4085 | je fild_mem_64bit |
4006 | je fild_mem_64bit |
4086 | or al,al |
4007 | or al,al |
4087 | jnz invalid_operand_size |
4008 | jnz invalid_operand_size |
4088 | cmp [error_line],0 |
4009 | call recoverable_unknown_size |
4089 | jne fild_mem_32bit |
- | |
4090 | mov eax,[current_line] |
- | |
4091 | mov [error_line],eax |
- | |
4092 | mov [error],operand_size_not_specified |
- | |
4093 | fild_mem_32bit: |
4010 | fild_mem_32bit: |
4094 | mov [base_code],0DBh |
4011 | mov [base_code],0DBh |
4095 | jmp instruction_ready |
4012 | jmp instruction_ready |
4096 | fild_mem_16bit: |
4013 | fild_mem_16bit: |
4097 | mov [base_code],0DFh |
4014 | mov [base_code],0DFh |
4098 | jmp instruction_ready |
4015 | jmp instruction_ready |
Line 5646... | Line 5563... | ||
5646 | cmp al,'[' |
5563 | cmp al,'[' |
5647 | jne invalid_operand |
5564 | jne invalid_operand |
5648 | call get_address |
5565 | call get_address |
5649 | cmp [operand_size],0 |
5566 | cmp [operand_size],0 |
5650 | je mmx_imm8 |
5567 | je instruction_ready |
5651 | mov al,[mmx_size] |
5568 | mov al,[mmx_size] |
5652 | cmp al,[operand_size] |
5569 | cmp al,[operand_size] |
5653 | jne invalid_operand_size |
5570 | jne invalid_operand_size |
5654 | jmp instruction_ready |
5571 | jmp instruction_ready |
5655 | pmovsx_xmmreg_reg: |
5572 | pmovsx_xmmreg_reg: |
5656 | lods byte [esi] |
5573 | lods byte [esi] |
Line 5852... | Line 5769... | ||
5852 | movntdqa_instruction: |
5769 | movntdqa_instruction: |
5853 | mov [opcode_prefix],66h |
5770 | mov [opcode_prefix],66h |
5854 | mov [base_code],0Fh |
5771 | mov [base_code],0Fh |
5855 | mov [extended_code],38h |
5772 | mov [extended_code],38h |
5856 | mov [supplemental_code],2Ah |
5773 | mov [supplemental_code],al |
5857 | lods byte [esi] |
5774 | lods byte [esi] |
5858 | call get_size_operator |
5775 | call get_size_operator |
5859 | cmp al,10h |
5776 | cmp al,10h |
5860 | jne invalid_operand |
5777 | jne invalid_operand |
5861 | lods byte [esi] |
5778 | lods byte [esi] |
5862 | call convert_xmm_register |
5779 | call convert_xmm_register |
Line 5977... | Line 5894... | ||
5977 | call operand_autodetect |
5894 | call operand_autodetect |
5978 | crc32_reg32_mem_store: |
5895 | crc32_reg32_mem_store: |
5979 | jmp instruction_ready |
5896 | jmp instruction_ready |
5980 | crc32_unknown_size: |
5897 | crc32_unknown_size: |
5981 | cmp [error_line],0 |
5898 | call recoverable_unknown_size |
5982 | jne crc32_reg32_mem_store |
- | |
5983 | mov eax,[current_line] |
5899 | jmp crc32_reg32_mem_store |
5984 | mov [error_line],eax |
- | |
5985 | mov [error],operand_size_not_specified |
- | |
5986 | jmp crc32_reg32_mem_store |
- | |
5987 | crc32_reg32_reg: |
5900 | crc32_reg32_reg: |
5988 | lods byte [esi] |
5901 | lods byte [esi] |
5989 | call convert_register |
5902 | call convert_register |
5990 | mov bl,al |
5903 | mov bl,al |
5991 | mov al,ah |
5904 | mov al,ah |
Line 6299... | Line 6212... | ||
6299 | mov al,ah |
6212 | mov al,ah |
6300 | call operand_autodetect |
6213 | call operand_autodetect |
6301 | jmp nomem_instruction_ready |
6214 | jmp nomem_instruction_ready |
6302 | rdfsbase_instruction: |
6215 | rdfsbase_instruction: |
6303 | mov [opcode_prefix],0F3h |
6216 | cmp [code_type],64 |
- | 6217 | jne illegal_instruction |
|
- | 6218 | mov [opcode_prefix],0F3h |
|
6304 | mov [base_code],0Fh |
6219 | mov [base_code],0Fh |
6305 | mov [extended_code],0AEh |
6220 | mov [extended_code],0AEh |
6306 | mov [postbyte_register],al |
6221 | mov [postbyte_register],al |
6307 | lods byte [esi] |
6222 | lods byte [esi] |
6308 | call get_size_operator |
6223 | call get_size_operator |
Line 6316... | Line 6231... | ||
6316 | je invalid_operand_size |
6231 | je invalid_operand_size |
6317 | call operand_autodetect |
6232 | call operand_autodetect |
6318 | jmp nomem_instruction_ready |
6233 | jmp nomem_instruction_ready |
6319 | 6234 | ||
Line -... | Line 6235... | ||
- | 6235 | xabort_instruction: |
|
- | 6236 | lods byte [esi] |
|
- | 6237 | call get_size_operator |
|
- | 6238 | cmp ah,1 |
|
- | 6239 | ja invalid_operand_size |
|
- | 6240 | cmp al,'(' |
|
- | 6241 | jne invalid_operand |
|
- | 6242 | call get_byte_value |
|
- | 6243 | mov dl,al |
|
- | 6244 | mov ax,0F8C6h |
|
- | 6245 | stos word [edi] |
|
- | 6246 | mov al,dl |
|
- | 6247 | stos byte [edi] |
|
- | 6248 | jmp instruction_assembled |
|
- | 6249 | xbegin_instruction: |
|
- | 6250 | lods byte [esi] |
|
- | 6251 | cmp al,'(' |
|
- | 6252 | jne invalid_operand |
|
- | 6253 | mov al,[code_type] |
|
- | 6254 | cmp al,64 |
|
- | 6255 | je xbegin_64bit |
|
- | 6256 | cmp al,32 |
|
- | 6257 | je xbegin_32bit |
|
- | 6258 | xbegin_16bit: |
|
- | 6259 | call get_address_word_value |
|
- | 6260 | add edi,4 |
|
- | 6261 | call calculate_relative_offset |
|
- | 6262 | sub edi,4 |
|
- | 6263 | shl eax,16 |
|
- | 6264 | mov ax,0F8C7h |
|
- | 6265 | stos dword [edi] |
|
- | 6266 | jmp instruction_assembled |
|
- | 6267 | xbegin_32bit: |
|
- | 6268 | call get_address_dword_value |
|
- | 6269 | jmp xbegin_address_ok |
|
- | 6270 | xbegin_64bit: |
|
- | 6271 | call get_address_qword_value |
|
- | 6272 | xbegin_address_ok: |
|
- | 6273 | add edi,5 |
|
- | 6274 | call calculate_relative_offset |
|
- | 6275 | sub edi,5 |
|
- | 6276 | mov edx,eax |
|
- | 6277 | cwde |
|
- | 6278 | cmp eax,edx |
|
- | 6279 | jne xbegin_rel32 |
|
- | 6280 | mov al,66h |
|
- | 6281 | stos byte [edi] |
|
- | 6282 | mov eax,edx |
|
- | 6283 | shl eax,16 |
|
- | 6284 | mov ax,0F8C7h |
|
- | 6285 | stos dword [edi] |
|
- | 6286 | jmp instruction_assembled |
|
- | 6287 | xbegin_rel32: |
|
- | 6288 | sub edx,1 |
|
- | 6289 | jno xbegin_rel32_ok |
|
- | 6290 | cmp [code_type],64 |
|
- | 6291 | je relative_jump_out_of_range |
|
- | 6292 | xbegin_rel32_ok: |
|
- | 6293 | mov ax,0F8C7h |
|
- | 6294 | stos word [edi] |
|
- | 6295 | mov eax,edx |
|
- | 6296 | stos dword [edi] |
|
- | 6297 | jmp instruction_assembled |
|
- | 6298 | ||
6320 | convert_register: |
6299 | convert_register: |
6321 | mov ah,al |
6300 | mov ah,al |
6322 | shr ah,4 |
6301 | shr ah,4 |
6323 | and al,0Fh |
6302 | and al,0Fh |
6324 | cmp ah,8 |
6303 | cmp ah,8 |
Line 6454... | Line 6433... | ||
6454 | mov [address_high],edx |
6433 | mov [address_high],edx |
6455 | cdq |
6434 | cdq |
6456 | cmp edx,[address_high] |
6435 | cmp edx,[address_high] |
6457 | je address_high_ok |
6436 | je address_high_ok |
6458 | cmp [error_line],0 |
6437 | call recoverable_overflow |
6459 | jne address_high_ok |
- | |
6460 | mov ebx,[current_line] |
- | |
6461 | mov [error_line],ebx |
- | |
6462 | mov [error],value_out_of_range |
- | |
6463 | address_high_ok: |
6438 | address_high_ok: |
6464 | mov edx,eax |
6439 | mov edx,eax |
6465 | ror ecx,16 |
6440 | ror ecx,16 |
6466 | mov cl,[value_type] |
6441 | mov cl,[value_type] |
6467 | rol ecx,16 |
6442 | rol ecx,16 |
6468 | mov bx,0FF00h |
6443 | mov bx,0FF00h |
Line 6557... | Line 6532... | ||
6557 | jz rex_prefix_ok |
6532 | jz rex_prefix_ok |
6558 | cmp [code_type],64 |
6533 | cmp [code_type],64 |
6559 | jne invalid_operand |
6534 | jne invalid_operand |
6560 | test al,0B0h |
6535 | test al,0B0h |
6561 | jnz prefix_conflict |
6536 | jnz disallowed_combination_of_registers |
6562 | stos byte [edi] |
6537 | stos byte [edi] |
6563 | rex_prefix_ok: |
6538 | rex_prefix_ok: |
6564 | mov al,[base_code] |
6539 | mov al,[base_code] |
6565 | stos byte [edi] |
6540 | stos byte [edi] |
6566 | cmp al,0Fh |
6541 | cmp al,0Fh |
6567 | jne instruction_code_ok |
6542 | jne instruction_code_ok |
Line 6615... | Line 6590... | ||
6615 | jnz address_value_ok |
6590 | jnz address_value_ok |
6616 | test bx,8080h |
6591 | test bx,8080h |
6617 | jz address_value_ok |
6592 | jz address_value_ok |
6618 | address_value_out_of_range: |
6593 | address_value_out_of_range: |
6619 | cmp [error_line],0 |
6594 | call recoverable_overflow |
6620 | jne address_value_ok |
- | |
6621 | mov edx,[current_line] |
- | |
6622 | mov [error_line],edx |
- | |
6623 | mov [error],value_out_of_range |
- | |
6624 | address_value_ok: |
6595 | address_value_ok: |
6625 | call store_segment_prefix_if_necessary |
6596 | call store_segment_prefix_if_necessary |
6626 | or bx,bx |
6597 | test [vex_required],4 |
- | 6598 | jnz address_vsib |
|
- | 6599 | or bx,bx |
|
6627 | jz address_immediate |
6600 | jz address_immediate |
6628 | cmp bx,0F800h |
6601 | cmp bx,0F800h |
6629 | je address_rip_based |
6602 | je address_rip_based |
6630 | cmp bx,0F400h |
6603 | cmp bx,0F400h |
6631 | je address_eip_based |
6604 | je address_eip_based |
Line 6731... | Line 6704... | ||
6731 | shl cl,3 |
6704 | shl cl,3 |
6732 | or al,cl |
6705 | or al,cl |
6733 | stos byte [edi] |
6706 | stos byte [edi] |
6734 | ret |
6707 | ret |
6735 | postbyte_32bit: |
6708 | address_vsib: |
- | 6709 | mov al,bl |
|
- | 6710 | shr al,4 |
|
- | 6711 | cmp al,0Ch |
|
- | 6712 | je vector_index_ok |
|
- | 6713 | cmp al,0Dh |
|
- | 6714 | jne invalid_address |
|
- | 6715 | vector_index_ok: |
|
- | 6716 | mov al,bh |
|
- | 6717 | shr al,4 |
|
- | 6718 | cmp al,4 |
|
- | 6719 | je postbyte_32bit |
|
- | 6720 | cmp [code_type],64 |
|
- | 6721 | je address_prefix_ok |
|
- | 6722 | test al,al |
|
- | 6723 | jnz invalid_address |
|
- | 6724 | postbyte_32bit: |
|
6736 | call address_32bit_prefix |
6725 | call address_32bit_prefix |
6737 | jmp address_prefix_ok |
6726 | jmp address_prefix_ok |
6738 | postbyte_64bit: |
6727 | postbyte_64bit: |
6739 | cmp [code_type],64 |
6728 | cmp [code_type],64 |
6740 | jne invalid_address_size |
6729 | jne invalid_address_size |
Line 6777... | Line 6766... | ||
6777 | shl bl,3 |
6766 | shl bl,3 |
6778 | or ah,bl |
6767 | or ah,bl |
6779 | and bh,111b |
6768 | and bh,111b |
6780 | or ah,bh |
6769 | or ah,bh |
6781 | test ch,44h |
6770 | sib_ready: |
- | 6771 | test ch,44h |
|
6782 | jnz sib_address_32bit_value |
6772 | jnz sib_address_32bit_value |
6783 | test ch,88h |
6773 | test ch,88h |
6784 | jnz sib_address_32bit_value |
6774 | jnz sib_address_32bit_value |
6785 | or ch,ch |
6775 | or ch,ch |
6786 | jnz address_sizes_do_not_agree |
6776 | jnz address_sizes_do_not_agree |