mirror of
https://github.com/tgrysztar/fasm
synced 2026-08-26 00:23:06 -04:00
release 1.71.01
This commit is contained in:
parent
1b84c438e7
commit
367bc95b16
7 changed files with 112 additions and 60 deletions
|
|
@ -33,7 +33,7 @@ assembler:
|
|||
mov [output_format],al
|
||||
mov [adjustment_sign],al
|
||||
mov [code_type],16
|
||||
call create_addressing_space
|
||||
call init_addressing_space
|
||||
pass_loop:
|
||||
call assemble_line
|
||||
jnc pass_loop
|
||||
|
|
@ -137,12 +137,14 @@ assembler:
|
|||
|
||||
create_addressing_space:
|
||||
mov ebx,[addressing_space]
|
||||
or ebx,ebx
|
||||
jz new_addressing_space
|
||||
test ebx,ebx
|
||||
jz init_addressing_space
|
||||
test byte [ebx+0Ah],1
|
||||
jnz illegal_instruction
|
||||
mov eax,edi
|
||||
sub eax,[ebx+18h]
|
||||
mov [ebx+1Ch],eax
|
||||
new_addressing_space:
|
||||
init_addressing_space:
|
||||
mov ebx,[tagged_blocks]
|
||||
mov dword [ebx-4],10h
|
||||
mov dword [ebx-8],20h
|
||||
|
|
@ -450,15 +452,15 @@ assemble_line:
|
|||
or byte [ebx+0Ah],2
|
||||
jmp continue_line
|
||||
assemble_instruction:
|
||||
; mov [operand_size],0
|
||||
; mov [size_override],0
|
||||
; mov [operand_prefix],0
|
||||
; mov [opcode_prefix],0
|
||||
; mov [operand_size],0
|
||||
; mov [size_override],0
|
||||
; mov [operand_prefix],0
|
||||
; mov [opcode_prefix],0
|
||||
and dword [operand_size],0
|
||||
; mov [rex_prefix],0
|
||||
; mov [vex_required],0
|
||||
; mov [vex_register],0
|
||||
; mov [immediate_size],0
|
||||
; mov [rex_prefix],0
|
||||
; mov [vex_required],0
|
||||
; mov [vex_register],0
|
||||
; mov [immediate_size],0
|
||||
and dword [rex_prefix],0
|
||||
call instruction_handler
|
||||
instruction_handler:
|
||||
|
|
@ -492,7 +494,19 @@ org_directive:
|
|||
test cl,1
|
||||
jnz invalid_use_of_symbol
|
||||
push eax
|
||||
call create_addressing_space
|
||||
mov ebx,[addressing_space]
|
||||
mov eax,edi
|
||||
sub eax,[ebx+18h]
|
||||
mov [ebx+1Ch],eax
|
||||
test byte [ebx+0Ah],1
|
||||
jnz in_virtual
|
||||
call init_addressing_space
|
||||
jmp org_space_ok
|
||||
in_virtual:
|
||||
call close_virtual_addressing_space
|
||||
call init_addressing_space
|
||||
or byte [ebx+0Ah],1
|
||||
org_space_ok:
|
||||
pop eax
|
||||
mov [ebx+9],cl
|
||||
mov cl,[value_sign]
|
||||
|
|
@ -719,6 +733,7 @@ store_directive:
|
|||
cmp al,80h
|
||||
jne invalid_argument
|
||||
call get_data_point
|
||||
jc instruction_assembled
|
||||
push esi edi
|
||||
mov esi,value
|
||||
mov edi,ebx
|
||||
|
|
@ -733,10 +748,6 @@ store_directive:
|
|||
jbe instruction_assembled
|
||||
mov [undefined_data_start],eax
|
||||
jmp instruction_assembled
|
||||
bad_store_address:
|
||||
pop edi esi
|
||||
call recoverable_overflow
|
||||
jmp instruction_assembled
|
||||
|
||||
display_directive:
|
||||
lods byte [esi]
|
||||
|
|
@ -890,7 +901,11 @@ virtual_directive:
|
|||
mov [ebx+8],edi
|
||||
mov ecx,[current_line]
|
||||
mov [ebx+4],ecx
|
||||
call create_addressing_space
|
||||
mov ebx,[addressing_space]
|
||||
mov eax,edi
|
||||
sub eax,[ebx+18h]
|
||||
mov [ebx+1Ch],eax
|
||||
call init_addressing_space
|
||||
or byte [ebx+0Ah],1
|
||||
pop eax
|
||||
mov cl,[address_sign]
|
||||
|
|
@ -937,12 +952,34 @@ virtual_directive:
|
|||
end_virtual:
|
||||
call find_structure_data
|
||||
jc unexpected_instruction
|
||||
mov edx,[addressing_space]
|
||||
mov ecx,edi
|
||||
sub ecx,[edx+18h]
|
||||
mov [edx+1Ch],ecx
|
||||
test byte [edx+0Ah],2
|
||||
jz virtual_space_ok
|
||||
push ebx
|
||||
call close_virtual_addressing_space
|
||||
pop ebx
|
||||
mov eax,[ebx+12]
|
||||
mov [addressing_space],eax
|
||||
mov edi,[ebx+8]
|
||||
remove_structure_data:
|
||||
push esi edi
|
||||
mov ecx,ebx
|
||||
sub ecx,[structures_buffer]
|
||||
shr ecx,2
|
||||
lea esi,[ebx-4]
|
||||
lea edi,[esi+18h]
|
||||
std
|
||||
rep movs dword [edi],[esi]
|
||||
cld
|
||||
add [structures_buffer],18h
|
||||
pop edi esi
|
||||
ret
|
||||
close_virtual_addressing_space:
|
||||
mov ebx,[addressing_space]
|
||||
mov eax,edi
|
||||
sub eax,[ebx+18h]
|
||||
mov [ebx+1Ch],eax
|
||||
test byte [ebx+0Ah],2
|
||||
jz addressing_space_closed
|
||||
push esi edi ecx edx
|
||||
mov ecx,eax
|
||||
mov eax,[tagged_blocks]
|
||||
mov dword [eax-4],11h
|
||||
mov dword [eax-8],ecx
|
||||
|
|
@ -951,10 +988,9 @@ virtual_directive:
|
|||
cmp eax,[ebx+8]
|
||||
jbe out_of_memory
|
||||
mov [tagged_blocks],eax
|
||||
mov [edx+18h],eax
|
||||
push esi
|
||||
lea esi,[edi-1]
|
||||
lea edi,[eax+ecx-1]
|
||||
xchg eax,[ebx+18h]
|
||||
lea esi,[eax+ecx-1]
|
||||
mov eax,edi
|
||||
sub eax,esi
|
||||
std
|
||||
|
|
@ -972,28 +1008,12 @@ virtual_directive:
|
|||
sub edi,2
|
||||
rep movs dword [edi],[esi]
|
||||
cld
|
||||
pop esi
|
||||
mov ecx,edx
|
||||
cdq
|
||||
add [ecx],eax
|
||||
adc dword [ecx+4],edx
|
||||
adc byte [ecx+8],dl
|
||||
virtual_space_ok:
|
||||
mov eax,[ebx+12]
|
||||
mov [addressing_space],eax
|
||||
mov edi,[ebx+8]
|
||||
remove_structure_data:
|
||||
push esi edi
|
||||
mov ecx,ebx
|
||||
sub ecx,[structures_buffer]
|
||||
shr ecx,2
|
||||
lea esi,[ebx-4]
|
||||
lea edi,[esi+18h]
|
||||
std
|
||||
rep movs dword [edi],[esi]
|
||||
cld
|
||||
add [structures_buffer],18h
|
||||
pop edi esi
|
||||
add [ebx],eax
|
||||
adc dword [ebx+4],edx
|
||||
adc byte [ebx+8],dl
|
||||
pop edx ecx edi esi
|
||||
addressing_space_closed:
|
||||
ret
|
||||
repeat_directive:
|
||||
cmp [prefixed_instruction],0
|
||||
|
|
|
|||
|
|
@ -281,9 +281,6 @@ heap_directive:
|
|||
je pe_heap
|
||||
jmp illegal_instruction
|
||||
segment_directive:
|
||||
mov ebp,[addressing_space]
|
||||
test byte [ds:ebp+0Ah],1
|
||||
jnz illegal_instruction
|
||||
mov al,[output_format]
|
||||
cmp al,2
|
||||
je mz_segment
|
||||
|
|
@ -291,9 +288,6 @@ segment_directive:
|
|||
je elf_segment
|
||||
jmp illegal_instruction
|
||||
section_directive:
|
||||
mov ebp,[addressing_space]
|
||||
test byte [ds:ebp+0Ah],1
|
||||
jnz illegal_instruction
|
||||
mov al,[output_format]
|
||||
cmp al,3
|
||||
je pe_section
|
||||
|
|
@ -1120,7 +1114,7 @@ format_pe:
|
|||
xor bh,bh
|
||||
pe_labels_type_ok:
|
||||
push eax ebx
|
||||
call new_addressing_space
|
||||
call init_addressing_space
|
||||
mov ebp,ebx
|
||||
pop ebx eax
|
||||
mov [ds:ebp],eax
|
||||
|
|
@ -2326,7 +2320,7 @@ format_coff:
|
|||
xor eax,eax
|
||||
mov [number_of_sections],eax
|
||||
mov edx,ebx
|
||||
call new_addressing_space
|
||||
call init_addressing_space
|
||||
mov [ebx+14h],edx
|
||||
mov byte [ebx+9],2
|
||||
mov [code_type],32
|
||||
|
|
@ -2944,7 +2938,7 @@ format_elf:
|
|||
mov al,4
|
||||
mov [ebx+10h],eax
|
||||
mov edx,ebx
|
||||
call new_addressing_space
|
||||
call init_addressing_space
|
||||
xchg edx,ebx
|
||||
mov [edx+14h],ebx
|
||||
mov byte [edx+9],2
|
||||
|
|
@ -3709,7 +3703,7 @@ format_elf_exe:
|
|||
adc cl,0
|
||||
elf_exe_addressing_setup:
|
||||
push eax
|
||||
call create_addressing_space
|
||||
call init_addressing_space
|
||||
pop eax
|
||||
mov [ebx],eax
|
||||
mov [ebx+4],edx
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
|
||||
|
||||
; flat assembler core
|
||||
; Copyright (c) 1999-2012, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
|
|
|
|||
|
|
@ -563,6 +563,10 @@ instructions_3:
|
|||
db 'xor',30h
|
||||
dw basic_instruction-instruction_handler
|
||||
instructions_4:
|
||||
db 'adcx',66h
|
||||
dw adx_instruction-instruction_handler
|
||||
db 'adox',0F3h
|
||||
dw adx_instruction-instruction_handler
|
||||
db 'andn',0F2h
|
||||
dw andn_instruction-instruction_handler
|
||||
db 'arpl',0
|
||||
|
|
@ -581,6 +585,8 @@ instructions_4:
|
|||
dw call_instruction-instruction_handler
|
||||
db 'cdqe',98h
|
||||
dw simple_instruction_64bit-instruction_handler
|
||||
db 'clac',0CAh
|
||||
dw simple_vmx_instruction-instruction_handler
|
||||
db 'clgi',0DDh
|
||||
dw simple_vmx_instruction-instruction_handler
|
||||
db 'clts',6
|
||||
|
|
@ -783,6 +789,8 @@ instructions_4:
|
|||
dw pm_store_word_instruction-instruction_handler
|
||||
db 'smsw',14h
|
||||
dw pm_store_word_instruction-instruction_handler
|
||||
db 'stac',0CBh
|
||||
dw simple_vmx_instruction-instruction_handler
|
||||
db 'stgi',0DCh
|
||||
dw simple_vmx_instruction-instruction_handler
|
||||
db 'stos',0AAh
|
||||
|
|
@ -1551,6 +1559,8 @@ instructions_6:
|
|||
dw simple_extended_instruction_64bit-instruction_handler
|
||||
db 'rdrand',110b
|
||||
dw rdrand_instruction-instruction_handler
|
||||
db 'rdseed',111b
|
||||
dw rdrand_instruction-instruction_handler
|
||||
db 'rdtscp',1
|
||||
dw rdtscp_instruction-instruction_handler
|
||||
db 'repeat',0
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
; cannot simply be copied and put under another distribution licence
|
||||
; (including the GNU Public Licence).
|
||||
|
||||
VERSION_STRING equ "1.71.00"
|
||||
VERSION_STRING equ "1.71.01"
|
||||
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 71
|
||||
|
|
|
|||
|
|
@ -5983,6 +5983,27 @@ movbe_instruction:
|
|||
mov al,[operand_size]
|
||||
call operand_autodetect
|
||||
jmp instruction_ready
|
||||
adx_instruction:
|
||||
mov [base_code],0Fh
|
||||
mov [extended_code],38h
|
||||
mov [supplemental_code],0F6h
|
||||
mov [operand_prefix],al
|
||||
call get_reg_mem
|
||||
jc adx_reg_reg
|
||||
mov al,[operand_size]
|
||||
cmp al,4
|
||||
je instruction_ready
|
||||
cmp al,8
|
||||
jne invalid_operand_size
|
||||
call operand_64bit
|
||||
jmp instruction_ready
|
||||
adx_reg_reg:
|
||||
cmp ah,4
|
||||
je nomem_instruction_ready
|
||||
cmp ah,8
|
||||
jne invalid_operand_size
|
||||
call operand_64bit
|
||||
jmp nomem_instruction_ready
|
||||
|
||||
simple_vmx_instruction:
|
||||
mov ah,al
|
||||
|
|
|
|||
|
|
@ -2,6 +2,14 @@
|
|||
Visit http://flatassembler.net/ for more information.
|
||||
|
||||
|
||||
version 1.71.01 (Sep 23, 2012)
|
||||
|
||||
[+] Added support for ADX, RDSEED and SMAP instruction sets.
|
||||
|
||||
[-] Fixed the bugs related to creating a new addressing space inside the
|
||||
virtual block with "org" directive.
|
||||
|
||||
|
||||
version 1.71.00 (Sep 21, 2012)
|
||||
|
||||
[+] Added ability to define a special kind of label identifying the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue