23,11 → 23,8 |
mov byte [edi+eax],0 |
loop mark_symbol_characters |
mov edi,locals_counter |
mov al,7 |
stos byte [edi] |
movzx ecx,al |
mov al,'0' |
rep stos byte [edi] |
mov ax,1 + '0' shl 8 |
stos word [edi] |
mov edi,[memory_start] |
mov [include_paths],edi |
mov esi,include_variable |
43,6 → 40,149 |
mov [display_buffer],eax |
mov [hash_tree],eax |
mov [macro_status],al |
|
mov esi,predefinitions |
process_predefinitions: |
movzx ecx,byte [esi] |
test ecx,ecx |
jz predefinitions_ok |
inc esi |
lea eax,[esi+ecx] |
push eax |
mov ch,10b |
call add_preprocessor_symbol |
pop esi |
mov edi,[memory_start] |
mov [edx+8],edi |
convert_predefinition: |
cmp edi,[memory_end] |
jae out_of_memory |
lods byte [esi] |
or al,al |
jz predefinition_converted |
cmp al,20h |
je convert_predefinition |
mov ah,al |
mov ebx,characters |
xlat byte [ebx] |
or al,al |
jz predefinition_separator |
cmp ah,27h |
je predefinition_string |
cmp ah,22h |
je predefinition_string |
mov byte [edi],1Ah |
scas word [edi] |
xchg al,ah |
stos byte [edi] |
mov ebx,characters |
xor ecx,ecx |
predefinition_symbol: |
lods byte [esi] |
stos byte [edi] |
xlat byte [ebx] |
or al,al |
loopnzd predefinition_symbol |
neg ecx |
cmp ecx,255 |
ja invalid_definition |
mov ebx,edi |
sub ebx,ecx |
mov byte [ebx-2],cl |
found_predefinition_separator: |
dec edi |
mov ah,[esi-1] |
predefinition_separator: |
xchg al,ah |
or al,al |
jz predefinition_converted |
cmp al,20h |
je convert_line_data |
cmp al,3Bh |
je invalid_definition |
cmp al,5Ch |
je predefinition_backslash |
stos byte [edi] |
jmp convert_predefinition |
predefinition_string: |
mov al,22h |
stos byte [edi] |
scas dword [edi] |
mov ebx,edi |
copy_predefinition_string: |
lods byte [esi] |
stos byte [edi] |
or al,al |
jz invalid_definition |
cmp al,ah |
jne copy_predefinition_string |
lods byte [esi] |
cmp al,ah |
je copy_predefinition_string |
dec esi |
dec edi |
mov eax,edi |
sub eax,ebx |
mov [ebx-4],eax |
jmp convert_predefinition |
predefinition_backslash: |
mov byte [edi],0 |
lods byte [esi] |
or al,al |
jz invalid_definition |
cmp al,20h |
je invalid_definition |
cmp al,3Bh |
je invalid_definition |
mov al,1Ah |
stos byte [edi] |
mov ecx,edi |
mov ax,5C01h |
stos word [edi] |
dec esi |
group_predefinition_backslashes: |
lods byte [esi] |
cmp al,5Ch |
jne predefinition_backslashed_symbol |
stos byte [edi] |
inc byte [ecx] |
jmp group_predefinition_backslashes |
predefinition_backslashed_symbol: |
cmp al,20h |
je invalid_definition |
cmp al,22h |
je invalid_definition |
cmp al,27h |
je invalid_definition |
cmp al,3Bh |
je invalid_definition |
mov ah,al |
mov ebx,characters |
xlat byte [ebx] |
or al,al |
jz predefinition_backslashed_symbol_character |
mov al,ah |
convert_predefinition_backslashed_symbol: |
stos byte [edi] |
xlat byte [ebx] |
or al,al |
jz found_predefinition_separator |
inc byte [ecx] |
jz invalid_definition |
lods byte [esi] |
jmp convert_predefinition_backslashed_symbol |
predefinition_backslashed_symbol_character: |
mov al,ah |
stos byte [edi] |
inc byte [ecx] |
jmp convert_predefinition |
predefinition_converted: |
mov [memory_start],edi |
sub edi,[edx+8] |
mov [edx+12],edi |
jmp process_predefinitions |
predefinitions_ok: |
|
mov esi,[input_file] |
mov edx,esi |
call open |
2220,16 → 2360,25 |
movzx ecx,byte [eax] |
counter_loop: |
inc byte [eax+ecx] |
cmp byte [eax+ecx],':' |
cmp byte [eax+ecx],'9'+1 |
jb counter_ok |
jne letter_digit |
mov byte [eax+ecx],'A' |
jmp counter_ok |
letter_digit: |
cmp byte [eax+ecx],'F' |
jbe counter_ok |
cmp byte [eax+ecx],'Z'+1 |
jb counter_ok |
jne small_letter_digit |
mov byte [eax+ecx],'a' |
jmp counter_ok |
small_letter_digit: |
cmp byte [eax+ecx],'z'+1 |
jb counter_ok |
mov byte [eax+ecx],'0' |
loop counter_loop |
inc byte [eax] |
movzx ecx,byte [eax] |
mov byte [eax+ecx],'0' |
counter_ok: |
pop ecx |
lods byte [esi] |