Fix generation of i8086 CPU code, as BTR/BTS instructions require at least 386 CPU

This commit is contained in:
Pierre Muller 2024-03-25 14:28:35 +00:00
parent ac150e58c8
commit 9056ab8025

View File

@ -52,6 +52,9 @@ implementation
globals,systems,
aasmbase,
cgutils,
{$ifdef I8086}
cpuinfo,
{$endif I8086}
cpubase,aasmcpu;
{ thlcgx86 }
@ -104,7 +107,13 @@ implementation
const
bit_set_clr_instr: array[boolean] of tasmop = (A_BTR,A_BTS);
begin
list.concat(taicpu.op_reg_reg(bit_set_clr_instr[doset],S_NO,bitnumber,dest));
{$ifdef I8086}
{ BTR/BTS is only supportd by 80386 CPU or later }
if current_settings.cputype < cpu_386 then
inherited
else
{$endif I8086}
list.concat(taicpu.op_reg_reg(bit_set_clr_instr[doset],S_NO,bitnumber,dest));
end;