mirror of
https://github.com/tgrysztar/fasm
synced 2026-08-26 00:23:06 -04:00
release 1.71.02
This commit is contained in:
parent
367bc95b16
commit
90c5a8c5ad
9 changed files with 131 additions and 68 deletions
28
FASM.TXT
28
FASM.TXT
|
|
@ -1454,7 +1454,7 @@ computes the sine of that value, "fcos" computes the cosine of that value,
|
|||
value, "frndint" rounds it to the nearest integral value, depending on the
|
||||
current rounding mode. "f2xm1" computes the exponential value of 2 to the
|
||||
power of ST0 and substracts the 1.0 from it, the value of ST0 must lie in the
|
||||
range -1.0 to +1.0. All these instruction store the result in ST0 and have no
|
||||
range -1.0 to +1.0. All these instructions store the result in ST0 and have no
|
||||
operands.
|
||||
"fsincos" computes both the sine and the cosine of the value in ST0
|
||||
register, stores the sine in ST0 and pushes the cosine on the top of FPU
|
||||
|
|
@ -1471,7 +1471,7 @@ remainder in the way specified by IEEE Standard 754. "fscale" truncates the
|
|||
value in ST1 and increases the exponent of ST0 by this value. "fxtract"
|
||||
separates the value in ST0 into its exponent and significand, stores the
|
||||
exponent in ST0 and pushes the significand onto the register stack. "fnop"
|
||||
performs no operation. These instruction have no operands.
|
||||
performs no operation. These instructions have no operands.
|
||||
"fxch" exchanges the contents of ST0 an another FPU register. The operand
|
||||
should be an FPU register, if no operand is specified, the contents of ST0 and
|
||||
ST1 are exchanged.
|
||||
|
|
@ -1504,7 +1504,7 @@ another FPU register and set the ZF, PF and CF flags according to the results.
|
|||
"fcomip" and "fucomip" additionaly pop the register stack after performing the
|
||||
comparison. The instructions obtained by attaching the FPU condition mnemonic
|
||||
(see table 2.2) to the "fcmov" mnemonic transfer the specified FPU register
|
||||
into ST0 register if the fiven test condition is true. These instruction
|
||||
into ST0 register if the given test condition is true. These instructions
|
||||
allow two different syntaxes, one with single operand specifying the source
|
||||
FPU register, and one with two operands, in that case destination operand
|
||||
should be ST0 register and the second operand specifies the source FPU
|
||||
|
|
@ -1533,7 +1533,7 @@ and sets the flags in FPU status word to indicate the class of value in the
|
|||
register. These instructions have no operands.
|
||||
"fstsw" and "fnstsw" store the current value of the FPU status word in the
|
||||
destination location. The destination operand can be either a 16-bit memory or
|
||||
the AX register. "fstsw" checks for pending umasked FPU exceptions before
|
||||
the AX register. "fstsw" checks for pending unmasked FPU exceptions before
|
||||
storing the status word, "fnstsw" does not.
|
||||
"fstcw" and "fnstcw" store the current value of the FPU control word at the
|
||||
specified destination in memory. "fstcw" checks for pending umasked FPU
|
||||
|
|
@ -1549,7 +1549,7 @@ FPU state (operating environment and register stack) at the specified
|
|||
destination in memory and reinitializes the FPU. "fsave" check for pending
|
||||
unmasked FPU exceptions before proceeding, "fnsave" does not. "frstor"
|
||||
loads the FPU state from the specified memory location. All these instructions
|
||||
need an operand being a memory location. For each of these instruction
|
||||
need an operand being a memory location. For each of these instructions
|
||||
exist two additional mnemonics that allow to precisely select the type of the
|
||||
operation. The "fstenvw", "fnstenvw", "fldenvw", "fsavew", "fnsavew" and
|
||||
"frstorw" mnemonics force the instruction to perform operation as in the 16-bit
|
||||
|
|
@ -1561,12 +1561,12 @@ state. "finit" checks for pending unmasked FPU exception before proceeding,
|
|||
FPU status word. "fclex" checks for pending unmasked FPU exception before
|
||||
proceeding, "fnclex" does not. "wait" and "fwait" are synonyms for the same
|
||||
instruction, which causes the processor to check for pending unmasked FPU
|
||||
exceptions and handle them before proceeding. These instruction have no
|
||||
exceptions and handle them before proceeding. These instructions have no
|
||||
operands.
|
||||
"ffree" sets the tag associated with specified FPU register to empty. The
|
||||
operand should be an FPU register.
|
||||
"fincstp" and "fdecstp" rotate the FPU stack by one by adding or
|
||||
substracting one to the pointer of the top of stack. These instruction have no
|
||||
substracting one to the pointer of the top of stack. These instructions have no
|
||||
operands.
|
||||
|
||||
|
||||
|
|
@ -1948,7 +1948,7 @@ operand. "cvtpd2dq" and "cvttpd2dq" convert packed double precision floating
|
|||
point values to packed two double word integers, storing the result in the low
|
||||
quad word of the destination operand. "cvtdq2ps" converts packed four
|
||||
double word integers to packed single precision floating point values.
|
||||
For all these instruction destination operand must be a SSE register, the
|
||||
For all these instructions destination operand must be a SSE register, the
|
||||
source operand can be a 128-bit memory location or SSE register.
|
||||
"cvtdq2pd" converts packed two double word integers from the source operand to
|
||||
packed double precision floating point values, the source can be a 64-bit
|
||||
|
|
@ -2050,7 +2050,7 @@ source operand into high quad word of destination operand. "haddpd" performs
|
|||
the addition of two double precision values within each operand, and stores
|
||||
the result from destination operand into low quad word of destination operand,
|
||||
and the result from source operand into high quad word of destination operand.
|
||||
All these instruction need the destination operand to be SSE register, source
|
||||
All these instructions need the destination operand to be SSE register, source
|
||||
operand can be SSE register or 128-bit memory location.
|
||||
"monitor" sets up an address range for monitoring of write-back stores. It
|
||||
need its three operands to be EAX, ECX and EDX register in that order. "mwait"
|
||||
|
|
@ -2300,7 +2300,7 @@ packed quad words into the destination register. "pminsb" and "pmaxsb"
|
|||
return the minimum or maximum values of packed signed bytes, "pminuw" and
|
||||
"pmaxuw" return the minimum and maximum values of packed unsigned words,
|
||||
"pminud", "pmaxud", "pminsd" and "pmaxsd" return minimum or maximum values
|
||||
of packed unsigned or signed words. These instruction complement the
|
||||
of packed unsigned or signed words. These instructions complement the
|
||||
instructions computing packed minimum or maximum introduced by SSE.
|
||||
"ptest" sets the ZF flag to one when the result of bitwise AND of the
|
||||
both operands is zero, and zeroes the ZF otherwise. It also sets CF flag
|
||||
|
|
@ -2842,7 +2842,7 @@ AVX. They introduce new vector instructions (and sometimes also their SSE
|
|||
equivalents that use classic instruction encoding), and even some new
|
||||
instructions operating on general registers that use the AVX-like encoding
|
||||
allowing the extended syntax with separate destination and source operands.
|
||||
The CPU support for each of these instruction sets needs to be determined
|
||||
The CPU support for each of these instructions sets needs to be determined
|
||||
separately.
|
||||
The AES extension provides a specialized set of instructions for the
|
||||
purpose of cryptographic computations defined by Advanced Encryption Standard.
|
||||
|
|
@ -2964,7 +2964,7 @@ unsigned quad words. The respective values from the first and second source
|
|||
are compared and the corresponding data element in destination is set to
|
||||
either all ones or all zeros depending on the result of comparison. The fourth
|
||||
operand has to specify one of the eight comparison types (table 2.5). All
|
||||
these instruction have also variants with only three operands and the type
|
||||
these instructions have also variants with only three operands and the type
|
||||
of comparison encoded within the instruction name by inserting the comparison
|
||||
mnemonic after "vpcom".
|
||||
|
||||
|
|
@ -3021,7 +3021,7 @@ from the first and second source and then add the products to the parallel
|
|||
values from the third source, then "vpmacsww" takes the lowest 16 bits of the
|
||||
result and "vpmacssww" saturates the result down to 16-bit value, and they
|
||||
store the final 16-bit results in the destination. "vpmacsdd" and "vpmacssdd"
|
||||
perform the analogous operation on 32-bit values. "vpmacswd" and "vpmacswd" do
|
||||
perform the analogous operation on 32-bit values. "vpmacswd" and "vpmacsswd" do
|
||||
the same calculation only on the low 16-bit values from each 32-bit block and
|
||||
form the 32-bit results. "vpmacsdql" and "vpmacssdql" perform such operation
|
||||
on the low 32-bit values from each 64-bit block and form the 64-bit results,
|
||||
|
|
@ -3703,7 +3703,7 @@ while it will itself define "alpha" when it's not already defined earlier, thus
|
|||
potentially causing the error because of double definition if the "alpha" is
|
||||
also defined somewhere later.
|
||||
The "used" operator may be expected to behave in a similar manner in
|
||||
analogous cases, however any other kinds of predictions my not be so simple and
|
||||
analogous cases, however any other kinds of predictions may not be so simple and
|
||||
you should never rely on them this way.
|
||||
The "err" directive, usually used to stop the assembly when some condition is
|
||||
met, stops the assembly immediately, regardless of whether the current pass
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
flat assembler version 1.70
|
||||
flat assembler version 1.71
|
||||
Copyright (c) 1999-2012, Tomasz Grysztar.
|
||||
All rights reserved.
|
||||
|
||||
|
|
|
|||
|
|
@ -256,10 +256,12 @@ get_params:
|
|||
stosb
|
||||
pop ds
|
||||
cmp [input_file],0
|
||||
je bad_params
|
||||
je no_input_file
|
||||
clc
|
||||
ret
|
||||
bad_params:
|
||||
pop ds
|
||||
no_input_file:
|
||||
stc
|
||||
ret
|
||||
|
||||
|
|
|
|||
|
|
@ -290,17 +290,27 @@ calculate_expression:
|
|||
mov [error_info],ebx
|
||||
jmp calculation_loop
|
||||
calculate_add:
|
||||
mov ecx,[ebx+16]
|
||||
cmp byte [edi+12],0
|
||||
je add_values
|
||||
mov ecx,[edi+16]
|
||||
cmp byte [ebx+12],0
|
||||
je add_values
|
||||
call recoverable_misuse
|
||||
add_values:
|
||||
xor ah,ah
|
||||
mov ah,[ebx+12]
|
||||
mov al,[edi+12]
|
||||
or [ebx+12],al
|
||||
or al,al
|
||||
jz add_values
|
||||
or ah,ah
|
||||
jz add_relocatable
|
||||
add ah,al
|
||||
jnz invalid_add
|
||||
mov ecx,[edi+16]
|
||||
cmp ecx,[ebx+16]
|
||||
je add_values
|
||||
invalid_add:
|
||||
call recoverable_misuse
|
||||
jmp add_values
|
||||
add_relocatable:
|
||||
mov ah,al
|
||||
mov ecx,[edi+16]
|
||||
mov [ebx+16],ecx
|
||||
add_values:
|
||||
mov [ebx+12],ah
|
||||
mov eax,[edi]
|
||||
add [ebx],eax
|
||||
mov eax,[edi+4]
|
||||
|
|
@ -314,31 +324,29 @@ calculate_expression:
|
|||
jz calculation_loop
|
||||
push esi
|
||||
mov esi,ebx
|
||||
lea ebx,[edi+10]
|
||||
mov cl,[edi+8]
|
||||
mov cl,[edi+10]
|
||||
mov al,[edi+8]
|
||||
call add_register
|
||||
lea ebx,[edi+11]
|
||||
mov cl,[edi+9]
|
||||
mov cl,[edi+11]
|
||||
mov al,[edi+9]
|
||||
call add_register
|
||||
pop esi
|
||||
jmp calculation_loop
|
||||
add_register:
|
||||
or cl,cl
|
||||
or al,al
|
||||
jz add_register_done
|
||||
add_register_start:
|
||||
cmp [esi+8],cl
|
||||
cmp [esi+8],al
|
||||
jne add_in_second_slot
|
||||
mov al,[ebx]
|
||||
add [esi+10],al
|
||||
add [esi+10],cl
|
||||
jo value_out_of_range
|
||||
jnz add_register_done
|
||||
mov byte [esi+8],0
|
||||
ret
|
||||
add_in_second_slot:
|
||||
cmp [esi+9],cl
|
||||
cmp [esi+9],al
|
||||
jne create_in_first_slot
|
||||
mov al,[ebx]
|
||||
add [esi+11],al
|
||||
add [esi+11],cl
|
||||
jo value_out_of_range
|
||||
jnz add_register_done
|
||||
mov byte [esi+9],0
|
||||
|
|
@ -346,16 +354,14 @@ calculate_expression:
|
|||
create_in_first_slot:
|
||||
cmp byte [esi+8],0
|
||||
jne create_in_second_slot
|
||||
mov [esi+8],cl
|
||||
mov al,[ebx]
|
||||
mov [esi+10],al
|
||||
mov [esi+8],al
|
||||
mov [esi+10],cl
|
||||
ret
|
||||
create_in_second_slot:
|
||||
cmp byte [esi+9],0
|
||||
jne invalid_expression
|
||||
mov [esi+9],cl
|
||||
mov al,[ebx]
|
||||
mov [esi+11],al
|
||||
mov [esi+9],al
|
||||
mov [esi+11],cl
|
||||
add_register_done:
|
||||
ret
|
||||
out_of_range:
|
||||
|
|
@ -366,6 +372,8 @@ calculate_expression:
|
|||
mov al,[edi+12]
|
||||
or al,al
|
||||
jz sub_values
|
||||
or ah,ah
|
||||
jz negate_relocatable
|
||||
cmp al,ah
|
||||
jne invalid_sub
|
||||
xor ah,ah
|
||||
|
|
@ -374,6 +382,12 @@ calculate_expression:
|
|||
je sub_values
|
||||
invalid_sub:
|
||||
call recoverable_misuse
|
||||
jmp sub_values
|
||||
negate_relocatable:
|
||||
neg al
|
||||
mov ah,al
|
||||
mov ecx,[edi+16]
|
||||
mov [ebx+16],ecx
|
||||
sub_values:
|
||||
mov [ebx+12],ah
|
||||
mov eax,[edi]
|
||||
|
|
@ -391,18 +405,18 @@ calculate_expression:
|
|||
jz calculation_loop
|
||||
push esi
|
||||
mov esi,ebx
|
||||
lea ebx,[edi+10]
|
||||
mov cl,[edi+8]
|
||||
mov cl,[edi+10]
|
||||
mov al,[edi+8]
|
||||
call sub_register
|
||||
lea ebx,[edi+11]
|
||||
mov cl,[edi+9]
|
||||
mov cl,[edi+11]
|
||||
mov al,[edi+9]
|
||||
call sub_register
|
||||
pop esi
|
||||
jmp calculation_loop
|
||||
sub_register:
|
||||
or cl,cl
|
||||
or al,al
|
||||
jz add_register_done
|
||||
neg byte [ebx]
|
||||
neg cl
|
||||
jo value_out_of_range
|
||||
jmp add_register_start
|
||||
calculate_mul:
|
||||
|
|
@ -424,6 +438,7 @@ calculate_expression:
|
|||
xor bl,bl
|
||||
cmp byte [esi+13],0
|
||||
je mul_first_sign_ok
|
||||
xor bl,-1
|
||||
mov eax,[esi]
|
||||
mov edx,[esi+4]
|
||||
not eax
|
||||
|
|
@ -434,10 +449,20 @@ calculate_expression:
|
|||
mov [esi+4],edx
|
||||
or eax,edx
|
||||
jz mul_overflow
|
||||
xor bl,-1
|
||||
mul_first_sign_ok:
|
||||
cmp byte [edi+13],0
|
||||
je mul_second_sign_ok
|
||||
xor bl,-1
|
||||
cmp byte [esi+8],0
|
||||
je mul_first_register_sign_ok
|
||||
neg byte [esi+10]
|
||||
jo invalid_expression
|
||||
mul_first_register_sign_ok:
|
||||
cmp byte [esi+9],0
|
||||
je mul_second_register_sign_ok
|
||||
neg byte [esi+11]
|
||||
jo invalid_expression
|
||||
mul_second_register_sign_ok:
|
||||
mov eax,[edi]
|
||||
mov edx,[edi+4]
|
||||
not eax
|
||||
|
|
@ -448,7 +473,6 @@ calculate_expression:
|
|||
mov [edi+4],edx
|
||||
or eax,edx
|
||||
jz mul_overflow
|
||||
xor bl,-1
|
||||
mul_second_sign_ok:
|
||||
cmp dword [esi+4],0
|
||||
jz mul_numbers
|
||||
|
|
@ -879,12 +903,17 @@ calculate_expression:
|
|||
not dword [edi]
|
||||
jmp finish_not
|
||||
calculate_neg:
|
||||
cmp word [edi+8],0
|
||||
jne invalid_expression
|
||||
cmp byte [edi+12],0
|
||||
je neg_ok
|
||||
call recoverable_misuse
|
||||
neg_ok:
|
||||
cmp byte [edi+8],0
|
||||
je neg_first_register_ok
|
||||
neg byte [edi+10]
|
||||
jo invalid_expression
|
||||
neg_first_register_ok:
|
||||
cmp byte [edi+9],0
|
||||
je neg_second_register_ok
|
||||
neg byte [edi+11]
|
||||
jo invalid_expression
|
||||
neg_second_register_ok:
|
||||
neg byte [edi+12]
|
||||
xor eax,eax
|
||||
xor edx,edx
|
||||
xor cl,cl
|
||||
|
|
|
|||
|
|
@ -2438,8 +2438,10 @@ mark_coff_relocation:
|
|||
test [format_flags],8
|
||||
jnz coff_64bit_relocation
|
||||
mov al,6
|
||||
cmp [value_type],2
|
||||
je coff_relocation
|
||||
cmp [value_type],5
|
||||
jne coff_relocation
|
||||
jne invalid_use_of_symbol
|
||||
inc al
|
||||
jmp coff_relocation
|
||||
coff_64bit_relocation:
|
||||
|
|
@ -2447,8 +2449,10 @@ mark_coff_relocation:
|
|||
cmp [value_type],4
|
||||
je coff_relocation
|
||||
mov al,2
|
||||
cmp [value_type],2
|
||||
je coff_relocation
|
||||
cmp [value_type],5
|
||||
jne coff_relocation
|
||||
jne invalid_use_of_symbol
|
||||
inc al
|
||||
jmp coff_relocation
|
||||
coff_relocation_relative:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
; flat assembler version 1.70
|
||||
; flat assembler version 1.71
|
||||
; Copyright (c) 1999-2012, Tomasz Grysztar.
|
||||
; All rights reserved.
|
||||
;
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
; cannot simply be copied and put under another distribution licence
|
||||
; (including the GNU Public Licence).
|
||||
|
||||
VERSION_STRING equ "1.71.01"
|
||||
VERSION_STRING equ "1.71.02"
|
||||
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 71
|
||||
|
|
|
|||
|
|
@ -343,9 +343,14 @@ listing:
|
|||
address_ok:
|
||||
ret
|
||||
address_register:
|
||||
test dh,dh
|
||||
jz register_ok
|
||||
cmp dh,0
|
||||
je register_ok
|
||||
jl negative_register
|
||||
mov al,'+'
|
||||
jmp register_sign_ok
|
||||
negative_register:
|
||||
mov al,'-'
|
||||
register_sign_ok:
|
||||
stosb
|
||||
push esi
|
||||
mov esi,address_registers
|
||||
|
|
|
|||
|
|
@ -114,15 +114,25 @@ symbols:
|
|||
mov bl,[edx+13]
|
||||
mov bh,[edx+15]
|
||||
call write_address_register
|
||||
cmp byte [edx+11],0
|
||||
mov bl,[edx+11]
|
||||
cmp bl,0
|
||||
je symbol_type_ok
|
||||
jl negated_symbol
|
||||
mov ax,', '
|
||||
stosw
|
||||
cmp byte [edx+11],1
|
||||
jmp write_symbol_type
|
||||
negated_symbol:
|
||||
mov ax,', '
|
||||
stosw
|
||||
mov esi,_negated
|
||||
call write_string
|
||||
neg bl
|
||||
write_symbol_type:
|
||||
cmp bl,1
|
||||
je segment_type
|
||||
cmp byte [edx+11],5
|
||||
cmp bl,5
|
||||
je rva_type
|
||||
cmp byte [edx+11],6
|
||||
cmp bl,6
|
||||
je plt_type
|
||||
test byte [edx+20+3],80h
|
||||
jnz external
|
||||
|
|
@ -250,9 +260,14 @@ write_dec_number:
|
|||
pop edx ebx
|
||||
ret
|
||||
write_address_register:
|
||||
test bh,bh
|
||||
jz register_ok
|
||||
cmp bh,0
|
||||
je register_ok
|
||||
jl negative_register
|
||||
mov al,'+'
|
||||
jmp register_sign_ok
|
||||
negative_register:
|
||||
mov al,'-'
|
||||
register_sign_ok:
|
||||
stosb
|
||||
push esi
|
||||
mov esi,address_registers
|
||||
|
|
@ -390,6 +405,7 @@ address_registers db 23h,2,'bx'
|
|||
db 0F8h,3,'rip'
|
||||
db 0,1,'?'
|
||||
|
||||
_negated db 'negated ',0
|
||||
_relocatable_segment db 'relocatable segment',0
|
||||
_relocatable db 'relocatable',0
|
||||
_in_section db ' in section ',0
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@
|
|||
Visit http://flatassembler.net/ for more information.
|
||||
|
||||
|
||||
version 1.71.02 (Sep 26, 2012)
|
||||
|
||||
[-] Expression calculator now allows to calculate the difference of
|
||||
relocatable addresses in a reverse order (first substracting/negating
|
||||
and then adding the other one).
|
||||
|
||||
|
||||
version 1.71.01 (Sep 23, 2012)
|
||||
|
||||
[+] Added support for ADX, RDSEED and SMAP instruction sets.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue