version 1.67.33 (Feb 20, 2009)
[+] Added ERR directive that allows to signalize error from the source.

version 1.67.32 (Feb 13, 2009)
[+] Allowed single quote character to be put inside the number value, to help improve long numbers readability.

version 1.67.31 (Feb 11, 2009)
[-] Fixed floating point converter to no longer generate NaN in some cases, and corrected denormal numbers generation.

version 1.67.30 (Feb 08, 2009)
[+] Added missing Intel SSE4 instructions.
[+] Added SSE4a (EXTRQ/INSERTQ/MOVNTSD/MOVNTSS) instructions.
[+] Added FSTENVW/FSTENVD/FSAVEW/FSAVED mnemonics.

Visit http://flatassembler.net/ for more information.

git-svn-id: svn://kolibrios.org@1039 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
heavyiron 2009-02-20 13:05:49 +00:00
parent c84192cba4
commit 1415df25a3
11 changed files with 818 additions and 77 deletions

View File

@ -1,6 +1,6 @@
; flat assembler core
; Copyright (c) 1999-2007, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
assembler:
@ -357,6 +357,7 @@ assemble_line:
; mov [operand_prefix],0
; mov [rex_prefix],0
mov dword [operand_size],0
mov [opcode_prefix],0
mov [immediate_size],0
movzx ebx,word [esi]
mov al,[esi+2]
@ -1587,8 +1588,41 @@ data_twords:
stos dword [edi]
mov ax,[esi+8]
add ax,3FFFh
cmp ax,8000h
jo value_out_of_range
cmp ax,7FFFh
jge value_out_of_range
cmp ax,0
jg tword_exp_ok
mov cx,ax
neg cx
inc cx
cmp cx,64
jae value_out_of_range
cmp cx,32
ja large_shift
mov eax,[esi]
mov edx,[esi+4]
mov ebx,edx
shr edx,cl
shrd eax,ebx,cl
jmp tword_mantissa_shift_done
large_shift:
sub cx,32
xor edx,edx
mov eax,[esi+4]
shr eax,cl
tword_mantissa_shift_done:
jnc store_shifted_mantissa
add eax,1
adc edx,0
store_shifted_mantissa:
mov [edi-8],eax
mov [edi-4],edx
xor ax,ax
test edx,1 shl 31
jz tword_exp_ok
inc ax
tword_exp_ok:
mov bl,[esi+11]
shl bx,15
or ax,bx
@ -1989,3 +2023,10 @@ align_directive:
nops_stosw_ok:
rep stos dword [edi]
jmp reserved_data
err_directive:
mov al,[esi]
cmp al,0Fh
je invoked_error
or al,al
jz invoked_error
jmp extra_characters_on_line

View File

@ -1,6 +1,6 @@
; flat assembler core
; Copyright (c) 1999-2007, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
out_of_memory:
@ -169,3 +169,6 @@ data_already_defined:
too_many_repeats:
push _too_many_repeats
jmp assembler_error
invoked_error:
push _invoked_error
jmp assembler_error

View File

@ -1,6 +1,6 @@
; flat assembler core
; Copyright (c) 1999-2007, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
convert_expression:
@ -206,6 +206,8 @@ get_number:
get_dec_digit:
cmp esi,ebx
ja number_ok
cmp byte [esi],27h
je next_dec_digit
xor edx,edx
mov eax,[edi]
shld edx,eax,2
@ -234,6 +236,7 @@ get_number:
add [edi],eax
adc dword [edi+4],0
jc dec_out_of_range
next_dec_digit:
inc esi
jmp get_dec_digit
dec_out_of_range:
@ -255,6 +258,8 @@ get_number:
cmp esi,[number_start]
jb number_ok
movzx eax,byte [esi]
cmp al,27h
je bin_digit_skip
sub al,30h
cmp al,1
ja bad_number
@ -279,6 +284,9 @@ get_number:
jz get_bin_digit
or ebp,-1
jmp get_bin_digit
bin_digit_skip:
dec esi
jmp get_bin_digit
pascal_hex_number:
cmp cl,1
je bad_number
@ -288,6 +296,8 @@ get_number:
cmp esi,[number_start]
jb number_ok
movzx eax,byte [esi]
cmp al,27h
je hex_digit_skip
cmp al,'x'
je hex_number_ok
cmp al,'$'
@ -326,12 +336,17 @@ get_number:
jz get_hex_digit
or ebp,-1
jmp get_hex_digit
hex_digit_skip:
dec esi
jmp get_hex_digit
get_oct_number:
xor bl,bl
get_oct_digit:
cmp esi,[number_start]
jb number_ok
movzx eax,byte [esi]
cmp al,27h
je oct_digit_skip
sub al,30h
cmp al,7
ja bad_number
@ -358,6 +373,9 @@ get_number:
shl eax,cl
or dword [edi+4],eax
jmp get_oct_digit
oct_digit_skip:
dec esi
jmp get_oct_digit
oct_out_of_range:
or al,al
jz get_oct_digit
@ -1736,8 +1754,25 @@ calculate_expression:
shr eax,1
fp_dword_ok:
add bx,7Fh
cmp bx,100h
jae value_out_of_range
cmp bx,0FFh
jge value_out_of_range
cmp bx,0
jg fp_dword_exp_ok
or eax,1 shl 23
mov cx,bx
neg cx
inc cx
cmp cx,23
ja value_out_of_range
xor bx,bx
shr eax,cl
jnc fp_dword_exp_ok
inc eax
test eax,1 shl 23
jz fp_dword_exp_ok
and eax,1 shl 23 - 1
inc bx
fp_dword_exp_ok:
shl ebx,23
or eax,ebx
fp_dword_store:
@ -1773,8 +1808,37 @@ calculate_expression:
rcr eax,1
fp_qword_ok:
add bx,3FFh
cmp bx,800h
jae value_out_of_range
cmp bx,7FFh
jge value_out_of_range
cmp bx,0
jg fp_qword_exp_ok
or edx,1 shl 20
mov cx,bx
neg cx
inc cx
cmp cx,52
ja value_out_of_range
cmp cx,32
jbe fp_qword_small_shift
sub cx,32
mov eax,edx
xor edx,edx
shr eax,cl
jmp fp_qword_shift_done
fp_qword_small_shift:
mov ebx,edx
shr edx,cl
shrd eax,ebx,cl
fp_qword_shift_done:
mov bx,0
jnc fp_qword_exp_ok
add eax,1
adc edx,0
test edx,1 shl 20
jz fp_qword_exp_ok
and edx,1 shl 20 - 1
inc bx
fp_qword_exp_ok:
shl ebx,20
or edx,ebx
fp_qword_store:

