forked from KolibriOS/kolibrios
fasm 1.67.22
git-svn-id: svn://kolibrios.org@607 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
4b5d5984ce
commit
13095ae856
@ -31,6 +31,7 @@ assembler:
|
|||||||
mov [format_flags],eax
|
mov [format_flags],eax
|
||||||
mov [number_of_relocations],eax
|
mov [number_of_relocations],eax
|
||||||
mov [undefined_data_end],eax
|
mov [undefined_data_end],eax
|
||||||
|
mov [file_extension],eax
|
||||||
mov [next_pass_needed],al
|
mov [next_pass_needed],al
|
||||||
mov [output_format],al
|
mov [output_format],al
|
||||||
mov [labels_type],al
|
mov [labels_type],al
|
||||||
|
@ -1992,6 +1992,8 @@ get_address_value:
|
|||||||
mov [address_symbol],eax
|
mov [address_symbol],eax
|
||||||
mov al,[edi+12]
|
mov al,[edi+12]
|
||||||
mov [value_type],al
|
mov [value_type],al
|
||||||
|
cmp al,6
|
||||||
|
je plt_address
|
||||||
cmp al,5
|
cmp al,5
|
||||||
je gotoff_address
|
je gotoff_address
|
||||||
ja invalid_use_of_symbol
|
ja invalid_use_of_symbol
|
||||||
@ -2002,6 +2004,7 @@ get_address_value:
|
|||||||
shl al,5
|
shl al,5
|
||||||
jmp address_symbol_ok
|
jmp address_symbol_ok
|
||||||
gotoff_address:
|
gotoff_address:
|
||||||
|
plt_address:
|
||||||
mov al,40h
|
mov al,40h
|
||||||
address_symbol_ok:
|
address_symbol_ok:
|
||||||
mov ah,[address_size]
|
mov ah,[address_size]
|
||||||
|
@ -33,6 +33,8 @@ formatter:
|
|||||||
lea eax,[edi+9]
|
lea eax,[edi+9]
|
||||||
cmp eax,[structures_buffer]
|
cmp eax,[structures_buffer]
|
||||||
jae out_of_memory
|
jae out_of_memory
|
||||||
|
cmp [file_extension],0
|
||||||
|
jne extension_specified
|
||||||
cmp [output_format],2
|
cmp [output_format],2
|
||||||
je exe_extension
|
je exe_extension
|
||||||
jb bin_extension
|
jb bin_extension
|
||||||
@ -93,6 +95,18 @@ formatter:
|
|||||||
inc edi
|
inc edi
|
||||||
cmp byte [edi],0
|
cmp byte [edi],0
|
||||||
jne adapt_case
|
jne adapt_case
|
||||||
|
jmp extension_ok
|
||||||
|
extension_specified:
|
||||||
|
mov al,'.'
|
||||||
|
stos byte [edi]
|
||||||
|
mov esi,[file_extension]
|
||||||
|
copy_extension:
|
||||||
|
lods byte [esi]
|
||||||
|
stos byte [edi]
|
||||||
|
test al,al
|
||||||
|
jnz copy_extension
|
||||||
|
dec edi
|
||||||
|
extension_ok:
|
||||||
mov esi,edi
|
mov esi,edi
|
||||||
lea ecx,[esi+1]
|
lea ecx,[esi+1]
|
||||||
sub ecx,[free_additional_memory]
|
sub ecx,[free_additional_memory]
|
||||||
@ -178,6 +192,15 @@ format_directive:
|
|||||||
je format_coff
|
je format_coff
|
||||||
cmp al,5
|
cmp al,5
|
||||||
je format_elf
|
je format_elf
|
||||||
|
format_defined:
|
||||||
|
cmp byte [esi],86h
|
||||||
|
jne instruction_assembled
|
||||||
|
cmp word [esi+1],'('
|
||||||
|
jne invalid_argument
|
||||||
|
mov eax,[esi+3]
|
||||||
|
add esi,3+4
|
||||||
|
mov [file_extension],esi
|
||||||
|
lea esi,[esi+eax+1]
|
||||||
jmp instruction_assembled
|
jmp instruction_assembled
|
||||||
format_prefix:
|
format_prefix:
|
||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
@ -377,7 +400,7 @@ format_mz:
|
|||||||
mov word [edx+0Ch],0FFFFh
|
mov word [edx+0Ch],0FFFFh
|
||||||
mov word [edx+10h],1000h
|
mov word [edx+10h],1000h
|
||||||
mov [code_type],16
|
mov [code_type],16
|
||||||
jmp instruction_assembled
|
jmp format_defined
|
||||||
mark_mz_relocation:
|
mark_mz_relocation:
|
||||||
push eax ebx
|
push eax ebx
|
||||||
inc [number_of_relocations]
|
inc [number_of_relocations]
|
||||||
@ -1023,7 +1046,7 @@ format_pe:
|
|||||||
jnc wdm_flag_ok
|
jnc wdm_flag_ok
|
||||||
or word [edx+5Eh],2000h
|
or word [edx+5Eh],2000h
|
||||||
wdm_flag_ok:
|
wdm_flag_ok:
|
||||||
jmp instruction_assembled
|
jmp format_defined
|
||||||
pe_section:
|
pe_section:
|
||||||
call close_pe_section
|
call close_pe_section
|
||||||
bts [format_flags],5
|
bts [format_flags],5
|
||||||
@ -1348,17 +1371,17 @@ pe_stack:
|
|||||||
cmp edx,[ecx+64h]
|
cmp edx,[ecx+64h]
|
||||||
ja value_out_of_range
|
ja value_out_of_range
|
||||||
jb instruction_assembled
|
jb instruction_assembled
|
||||||
cmp eax,[edx+60h]
|
cmp eax,[ecx+60h]
|
||||||
ja value_out_of_range
|
ja value_out_of_range
|
||||||
jmp instruction_assembled
|
jmp instruction_assembled
|
||||||
default_pe64_stack_commit:
|
default_pe64_stack_commit:
|
||||||
mov dword [edx+68h],1000h
|
mov dword [ecx+68h],1000h
|
||||||
cmp dword [edx+64h],0
|
cmp dword [ecx+64h],0
|
||||||
jne instruction_assembled
|
jne instruction_assembled
|
||||||
mov eax,[edx+60h]
|
mov eax,[ecx+60h]
|
||||||
cmp eax,1000h
|
cmp eax,1000h
|
||||||
ja instruction_assembled
|
ja instruction_assembled
|
||||||
mov dword [edx+68h],eax
|
mov dword [ecx+68h],eax
|
||||||
jmp instruction_assembled
|
jmp instruction_assembled
|
||||||
pe_heap:
|
pe_heap:
|
||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
@ -1494,11 +1517,12 @@ make_pe_fixups:
|
|||||||
store_fixup:
|
store_fixup:
|
||||||
jecxz fixups_done
|
jecxz fixups_done
|
||||||
add dword [ebx],2
|
add dword [ebx],2
|
||||||
mov eax,[esi]
|
mov ah,[esi+1]
|
||||||
and ax,0FFFh
|
and ah,0Fh
|
||||||
mov dl,[esi+4]
|
mov al,[esi+4]
|
||||||
shl dx,12
|
shl al,4
|
||||||
or ax,dx
|
or ah,al
|
||||||
|
mov al,[esi]
|
||||||
stos word [edi]
|
stos word [edi]
|
||||||
add esi,5
|
add esi,5
|
||||||
loop make_fixups
|
loop make_fixups
|
||||||
@ -2174,10 +2198,10 @@ format_coff:
|
|||||||
mov [labels_type],2
|
mov [labels_type],2
|
||||||
mov [code_type],32
|
mov [code_type],32
|
||||||
test [format_flags],8
|
test [format_flags],8
|
||||||
jz instruction_assembled
|
jz format_defined
|
||||||
mov [labels_type],4
|
mov [labels_type],4
|
||||||
mov [code_type],64
|
mov [code_type],64
|
||||||
jmp instruction_assembled
|
jmp format_defined
|
||||||
coff_section:
|
coff_section:
|
||||||
call close_coff_section
|
call close_coff_section
|
||||||
mov ebx,[free_additional_memory]
|
mov ebx,[free_additional_memory]
|
||||||
@ -2774,9 +2798,9 @@ format_elf:
|
|||||||
mov al,4
|
mov al,4
|
||||||
mov [ebx+10h],eax
|
mov [ebx+10h],eax
|
||||||
test [format_flags],8
|
test [format_flags],8
|
||||||
jz instruction_assembled
|
jz format_defined
|
||||||
mov byte [ebx+10h],8
|
mov byte [ebx+10h],8
|
||||||
jmp instruction_assembled
|
jmp format_defined
|
||||||
format_elf64:
|
format_elf64:
|
||||||
mov edx,edi
|
mov edx,edi
|
||||||
mov ecx,40h shr 2
|
mov ecx,40h shr 2
|
||||||
@ -3513,7 +3537,7 @@ format_elf_exe:
|
|||||||
mov [org_registers],0
|
mov [org_registers],0
|
||||||
mov [org_start],edi
|
mov [org_start],edi
|
||||||
mov [symbols_stream],edi
|
mov [symbols_stream],edi
|
||||||
jmp instruction_assembled
|
jmp format_defined
|
||||||
format_elf64_exe:
|
format_elf64_exe:
|
||||||
add esi,2
|
add esi,2
|
||||||
or [format_flags],1
|
or [format_flags],1
|
||||||
@ -3573,7 +3597,7 @@ format_elf_exe:
|
|||||||
mov [org_registers],0
|
mov [org_registers],0
|
||||||
mov [org_start],edi
|
mov [org_start],edi
|
||||||
mov [symbols_stream],edi
|
mov [symbols_stream],edi
|
||||||
jmp instruction_assembled
|
jmp format_defined
|
||||||
elf_entry:
|
elf_entry:
|
||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
cmp al,'('
|
cmp al,'('
|
||||||
|
@ -159,10 +159,10 @@ parser:
|
|||||||
blocks_stack_ok:
|
blocks_stack_ok:
|
||||||
xor al,al
|
xor al,al
|
||||||
stos byte [edi]
|
stos byte [edi]
|
||||||
mov eax,[error_line]
|
;mov eax,[error_line]
|
||||||
mov [current_line],eax
|
;mov [current_line],eax
|
||||||
cmp [anonymous_forward],0
|
;cmp [anonymous_forward],0
|
||||||
jne invalid_value
|
;jne invalid_value
|
||||||
add edi,0Fh
|
add edi,0Fh
|
||||||
and edi,not 0Fh
|
and edi,not 0Fh
|
||||||
mov [code_start],edi
|
mov [code_start],edi
|
||||||
@ -1163,10 +1163,10 @@ get_label_id:
|
|||||||
xor ebx,ebx
|
xor ebx,ebx
|
||||||
ret
|
ret
|
||||||
anonymous_back:
|
anonymous_back:
|
||||||
add esi,2
|
|
||||||
mov eax,[anonymous_reverse]
|
mov eax,[anonymous_reverse]
|
||||||
or eax,eax
|
or eax,eax
|
||||||
jz invalid_value
|
jz new_anonymous
|
||||||
|
add esi,2
|
||||||
jmp anonymous_ok
|
jmp anonymous_ok
|
||||||
new_anonymous:
|
new_anonymous:
|
||||||
add esi,2
|
add esi,2
|
||||||
|
@ -88,6 +88,7 @@ parenthesis_stack dd ?
|
|||||||
blocks_stack dd ?
|
blocks_stack dd ?
|
||||||
parsed_lines dd ?
|
parsed_lines dd ?
|
||||||
logical_value_parentheses dd ?
|
logical_value_parentheses dd ?
|
||||||
|
file_extension dd ?
|
||||||
|
|
||||||
next_pass_needed db ?
|
next_pass_needed db ?
|
||||||
macro_status db ?
|
macro_status db ?
|
||||||
|
@ -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.21"
|
VERSION_STRING equ "1.67.22"
|
||||||
|
|
||||||
VERSION_MAJOR = 1
|
VERSION_MAJOR = 1
|
||||||
VERSION_MINOR = 67
|
VERSION_MINOR = 67
|
||||||
|
@ -5775,12 +5775,16 @@ vmread_instruction:
|
|||||||
mov [extended_code],78h
|
mov [extended_code],78h
|
||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
call get_size_operator
|
call get_size_operator
|
||||||
|
cmp al,10h
|
||||||
|
je vmread_nomem
|
||||||
cmp al,'['
|
cmp al,'['
|
||||||
jne invalid_operand
|
jne invalid_operand
|
||||||
call get_address
|
call get_address
|
||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
cmp al,','
|
cmp al,','
|
||||||
jne invalid_operand
|
jne invalid_operand
|
||||||
|
call vmread_check_size
|
||||||
|
mov [operand_size],0
|
||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
call get_size_operator
|
call get_size_operator
|
||||||
cmp al,10h
|
cmp al,10h
|
||||||
@ -5788,16 +5792,41 @@ vmread_instruction:
|
|||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
call convert_register
|
call convert_register
|
||||||
mov [postbyte_register],al
|
mov [postbyte_register],al
|
||||||
|
cmp [operand_size],4
|
||||||
|
jne invalid_operand_size
|
||||||
|
jmp vmx_size_ok
|
||||||
|
vmread_nomem:
|
||||||
|
lods byte [esi]
|
||||||
|
call convert_register
|
||||||
|
push eax
|
||||||
|
call vmread_check_size
|
||||||
|
lods byte [esi]
|
||||||
|
cmp al,','
|
||||||
|
jne invalid_operand
|
||||||
|
mov [operand_size],0
|
||||||
|
lods byte [esi]
|
||||||
|
call get_size_operator
|
||||||
|
cmp al,10h
|
||||||
|
jne invalid_operand
|
||||||
|
lods byte [esi]
|
||||||
|
call convert_register
|
||||||
|
mov [postbyte_register],al
|
||||||
|
cmp [operand_size],4
|
||||||
|
jne invalid_operand_size
|
||||||
|
pop ebx
|
||||||
|
mov [base_code],0Fh
|
||||||
|
call store_nomem_instruction
|
||||||
|
jmp instruction_assembled
|
||||||
vmread_check_size:
|
vmread_check_size:
|
||||||
cmp [code_type],64
|
cmp [code_type],64
|
||||||
je vmread_long
|
je vmread_long
|
||||||
cmp [operand_size],4
|
cmp [operand_size],4
|
||||||
je vmx_size_ok
|
jne invalid_operand_size
|
||||||
jmp invalid_operand_size
|
ret
|
||||||
vmread_long:
|
vmread_long:
|
||||||
cmp [operand_size],8
|
cmp [operand_size],8
|
||||||
je vmx_size_ok
|
jne invalid_operand_size
|
||||||
jmp invalid_operand_size
|
ret
|
||||||
vmwrite_instruction:
|
vmwrite_instruction:
|
||||||
mov [extended_code],79h
|
mov [extended_code],79h
|
||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
@ -5807,15 +5836,28 @@ vmwrite_instruction:
|
|||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
call convert_register
|
call convert_register
|
||||||
mov [postbyte_register],al
|
mov [postbyte_register],al
|
||||||
|
cmp [operand_size],4
|
||||||
|
jne invalid_operand_size
|
||||||
|
mov [operand_size],0
|
||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
cmp al,','
|
cmp al,','
|
||||||
jne invalid_operand
|
jne invalid_operand
|
||||||
lods byte [esi]
|
lods byte [esi]
|
||||||
call get_size_operator
|
call get_size_operator
|
||||||
|
cmp al,10h
|
||||||
|
je vmwrite_nomem
|
||||||
cmp al,'['
|
cmp al,'['
|
||||||
jne invalid_operand
|
jne invalid_operand
|
||||||
call get_address
|
call get_address
|
||||||
jmp vmread_check_size
|
call vmread_check_size
|
||||||
|
jmp vmx_size_ok
|
||||||
|
vmwrite_nomem:
|
||||||
|
lods byte [esi]
|
||||||
|
call convert_register
|
||||||
|
mov bl,al
|
||||||
|
mov [base_code],0Fh
|
||||||
|
call store_nomem_instruction
|
||||||
|
jmp instruction_assembled
|
||||||
simple_svm_instruction:
|
simple_svm_instruction:
|
||||||
push eax
|
push eax
|
||||||
mov [base_code],0Fh
|
mov [base_code],0Fh
|
||||||
|
Loading…
Reference in New Issue
Block a user