release 1.20

This commit is contained in:
Tomasz Grysztar 2001-11-17 12:00:00 +00:00
parent 8fe42c5d06
commit 7cc70d63f1
11 changed files with 1479 additions and 1054 deletions

View file

@ -9,7 +9,7 @@
ÛÛ Û ÛÛ Ü ÞÛ ÞÛ Û Ý
ßßßßßß ßßßßß ßß ßßßßßß ß ß ß
flat assembler version 1.14
flat assembler version 1.20
Copyright (c) 1999-2001, Tomasz Grysztar. All rights reserved.
@ -115,7 +115,7 @@ use size override: 'mov eax,dword [myvar]', or (short form):
8-bit or a 16-bit variable; eax will contain whatever is in the four bytes
beginning at the address of 'myvar'! Allowed size overrides are: byte (8-bit),
word (16-bit), dword (32-bit), pword (48-bit), qword (64-bit), tword (80-bit),
xword (128-bit), first letters are the short forms.
dqword (128-bit), first letters are the short forms.
2.1.1.2 Jumps and calls
@ -167,12 +167,12 @@ be [ebx+00000001], etc.
2.1.1.5 Special cases
'xlat' instruction accepts no arguments, or one argument:
'[bx]'/'byte [bx]' to create 16-bit version, or '[ebx]'/'byte [ebx]'
to create 32-bit version of opcode; in the similar way advanced settings
of string instructions can be done, like 'movs byte [es:edi],[fs:esi]',
to adjust address registers size and segment override ('movs' needs two
arguments). 'xlatb', 'movsb', etc. accept no arguments.
'xlat' instruction accepts one argument: '[bx]'/'byte [bx]' to create
16-bit version, or '[ebx]'/'byte [ebx]' to create 32-bit version of opcode;
in the similar way advanced settings of string instructions can be done, like
'movs byte [es:edi],[fs:esi]', to adjust address registers size and segment
override ('movs' needs two arguments). 'xlatb', 'movsb', etc. accept no
arguments.
2.1.1.6 FPU and MMX instructions
@ -188,7 +188,7 @@ arguments). 'xlatb', 'movsb', etc. accept no arguments.
paddb mm0,mm1 ; packed add bytes
pand mm7,qword [esi] ; logical and
addps xmm0,xmm1 ; packed single fp add
cmpeqps xmm7,xword [esi] ; packed single fp compare
cmpeqps xmm7,dqword [esi] ; packed single fp compare
shufps xmm4,xmm5,1 ; shuffle single fp
2.1.2 Number syntax
@ -287,6 +287,10 @@ directive before data definition, for example:
2.2.1 Preprocessor directives
common - used inside macro definitions, all following instructions in this
part of macroinstructions will be processed only once, even if
multiple arguments are processed.
include - includes source file in source code before assembly
macro - defines macroinstructions, arguments are macro name and names

View file

@ -1,5 +1,5 @@
flat assembler version 1.14
flat assembler version 1.20
Copyright (c) 1999-2001, Tomasz Grysztar
All rights reserved.

File diff suppressed because it is too large Load diff

View file

