diff --git a/programs/develop/fasm/trunk/expressi.inc b/programs/develop/fasm/trunk/expressi.inc index 29a3d43613..4f59111002 100644 --- a/programs/develop/fasm/trunk/expressi.inc +++ b/programs/develop/fasm/trunk/expressi.inc @@ -2034,17 +2034,36 @@ get_address_value: and ah,0Fh jz address_registers_sizes_ok cmp al,ah - jne invalid_address + jne address_sizes_do_not_match address_registers_sizes_ok: cmp al,4 je sib_allowed cmp al,8 je sib_allowed + cmp al,0Fh + je check_ip_relative_address or cl,cl jz check_word_value cmp cl,1 je check_word_value jmp invalid_address + address_sizes_do_not_match: + cmp al,0Fh + jne invalid_address + mov al,bh + and al,0Fh + cmp al,ah + jne invalid_address + check_ip_relative_address: + cmp bh,0F4h + je check_dword_value + cmp bh,0F8h + jne invalid_address + mov eax,[edi] + cdq + cmp edx,[edi+4] + jne range_exceeded + ret get_address_register: or al,al jz address_register_ok diff --git a/programs/develop/fasm/trunk/fasm.asm b/programs/develop/fasm/trunk/fasm.asm index 85d4a83a9c..c0e3ea43ea 100644 --- a/programs/develop/fasm/trunk/fasm.asm +++ b/programs/develop/fasm/trunk/fasm.asm @@ -23,7 +23,7 @@ APP_MEMORY = 0x00800000 ;; Menuet header appname equ "FASM " -version equ "1.67.11" +version equ "1.67.12" use32 diff --git a/programs/develop/fasm/trunk/tables.inc b/programs/develop/fasm/trunk/tables.inc index ef9057c233..c82989b5c8 100644 --- a/programs/develop/fasm/trunk/tables.inc +++ b/programs/develop/fasm/trunk/tables.inc @@ -89,6 +89,7 @@ address_registers: db 3,'ecx',41h db 3,'edi',47h db 3,'edx',42h + db 3,'eip',0F4h db 3,'esi',46h db 3,'esp',44h db 3,'r10',8Ah @@ -113,7 +114,7 @@ address_registers: db 3,'rcx',81h db 3,'rdi',87h db 3,'rdx',82h - db 3,'rip',0F0h + db 3,'rip',0F8h db 3,'rsi',86h db 3,'rsp',84h db 2,'si',26h @@ -514,8 +515,8 @@ instructions_3: dw single_operand_instruction-assembler db 'neg',3 dw single_operand_instruction-assembler - ;db 'nop',90h - ;dw nop_instruction-assembler + db 'nop',90h + dw nop_instruction-assembler db 'not',2 dw single_operand_instruction-assembler db 'org',0 diff --git a/programs/develop/fasm/trunk/version.inc b/programs/develop/fasm/trunk/version.inc index 7951ebcd20..47308909a9 100644 --- a/programs/develop/fasm/trunk/version.inc +++ b/programs/develop/fasm/trunk/version.inc @@ -33,7 +33,7 @@ ; cannot simply be copied and put under another distribution licence ; (including the GNU Public Licence). -VERSION_STRING equ "1.67.11" +VERSION_STRING equ "1.67.12" VERSION_MAJOR = 1 VERSION_MINOR = 67 diff --git a/programs/develop/fasm/trunk/x86_64.inc b/programs/develop/fasm/trunk/x86_64.inc index f9217f0276..ab2ccc4f0e 100644 --- a/programs/develop/fasm/trunk/x86_64.inc +++ b/programs/develop/fasm/trunk/x86_64.inc @@ -6008,15 +6008,18 @@ get_address: test ch,0Fh jnz address_ok calculate_relative_address: + mov edx,[address_high] call calculate_relative_offset mov [address_high],edx + cdq + cmp edx,[address_high] + jne value_out_of_range mov edx,[symbol_identifier] mov [address_symbol],edx mov edx,eax mov bx,0FF00h address_ok: ret - operand_16bit: cmp [code_type],16 je size_prefix_ok @@ -6146,8 +6149,10 @@ store_instruction: call store_segment_prefix_if_necessary or bx,bx jz address_immediate - cmp bx,0F000h + cmp bx,0F800h je address_rip_based + cmp bx,0F400h + je address_eip_based cmp bx,0FF00h je address_relative mov al,bl @@ -6485,6 +6490,9 @@ store_instruction: or al,cl stos word [edi] jmp store_address_32bit_value + address_eip_based: + mov al,67h + stos byte [edi] address_rip_based: cmp [code_type],64 jne invalid_address