View File

@ -1,6 +1,6 @@
; flat assembler core
; Copyright (c) 1999-2007, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
formatter:

View File

@ -1,6 +1,6 @@
; flat assembler core
; Copyright (c) 1999-2007, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
_out_of_memory db 'out of memory',0
@ -48,4 +48,4 @@ _section_not_aligned_enough db 'section is not aligned enough',0
_setting_already_specified db 'setting already specified',0
_data_already_defined db 'data already defined',0
_too_many_repeats db 'too many repeats',0
_invoked_error db 'error directive invoked in source file',0

View File

@ -1,6 +1,6 @@
; flat assembler core
; Copyright (c) 1999-2007, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
parser:

View File

@ -1,6 +1,6 @@
; flat assembler core
; Copyright (c) 1999-2007, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
preprocessor:

View File

@ -1,6 +1,6 @@
; flat assembler core
; Copyright (c) 1999-2007, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
include_variable db 'INCLUDE',0
@ -451,6 +451,8 @@ instructions_3:
dw single_operand_instruction-assembler
db 'end',0
dw end_directive-assembler
db 'err',0
dw err_directive-assembler
db 'fld',0
dw fld_instruction-assembler
db 'fst',2
@ -841,6 +843,8 @@ instructions_5:
dw simple_instruction_16bit-assembler
db 'cpuid',0A2h
dw simple_extended_instruction-assembler
db 'crc32',0
dw crc32_instruction-assembler
db 'divpd',5Eh
dw sse_pd_instruction-assembler
db 'divps',5Eh
@ -855,6 +859,8 @@ instructions_5:
dw entry_directive-assembler
db 'extrn',0
dw extrn_directive-assembler
db 'extrq',0
dw extrq_instruction-assembler
db 'f2xm1',110000b
dw simple_fpu_instruction-assembler
db 'faddp',0
@ -1290,6 +1296,10 @@ instructions_6:
dw fnsave_instruction-assembler
db 'frstpm',0E5h
dw fninit_instruction-assembler
db 'fsaved',6
dw fsave_instruction_32bit-assembler
db 'fsavew',6
dw fsave_instruction_16bit-assembler
db 'fscale',111101b
dw simple_fpu_instruction-assembler
db 'fsetpm',0E4h
@ -1366,7 +1376,13 @@ instructions_6:
dw basic_mmx_instruction-assembler
db 'paddsw',0EDh
dw basic_mmx_instruction-assembler
db 'pextrw',0C5h
db 'pextrb',14h
dw pextrb_instruction-assembler
db 'pextrd',16h
dw pextrd_instruction-assembler
db 'pextrq',16h
dw pextrq_instruction-assembler
db 'pextrw',15h
dw pextrw_instruction-assembler
db 'pfnacc',8Ah
dw amd3dnow_instruction-assembler
@ -1380,6 +1396,12 @@ instructions_6:
dw ssse3_instruction-assembler
db 'phsubw',5
dw ssse3_instruction-assembler
db 'pinsrb',20h
dw pinsrb_instruction-assembler
db 'pinsrd',22h
dw pinsrd_instruction-assembler
db 'pinsrq',22h
dw pinsrq_instruction-assembler
db 'pinsrw',0C4h
dw pinsrw_instruction-assembler
db 'pmaxsb',3Ch
@ -1414,6 +1436,8 @@ instructions_6:
dw sse4_instruction_38-assembler
db 'pmullw',0D5h
dw basic_mmx_instruction-assembler
db 'popcnt',0B8h
dw popcnt_instruction-assembler
db 'psadbw',0F6h
dw basic_mmx_instruction-assembler
db 'pshufb',0
@ -1555,12 +1579,28 @@ instructions_7:
dw simple_fpu_instruction-assembler
db 'fincstp',110111b
dw simple_fpu_instruction-assembler
db 'fldenvd',4
dw fldenv_instruction_32bit-assembler
db 'fldenvw',4
dw fldenv_instruction_32bit-assembler
db 'fnsaved',6
dw fnsave_instruction_32bit-assembler
db 'fnsavew',6
dw fnsave_instruction_16bit-assembler
db 'fnstenv',6
dw fldenv_instruction-assembler
db 'frndint',111100b
dw simple_fpu_instruction-assembler
db 'frstord',4
dw fnsave_instruction_32bit-assembler
db 'frstorw',4
dw fnsave_instruction_16bit-assembler
db 'fsincos',111011b
dw simple_fpu_instruction-assembler
db 'fstenvd',6
dw fstenv_instruction_32bit-assembler
db 'fstenvw',6
dw fstenv_instruction_16bit-assembler
db 'fucomip',0E8h
dw fcomip_instruction-assembler
db 'fucompp',0
@ -1571,6 +1611,8 @@ instructions_7:
dw simple_fpu_instruction-assembler
db 'fyl2xp1',111001b
dw simple_fpu_instruction-assembler
db 'insertq',0
dw insertq_instruction-assembler
db 'invlpga',0DFh
dw invlpga_instruction-assembler
db 'ldmxcsr',10b
@ -1603,6 +1645,10 @@ instructions_7:
dw movntdq_instruction-assembler
db 'movntps',2Bh
dw movntps_instruction-assembler
db 'movntsd',2Bh
dw movntsd_instruction-assembler
db 'movntss',2Bh
dw movntss_instruction-assembler
db 'movq2dq',0
dw movq2dq_instruction-assembler
db 'mpsadbw',42h
@ -1778,12 +1824,20 @@ instructions_8:
dw cvtss2si_instruction-assembler
db 'fcmovnbe',0D0h
dw fcomi_instruction-assembler
db 'fnstenvd',6
dw fldenv_instruction_32bit-assembler
db 'fnstenvw',6
dw fldenv_instruction_16bit-assembler
db 'insertps',0
dw insertps_instruction-assembler
db 'maskmovq',0
dw maskmovq_instruction-assembler
db 'movmskpd',0
dw movmskpd_instruction-assembler
db 'movmskps',0
dw movmskps_instruction-assembler
db 'movntdqa',0
dw movntdqa_instruction-assembler
db 'movshdup',16h
dw cvtdq2pd_instruction-assembler
db 'movsldup',12h
@ -1805,7 +1859,31 @@ instructions_8:
db 'pfrsqit1',0A7h
dw amd3dnow_instruction-assembler
db 'pmovmskb',0D7h
dw pextrw_instruction-assembler
dw pmovmskb_instruction-assembler
db 'pmovsxbd',21h
dw pmovsxbd_instruction-assembler
db 'pmovsxbq',22h
dw pmovsxbq_instruction-assembler
db 'pmovsxbw',20h
dw pmovsxbw_instruction-assembler
db 'pmovsxdq',25h
dw pmovsxdq_instruction-assembler
db 'pmovsxwd',23h
dw pmovsxwd_instruction-assembler
db 'pmovsxwq',24h
dw pmovsxwq_instruction-assembler
db 'pmovzxbd',31h
dw pmovsxbd_instruction-assembler
db 'pmovzxbq',32h
dw pmovsxbq_instruction-assembler
db 'pmovzxbw',30h
dw pmovsxbw_instruction-assembler
db 'pmovzxdq',35h
dw pmovsxdq_instruction-assembler
db 'pmovzxwd',33h
dw pmovsxwd_instruction-assembler
db 'pmovzxwq',34h
dw pmovsxwq_instruction-assembler
db 'pmulhrsw',0Bh
dw ssse3_instruction-assembler
db 'prefetch',0
@ -1841,6 +1919,8 @@ instructions_9:
dw cvtsd2si_instruction-assembler
db 'cvttss2si',2Ch
dw cvtss2si_instruction-assembler
db 'extractps',0
dw extractps_instruction-assembler
db 'pcmpestri',61h
dw sse4_instruction_3a_imm8-assembler
db 'pcmpestrm',60h