@ -743,11 +743,11 @@ calculate_expression:
je expression_calculated
cmp al,']'
je expression_calculated
sub edi,20h
sub edi,10h
mov ebx,edi
sub ebx,20h
mov dx,[ebx+24]
or dx,[edi+24]
sub ebx,10h
mov dx,[ebx+8]
or dx,[edi+8]
cmp al,0E0h
je calculate_rva
cmp al,0D0h
@ -758,8 +758,8 @@ calculate_expression:
je calculate_add
cmp al,81h
je calculate_sub
mov ah,[ebx+26]
or ah,[edi+26]
mov ah,[ebx+12]
or ah,[edi+12]
jnz invalid_use_of_symbol
cmp al,90h
je calculate_mul
@ -781,70 +781,67 @@ calculate_expression:
je calculate_shr
jmp invalid_expression
expression_calculated:
sub edi,20h
sub edi,10h
ret
get_byte_number:
mov word [edi+24],0
mov byte [edi+26],0
mov word [edi+8],0
mov byte [edi+12],0
xor eax,eax
lods byte [esi]
stos dword [edi]
xor al,al
stos dword [edi]
add edi,18h
add edi,8
jmp calculate_expression
get_word_number:
mov word [edi+24],0
mov byte [edi+26],0
mov word [edi+8],0
mov byte [edi+12],0
xor eax,eax
lods word [esi]
stos dword [edi]
xor ax,ax
stos dword [edi]
add edi,18h
add edi,8
jmp calculate_expression
get_dword_number:
mov word [edi+24],0
mov byte [edi+26],0
mov word [edi+8],0
mov byte [edi+12],0
movs dword [edi],[esi]
xor eax,eax
stos dword [edi]
add edi,18h
add edi,8
jmp calculate_expression
get_qword_number:
mov word [edi+24],0
mov byte [edi+26],0
mov word [edi+8],0
mov byte [edi+12],0
movs dword [edi],[esi]
movs dword [edi],[esi]
add edi,18h
add edi,8
jmp calculate_expression
get_register:
mov byte [edi+25],0
mov byte [edi+26],0
mov byte [edi+9],0
mov byte [edi+12],0
lods byte [esi]
mov [edi+24],al
mov [edi+8],al
mov byte [edi+10],1
xor eax,eax
stos dword [edi]
stos dword [edi]
mov al,1
stos dword [edi]
xor al,al
stos dword [edi]
add edi,10h
add edi,8
jmp calculate_expression
get_label:
mov word [edi+24],0
mov byte [edi+26],0
mov word [edi+8],0
mov byte [edi+12],0
lods dword [esi]
or eax,eax
jz current_offset_label
cmp eax,1
je counter_label
mov ebx,eax
cmp byte [ebx+8],0
je label_undefined
cmp byte [ebx+13],0
je label_defined
test byte [ebx+8],1
jz label_undefined
test byte [ebx+8],4
jz label_defined
mov al,[current_pass]
cmp al,[ebx+9]
jne label_undefined
@ -856,12 +853,14 @@ calculate_expression:
jne label_type_ok
xor al,al
label_type_ok:
mov [edi+26],al
mov [edi+12],al
mov eax,[ebx+12]
mov [edi+8],eax
mov eax,[ebx]
stos dword [edi]
mov eax,[ebx+4]
stos dword [edi]
add edi,18h
add edi,8
mov al,[ebx+10]
or al,al
jz calculate_expression
@ -883,43 +882,45 @@ calculate_expression:
current_offset_label:
cmp [reloc_labels],0
je get_current_offset
mov byte [edi+26],2
mov byte [edi+12],2
get_current_offset:
mov eax,[current_offset]
sub eax,[org_start]
cdq
stos dword [edi]
xor eax,eax
mov eax,edx
stos dword [edi]
add edi,18h
mov eax,[org_sib]
stos dword [edi]
add edi,4
jmp calculate_expression
counter_label:
mov eax,[counter]
stos dword [edi]
xor eax,eax
stos dword [edi]
add edi,18h
add edi,8
jmp calculate_expression
label_undefined:
cmp [current_pass],0
jne invalid_value
mov [next_pass_needed],1
mov byte [edi+26],0
mov byte [edi+12],0
xor eax,eax
stos dword [edi]
stos dword [edi]
add edi,18h
add edi,8
jmp calculate_expression
calculate_add:
cmp [next_pass_needed],0
jne add_values
cmp byte [edi+26],0
cmp byte [edi+12],0
je add_values
cmp byte [ebx+26],0
je add_values
jmp invalid_use_of_symbol
cmp byte [ebx+12],0
jne invalid_use_of_symbol
add_values:
mov al,[edi+26]
or [ebx+26],al
mov al,[edi+12]
or [ebx+12],al
mov eax,[edi]
add [ebx],eax
mov eax,[edi+4]
@ -928,11 +929,11 @@ calculate_expression:
jz calculate_expression
push esi
mov esi,ebx
lea ebx,[edi+8]
mov cl,[edi+24]
lea ebx,[edi+10]
mov cl,[edi+8]
call add_register
lea ebx,[edi+16]
mov cl,[edi+25]
lea ebx,[edi+11]
mov cl,[edi+9]
call add_register
pop esi
jmp calculate_expression
@ -940,61 +941,49 @@ calculate_expression:
or cl,cl
jz add_register_done
add_register_start:
cmp [esi+24],cl
cmp [esi+8],cl
jne add_in_second_slot
mov eax,[ebx]
add [esi+8],eax
mov eax,[ebx+4]
adc [esi+8+4],eax
mov eax,[esi+8]
or eax,[esi+8+4]
mov al,[ebx]
add [esi+10],al
jnz add_register_done
mov byte [esi+24],0
mov byte [esi+8],0
ret
add_in_second_slot:
cmp [esi+25],cl
cmp [esi+9],cl
jne create_in_first_slot
mov eax,[ebx]
add [esi+16],eax
mov eax,[ebx+4]
adc [esi+16+4],eax
mov eax,[esi+16]
or eax,[esi+16+4]
mov al,[ebx]
add [esi+11],al
jnz add_register_done
mov byte [esi+25],0
mov byte [esi+9],0
ret
create_in_first_slot:
cmp byte [esi+24],0
cmp byte [esi+8],0
jne create_in_second_slot
mov [esi+24],cl
mov eax,[ebx]
mov [esi+8],eax
mov eax,[ebx+4]
mov [esi+8+4],eax
mov [esi+8],cl
mov al,[ebx]
mov [esi+10],al
ret
create_in_second_slot:
cmp byte [esi+25],0
cmp byte [esi+9],0
jne invalid_expression
mov [esi+25],cl
mov eax,[ebx]
mov [esi+16],eax
mov eax,[ebx+4]
mov [esi+16+4],eax
mov [esi+9],cl
mov al,[ebx]
mov [esi+11],al
add_register_done:
ret
calculate_sub:
xor ah,ah
cmp [next_pass_needed],0
jne sub_values
mov ah,[ebx+26]
mov al,[edi+26]
mov ah,[ebx+12]
mov al,[edi+12]
or al,al
jz sub_values
cmp al,ah
jne invalid_use_of_symbol
xor ah,ah
sub_values:
mov byte [ebx+26],ah
mov byte [ebx+12],ah
mov eax,[edi]
sub [ebx],eax
mov eax,[edi+4]
@ -1003,26 +992,23 @@ calculate_expression:
jz calculate_expression
push esi
mov esi,ebx
lea ebx,[edi+8]
mov cl,[edi+24]
lea ebx,[edi+10]
mov cl,[edi+8]
call sub_register
lea ebx,[edi+16]
mov cl,[edi+25]
lea ebx,[edi+11]
mov cl,[edi+9]
call sub_register
pop esi
jmp calculate_expression
sub_register:
or cl,cl
jz add_register_done
not dword [ebx]
not dword [ebx+4]
add dword [ebx],1
adc dword [ebx+4],0
neg byte [ebx]
jmp add_register_start
calculate_mul:
or dx,dx
jz mul_start
cmp word [ebx+24],0
cmp word [ebx+8],0
jne mul_start
mov eax,[ebx]
xchg eax,[edi]
@ -1033,39 +1019,96 @@ calculate_expression:
mov eax,[ebx+8]
xchg eax,[edi+8]
mov [ebx+8],eax
mov eax,[ebx+8+4]
xchg eax,[edi+8+4]
mov [ebx+8+4],eax
mov eax,[ebx+16]
xchg eax,[edi+16]
mov [ebx+16],eax
mov eax,[ebx+16+4]
xchg eax,[edi+16+4]
mov [ebx+16+4],eax
mov ax,[ebx+24]
xchg ax,[edi+24]
mov [ebx+24],ax
mov eax,[ebx+12]
xchg eax,[edi+12]
mov [ebx+12],eax
mul_start:
push esi dx
mov esi,ebx
call mul_64
xor bl,bl
test dword [esi+4],1 shl 31
jz mul_first_sign_ok
not dword [esi]
not dword [esi+4]
add dword [esi],1
adc dword [esi+4],0
not bl
mul_first_sign_ok:
test dword [edi+4],1 shl 31
jz mul_second_sign_ok
not dword [edi]
not dword [edi+4]
add dword [edi],1
adc dword [edi+4],0
not bl
mul_second_sign_ok:
cmp dword [esi+4],0
jz mul_numbers
cmp dword [edi+4],0
jnz value_out_of_range
mul_numbers:
mov eax,[esi+4]
mul dword [edi]
or edx,edx
jnz value_out_of_range
mov ecx,eax
mov eax,[esi]
mul dword [edi+4]
or edx,edx
jnz value_out_of_range
add ecx,eax
jc value_out_of_range
mov eax,[esi]
mul dword [edi]
add edx,ecx
jc value_out_of_range
mov [esi],eax
mov [esi+4],edx
or bl,bl
jz mul_ok
not dword [esi]
not dword [esi+4]
add dword [esi],1
adc dword [esi+4],0
mul_ok:
pop dx
or dx,dx
jz mul_calculated
cmp word [edi+24],0
cmp word [edi+8],0
jne invalid_value
add esi,8
cmp byte [esi+16],0
cmp byte [esi+8],0
je mul_first_register_ok
call mul_64
jc value_out_of_range
mov al,[edi]
cbw
cwde
cdq
cmp edx,[edi+4]
jne value_out_of_range
cmp eax,[edi]
jne value_out_of_range
imul byte [esi+10]
mov dl,ah
cbw
cmp ah,dl
jne value_out_of_range
mov [esi+10],al
mul_first_register_ok:
add esi,8
cmp byte [esi+9],0
je mul_calculated
call mul_64
jc value_out_of_range
mov al,[edi]
cbw
cwde
cdq
cmp edx,[edi+4]
jne value_out_of_range
cmp eax,[edi]
jne value_out_of_range
imul byte [esi+11]
mov dl,ah
cbw
cmp ah,dl
jne value_out_of_range
mov [esi+11],al
mul_calculated:
pop esi
jmp calculate_expression
@ -1076,19 +1119,39 @@ calculate_expression:
pop dx
or dx,dx
jz div_calculated
add esi,8
cmp byte [esi+16],0
cmp byte [esi+8],0
je div_first_register_ok
call div_64
or eax,edx
jnz invalid_value
mov al,[edi]
cbw
cwde
cdq
cmp edx,[edi+4]
jne value_out_of_range
cmp eax,[edi]
jne value_out_of_range
or al,al
jz value_out_of_range
mov al,[esi+10]
cbw
idiv byte [edi]
mov [esi+10],al
div_first_register_ok:
add esi,8
cmp byte [esi+9],0
je div_calculated
call div_64
or eax,edx
jnz invalid_value
mov al,[edi]
cbw
cwde
cdq
cmp edx,[edi+4]
jne value_out_of_range
cmp eax,[edi]
jne value_out_of_range
or al,al
jz value_out_of_range
mov al,[esi+11]
cbw
idiv byte [edi]
mov [esi+11],al
div_calculated:
pop esi
jmp calculate_expression
@ -1225,9 +1288,9 @@ calculate_expression:
mov dword [ebx+4],0
jmp calculate_expression
calculate_not:
cmp word [edi+24],0
cmp word [edi+8],0
jne invalid_expression
cmp byte [edi+26],0
cmp byte [edi+12],0
jne invalid_use_of_symbol
cmp [value_size],1
je not_byte
@ -1240,7 +1303,7 @@ calculate_expression:
not_qword:
not dword [edi]
not dword [edi+4]
add edi,20h
add edi,10h
jmp calculate_expression
not_byte:
cmp dword [edi+4],0
@ -1250,7 +1313,7 @@ calculate_expression:
cmp byte [edi+1],0
jne not_qword
not byte [edi]
add edi,20h
add edi,10h
jmp calculate_expression
not_word:
cmp dword [edi+4],0
@ -1258,25 +1321,25 @@ calculate_expression:
cmp word [edi+2],0
jne not_qword
not word [edi]
add edi,20h
add edi,10h
jmp calculate_expression
not_dword:
cmp dword [edi+4],0
jne not_qword
not dword [edi]
add edi,20h
add edi,10h
jmp calculate_expression
not_pword:
cmp word [edi+6],0
jne not_qword
not dword [edi]
not word [edi+4]
add edi,20h
add edi,10h
jmp calculate_expression
calculate_neg:
cmp word [edi+24],0
cmp word [edi+8],0
jne invalid_expression
cmp byte [edi+26],0
cmp byte [edi+12],0
jne invalid_use_of_symbol
mov eax,[edi]
mov edx,[edi+4]
@ -1284,12 +1347,12 @@ calculate_expression:
mov dword [edi+4],0
sub [edi],eax
sbb [edi+4],edx
add edi,20h
add edi,10h
jmp calculate_expression
calculate_rva:
cmp word [edi+24],0
cmp word [edi+8],0
jne invalid_expression
mov al,[edi+26]
mov al,[edi+12]
cmp al,2
je rva_ok
or al,al
@ -1297,64 +1360,12 @@ calculate_expression:
cmp [next_pass_needed],0
je invalid_use_of_symbol
rva_ok:
mov byte [edi+26],0
mov byte [edi+12],0
mov eax,[image_base]
sub [edi],eax
sbb dword [edi+4],0
add edi,20h
add edi,10h
jmp calculate_expression
mul_64:
xor bl,bl
test dword [esi+4],1 shl 31
jz mul_first_sign_ok
not dword [esi]
not dword [esi+4]
add dword [esi],1
adc dword [esi+4],0
not bl
mul_first_sign_ok:
test dword [edi+4],1 shl 31
jz mul_second_sign_ok
not dword [edi]
not dword [edi+4]
add dword [edi],1
adc dword [edi+4],0
not bl
mul_second_sign_ok:
cmp dword [esi+4],0
jz mul_numbers
cmp dword [edi+4],0
jnz mul_error
mul_numbers:
mov eax,[esi+4]
mul dword [edi]
or edx,edx
jnz mul_error
mov ecx,eax
mov eax,[esi]
mul dword [edi+4]
or edx,edx
jnz mul_error
add ecx,eax
jc mul_error
mov eax,[esi]
mul dword [edi]
add edx,ecx
jc mul_error
mov [esi],eax
mov [esi+4],edx
or bl,bl
jz mul_ok
not dword [esi]
not dword [esi+4]
add dword [esi],1
adc dword [esi+4],0
mul_ok:
clc
ret
mul_error:
stc
ret
div_64:
xor bl,bl
cmp dword [edi],0
@ -1430,8 +1441,8 @@ calculate_expression:
div_ok:
ret
convert_fp:
mov word [edi+24],0
mov byte [edi+26],0
mov word [edi+8],0
mov byte [edi+12],0
mov al,[value_size]
cmp al,4
je convert_fp_dword
@ -1517,8 +1528,8 @@ calculate_expression:
rep movs byte [edi],[esi]
mov edi,edx
inc esi
mov word [edi+24],0
mov byte [edi+26],0
mov word [edi+8],0
mov byte [edi+12],0
ret
get_byte_value:
@ -1526,11 +1537,9 @@ get_byte_value:
mov [forced_size],2
mov [current_offset],edi
call calculate_expression
cmp byte [edi+24],0
cmp word [edi+8],0
jne invalid_value
cmp byte [edi+25],0
jne invalid_value
cmp byte [edi+26],0
cmp byte [edi+12],0
jne invalid_use_of_symbol
mov eax,[edi]
cmp dword [edi+4],0
@ -1559,11 +1568,9 @@ get_word_value:
mov [forced_size],2
mov [current_offset],edi
call calculate_expression
cmp byte [edi+24],0
cmp word [edi+8],0
jne invalid_value
cmp byte [edi+25],0
jne invalid_value
mov al,[edi+26]
mov al,[edi+12]
cmp al,2
je invalid_use_of_symbol
mov [value_type],al
@ -1585,11 +1592,9 @@ get_dword_value:
mov [forced_size],2
mov [current_offset],edi
call calculate_expression
cmp byte [edi+24],0
cmp word [edi+8],0
jne invalid_value
cmp byte [edi+25],0
jne invalid_value
mov al,[edi+26]
mov al,[edi+12]
mov [value_type],al
check_dword_value:
mov eax,[edi]
@ -1606,11 +1611,9 @@ get_pword_value:
mov [forced_size],2
mov [current_offset],edi
call calculate_expression
cmp byte [edi+24],0
cmp word [edi+8],0
jne invalid_value
cmp byte [edi+25],0
jne invalid_value
mov al,[edi+26]
mov al,[edi+12]
mov [value_type],al
mov eax,[edi]
mov edx,[edi+4]
@ -1624,11 +1627,9 @@ get_qword_value:
mov [forced_size],2
mov [current_offset],edi
call calculate_expression
cmp byte [edi+24],0
cmp word [edi+8],0
jne invalid_value
cmp byte [edi+25],0
jne invalid_value
mov al,[edi+26]
mov al,[edi+12]
mov [value_type],al
mov eax,[edi]
mov edx,[edi+4]
@ -1636,8 +1637,8 @@ get_qword_value:
get_value:
mov [operand_size],0
mov [forced_size],0
call get_operand_size
lods byte [esi]
call get_size_operator
cmp al,'('
jne invalid_value
mov al,[operand_size]
@ -1698,10 +1699,16 @@ get_address:
ja invalid_address_size
mov [address_size],al
mov [value_size],al
jmp calculate_address
get_address_value:
mov [address_size],0
mov [value_size],4
push address_ok
calculate_address:
mov [current_offset],edi
call calculate_expression
mov al,[edi+26]
mov al,[edi+12]
mov [value_type],al
cmp al,1
je invalid_use_of_symbol
or al,al
@ -1716,13 +1723,13 @@ get_address:
xor bx,bx
xor cl,cl
mov ch,[address_size]
cmp word [edi+24],0
cmp word [edi+8],0
je check_dword_value
mov al,[edi+24]
lea edx,[edi+8]
mov al,[edi+8]
mov dl,[edi+10]
call get_address_register
mov al,[edi+25]
lea edx,[edi+16]
mov al,[edi+9]
mov dl,[edi+11]
call get_address_register
mov ax,bx
shr ah,4
@ -1775,9 +1782,7 @@ get_address:
get_address_register:
or al,al
jz address_register_ok
cmp dword [edx+4],0
jne invalid_address
cmp dword [edx],1
cmp dl,1
jne scaled_register
or bh,bh
jnz scaled_register
@ -1788,9 +1793,7 @@ get_address:
or bl,bl
jnz invalid_address
mov bl,al
mov cl,[edx]
cmp dword [edx],255
ja invalid_address
mov cl,dl
jmp address_register_ok
address_ok:
mov edx,eax

View file

@ -226,12 +226,12 @@ mz_stack:
mz_heap:
cmp [output_format],2
jne unexpected_instruction
call get_operand_size
cmp [operand_size],1
je invalid_value
cmp [operand_size],2
ja invalid_value
lods byte [esi]
call get_size_operator
cmp ah,1
je invalid_value
cmp ah,2
ja invalid_value
cmp al,'('
jne invalid_argument
call get_word_value
@ -596,12 +596,11 @@ section_directive:
mov [current_data],-1
jmp instruction_assembled
pe_entry:
call get_operand_size
lods byte [esi]
call get_size_operator
cmp al,'('
jne invalid_argument
mov al,[operand_size]
test al,not 4
test ah,not 4
jnz invalid_address
cmp byte [esi],'.'
je invalid_value
@ -618,12 +617,11 @@ pe_entry:
mov [entry_rva],eax
jmp instruction_assembled
pe_stack:
call get_operand_size
lods byte [esi]
call get_size_operator
cmp al,'('
jne invalid_argument
mov al,[operand_size]
test al,not 4
test ah,not 4
jnz invalid_address
cmp byte [esi],'.'
je invalid_value
@ -634,12 +632,11 @@ pe_stack:
cmp byte [esi],','
jne default_stack_commit
lods byte [esi]
call get_operand_size
lods byte [esi]
call get_size_operator
cmp al,'('
jne invalid_argument
mov al,[operand_size]
test al,not 4
test ah,not 4
jnz invalid_address
cmp byte [esi],'.'
je invalid_value
@ -658,12 +655,11 @@ pe_stack:
mov [stack_commit],eax
jmp instruction_assembled
pe_heap:
call get_operand_size
lods byte [esi]
call get_size_operator
cmp al,'('
jne invalid_argument
mov al,[operand_size]
test al,not 4
test ah,not 4
jnz invalid_address
cmp byte [esi],'.'
je invalid_value
@ -674,12 +670,11 @@ pe_heap:
cmp byte [esi],','
jne default_heap_commit
lods byte [esi]
call get_operand_size
lods byte [esi]
call get_size_operator
cmp al,'('
jne invalid_argument
mov al,[operand_size]
test al,not 4
test ah,not 4
jnz invalid_address
cmp byte [esi],'.'
je invalid_value

