fasm 1.67.17

tinypad - fixed link to fasm (/rd/1/develop/fasm)

git-svn-id: svn://kolibrios.org@242 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
heavyiron 2006-12-21 06:34:09 +00:00
parent e85c475db0
commit 3a022d4441
7 changed files with 107 additions and 29 deletions

View File

@ -618,6 +618,7 @@ load_directive:
load_from_code: load_from_code:
cmp byte [esi],'.' cmp byte [esi],'.'
je invalid_value je invalid_value
or [size_override],-1
call get_address_value call get_address_value
call calculate_relative_offset call calculate_relative_offset
push esi edi push esi edi
@ -676,6 +677,7 @@ store_directive:
jne invalid_argument jne invalid_argument
cmp byte [esi],'.' cmp byte [esi],'.'
je invalid_value je invalid_value
or [size_override],-1
call get_address_value call get_address_value
call calculate_relative_offset call calculate_relative_offset
push esi edi push esi edi

View File

@ -180,7 +180,7 @@ get_number:
cmp byte [ebx],'$' cmp byte [ebx],'$'
je pascal_hex_number je pascal_hex_number
cmp word [ebx],'0x' cmp word [ebx],'0x'
je c_hex_number je get_hex_number
mov al,[esi] mov al,[esi]
dec esi dec esi
cmp al,'h' cmp al,'h'
@ -279,9 +279,6 @@ get_number:
jz get_bin_digit jz get_bin_digit
or ebp,-1 or ebp,-1
jmp get_bin_digit jmp get_bin_digit
c_hex_number:
cmp cl,2
je bad_number
pascal_hex_number: pascal_hex_number:
cmp cl,1 cmp cl,1
je bad_number je bad_number
@ -1270,6 +1267,9 @@ calculate_expression:
cmp ah,dl cmp ah,dl
jne value_out_of_range jne value_out_of_range
mov [esi+10],al mov [esi+10],al
or al,al
jnz mul_first_register_ok
mov [esi+8],al
mul_first_register_ok: mul_first_register_ok:
cmp byte [esi+9],0 cmp byte [esi+9],0
je mul_calculated je mul_calculated
@ -1287,6 +1287,9 @@ calculate_expression:
cmp ah,dl cmp ah,dl
jne value_out_of_range jne value_out_of_range
mov [esi+11],al mov [esi+11],al
or al,al
jnz mul_calculated
mov [esi+9],al
mul_calculated: mul_calculated:
pop esi pop esi
jmp calculation_loop jmp calculation_loop
@ -2175,6 +2178,9 @@ calculate_relative_offset:
ret ret
preevaluate_logical_expression: preevaluate_logical_expression:
xor al,al
preevaluate_embedded_logical_expression:
mov [logical_value_wrapping],al
push edi push edi
call preevaluate_logical_value call preevaluate_logical_value
preevaluation_loop: preevaluation_loop:
@ -2254,7 +2260,7 @@ preevaluate_logical_expression:
mov al,0FFh mov al,0FFh
stos byte [edi] stos byte [edi]
ret ret
skip_logical_value: skip_logical_value:
cmp byte [esi],'~' cmp byte [esi],'~'
jne negation_skipped jne negation_skipped
inc esi inc esi
@ -2263,6 +2269,8 @@ skip_logical_value:
cmp byte [esi],'{' cmp byte [esi],'{'
jne skip_simple_logical_value jne skip_simple_logical_value
inc esi inc esi
xchg al,[logical_value_wrapping]
push eax
skip_logical_expression: skip_logical_expression:
call skip_logical_value call skip_logical_value
lods byte [esi] lods byte [esi]
@ -2275,29 +2283,42 @@ skip_logical_value:
cmp al,'&' cmp al,'&'
je skip_logical_expression je skip_logical_expression
cmp al,'}' cmp al,'}'
je logical_value_skipped jne wrongly_structured_logical_expression
pop eax
mov [logical_value_wrapping],al
logical_value_skipped:
clc
ret
wrongly_structured_logical_expression: wrongly_structured_logical_expression:
stc stc
ret ret
skip_simple_logical_value: skip_simple_logical_value:
mov [logical_value_parentheses],0
find_simple_logical_value_end:
mov al,[esi] mov al,[esi]
or al,al or al,al
jz logical_value_skipped jz logical_value_skipped
cmp al,0Fh cmp al,0Fh
je logical_value_skipped je logical_value_skipped
cmp al,'}'
je logical_value_skipped
cmp al,'|' cmp al,'|'
je logical_value_skipped je logical_value_skipped
cmp al,'&' cmp al,'&'
je logical_value_skipped je logical_value_skipped
cmp al,'{'
je skip_logical_value_internal_parenthesis
cmp al,'}'
jne skip_logical_value_symbol
sub [logical_value_parentheses],1
jnc skip_logical_value_symbol
cmp [logical_value_wrapping],al
jne skip_logical_value_symbol
jmp logical_value_skipped
skip_logical_value_internal_parenthesis:
inc [logical_value_parentheses]
skip_logical_value_symbol:
call skip_symbol call skip_symbol
jmp skip_simple_logical_value jmp find_simple_logical_value_end
logical_value_skipped: preevaluate_logical_value:
clc
ret
preevaluate_logical_value:
mov ebp,edi mov ebp,edi
preevaluate_negation: preevaluate_negation:
cmp byte [esi],'~' cmp byte [esi],'~'
@ -2306,12 +2327,16 @@ preevaluate_logical_value:
jmp preevaluate_negation jmp preevaluate_negation
preevaluate_negation_ok: preevaluate_negation_ok:
mov ebx,esi mov ebx,esi
xor edx,edx
cmp byte [esi],'{' cmp byte [esi],'{'
jne find_logical_value_boundaries jne preevaluate_simple_logical_value
movs byte [edi],[esi] lods byte [esi]
stos byte [edi]
push ebp push ebp
call preevaluate_logical_expression mov dl,[logical_value_wrapping]
push edx
call preevaluate_embedded_logical_expression
pop edx
mov [logical_value_wrapping],dl
pop ebp pop ebp
cmp al,0FFh cmp al,0FFh
je invalid_logical_value je invalid_logical_value
@ -2335,12 +2360,17 @@ preevaluate_logical_value:
mov edi,ebp mov edi,ebp
mov al,0FFh mov al,0FFh
ret ret
preevaluate_simple_logical_value:
xor edx,edx
mov [logical_value_parentheses],edx
find_logical_value_boundaries: find_logical_value_boundaries:
mov al,[esi] mov al,[esi]
or al,al or al,al
jz logical_value_boundaries_found jz logical_value_boundaries_found
cmp al,'{'
je logical_value_internal_parentheses
cmp al,'}' cmp al,'}'
je logical_value_boundaries_found je logical_value_boundaries_parenthesis_close
cmp al,'|' cmp al,'|'
je logical_value_boundaries_found je logical_value_boundaries_found
cmp al,'&' cmp al,'&'
@ -2358,6 +2388,14 @@ preevaluate_logical_value:
next_symbol_in_logical_value: next_symbol_in_logical_value:
call skip_symbol call skip_symbol
jmp find_logical_value_boundaries jmp find_logical_value_boundaries
logical_value_internal_parentheses:
inc [logical_value_parentheses]
jmp next_symbol_in_logical_value
logical_value_boundaries_parenthesis_close:
sub [logical_value_parentheses],1
jnc next_symbol_in_logical_value
cmp [logical_value_wrapping],'{'
jne next_symbol_in_logical_value
logical_value_boundaries_found: logical_value_boundaries_found:
or edx,edx or edx,edx
jz non_preevaluable_logical_value jz non_preevaluable_logical_value
@ -2506,6 +2544,9 @@ preevaluate_logical_value:
jmp invalid_logical_value jmp invalid_logical_value
calculate_logical_expression: calculate_logical_expression:
xor al,al
calculate_embedded_logical_expression:
mov [logical_value_wrapping],al
call get_logical_value call get_logical_value
logical_loop: logical_loop:
cmp byte [esi],'|' cmp byte [esi],'|'
@ -2537,7 +2578,7 @@ calculate_logical_expression:
jc invalid_expression jc invalid_expression
pop eax pop eax
jmp logical_loop jmp logical_loop
get_logical_value: get_logical_value:
xor al,al xor al,al
check_for_negation: check_for_negation:
cmp byte [esi],'~' cmp byte [esi],'~'
@ -2748,8 +2789,12 @@ get_logical_value:
or al,-1 or al,-1
jmp logical_value_ok jmp logical_value_ok
logical_expression: logical_expression:
inc esi lods byte [esi]
call calculate_logical_expression mov dl,[logical_value_wrapping]
push edx
call calculate_embedded_logical_expression
pop edx
mov [logical_value_wrapping],dl
push eax push eax
lods byte [esi] lods byte [esi]
cmp al,'}' cmp al,'}'

View File

@ -14,6 +14,7 @@ parser:
mov [anonymous_forward],eax mov [anonymous_forward],eax
mov [hash_tree],eax mov [hash_tree],eax
mov [blocks_stack],eax mov [blocks_stack],eax
mov [parsed_lines],eax
mov esi,[memory_start] mov esi,[memory_start]
mov edi,[source_start] mov edi,[source_start]
parser_loop: parser_loop:
@ -27,6 +28,7 @@ parser:
stos byte [edi] stos byte [edi]
mov eax,esi mov eax,esi
stos dword [edi] stos dword [edi]
inc [parsed_lines]
add esi,16 add esi,16
parse_line: parse_line:
cmp byte [esi],1Ah cmp byte [esi],1Ah
@ -410,6 +412,7 @@ parser:
stos byte [edi] stos byte [edi]
mov eax,[current_line] mov eax,[current_line]
stos dword [edi] stos dword [edi]
inc [parsed_lines]
mov eax,1 + (end_directive-assembler) shl 8 mov eax,1 + (end_directive-assembler) shl 8
stos dword [edi] stos dword [edi]
mov eax,1 + (if_directive-assembler) shl 8 mov eax,1 + (if_directive-assembler) shl 8
@ -446,6 +449,7 @@ parser:
stos byte [edi] stos byte [edi]
mov eax,[current_line] mov eax,[current_line]
stos dword [edi] stos dword [edi]
inc [parsed_lines]
parse_else_if: parse_else_if:
mov eax,1 + (if_directive-assembler) shl 8 mov eax,1 + (if_directive-assembler) shl 8
stos dword [edi] stos dword [edi]
@ -898,7 +902,12 @@ parse_line_contents:
jmp expression jmp expression
contents_parsed: contents_parsed:
cmp [parenthesis_stack],0 cmp [parenthesis_stack],0
jne invalid_expression ; jne invalid_expression
je contents_ok
dec [parenthesis_stack]
add esp,8
jmp contents_parsed
contents_ok:
ret ret
identify_label: identify_label:

View File

@ -1198,6 +1198,12 @@ process_macro_operators:
lods word [esi] lods word [esi]
movzx ecx,ah movzx ecx,ah
lea ebx,[edi+3] lea ebx,[edi+3]
jecxz convert_to_quoted_string
cmp byte [esi],'\'
jne convert_to_quoted_string
inc esi
dec ecx
dec ebx
jmp convert_to_quoted_string jmp convert_to_quoted_string
symbol_character_conversion: symbol_character_conversion:
cmp al,22h cmp al,22h
@ -1260,14 +1266,21 @@ process_macro_operators:
movzx ecx,al movzx ecx,al
jecxz do_symbol_concatenation jecxz do_symbol_concatenation
cmp byte [esi],'\' cmp byte [esi],'\'
jne do_symbol_concatenation je concatenate_escaped_symbol
sub esi,2
jmp no_concatenation
do_symbol_concatenation: do_symbol_concatenation:
add [ebx],al add [ebx],cl
jc name_too_long jc name_too_long
rep movs byte [edi],[esi] rep movs byte [edi],[esi]
jmp after_macro_operators jmp after_macro_operators
concatenate_escaped_symbol:
inc esi
dec ecx
jz do_symbol_concatenation
movzx eax,byte [esi]
cmp byte [characters+eax],0
jne do_symbol_concatenation
sub esi,3
jmp no_concatenation
string_concatenation: string_concatenation:
cmp byte [esi],22h cmp byte [esi],22h
je do_string_concatenation je do_string_concatenation
@ -1285,6 +1298,12 @@ process_macro_operators:
inc esi inc esi
lods byte [esi] lods byte [esi]
movzx ecx,al movzx ecx,al
jecxz finish_concatenating_converted_symbol
cmp byte [esi],'\'
jne finish_concatenating_converted_symbol
inc esi
dec ecx
finish_concatenating_converted_symbol:
add [ebx],ecx add [ebx],ecx
rep movs byte [edi],[esi] rep movs byte [edi],[esi]
jmp after_macro_operators jmp after_macro_operators

View File

@ -86,6 +86,8 @@ resource_data dd ?
resource_size dd ? resource_size dd ?
parenthesis_stack dd ? parenthesis_stack dd ?
blocks_stack dd ? blocks_stack dd ?
parsed_lines dd ?
logical_value_parentheses dd ?
next_pass_needed db ? next_pass_needed db ?
macro_status db ? macro_status db ?
@ -115,6 +117,7 @@ push_size db ?
operand_prefix db ? operand_prefix db ?
rex_prefix db ? rex_prefix db ?
immediate_size db ? immediate_size db ?
logical_value_wrapping db ?
characters rb 100h characters rb 100h
converted rb 100h converted rb 100h

View File

@ -33,7 +33,7 @@
; cannot simply be copied and put under another distribution licence ; cannot simply be copied and put under another distribution licence
; (including the GNU Public Licence). ; (including the GNU Public Licence).
VERSION_STRING equ "1.67.16" VERSION_STRING equ "1.67.17"
VERSION_MAJOR = 1 VERSION_MAJOR = 1
VERSION_MINOR = 67 VERSION_MINOR = 67

View File

@ -646,7 +646,7 @@ fasm_start:
dd fasm_parameters dd fasm_parameters
dd 0 dd 0
dd 0 dd 0
db '/RD/1/FASM',0 db '/RD/1/DEVELOP/FASM',0
board_start: board_start:
dd 7 dd 7
dd 0 dd 0