Rev 4478 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4478 | Rev 6467 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ; flat assembler core |
1 | ; flat assembler core |
2 | ; Copyright (c) 1999-2013, Tomasz Grysztar. |
2 | ; Copyright (c) 1999-2016, Tomasz Grysztar. |
3 | ; All rights reserved. |
3 | ; All rights reserved. |
Line 4... | Line 4... | ||
4 | 4 | ||
5 | preprocessor: |
5 | preprocessor: |
6 | mov edi,characters |
6 | mov edi,characters |
Line 40... | Line 40... | ||
40 | mov [tagged_blocks],eax |
40 | mov [tagged_blocks],eax |
41 | mov [hash_tree],eax |
41 | mov [hash_tree],eax |
42 | mov [error],eax |
42 | mov [error],eax |
43 | mov [macro_status],al |
43 | mov [macro_status],al |
44 | mov esi,[input_file] |
44 | mov [current_line],eax |
- | 45 | mov esi,[initial_definitions] |
|
- | 46 | test esi,esi |
|
- | 47 | jz predefinitions_ok |
|
- | 48 | process_predefinitions: |
|
- | 49 | movzx ecx,byte [esi] |
|
- | 50 | test ecx,ecx |
|
- | 51 | jz predefinitions_ok |
|
- | 52 | inc esi |
|
- | 53 | lea eax,[esi+ecx] |
|
- | 54 | push eax |
|
- | 55 | mov ch,10b |
|
- | 56 | call add_preprocessor_symbol |
|
- | 57 | pop esi |
|
- | 58 | mov edi,[memory_start] |
|
- | 59 | mov [edx+8],edi |
|
- | 60 | convert_predefinition: |
|
- | 61 | cmp edi,[memory_end] |
|
- | 62 | jae out_of_memory |
|
- | 63 | lods byte [esi] |
|
- | 64 | or al,al |
|
- | 65 | jz predefinition_converted |
|
- | 66 | cmp al,20h |
|
- | 67 | je convert_predefinition |
|
- | 68 | mov ah,al |
|
- | 69 | mov ebx,characters |
|
- | 70 | xlat byte [ebx] |
|
- | 71 | or al,al |
|
- | 72 | jz predefinition_separator |
|
- | 73 | cmp ah,27h |
|
- | 74 | je predefinition_string |
|
- | 75 | cmp ah,22h |
|
- | 76 | je predefinition_string |
|
- | 77 | mov byte [edi],1Ah |
|
- | 78 | scas word [edi] |
|
- | 79 | xchg al,ah |
|
- | 80 | stos byte [edi] |
|
- | 81 | mov ebx,characters |
|
- | 82 | xor ecx,ecx |
|
- | 83 | predefinition_symbol: |
|
- | 84 | lods byte [esi] |
|
- | 85 | stos byte [edi] |
|
- | 86 | xlat byte [ebx] |
|
- | 87 | or al,al |
|
- | 88 | loopnzd predefinition_symbol |
|
- | 89 | neg ecx |
|
- | 90 | cmp ecx,255 |
|
- | 91 | ja invalid_definition |
|
- | 92 | mov ebx,edi |
|
- | 93 | sub ebx,ecx |
|
- | 94 | mov byte [ebx-2],cl |
|
- | 95 | found_predefinition_separator: |
|
- | 96 | dec edi |
|
- | 97 | mov ah,[esi-1] |
|
- | 98 | predefinition_separator: |
|
- | 99 | xchg al,ah |
|
- | 100 | or al,al |
|
- | 101 | jz predefinition_converted |
|
- | 102 | cmp al,20h |
|
- | 103 | je convert_predefinition |
|
- | 104 | cmp al,3Bh |
|
- | 105 | je invalid_definition |
|
- | 106 | cmp al,5Ch |
|
- | 107 | je predefinition_backslash |
|
- | 108 | stos byte [edi] |
|
- | 109 | jmp convert_predefinition |
|
- | 110 | predefinition_string: |
|
- | 111 | mov al,22h |
|
- | 112 | stos byte [edi] |
|
- | 113 | scas dword [edi] |
|
- | 114 | mov ebx,edi |
|
- | 115 | copy_predefinition_string: |
|
- | 116 | lods byte [esi] |
|
- | 117 | stos byte [edi] |
|
- | 118 | or al,al |
|
- | 119 | jz invalid_definition |
|
- | 120 | cmp al,ah |
|
- | 121 | jne copy_predefinition_string |
|
- | 122 | lods byte [esi] |
|
- | 123 | cmp al,ah |
|
- | 124 | je copy_predefinition_string |
|
- | 125 | dec esi |
|
- | 126 | dec edi |
|
- | 127 | mov eax,edi |
|
- | 128 | sub eax,ebx |
|
- | 129 | mov [ebx-4],eax |
|
- | 130 | jmp convert_predefinition |
|
- | 131 | predefinition_backslash: |
|
- | 132 | mov byte [edi],0 |
|
- | 133 | lods byte [esi] |
|
- | 134 | or al,al |
|
- | 135 | jz invalid_definition |
|
- | 136 | cmp al,20h |
|
- | 137 | je invalid_definition |
|
- | 138 | cmp al,3Bh |
|
- | 139 | je invalid_definition |
|
- | 140 | mov al,1Ah |
|
- | 141 | stos byte [edi] |
|
- | 142 | mov ecx,edi |
|
- | 143 | mov ax,5C01h |
|
- | 144 | stos word [edi] |
|
- | 145 | dec esi |
|
- | 146 | group_predefinition_backslashes: |
|
- | 147 | lods byte [esi] |
|
- | 148 | cmp al,5Ch |
|
- | 149 | jne predefinition_backslashed_symbol |
|
- | 150 | stos byte [edi] |
|
- | 151 | inc byte [ecx] |
|
- | 152 | jmp group_predefinition_backslashes |
|
- | 153 | predefinition_backslashed_symbol: |
|
- | 154 | cmp al,20h |
|
- | 155 | je invalid_definition |
|
- | 156 | cmp al,22h |
|
- | 157 | je invalid_definition |
|
- | 158 | cmp al,27h |
|
- | 159 | je invalid_definition |
|
- | 160 | cmp al,3Bh |
|
- | 161 | je invalid_definition |
|
- | 162 | mov ah,al |
|
- | 163 | mov ebx,characters |
|
- | 164 | xlat byte [ebx] |
|
- | 165 | or al,al |
|
- | 166 | jz predefinition_backslashed_symbol_character |
|
- | 167 | mov al,ah |
|
- | 168 | convert_predefinition_backslashed_symbol: |
|
- | 169 | stos byte [edi] |
|
- | 170 | xlat byte [ebx] |
|
- | 171 | or al,al |
|
- | 172 | jz found_predefinition_separator |
|
- | 173 | inc byte [ecx] |
|
- | 174 | jz invalid_definition |
|
- | 175 | lods byte [esi] |
|
- | 176 | jmp convert_predefinition_backslashed_symbol |
|
- | 177 | predefinition_backslashed_symbol_character: |
|
- | 178 | mov al,ah |
|
- | 179 | stos byte [edi] |
|
- | 180 | inc byte [ecx] |
|
- | 181 | jmp convert_predefinition |
|
- | 182 | predefinition_converted: |
|
- | 183 | mov [memory_start],edi |
|
- | 184 | sub edi,[edx+8] |
|
- | 185 | mov [edx+12],edi |
|
- | 186 | jmp process_predefinitions |
|
- | 187 | predefinitions_ok: |
|
- | 188 | mov esi,[input_file] |
|
45 | mov edx,esi |
189 | mov edx,esi |
46 | call open |
190 | call open |
47 | jc main_file_not_found |
191 | jc main_file_not_found |
48 | mov edi,[memory_start] |
192 | mov edi,[memory_start] |
49 | call preprocess_file |
193 | call preprocess_file |
Line 76... | Line 220... | ||
76 | earliest_postponed_found: |
220 | earliest_postponed_found: |
77 | mov [ebx],eax |
221 | mov [ebx],eax |
78 | call use_postponed_macro |
222 | call use_postponed_macro |
79 | pop edx |
223 | pop edx |
80 | jmp process_postponed_list |
224 | cmp [macro_status],0 |
- | 225 | je process_postponed_list |
|
81 | preprocessing_finished: |
226 | mov eax,[error_line] |
- | 227 | mov [current_line],eax |
|
- | 228 | jmp incomplete_macro |
|
- | 229 | preprocessing_finished: |
|
82 | mov [source_start],edi |
230 | mov [source_start],edi |
83 | ret |
231 | ret |
84 | use_postponed_macro: |
232 | use_postponed_macro: |
85 | lea esi,[edi-1] |
233 | lea esi,[edi-1] |
86 | push ecx esi |
234 | push ecx esi |
Line 273... | Line 421... | ||
273 | cmp al,5Ch |
421 | cmp al,5Ch |
274 | jne backslashed_symbol |
422 | jne backslashed_symbol |
275 | stos byte [edi] |
423 | stos byte [edi] |
276 | inc byte [ecx] |
424 | inc byte [ecx] |
277 | jmp group_backslashes |
425 | jz name_too_long |
- | 426 | jmp group_backslashes |
|
278 | no_end_quote: |
427 | no_end_quote: |
279 | mov byte [ebx-5],0 |
428 | mov byte [ebx-5],0 |
280 | jmp missing_end_quote |
429 | jmp missing_end_quote |
281 | backslashed_symbol: |
430 | backslashed_symbol: |
282 | cmp al,1Ah |
431 | cmp al,1Ah |
Line 894... | Line 1043... | ||
894 | movzx eax,byte [esi] |
1043 | movzx eax,byte [esi] |
895 | inc esi |
1044 | inc esi |
896 | add esi,eax |
1045 | add esi,eax |
897 | lods byte [esi] |
1046 | lods byte [esi] |
898 | cmp al,'=' |
1047 | cmp al,':' |
- | 1048 | je macro_argument_with_default_value |
|
- | 1049 | cmp al,'=' |
|
899 | je macro_argument_with_default_value |
1050 | je macro_argument_with_default_value |
900 | cmp al,'*' |
1051 | cmp al,'*' |
901 | jne macro_argument_end |
1052 | jne macro_argument_end |
902 | lods byte [esi] |
1053 | lods byte [esi] |
903 | macro_argument_end: |
1054 | macro_argument_end: |
904 | cmp al,',' |
1055 | cmp al,',' |
905 | je skip_macro_arguments |
1056 | je skip_macro_arguments |
906 | cmp al,']' |
1057 | cmp al,'&' |
- | 1058 | je macro_arguments_finisher |
|
- | 1059 | cmp al,']' |
|
907 | jne end_macro_arguments |
1060 | jne end_macro_arguments |
908 | lods byte [esi] |
1061 | not ebp |
909 | not ebp |
- | |
910 | end_macro_arguments: |
1062 | macro_arguments_finisher: |
- | 1063 | lods byte [esi] |
|
- | 1064 | end_macro_arguments: |
|
911 | or ebp,ebp |
1065 | or ebp,ebp |
912 | jnz invalid_macro_arguments |
1066 | jnz invalid_macro_arguments |
913 | or al,al |
1067 | or al,al |
914 | jz line_preprocessed |
1068 | jz line_preprocessed |
915 | cmp al,'{' |
1069 | cmp al,'{' |
916 | je found_macro_block |
1070 | je found_macro_block |
917 | jmp invalid_macro_arguments |
1071 | jmp invalid_macro_arguments |
918 | macro_argument_with_default_value: |
1072 | macro_argument_with_default_value: |
919 | or [default_argument_value],-1 |
1073 | or [skip_default_argument_value],-1 |
920 | call skip_macro_argument_value |
1074 | call skip_macro_argument_value |
921 | inc esi |
1075 | inc esi |
922 | jmp macro_argument_end |
1076 | jmp macro_argument_end |
923 | skip_macro_argument_value: |
1077 | skip_macro_argument_value: |
924 | cmp byte [esi],'<' |
1078 | cmp byte [esi],'<' |
925 | jne simple_argument |
1079 | jne simple_argument |
Line 954... | Line 1108... | ||
954 | or al,al |
1108 | or al,al |
955 | jz argument_value_end |
1109 | jz argument_value_end |
956 | cmp al,',' |
1110 | cmp al,',' |
957 | je argument_value_end |
1111 | je argument_value_end |
958 | cmp [default_argument_value],0 |
1112 | cmp [skip_default_argument_value],0 |
959 | je invalid_macro_arguments |
1113 | je invalid_macro_arguments |
960 | cmp al,'{' |
1114 | cmp al,'{' |
961 | je argument_value_end |
1115 | je argument_value_end |
962 | or ebp,ebp |
1116 | cmp al,'&' |
- | 1117 | je argument_value_end |
|
- | 1118 | or ebp,ebp |
|
963 | jz invalid_macro_arguments |
1119 | jz invalid_macro_arguments |
964 | cmp al,']' |
1120 | cmp al,']' |
965 | je argument_value_end |
1121 | je argument_value_end |
966 | jmp invalid_macro_arguments |
1122 | jmp invalid_macro_arguments |
967 | simple_argument: |
1123 | simple_argument: |
Line 973... | Line 1129... | ||
973 | cmp al,22h |
1129 | cmp al,22h |
974 | je argument_string |
1130 | je argument_string |
975 | cmp al,1Ah |
1131 | cmp al,1Ah |
976 | je argument_symbol |
1132 | je argument_symbol |
977 | cmp [default_argument_value],0 |
1133 | cmp [skip_default_argument_value],0 |
978 | je simple_argument |
1134 | je simple_argument |
979 | cmp al,'{' |
1135 | cmp al,'{' |
980 | je argument_value_end |
1136 | je argument_value_end |
981 | or ebp,ebp |
1137 | cmp al,'&' |
- | 1138 | je argument_value_end |
|
- | 1139 | or ebp,ebp |
|
982 | jz simple_argument |
1140 | jz simple_argument |
983 | cmp al,']' |
1141 | cmp al,']' |
984 | je argument_value_end |
1142 | je argument_value_end |
985 | argument_symbol: |
1143 | argument_symbol: |
986 | movzx eax,byte [esi] |
1144 | movzx eax,byte [esi] |
Line 1054... | Line 1212... | ||
1054 | mov esi,edx |
1212 | mov esi,edx |
1055 | xor ecx,ecx |
1213 | xor ecx,ecx |
1056 | call add_preprocessor_symbol |
1214 | call add_preprocessor_symbol |
1057 | mov eax,[current_line] |
1215 | mov eax,[current_line] |
1058 | mov [edx+12],eax |
1216 | mov [error_line],eax |
- | 1217 | mov [edx+12],eax |
|
1059 | pop esi |
1218 | pop esi |
1060 | mov [edx+8],esi |
1219 | mov [edx+8],esi |
1061 | mov al,[macro_status] |
1220 | mov al,[macro_status] |
1062 | and al,0F0h |
1221 | and al,0F0h |
1063 | or al,1 |
1222 | or al,1 |
1064 | mov [macro_status],al |
1223 | mov [macro_status],al |
1065 | mov eax,[current_line] |
1224 | lods byte [esi] |
1066 | mov [error_line],eax |
- | |
1067 | lods byte [esi] |
- | |
1068 | or al,al |
1225 | or al,al |
1069 | jz line_preprocessed |
1226 | jz line_preprocessed |
1070 | cmp al,'{' |
1227 | cmp al,'{' |
1071 | jne unexpected_characters |
1228 | jne unexpected_characters |
1072 | jmp found_macro_block |
1229 | jmp found_macro_block |
Line 1078... | Line 1235... | ||
1078 | jmp define_instant_macro |
1235 | jmp define_instant_macro |
1079 | irps_directive: |
1236 | irps_directive: |
1080 | mov [base_code],2 |
1237 | mov [base_code],2 |
1081 | jmp define_instant_macro |
1238 | jmp define_instant_macro |
1082 | match_directive: |
1239 | irpv_directive: |
- | 1240 | mov [base_code],3 |
|
- | 1241 | jmp define_instant_macro |
|
- | 1242 | match_directive: |
|
1083 | mov [base_code],10h |
1243 | mov [base_code],10h |
1084 | define_instant_macro: |
1244 | define_instant_macro: |
1085 | mov al,[macro_status] |
1245 | mov al,[macro_status] |
1086 | and al,0F0h |
1246 | and al,0F0h |
1087 | or al,8+1 |
1247 | or al,8+1 |
Line 1553... | Line 1713... | ||
1553 | cmp al,',' |
1713 | cmp al,',' |
1554 | je next_argument |
1714 | je next_argument |
1555 | cmp al,']' |
1715 | cmp al,']' |
1556 | je next_arguments_group |
1716 | je next_arguments_group |
1557 | dec esi |
1717 | cmp al,'&' |
- | 1718 | je arguments_end |
|
- | 1719 | dec esi |
|
1558 | jmp arguments_end |
1720 | jmp arguments_end |
1559 | next_argument: |
1721 | next_argument: |
1560 | cmp byte [ebx],',' |
1722 | cmp byte [ebx],',' |
1561 | jne process_macro_arguments |
1723 | jne process_macro_arguments |
1562 | inc ebx |
1724 | inc ebx |
Line 1573... | Line 1735... | ||
1573 | movzx ecx,al |
1735 | movzx ecx,al |
1574 | mov eax,[counter_limit] |
1736 | mov eax,[counter_limit] |
1575 | call add_macro_symbol |
1737 | call add_macro_symbol |
1576 | add esi,ecx |
1738 | add esi,ecx |
1577 | xchg esi,ebx |
1739 | xor eax,eax |
- | 1740 | mov [default_argument_value],eax |
|
- | 1741 | cmp byte [esi],'*' |
|
- | 1742 | je required_value |
|
- | 1743 | cmp byte [esi],':' |
|
- | 1744 | je get_default_value |
|
- | 1745 | cmp byte [esi],'=' |
|
- | 1746 | jne default_value_ok |
|
- | 1747 | get_default_value: |
|
- | 1748 | inc esi |
|
- | 1749 | mov [default_argument_value],esi |
|
- | 1750 | or [skip_default_argument_value],-1 |
|
- | 1751 | call skip_macro_argument_value |
|
- | 1752 | jmp default_value_ok |
|
- | 1753 | required_value: |
|
- | 1754 | inc esi |
|
- | 1755 | or [default_argument_value],-1 |
|
- | 1756 | default_value_ok: |
|
- | 1757 | xchg esi,ebx |
|
1578 | mov [edx+12],esi |
1758 | mov [edx+12],esi |
1579 | mov [default_argument_value],0 |
1759 | mov [skip_default_argument_value],0 |
1580 | call skip_macro_argument_value |
1760 | cmp byte [ebx],'&' |
- | 1761 | je greedy_macro_argument |
|
- | 1762 | call skip_macro_argument_value |
|
1581 | call finish_macro_argument |
1763 | call finish_macro_argument |
1582 | xchg esi,ebx |
1764 | jmp got_macro_argument |
- | 1765 | greedy_macro_argument: |
|
- | 1766 | call skip_foreign_line |
|
- | 1767 | dec esi |
|
- | 1768 | mov eax,[edx+12] |
|
- | 1769 | mov ecx,esi |
|
- | 1770 | sub ecx,eax |
|
- | 1771 | mov [edx+8],ecx |
|
- | 1772 | got_macro_argument: |
|
- | 1773 | xchg esi,ebx |
|
1583 | cmp byte [esi],'=' |
1774 | cmp dword [edx+8],0 |
1584 | je argument_with_default_value |
- | |
1585 | cmp byte [esi],'*' |
- | |
1586 | jne macro_argument_ok |
- | |
1587 | cmp dword [edx+8],0 |
- | |
1588 | je invalid_macro_arguments |
1775 | jne macro_argument_ok |
- | 1776 | mov eax,[default_argument_value] |
|
- | 1777 | or eax,eax |
|
- | 1778 | jz macro_argument_ok |
|
- | 1779 | cmp eax,-1 |
|
- | 1780 | je invalid_macro_arguments |
|
1589 | inc esi |
1781 | mov [edx+12],eax |
1590 | macro_argument_ok: |
1782 | call finish_macro_argument |
- | 1783 | macro_argument_ok: |
|
1591 | ret |
1784 | ret |
1592 | finish_macro_argument: |
1785 | finish_macro_argument: |
1593 | mov eax,[edx+12] |
1786 | mov eax,[edx+12] |
1594 | mov ecx,esi |
1787 | mov ecx,esi |
1595 | sub ecx,eax |
1788 | sub ecx,eax |
Line 1600... | Line 1793... | ||
1600 | or ecx,80000000h |
1793 | or ecx,80000000h |
1601 | argument_value_length_ok: |
1794 | argument_value_length_ok: |
1602 | mov [edx+8],ecx |
1795 | mov [edx+8],ecx |
1603 | ret |
1796 | ret |
1604 | argument_with_default_value: |
1797 | arguments_end: |
1605 | inc esi |
- | |
1606 | push esi |
- | |
1607 | or [default_argument_value],-1 |
- | |
1608 | call skip_macro_argument_value |
- | |
1609 | pop eax |
- | |
1610 | cmp dword [edx+8],0 |
- | |
1611 | jne macro_argument_ok |
- | |
1612 | mov [edx+12],eax |
- | |
1613 | call finish_macro_argument |
- | |
1614 | jmp macro_argument_ok |
- | |
1615 | arguments_end: |
- | |
1616 | cmp byte [ebx],0 |
1798 | cmp byte [ebx],0 |
1617 | jne invalid_macro_arguments |
1799 | jne invalid_macro_arguments |
1618 | mov eax,[esp+4] |
1800 | mov eax,[esp+4] |
1619 | dec eax |
1801 | dec eax |
1620 | call process_macro |
1802 | call process_macro |
Line 1736... | Line 1918... | ||
1736 | lea esi,[esi+2+eax] |
1918 | lea esi,[esi+2+eax] |
1737 | lods byte [esi] |
1919 | lods byte [esi] |
1738 | cmp [base_code],1 |
1920 | cmp [base_code],1 |
1739 | ja irps_name_ok |
1921 | ja irps_name_ok |
1740 | cmp al,'=' |
1922 | cmp al,':' |
- | 1923 | je irp_with_default_value |
|
- | 1924 | cmp al,'=' |
|
1741 | je irp_with_default_value |
1925 | je irp_with_default_value |
1742 | cmp al,'*' |
1926 | cmp al,'*' |
1743 | jne irp_name_ok |
1927 | jne irp_name_ok |
1744 | lods byte [esi] |
1928 | lods byte [esi] |
1745 | irp_name_ok: |
1929 | irp_name_ok: |
Line 1747... | Line 1931... | ||
1747 | jne invalid_macro_arguments |
1931 | jne invalid_macro_arguments |
1748 | jmp irp_parameters_start |
1932 | jmp irp_parameters_start |
1749 | irp_with_default_value: |
1933 | irp_with_default_value: |
1750 | xor ebp,ebp |
1934 | xor ebp,ebp |
1751 | or [default_argument_value],-1 |
1935 | or [skip_default_argument_value],-1 |
1752 | call skip_macro_argument_value |
1936 | call skip_macro_argument_value |
1753 | inc esi |
1937 | cmp byte [esi],',' |
- | 1938 | jne invalid_macro_arguments |
|
- | 1939 | inc esi |
|
1754 | jmp irp_parameters_start |
1940 | jmp irp_parameters_start |
1755 | irps_name_ok: |
1941 | irps_name_ok: |
1756 | cmp al,',' |
1942 | cmp al,',' |
1757 | jne invalid_macro_arguments |
1943 | jne invalid_macro_arguments |
1758 | mov al,[esi] |
1944 | cmp [base_code],3 |
- | 1945 | je irp_parameters_start |
|
- | 1946 | mov al,[esi] |
|
1759 | or al,al |
1947 | or al,al |
1760 | jz instant_macro_done |
1948 | jz instant_macro_done |
1761 | cmp al,'{' |
1949 | cmp al,'{' |
1762 | je instant_macro_done |
1950 | je instant_macro_done |
1763 | irp_parameters_start: |
1951 | irp_parameters_start: |
Line 1767... | Line 1955... | ||
1767 | mov [macro_symbols],eax |
1955 | mov [macro_symbols],eax |
1768 | push [counter_limit] |
1956 | push [counter_limit] |
1769 | mov [counter_limit],eax |
1957 | mov [counter_limit],eax |
1770 | mov [struc_name],eax |
1958 | mov [struc_name],eax |
1771 | mov ebx,esi |
1959 | cmp [base_code],3 |
- | 1960 | je get_irpv_parameter |
|
- | 1961 | mov ebx,esi |
|
1772 | cmp [base_code],1 |
1962 | cmp [base_code],2 |
1773 | ja get_irps_parameter |
1963 | je get_irps_parameter |
1774 | mov edx,[parameters_end] |
1964 | mov edx,[parameters_end] |
1775 | mov al,[edx] |
1965 | mov al,[edx] |
1776 | push eax |
1966 | push eax |
1777 | mov byte [edx],0 |
1967 | mov byte [edx],0 |
1778 | get_irp_parameter: |
1968 | get_irp_parameter: |
1779 | inc [counter_limit] |
1969 | inc [counter_limit] |
Line 1820... | Line 2010... | ||
1820 | jne get_irps_parameter |
2010 | jne get_irps_parameter |
1821 | irps_parameters_end: |
2011 | irps_parameters_end: |
1822 | mov esi,ebx |
2012 | mov esi,ebx |
1823 | jmp instant_macro_parameters_ok |
2013 | jmp instant_macro_parameters_ok |
1824 | do_match: |
2014 | get_irpv_parameter: |
- | 2015 | lods byte [esi] |
|
- | 2016 | cmp al,1Ah |
|
- | 2017 | jne invalid_macro_arguments |
|
- | 2018 | lods byte [esi] |
|
- | 2019 | mov ebp,esi |
|
- | 2020 | mov cl,al |
|
- | 2021 | mov ch,10b |
|
- | 2022 | call get_preprocessor_symbol |
|
- | 2023 | jc instant_macro_finish |
|
- | 2024 | push edx |
|
- | 2025 | mark_variable_value: |
|
- | 2026 | inc [counter_limit] |
|
- | 2027 | mov [edx+4],ebp |
|
- | 2028 | next_variable_value: |
|
- | 2029 | mov edx,[edx] |
|
- | 2030 | or edx,edx |
|
- | 2031 | jz variable_values_marked |
|
- | 2032 | mov eax,[edx+4] |
|
- | 2033 | cmp eax,1 |
|
- | 2034 | jbe next_variable_value |
|
- | 2035 | mov esi,ebp |
|
- | 2036 | movzx ecx,byte [esi-1] |
|
- | 2037 | xchg edi,eax |
|
- | 2038 | repe cmps byte [esi],[edi] |
|
- | 2039 | xchg edi,eax |
|
- | 2040 | je mark_variable_value |
|
- | 2041 | jmp next_variable_value |
|
- | 2042 | variable_values_marked: |
|
- | 2043 | pop edx |
|
- | 2044 | push [counter_limit] |
|
- | 2045 | add_irpv_value: |
|
- | 2046 | push edx |
|
- | 2047 | mov esi,[instant_macro_start] |
|
- | 2048 | inc esi |
|
- | 2049 | lods byte [esi] |
|
- | 2050 | movzx ecx,al |
|
- | 2051 | mov eax,[esp+4] |
|
- | 2052 | call add_macro_symbol |
|
- | 2053 | mov ebx,edx |
|
- | 2054 | pop edx |
|
- | 2055 | mov ecx,[edx+12] |
|
- | 2056 | mov eax,[edx+8] |
|
- | 2057 | mov [ebx+12],eax |
|
- | 2058 | mov [ebx+8],ecx |
|
- | 2059 | collect_next_variable_value: |
|
- | 2060 | mov edx,[edx] |
|
- | 2061 | or edx,edx |
|
- | 2062 | jz variable_values_collected |
|
- | 2063 | cmp ebp,[edx+4] |
|
- | 2064 | jne collect_next_variable_value |
|
- | 2065 | dec dword [esp] |
|
- | 2066 | jnz add_irpv_value |
|
- | 2067 | variable_values_collected: |
|
- | 2068 | pop eax |
|
- | 2069 | mov esi,ebp |
|
- | 2070 | movzx ecx,byte [esi-1] |
|
- | 2071 | add esi,ecx |
|
- | 2072 | cmp byte [esi],0 |
|
- | 2073 | je instant_macro_parameters_ok |
|
- | 2074 | cmp byte [esi],'{' |
|
- | 2075 | jne invalid_macro_arguments |
|
- | 2076 | jmp instant_macro_parameters_ok |
|
- | 2077 | ||
- | 2078 | do_match: |
|
1825 | mov ebx,esi |
2079 | mov ebx,esi |
1826 | call skip_pattern |
2080 | call skip_pattern |
1827 | call exact_match |
2081 | call exact_match |
1828 | mov edx,edi |
2082 | mov edx,edi |
1829 | mov al,[ebx] |
2083 | mov al,[ebx] |
Line 2449... | Line 2703... | ||
2449 | mov [macro_block_line],eax |
2703 | mov [macro_block_line],eax |
2450 | mov [macro_block_line_number],ecx |
2704 | mov [macro_block_line_number],ecx |
2451 | jmp process_macro_line |
2705 | jmp process_macro_line |
2452 | close_macro_block: |
2706 | close_macro_block: |
2453 | cmp [counter],0 |
2707 | cmp esi,[macro_block] |
- | 2708 | je block_closed |
|
- | 2709 | cmp [counter],0 |
|
2454 | je block_closed |
2710 | je block_closed |
2455 | jl reverse_counter |
2711 | jl reverse_counter |
2456 | mov eax,[counter] |
2712 | mov eax,[counter] |
2457 | cmp eax,[counter_limit] |
2713 | cmp eax,[counter_limit] |
2458 | je block_closed |
2714 | je block_closed |