View file

@ -410,6 +410,8 @@ parse_line:
jc not_symbol_argument
pop edi
stos word [edi]
cmp ax,13h
je at_parsed
jmp argument_parsed
not_symbol_argument:
cmp ecx,1
@ -498,6 +500,15 @@ parse_line:
mov eax,[fp_value+8]
stos dword [edi]
jmp expression_parsed
at_parsed:
cmp [parenthesis_stack],0
je at_expression
dec [parenthesis_stack]
add esp,8
jmp at_parsed
at_expression:
mov al,'('
stos byte [edi]
expression:
call convert_expression
mov al,')'

View file

@ -557,9 +557,9 @@ define_macro:
lods byte [esi]
macro_arguments_end:
or al,al
jz find_macro_start
jz find_macro_block
cmp al,';'
je find_macro_start
je find_macro_block
cmp al,'{'
je find_macro_end
jmp invalid_macro_arguments
@ -572,7 +572,7 @@ define_macro:
cmp al,';'
je invalid_macro_arguments
jmp find_macro_argument
find_macro_start:
find_macro_block:
mov ebp,esp
call get_macro_line
jc unexpected_end_of_file
@ -580,9 +580,9 @@ define_macro:
call skip_spaces
lods byte [esi]
or al,al
jz find_macro_start
jz find_macro_block
cmp al,';'
je find_macro_start
je find_macro_block
cmp al,'{'
jne unexpected_characters
find_macro_end:
@ -1198,6 +1198,7 @@ use_macro:
lods byte [esi]
cmp al,','
je local_symbols
macro_directive_processed:
or al,al
jz macro_directive_end
cmp al,';'
@ -1216,6 +1217,15 @@ use_macro:
pop esi
dec edi
jmp macro_process
common_block:
lods byte [esi]
cmp [multi_macro_current],0
je macro_directive_processed
mov cx,[multi_macro_count]
cmp [multi_macro_current],cx
jb end_macro_block
mov [multi_macro_current],0
jmp macro_directive_processed
skip_string:
lods byte [esi]
stos byte [edi]
@ -1256,6 +1266,7 @@ use_macro:
cmp al,'}'
jne macro_process
dec edi
end_macro_block:
xor al,al
stos byte [edi]
mov [current_line_end],edi

