mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 08:29:28 +02:00
* made the i8086 internal assembler cpu instruction set checking follow the
asd_cpu directive (and thus, respect the {$asmcpu XXX} directive) git-svn-id: trunk@33141 -
This commit is contained in:
parent
843aee8f4a
commit
c061a98e93
@ -1612,7 +1612,7 @@ implementation
|
||||
if (segprefix>=NR_ES) and (segprefix<=NR_GS) then
|
||||
begin
|
||||
{$ifdef i8086}
|
||||
if (current_settings.cputype<cpu_386) and
|
||||
if (objdata.CPUType<>cpu_none) and (objdata.CPUType<cpu_386) and
|
||||
((segprefix=NR_FS) or (segprefix=NR_GS)) then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
{$endif i8086}
|
||||
@ -2618,7 +2618,7 @@ implementation
|
||||
b66: Byte=$66;
|
||||
begin
|
||||
{$ifdef i8086}
|
||||
if current_settings.cputype<cpu_386 then
|
||||
if (objdata.CPUType<>cpu_none) and (objdata.CPUType<cpu_386) then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
{$endif i8086}
|
||||
objdata.writebytes(b66,1);
|
||||
@ -2629,7 +2629,7 @@ implementation
|
||||
b67: Byte=$67;
|
||||
begin
|
||||
{$ifdef i8086}
|
||||
if current_settings.cputype<cpu_386 then
|
||||
if (objdata.CPUType<>cpu_none) and (objdata.CPUType<cpu_386) then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
{$endif i8086}
|
||||
objdata.writebytes(b67,1);
|
||||
@ -2693,43 +2693,46 @@ implementation
|
||||
{ check instruction's processor level }
|
||||
{ todo: maybe adapt and enable this code for i386 and x86_64 as well }
|
||||
{$ifdef i8086}
|
||||
case insentry^.flags and IF_PLEVEL of
|
||||
IF_8086:
|
||||
;
|
||||
IF_186:
|
||||
if current_settings.cputype<cpu_186 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_286:
|
||||
if current_settings.cputype<cpu_286 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_386:
|
||||
if current_settings.cputype<cpu_386 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_486,
|
||||
IF_PENT:
|
||||
if current_settings.cputype<cpu_Pentium then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_P6:
|
||||
if current_settings.cputype<cpu_Pentium2 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_KATMAI:
|
||||
if current_settings.cputype<cpu_Pentium3 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_WILLAMETTE,
|
||||
IF_PRESCOTT:
|
||||
if current_settings.cputype<cpu_Pentium4 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
{ the NEC V20/V30 extensions are incompatible with 386+, due to overlapping opcodes }
|
||||
IF_NEC:
|
||||
if current_settings.cputype>=cpu_386 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
{ todo: handle these properly }
|
||||
IF_CYRIX,
|
||||
IF_AMD,
|
||||
IF_CENTAUR,
|
||||
IF_SANDYBRIDGE:
|
||||
;
|
||||
end;
|
||||
if objdata.CPUType<>cpu_none then
|
||||
begin
|
||||
case insentry^.flags and IF_PLEVEL of
|
||||
IF_8086:
|
||||
;
|
||||
IF_186:
|
||||
if objdata.CPUType<cpu_186 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_286:
|
||||
if objdata.CPUType<cpu_286 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_386:
|
||||
if objdata.CPUType<cpu_386 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_486,
|
||||
IF_PENT:
|
||||
if objdata.CPUType<cpu_Pentium then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_P6:
|
||||
if objdata.CPUType<cpu_Pentium2 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_KATMAI:
|
||||
if objdata.CPUType<cpu_Pentium3 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
IF_WILLAMETTE,
|
||||
IF_PRESCOTT:
|
||||
if objdata.CPUType<cpu_Pentium4 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
{ the NEC V20/V30 extensions are incompatible with 386+, due to overlapping opcodes }
|
||||
IF_NEC:
|
||||
if objdata.CPUType>=cpu_386 then
|
||||
Message(asmw_e_instruction_not_supported_by_cpu);
|
||||
{ todo: handle these properly }
|
||||
IF_CYRIX,
|
||||
IF_AMD,
|
||||
IF_CENTAUR,
|
||||
IF_SANDYBRIDGE:
|
||||
;
|
||||
end;
|
||||
end;
|
||||
{$endif i8086}
|
||||
|
||||
{ load data to write }
|
||||
|
Loading…
Reference in New Issue
Block a user