Rev 4039 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4039 | Rev 4478 | ||
---|---|---|---|
Line 46... | Line 46... | ||
46 | call open |
46 | call open |
47 | jc main_file_not_found |
47 | jc main_file_not_found |
48 | mov edi,[memory_start] |
48 | mov edi,[memory_start] |
49 | call preprocess_file |
49 | call preprocess_file |
50 | mov eax,[error_line] |
50 | cmp [macro_status],0 |
- | 51 | je process_postponed |
|
- | 52 | mov eax,[error_line] |
|
51 | mov [current_line],eax |
53 | mov [current_line],eax |
52 | cmp [macro_status],0 |
54 | jmp incomplete_macro |
53 | jne incomplete_macro |
55 | process_postponed: |
- | 56 | mov edx,hash_tree |
|
- | 57 | mov ecx,32 |
|
- | 58 | find_postponed_list: |
|
- | 59 | mov edx,[edx] |
|
- | 60 | or edx,edx |
|
- | 61 | loopnz find_postponed_list |
|
- | 62 | jz preprocessing_finished |
|
- | 63 | process_postponed_list: |
|
- | 64 | mov eax,[edx] |
|
- | 65 | or eax,eax |
|
- | 66 | jz preprocessing_finished |
|
- | 67 | push edx |
|
- | 68 | mov ebx,edx |
|
- | 69 | find_earliest_postponed: |
|
- | 70 | mov eax,[edx] |
|
- | 71 | or eax,eax |
|
- | 72 | jz earliest_postponed_found |
|
- | 73 | mov ebx,edx |
|
- | 74 | mov edx,eax |
|
- | 75 | jmp find_earliest_postponed |
|
- | 76 | earliest_postponed_found: |
|
- | 77 | mov [ebx],eax |
|
- | 78 | call use_postponed_macro |
|
54 | mov [source_start],edi |
79 | pop edx |
- | 80 | jmp process_postponed_list |
|
- | 81 | preprocessing_finished: |
|
- | 82 | mov [source_start],edi |
|
55 | ret |
83 | ret |
56 | 84 | use_postponed_macro: |
|
- | 85 | lea esi,[edi-1] |
|
- | 86 | push ecx esi |
|
- | 87 | mov [struc_name],0 |
|
- | 88 | jmp use_macro |
|
- | 89 | ||
Line 57... | Line 90... | ||
57 | preprocess_file: |
90 | preprocess_file: |
58 | push [memory_end] |
91 | push [memory_end] |
59 | push esi |
92 | push esi |
60 | mov al,2 |
93 | mov al,2 |
Line 689... | Line 722... | ||
689 | jb fnv1a_hash |
722 | jb fnv1a_hash |
690 | ret |
723 | ret |
691 | add_preprocessor_symbol: |
724 | add_preprocessor_symbol: |
692 | push edi esi |
725 | push edi esi |
693 | cmp ch,11b |
726 | xor eax,eax |
- | 727 | or cl,cl |
|
- | 728 | jz reshape_hash |
|
- | 729 | cmp ch,11b |
|
694 | je preprocessor_symbol_name_ok |
730 | je preprocessor_symbol_name_ok |
695 | push ecx |
731 | push ecx |
696 | movzx ecx,cl |
732 | movzx ecx,cl |
697 | mov edi,preprocessor_directives |
733 | mov edi,preprocessor_directives |
698 | call get_directive |
734 | call get_directive |
699 | jnc reserved_word_used_as_symbol |
735 | jnc reserved_word_used_as_symbol |
700 | pop ecx |
736 | pop ecx |
701 | preprocessor_symbol_name_ok: |
737 | preprocessor_symbol_name_ok: |
702 | call calculate_hash |
738 | call calculate_hash |
703 | mov ebp,eax |
739 | reshape_hash: |
- | 740 | mov ebp,eax |
|
704 | and ebp,3FFh |
741 | and ebp,3FFh |
705 | shr eax,10 |
742 | shr eax,10 |
706 | xor ebp,eax |
743 | xor ebp,eax |
707 | shl ecx,22 |
744 | shl ecx,22 |
708 | or ebp,ecx |
745 | or ebp,ecx |
Line 1011... | Line 1048... | ||
1011 | skip_macro_string: |
1048 | skip_macro_string: |
1012 | lods dword [esi] |
1049 | lods dword [esi] |
1013 | add esi,eax |
1050 | add esi,eax |
1014 | jmp skip_macro_block |
1051 | jmp skip_macro_block |
1015 | rept_directive: |
1052 | postpone_directive: |
- | 1053 | push esi |
|
- | 1054 | mov esi,edx |
|
- | 1055 | xor ecx,ecx |
|
- | 1056 | call add_preprocessor_symbol |
|
- | 1057 | mov eax,[current_line] |
|
- | 1058 | mov [edx+12],eax |
|
- | 1059 | pop esi |
|
- | 1060 | mov [edx+8],esi |
|
- | 1061 | mov al,[macro_status] |
|
- | 1062 | and al,0F0h |
|
- | 1063 | or al,1 |
|
- | 1064 | mov [macro_status],al |
|
- | 1065 | mov eax,[current_line] |
|
- | 1066 | mov [error_line],eax |
|
- | 1067 | lods byte [esi] |
|
- | 1068 | or al,al |
|
- | 1069 | jz line_preprocessed |
|
- | 1070 | cmp al,'{' |
|
- | 1071 | jne unexpected_characters |
|
- | 1072 | jmp found_macro_block |
|
- | 1073 | rept_directive: |
|
1016 | mov [base_code],0 |
1074 | mov [base_code],0 |
1017 | jmp define_instant_macro |
1075 | jmp define_instant_macro |
1018 | irp_directive: |
1076 | irp_directive: |
1019 | mov [base_code],1 |
1077 | mov [base_code],1 |
1020 | jmp define_instant_macro |
1078 | jmp define_instant_macro |
Line 1985... | Line 2043... | ||
1985 | mov eax,[macro_line] |
2043 | mov eax,[macro_line] |
1986 | stos dword [edi] |
2044 | stos dword [edi] |
1987 | jmp macro_line_header_ok |
2045 | jmp macro_line_header_ok |
1988 | instant_macro_line_header: |
2046 | instant_macro_line_header: |
1989 | mov eax,[macro_line] |
2047 | mov eax,[esp] |
1990 | add eax,16+1 |
2048 | add eax,16 |
1991 | stos dword [edi] |
2049 | find_defining_directive: |
- | 2050 | inc eax |
|
- | 2051 | cmp byte [eax-1],3Bh |
|
- | 2052 | je defining_directive_ok |
|
- | 2053 | cmp byte [eax-1],1Ah |
|
- | 2054 | jne find_defining_directive |
|
- | 2055 | push eax |
|
- | 2056 | movzx eax,byte [eax] |
|
- | 2057 | inc eax |
|
- | 2058 | add [esp],eax |
|
- | 2059 | pop eax |
|
- | 2060 | jmp find_defining_directive |
|
- | 2061 | defining_directive_ok: |
|
- | 2062 | stos dword [edi] |
|
1992 | mov eax,ecx |
2063 | mov eax,ecx |
1993 | stos dword [edi] |
2064 | stos dword [edi] |
1994 | mov eax,[macro_line] |
2065 | mov eax,[macro_line] |
1995 | stos dword [edi] |
2066 | stos dword [edi] |
1996 | stos dword [edi] |
2067 | stos dword [edi] |