View file

@ -288,6 +288,8 @@ symbols:
db 2,'di',10h,27h
db 11,'discardable',19h,25
db 2,'dl',10h,12h
db 2,'dq',11h,16
db 6,'dqword',11h,16
db 3,'dr0',10h,80h
db 3,'dr1',10h,81h
db 3,'dr2',10h,82h
@ -364,16 +366,14 @@ symbols:
db 1,'w',11h,2
db 4,'word',11h,2
db 9,'writeable',19h,31
db 1,'x',11h,16
db 4,'xmm0',1Ch,0
db 4,'xmm1',1Ch,1
db 4,'xmm2',1Ch,2
db 4,'xmm3',1Ch,3
db 4,'xmm4',1Ch,4
db 4,'xmm5',1Ch,5
db 4,'xmm6',1Ch,6
db 4,'xmm7',1Ch,7
db 5,'xword',11h,16
db 4,'xmm0',16h,10h
db 4,'xmm1',16h,11h
db 4,'xmm2',16h,12h
db 4,'xmm3',16h,13h
db 4,'xmm4',16h,14h
db 4,'xmm5',16h,15h
db 4,'xmm6',16h,16h
db 4,'xmm7',16h,17h
db 0
preprocessor_directives:
@ -388,6 +388,8 @@ preprocessor_directives:
db 0
macro_directives:
db 6,'common'
dw common_block-preprocessor
db 5,'local'
dw local_symbols-preprocessor
db 0
@ -1015,6 +1017,8 @@ instructions_5:
dw mmx_instruction-assembler,0FCh
db 'paddd'
dw mmx_instruction-assembler,0FEh
db 'paddq'
dw mmx_instruction-assembler,0D4h
db 'paddw'
dw mmx_instruction-assembler,0FDh
db 'pandn'
@ -1053,6 +1057,8 @@ instructions_5:
dw mmx_instruction-assembler,0F8h
db 'psubd'
dw mmx_instruction-assembler,0FAh
db 'psubq'
dw mmx_instruction-assembler,0FBh
db 'psubw'
dw mmx_instruction-assembler,0F9h
db 'pusha'
@ -1254,9 +1260,13 @@ instructions_6:
db 'mfence'
dw fence_instruction-assembler,0F0h
db 'movapd'
dw movapd_instruction-assembler,0
dw movpd_instruction-assembler,28h
db 'movaps'
dw movaps_instruction-assembler,0
dw movps_instruction-assembler,28h
db 'movdqa'
dw movdq_instruction-assembler,66h
db 'movdqu'
dw movdq_instruction-assembler,0F3h
db 'movhpd'
dw movlpd_instruction-assembler,16h
db 'movhps'
@ -1265,12 +1275,14 @@ instructions_6:
dw movlpd_instruction-assembler,12h
db 'movlps'
dw movlps_instruction-assembler,12h
db 'movnti'
dw movnti_instruction-assembler,0C3h
db 'movntq'
dw movntq_instruction-assembler,0
dw movntq_instruction-assembler,0E7h
db 'movupd'
dw movupd_instruction-assembler,0
dw movpd_instruction-assembler,10h
db 'movups'
dw movups_instruction-assembler,0
dw movps_instruction-assembler,10h
db 'paddsb'
dw mmx_instruction-assembler,0ECh
db 'paddsw'
@ -1293,8 +1305,14 @@ instructions_6:
dw mmx_instruction-assembler,0D5h
db 'psadbw'
dw mmx_instruction-assembler,0F6h
db 'pshufd'
dw pshufd_instruction-assembler,66h
db 'pshufw'
dw mmx_instruction-assembler,70h
dw pshufw_instruction-assembler,0
db 'pslldq'
dw ps_dq_instruction-assembler,111b
db 'psrldq'
dw ps_dq_instruction-assembler,011b
db 'psubsb'
dw mmx_instruction-assembler,0E8h
db 'psubsw'
@ -1329,12 +1347,16 @@ instructions_6:
dw sse_pd_instruction-assembler,51h
db 'sqrtps'
dw sse_ps_instruction-assembler,51h
db 'sqrtsd'
dw sse_sd_instruction-assembler,51h
db 'sqrtss'
dw sse_ss_instruction-assembler,51h
db 'wbinvd'
dw simple_extended_instruction-assembler,9
db 0
instructions_7:
db 'clflush'
dw fxsave_instruction-assembler,111b
db 'cmovnae'
dw cmov_instruction-assembler,42h
db 'cmovnbe'
@ -1410,7 +1432,7 @@ instructions_7:
db 'fyl2xp1'
dw simple_fpu_instruction-assembler,111001b
db 'ldmxcsr'
dw ldmxcsr_instruction-assembler,10b
dw fxsave_instruction-assembler,10b
db 'loopned'
dw loop_instruction_32bit-assembler,0E0h
db 'loopnew'
@ -1419,12 +1441,20 @@ instructions_7:
dw loop_instruction_32bit-assembler,0E0h
db 'loopnzw'
dw loop_instruction_16bit-assembler,0E0h
db 'movdq2q'
dw movdq2q_instruction-assembler,0
db 'movhlps'
dw movhlps_instruction-assembler,12h
db 'movlhps'
dw movhlps_instruction-assembler,16h
db 'movntdq'
dw movntdq_instruction-assembler,0E7h
db 'movntpd'
dw movntdq_instruction-assembler,2Bh
db 'movntps'
dw movntps_instruction-assembler,2Bh
dw movntq_instruction-assembler,2Bh
db 'movq2dq'
dw movq2dq_instruction-assembler,0
db 'paddusb'
dw mmx_instruction-assembler,0DCh
db 'paddusw'
@ -1447,20 +1477,24 @@ instructions_7:
dw mmx_instruction-assembler,0E4h
db 'pmuludq'
dw mmx_instruction-assembler,0F4h
db 'psqrtps'
dw sse_ps_instruction-assembler,52h
db 'psqrtss'
dw sse_ss_instruction-assembler,52h
db 'pshufhw'
dw pshufd_instruction-assembler,0F3h
db 'pshuflw'
dw pshufd_instruction-assembler,0F2h
db 'psubusb'
dw mmx_instruction-assembler,0D8h
db 'psubusw'
dw mmx_instruction-assembler,0D9h
db 'rsqrtps'
dw sse_ps_instruction-assembler,52h
db 'rsqrtss'
dw sse_ss_instruction-assembler,52h
db 'section'
dw section_directive-assembler,0
db 'segment'
dw segment_directive-assembler,0
db 'stmxcsr'
dw ldmxcsr_instruction-assembler,11b
dw fxsave_instruction-assembler,11b
db 'sysexit'
dw simple_extended_instruction-assembler,35h
db 'ucomisd'
@ -1479,12 +1513,36 @@ instructions_8:
dw cmp_ps_instruction-assembler,7
db 'cmpordss'
dw cmp_ss_instruction-assembler,7
db 'cvtdq2pd'
dw cvtdq2pd_instruction-assembler,0E6h
db 'cvtdq2ps'
dw sse_ps_instruction-assembler,5Bh
db 'cvtpd2dq'
dw cvtpd2dq_instruction-assembler,0E6h
db 'cvtpd2pi'
dw cvtpd2pi_instruction-assembler,2Dh
db 'cvtpd2ps'
dw sse_pd_instruction-assembler,5Ah
db 'cvtpi2pd'
dw cvtpi2pd_instruction-assembler,2Ah
db 'cvtpi2ps'
dw cvtpi2ps_instruction-assembler,2Ah
db 'cvtps2dq'
dw sse_pd_instruction-assembler,5Bh
db 'cvtps2pd'
dw sse_ps_instruction-assembler,5Ah
db 'cvtps2pi'
dw cvtps2pi_instruction-assembler,2Dh
db 'cvtsd2si'
dw cvtsd2si_instruction-assembler,2Dh
db 'cvtsd2ss'
dw sse_sd_instruction-assembler,5Ah
db 'cvtsi2sd'
dw cvtsi2sd_instruction-assembler,2Ah
db 'cvtsi2ss'
dw cvtsi2ss_instruction-assembler,2Ah
db 'cvtss2sd'
dw sse_ss_instruction-assembler,5Ah
db 'cvtss2si'
dw cvtss2si_instruction-assembler,2Dh
db 'fcmovnbe'
@ -1517,8 +1575,16 @@ instructions_8:
instructions_9:
db 'cmpxchg8b'
dw cmpxchg8b_instruction-assembler,0
db 'cvttpd2dq'
dw sse_pd_instruction-assembler,0E6h
db 'cvttpd2pi'
dw cvtpd2pi_instruction-assembler,2Ch
db 'cvttps2dq'
dw cvtdq2pd_instruction-assembler,5Bh
db 'cvttps2pi'
dw cvtps2pi_instruction-assembler,2Ch
db 'cvttsd2si'
dw cvtsd2si_instruction-assembler,2Ch
db 'cvttss2si'
dw cvtss2si_instruction-assembler,2Ch
db 'punpckhbw'
@ -1528,11 +1594,11 @@ instructions_9:
db 'punpckhwd'
dw mmx_instruction-assembler,69h
db 'punpcklbw'
dw mmx_32bit_instruction-assembler,60h
dw mmx_instruction-assembler,60h
db 'punpckldq'
dw mmx_32bit_instruction-assembler,62h
dw mmx_instruction-assembler,62h
db 'punpcklwd'
dw mmx_32bit_instruction-assembler,61h
dw mmx_instruction-assembler,61h
db 0
instructions_10:
db 'cmpunordps'
@ -1543,13 +1609,21 @@ instructions_10:
dw simple_extended_instruction-assembler,5
db 'loadall386'
dw simple_extended_instruction-assembler,7
db 'maskmovdqu'
dw maskmovdqu_instruction-assembler,0
db 'prefetcht0'
dw prefetch_instruction-assembler,1
db 'prefetcht1'
dw prefetch_instruction-assembler,2
db 'prefetcht2'
dw prefetch_instruction-assembler,3
db 'punpckhqdq'
dw sse_pd_instruction-assembler,6Dh
db 'punpcklqdq'
dw sse_pd_instruction-assembler,6Ch
db 0
instructions_11:
db 'prefetchnta'
dw prefetch_instruction-assembler,0

View file

@ -1,5 +1,5 @@
; flat assembler version 1.14
; flat assembler version 1.20
; Copyright (c) 1999-2001, Tomasz Grysztar
; All rights reserved.
;
@ -33,4 +33,4 @@
; cannot simply be copied and put under another distribution licence
; (including the GNU Public Licence).
VERSION equ "1.14"
VERSION equ "1.20"

View file

@ -89,6 +89,12 @@ get_params:
call [GetCommandLine]
mov esi,eax
mov edi,params
find_command_start:
lodsb
cmp al,20h
je find_command_start
cmp al,22h
je skip_quoted_name
skip_name:
lodsb
cmp al,20h
@ -96,6 +102,13 @@ get_params:
or al,al
jz all_params
jmp skip_name
skip_quoted_name:
lodsb
cmp al,22h
je find_param
or al,al
jz all_params
jmp skip_quoted_name
find_param:
lodsb
cmp al,20h

View file

@ -2,6 +2,15 @@
Questions or comments please send to:
grysztar@omega.im.uj.edu.pl
version 1.20
[17-11-2001]
------------
[+] full SSE2 instructions support
[+] SIB addresses allowed for virtual data
[+] common directive in macroinstructions
[-] segment prefixes only if necessary
[-] general revisions and improvements
version 1.14
[17-10-2001]
------------