View File

@ -1,6 +1,6 @@
; flat assembler core variables
; Copyright (c) 1999-2007, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
; Variables which have to be set up by interface:
@ -100,6 +100,7 @@ operand_size db ?
size_override db ?
operand_prefix db ?
rex_prefix db ?
opcode_prefix db ?
base_code db ?
extended_code db ?
supplemental_code db ?

View File

@ -1,6 +1,6 @@
; flat assembler version 1.67
; Copyright (c) 1999-2008, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
;
; This programs is free for commercial and non-commercial use as long as
@ -33,7 +33,7 @@
; cannot simply be copied and put under another distribution licence
; (including the GNU Public Licence).
VERSION_STRING equ "1.67.29"
VERSION_STRING equ "1.67.33"
VERSION_MAJOR = 1
VERSION_MINOR = 67

View File

@ -1,6 +1,6 @@
; flat assembler core
; Copyright (c) 1999-2007, Tomasz Grysztar.
; Copyright (c) 1999-2009, Tomasz Grysztar.
; All rights reserved.
simple_instruction_except64:
@ -2337,24 +2337,21 @@ movx_instruction:
cmp ah,al
jae invalid_operand_size
cmp ah,1
je movx_mem_8bit
je movx_mem_store
cmp ah,2
jne invalid_operand_size
movx_mem_16bit:
inc [extended_code]
movx_mem_store:
call operand_autodetect
call store_instruction
jmp instruction_assembled
movx_unknown_size:
cmp [error_line],0
jne movx_mem_8bit
jne movx_mem_store
mov eax,[current_line]
mov [error_line],eax
mov [error],operand_size_not_specified
movx_mem_8bit:
call operand_autodetect
call store_instruction
jmp instruction_assembled
jmp movx_mem_store
movx_reg:
lods byte [esi]
call convert_register
@ -4069,18 +4066,11 @@ nop_instruction:
call get_address
mov al,[operand_size]
or al,al
jz extended_nop_nosize
jz extended_nop_store
call operand_autodetect
extended_nop_store:
call store_instruction
jmp instruction_assembled
extended_nop_nosize:
cmp [error_line],0
jne extended_nop_store
mov eax,[current_line]
mov [error_line],eax
mov [error],operand_size_not_specified
jmp extended_nop_store
extended_nop_reg:
lods byte [esi]
call convert_register
@ -4396,12 +4386,37 @@ ffree_instruction:
mov ax,dx
stos word [edi]
jmp instruction_assembled
fstenv_instruction:
mov byte [edi],9Bh
inc edi
fldenv_instruction:
mov [base_code],0D9h
jmp fpu_mem
fstenv_instruction_16bit:
mov byte [edi],9Bh
inc edi
fldenv_instruction_16bit:
call operand_16bit
jmp fldenv_instruction
fstenv_instruction_32bit:
mov byte [edi],9Bh
inc edi
fldenv_instruction_32bit:
call operand_32bit
jmp fldenv_instruction
fsave_instruction_32bit:
mov byte [edi],9Bh
inc edi
fnsave_instruction_32bit:
call operand_32bit
jmp fnsave_instruction
fsave_instruction_16bit:
mov byte [edi],9Bh
inc edi
fnsave_instruction_16bit:
call operand_16bit
jmp fnsave_instruction
fsave_instruction:
mov byte [edi],9Bh
inc edi
@ -4588,7 +4603,7 @@ mmx_ps_instruction:
mov al,byte [value]
stos byte [edi]
jmp instruction_assembled
pextrw_instruction:
pmovmskb_instruction:
mov [base_code],0Fh
mov [extended_code],al
lods byte [esi]
@ -4635,6 +4650,9 @@ pextrw_instruction:
jmp instruction_assembled
mmx_nomem_imm8:
call store_nomem_instruction
call append_imm8
jmp instruction_assembled
append_imm8:
mov [operand_size],0
lods byte [esi]
cmp al,','
@ -4647,7 +4665,7 @@ pextrw_instruction:
jne invalid_operand
call get_byte_value
stosb
jmp instruction_assembled
ret
pinsrw_instruction:
mov [extended_code],al
mov [base_code],0Fh
@ -4684,11 +4702,11 @@ pinsrw_instruction:
jmp mmx_nomem_imm8
pshufw_instruction:
mov [mmx_size],8
mov [operand_prefix],al
mov [opcode_prefix],al
jmp pshuf_instruction
pshufd_instruction:
mov [mmx_size],16
mov [operand_prefix],al
mov [opcode_prefix],al
pshuf_instruction:
mov [base_code],0Fh
mov [extended_code],70h
@ -4827,7 +4845,7 @@ movq_instruction:
jmp instruction_assembled
movq_mem_xmmreg:
mov [extended_code],0D6h
mov [operand_prefix],66h
mov [opcode_prefix],66h
call store_instruction
jmp instruction_assembled
movq_reg:
@ -4862,7 +4880,7 @@ movq_instruction:
cmp ah,16
jne movq_mmreg_
mov [extended_code],7Eh
mov [operand_prefix],0F3h
mov [opcode_prefix],0F3h
movq_mmreg_:
lods byte [esi]
cmp al,','
@ -4886,11 +4904,11 @@ movq_instruction:
cmp ah,8
jne invalid_operand_size
mov [extended_code],6Eh
mov [operand_prefix],0
mov [opcode_prefix],0
mov bl,al
cmp [mmx_size],16
jne movq_mmreg_reg_store
mov [operand_prefix],66h
mov [opcode_prefix],66h
movq_mmreg_reg_store:
call operand_64bit
call store_nomem_instruction
@ -4903,7 +4921,7 @@ movq_instruction:
call store_nomem_instruction
jmp instruction_assembled
movdq_instruction:
mov [operand_prefix],al
mov [opcode_prefix],al
mov [base_code],0Fh
mov [extended_code],6Fh
lods byte [esi]
@ -4974,7 +4992,7 @@ lddqu_instruction:
call get_address
pop eax
mov [postbyte_register],al
mov [operand_prefix],0F2h
mov [opcode_prefix],0F2h
mov [base_code],0Fh
mov [extended_code],0F0h
call store_instruction
@ -5002,7 +5020,7 @@ movq2dq_instruction:
cmp ah,8
jne invalid_operand_size
mov bl,al
mov [operand_prefix],0F3h
mov [opcode_prefix],0F3h
mov [base_code],0Fh
mov [extended_code],0D6h
call store_nomem_instruction
@ -5030,7 +5048,7 @@ movdq2q_instruction:
cmp ah,16
jne invalid_operand_size
mov bl,al
mov [operand_prefix],0F2h
mov [opcode_prefix],0F2h
mov [base_code],0Fh
mov [extended_code],0D6h
call store_nomem_instruction
@ -5045,33 +5063,33 @@ sse_pd_instruction_imm8:
mov [immediate_size],8
sse_pd_instruction:
mov [mmx_size],16
mov [operand_prefix],66h
mov [opcode_prefix],66h
jmp sse_instruction
sse_ss_instruction:
mov [mmx_size],4
mov [operand_prefix],0F3h
mov [opcode_prefix],0F3h
jmp sse_instruction
sse_sd_instruction:
mov [mmx_size],8
mov [operand_prefix],0F2h
mov [opcode_prefix],0F2h
jmp sse_instruction
comiss_instruction:
mov [mmx_size],4
jmp sse_instruction
comisd_instruction:
mov [mmx_size],8
mov [operand_prefix],66h
mov [opcode_prefix],66h
jmp sse_instruction
cvtps2pd_instruction:
mov [mmx_size],8
jmp sse_instruction
cvtpd2dq_instruction:
mov [mmx_size],16
mov [operand_prefix],0F2h
mov [opcode_prefix],0F2h
jmp sse_instruction
cvtdq2pd_instruction:
mov [mmx_size],16
mov [operand_prefix],0F3h
mov [opcode_prefix],0F3h
sse_instruction:
mov [base_code],0Fh
mov [extended_code],al
@ -5150,7 +5168,7 @@ sse_instruction:
ps_dq_instruction:
mov [postbyte_register],al
mov [operand_prefix],66h
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [extended_code],73h
lods byte [esi]
@ -5164,7 +5182,7 @@ ps_dq_instruction:
mov bl,al
jmp mmx_nomem_imm8
movpd_instruction:
mov [operand_prefix],66h
mov [opcode_prefix],66h
movps_instruction:
mov [base_code],0Fh
mov [extended_code],al
@ -5172,7 +5190,7 @@ movps_instruction:
jmp sse_mov_instruction
movss_instruction:
mov [mmx_size],4
mov [operand_prefix],0F3h
mov [opcode_prefix],0F3h
jmp sse_movs
movsd_instruction:
mov al,0A5h
@ -5182,7 +5200,7 @@ movsd_instruction:
cmp ah,0Fh
je simple_instruction_32bit
mov [mmx_size],8
mov [operand_prefix],0F2h
mov [opcode_prefix],0F2h
sse_movs:
mov [base_code],0Fh
mov [extended_code],10h
@ -5219,7 +5237,7 @@ sse_mov_instruction:
call store_instruction
jmp instruction_assembled
movlpd_instruction:
mov [operand_prefix],66h
mov [opcode_prefix],66h
movlps_instruction:
mov [base_code],0Fh
mov [extended_code],al
@ -5266,7 +5284,7 @@ maskmovq_instruction:
jmp maskmov_instruction
maskmovdqu_instruction:
mov cl,16
mov [operand_prefix],66h
mov [opcode_prefix],66h
maskmov_instruction:
mov [base_code],0Fh
mov [extended_code],0F7h
@ -5292,7 +5310,7 @@ maskmovdqu_instruction:
call store_nomem_instruction
jmp instruction_assembled
movmskpd_instruction:
mov [operand_prefix],66h
mov [opcode_prefix],66h
movmskps_instruction:
mov [base_code],0Fh
mov [extended_code],50h
@ -5321,7 +5339,7 @@ movmskps_instruction:
call store_nomem_instruction
jmp instruction_assembled
cmppd_instruction:
mov [operand_prefix],66h
mov [opcode_prefix],66h
cmpps_instruction:
mov [base_code],0Fh
mov [extended_code],0C2h
@ -5329,7 +5347,7 @@ cmpps_instruction:
mov byte [value],-1
jmp sse_cmp_instruction
cmp_pd_instruction:
mov [operand_prefix],66h
mov [opcode_prefix],66h
cmp_ps_instruction:
mov [base_code],0Fh
mov [extended_code],0C2h
@ -5338,7 +5356,7 @@ cmp_ps_instruction:
jmp sse_cmp_instruction
cmpss_instruction:
mov [mmx_size],4
mov [operand_prefix],0F3h
mov [opcode_prefix],0F3h
jmp cmpsx_instruction
cmpsd_instruction:
mov al,0A7h
@ -5348,7 +5366,7 @@ cmpsd_instruction:
cmp ah,0Fh
je simple_instruction_32bit
mov [mmx_size],8
mov [operand_prefix],0F2h
mov [opcode_prefix],0F2h
cmpsx_instruction:
mov [base_code],0Fh
mov [extended_code],0C2h
@ -5356,11 +5374,11 @@ cmpsd_instruction:
jmp sse_cmp_instruction
cmp_ss_instruction:
mov [mmx_size],4
mov [operand_prefix],0F3h
mov [opcode_prefix],0F3h
jmp cmp_sx_instruction
cmp_sd_instruction:
mov [mmx_size],8
mov [operand_prefix],0F2h
mov [opcode_prefix],0F2h
cmp_sx_instruction:
mov [base_code],0Fh
mov [extended_code],0C2h
@ -5428,7 +5446,7 @@ sse_cmp_instruction:
nextbyte_ok:
ret
cvtpi2pd_instruction:
mov [operand_prefix],66h
mov [opcode_prefix],66h
cvtpi2ps_instruction:
mov [base_code],0Fh
mov [extended_code],al
@ -5468,10 +5486,10 @@ cvtpi2ps_instruction:
call store_nomem_instruction
jmp instruction_assembled
cvtsi2ss_instruction:
mov [operand_prefix],0F3h
mov [opcode_prefix],0F3h
jmp cvtsi_instruction
cvtsi2sd_instruction:
mov [operand_prefix],0F2h
mov [opcode_prefix],0F2h
cvtsi_instruction:
mov [base_code],0Fh
mov [extended_code],al
@ -5518,7 +5536,7 @@ cvtps2pi_instruction:
mov [mmx_size],8
jmp cvtpd_instruction
cvtpd2pi_instruction:
mov [operand_prefix],66h
mov [opcode_prefix],66h
mov [mmx_size],16
cvtpd_instruction:
mov [base_code],0Fh
@ -5534,11 +5552,11 @@ cvtpd2pi_instruction:
mov [operand_size],0
jmp sse_reg
cvtss2si_instruction:
mov [operand_prefix],0F3h
mov [opcode_prefix],0F3h
mov [mmx_size],4
jmp cvt2si_instruction
cvtsd2si_instruction:
mov [operand_prefix],0F2h
mov [opcode_prefix],0F2h
mov [mmx_size],8
cvt2si_instruction:
mov [extended_code],al
@ -5632,7 +5650,7 @@ sse4_instruction_38_xmm0:
sse4_instruction_38_imm8:
mov [immediate_size],8
sse4_instruction_38:
mov [operand_prefix],66h
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [supplemental_code],al
mov al,38h
@ -5640,11 +5658,304 @@ sse4_instruction_38:
sse4_instruction_3a_imm8:
mov [immediate_size],8
sse4_instruction_3a:
mov [operand_prefix],66h
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [supplemental_code],al
mov al,3Ah
jmp sse_instruction
extractps_instruction:
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [extended_code],3Ah
mov [supplemental_code],17h
lods byte [esi]
call get_size_operator
cmp al,10h
je extractps_reg
cmp al,'['
jne invalid_operand
call get_address
cmp [operand_size],4
je extractps_size_ok
cmp [operand_size],0
jne invalid_operand_size
extractps_size_ok:
push edx ebx ecx
mov [operand_size],0
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
pop ecx ebx edx
jmp mmx_imm8
extractps_reg:
lods byte [esi]
call convert_register
push eax
mov [operand_size],0
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
pop ebx
mov al,bh
cmp al,8
je extractps_store
cmp al,4
jne invalid_operand_size
extractps_store:
call operand_autodetect
jmp mmx_nomem_imm8
insertps_instruction:
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [extended_code],3Ah
mov [supplemental_code],21h
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
mov [operand_size],0
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
je insertps_reg
cmp al,'['
jne invalid_operand
call get_address
cmp [operand_size],4
je insertps_size_ok
cmp [operand_size],0
jne invalid_operand_size
insertps_size_ok:
jmp mmx_imm8
insertps_reg:
lods byte [esi]
call convert_mmx_register
mov bl,al
jmp mmx_nomem_imm8
pextrq_instruction:
mov [mmx_size],8
jmp pextr_instruction
pextrd_instruction:
mov [mmx_size],4
jmp pextr_instruction
pextrw_instruction:
mov [mmx_size],2
jmp pextr_instruction
pextrb_instruction:
mov [mmx_size],1
pextr_instruction:
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [extended_code],3Ah
mov [supplemental_code],al
lods byte [esi]
call get_size_operator
cmp al,10h
je pextr_reg
cmp al,'['
jne invalid_operand
call get_address
mov al,[mmx_size]
cmp al,[operand_size]
je pextr_size_ok
cmp [operand_size],0
jne invalid_operand_size
pextr_size_ok:
push edx ebx ecx
mov [operand_size],0
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
pop ecx ebx edx
jmp mmx_imm8
pextr_reg:
lods byte [esi]
call convert_register
cmp [mmx_size],4
ja pextrq_reg
cmp ah,4
je pextr_reg_size_ok
cmp ah,8
je pextr_reg_size_ok
pextr_invalid_size:
jmp invalid_operand_size
pextrq_reg:
cmp ah,8
jne pextr_invalid_size
call operand_64bit
pextr_reg_size_ok:
mov [operand_size],0
push eax
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
mov ebx,eax
pop eax
mov [postbyte_register],al
mov al,ah
cmp [mmx_size],2
jne pextr_reg_store
mov [opcode_prefix],0
mov [extended_code],0C5h
call make_mmx_prefix
jmp mmx_nomem_imm8
pextr_reg_store:
cmp bh,16
jne invalid_operand_size
xchg bl,[postbyte_register]
call operand_autodetect
jmp mmx_nomem_imm8
pinsrb_instruction:
mov [mmx_size],1
jmp pinsr_instruction
pinsrd_instruction:
mov [mmx_size],4
jmp pinsr_instruction
pinsrq_instruction:
mov [mmx_size],8
jmp pinsr_instruction
pinsr_instruction:
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [extended_code],3Ah
mov [supplemental_code],al
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
mov [operand_size],0
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
je pinsr_xmmreg_reg
cmp al,'['
jne invalid_operand
call get_address
cmp [operand_size],0
je mmx_imm8
mov al,[mmx_size]
cmp al,[operand_size]
je mmx_imm8
jmp invalid_operand_size
pinsr_xmmreg_reg:
lods byte [esi]
call convert_register
mov bl,al
cmp [mmx_size],8
je pinsrq_xmmreg_reg
cmp ah,4
je mmx_nomem_imm8
jmp invalid_operand_size
pinsrq_xmmreg_reg:
cmp ah,8
je mmx_nomem_imm8
jmp invalid_operand_size
pmovsxbw_instruction:
mov [mmx_size],8
jmp pmovsx_instruction
pmovsxbd_instruction:
mov [mmx_size],4
jmp pmovsx_instruction
pmovsxbq_instruction:
mov [mmx_size],2
jmp pmovsx_instruction
pmovsxwd_instruction:
mov [mmx_size],8
jmp pmovsx_instruction
pmovsxwq_instruction:
mov [mmx_size],4
jmp pmovsx_instruction
pmovsxdq_instruction:
mov [mmx_size],8
pmovsx_instruction:
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [extended_code],38h
mov [supplemental_code],al
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
lods byte [esi]
cmp al,','
jne invalid_operand
mov [operand_size],0
lods byte [esi]
call get_size_operator
cmp al,10h
je pmovsx_xmmreg_reg
cmp al,'['
jne invalid_operand
call get_address
cmp [operand_size],0
je mmx_imm8
mov al,[mmx_size]
cmp al,[operand_size]
jne invalid_operand_size
call store_instruction
jmp instruction_assembled
pmovsx_xmmreg_reg:
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov bl,al
call store_nomem_instruction
jmp instruction_assembled
fxsave_instruction:
mov [extended_code],0AEh
@ -5712,7 +6023,7 @@ movntps_instruction:
mov [mmx_size],16
jmp movnt_instruction
movntdq_instruction:
mov [operand_prefix],66h
mov [opcode_prefix],66h
mov [mmx_size],16
movnt_instruction:
mov [extended_code],al
@ -5736,6 +6047,44 @@ movntdq_instruction:
mov [postbyte_register],al
call store_instruction
jmp instruction_assembled
movntsd_instruction:
mov [opcode_prefix],0F2h
mov [mmx_size],8
jmp movnts_instruction
movntss_instruction:
mov [opcode_prefix],0F3h
mov [mmx_size],4
movnts_instruction:
mov [extended_code],al
mov [base_code],0Fh
lods byte [esi]
call get_size_operator
cmp al,'['
jne invalid_operand
call get_address
mov al,[operand_size]
cmp al,[mmx_size]
je movnts_size_ok
test al,al
jnz invalid_operand_size
movnts_size_ok:
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_mmx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
call store_instruction
jmp instruction_assembled
movnti_instruction:
mov [base_code],0Fh
mov [extended_code],al
@ -5802,6 +6151,204 @@ monitor_instruction:
mov al,[postbyte_register]
stos byte [edi]
jmp instruction_assembled
movntdqa_instruction:
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [extended_code],38h
mov [supplemental_code],2Ah
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,'['
jne invalid_operand
call get_address
call store_instruction
jmp instruction_assembled
extrq_instruction:
mov [opcode_prefix],66h
mov [base_code],0Fh
mov [extended_code],78h
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
mov [operand_size],0
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
je extrq_xmmreg_xmmreg
test ah,not 1
jnz invalid_operand_size
cmp al,'('
jne invalid_operand
xor bl,bl
call store_nomem_instruction
call get_byte_value
stosb
call append_imm8
jmp instruction_assembled
extrq_xmmreg_xmmreg:
inc [extended_code]
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov bl,al
call store_nomem_instruction
jmp instruction_assembled
insertq_instruction:
mov [opcode_prefix],0F2h
mov [base_code],0Fh
mov [extended_code],78h
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov [postbyte_register],al
mov [operand_size],0
lods byte [esi]
cmp al,','
jne invalid_operand
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_mmx_register
cmp ah,16
jne invalid_operand_size
mov bl,al
cmp byte [esi],','
je insertq_with_imm
inc [extended_code]
call store_nomem_instruction
jmp instruction_assembled
insertq_with_imm:
call store_nomem_instruction
call append_imm8
call append_imm8
jmp instruction_assembled
crc32_instruction:
mov [opcode_prefix],0F2h
mov [base_code],0Fh
mov [extended_code],38h
mov [supplemental_code],0F0h
lods byte [esi]
call get_size_operator
cmp al,10h
jne invalid_operand
lods byte [esi]
call convert_register
mov [postbyte_register],al
cmp ah,8
je crc32_reg64
cmp ah,4
jne invalid_operand
lods byte [esi]
cmp al,','
jne invalid_operand
mov [operand_size],0
lods byte [esi]
call get_size_operator
cmp al,10h
je crc32_reg32_reg
cmp al,'['
jne invalid_operand
call get_address
mov al,[operand_size]
test al,al
jz crc32_unknown_size
cmp al,1
je crc32_reg32_mem_store
cmp al,4
ja invalid_operand_size
inc [supplemental_code]
call operand_autodetect
crc32_reg32_mem_store:
call store_instruction
jmp instruction_assembled
crc32_unknown_size:
cmp [error_line],0
jne crc32_reg32_mem_store
mov eax,[current_line]
mov [error_line],eax
mov [error],operand_size_not_specified
jmp crc32_reg32_mem_store
crc32_reg32_reg:
lods byte [esi]
call convert_register
mov bl,al
mov al,ah
cmp al,1
je crc32_reg32_reg_store
cmp al,4
ja invalid_operand_size
inc [supplemental_code]
call operand_autodetect
crc32_reg32_reg_store:
call store_nomem_instruction
jmp instruction_assembled
crc32_reg64:
lods byte [esi]
cmp al,','
jne invalid_operand
mov [operand_size],0
lods byte [esi]
call get_size_operator
cmp al,10h
je crc32_reg64_reg
cmp al,'['
jne invalid_operand
call get_address
mov ah,[operand_size]
mov al,8
test ah,ah
jz crc32_unknown_size
cmp ah,1
je crc32_reg32_mem_store
cmp ah,al
jne invalid_operand_size
inc [supplemental_code]
jmp crc32_reg32_mem_store
crc32_reg64_reg:
lods byte [esi]
call convert_register
mov bl,al
mov al,8
cmp ah,1
je crc32_reg32_reg_store
cmp ah,al
jne invalid_operand_size
inc [supplemental_code]
jmp crc32_reg32_reg_store
popcnt_instruction:
mov [opcode_prefix],0F3h
jmp bs_instruction
simple_vmx_instruction:
mov ah,al
@ -5811,10 +6358,10 @@ simple_vmx_instruction:
stos word [edi]
jmp instruction_assembled
vmclear_instruction:
mov [operand_prefix],66h
mov [opcode_prefix],66h
jmp vmx_instruction
vmxon_instruction:
mov [operand_prefix],0F3h
mov [opcode_prefix],0F3h
vmx_instruction:
mov [postbyte_register],al
mov [extended_code],0C7h
@ -6210,6 +6757,11 @@ store_instruction_code:
jz operand_prefix_ok
stos byte [edi]
operand_prefix_ok:
mov al,[opcode_prefix]
or al,al
jz opcode_prefix_ok
stos byte [edi]
opcode_prefix_ok:
mov al,[rex_prefix]
test al,40h
jz rex_prefix_ok