mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 02:09:14 +02:00
* on i8086, for BP7 compatibility, assemble 'call/jmp dword [ref]' as a far call
git-svn-id: trunk@31945 -
This commit is contained in:
parent
ed972c4f99
commit
b3c2765da9
@ -2164,14 +2164,20 @@ Unit Rax86int;
|
|||||||
(instr.operands[1].typesize<>0) then
|
(instr.operands[1].typesize<>0) then
|
||||||
instr.operands[1].setsize(instr.operands[1].typesize,false);
|
instr.operands[1].setsize(instr.operands[1].typesize,false);
|
||||||
{$ifdef i8086}
|
{$ifdef i8086}
|
||||||
{ convert 'call symbol' to 'call far symbol' for memory models with far code }
|
|
||||||
for i:=1 to operandnum do
|
for i:=1 to operandnum do
|
||||||
with instr.operands[i].opr do
|
with instr.operands[i].opr do
|
||||||
if (instr.opcode=A_CALL) and (typ=OPR_SYMBOL) and (symbol<>nil) and (symbol.typ<>AT_DATA) then
|
begin
|
||||||
if current_settings.x86memorymodel in x86_far_code_models then
|
{ convert 'call symbol' to 'call far symbol' for memory models with far code }
|
||||||
begin
|
if (instr.opcode=A_CALL) and (typ=OPR_SYMBOL) and (symbol<>nil) and (symbol.typ<>AT_DATA) then
|
||||||
instr.opsize:=S_FAR;
|
if current_settings.x86memorymodel in x86_far_code_models then
|
||||||
end;
|
begin
|
||||||
|
instr.opsize:=S_FAR;
|
||||||
|
end;
|
||||||
|
{ convert 'call/jmp dword [something]' to 'call/jmp far [something]' (BP7 compatibility) }
|
||||||
|
if (instr.opcode in [A_CALL,A_JMP]) and (instr.opsize=S_NO) and
|
||||||
|
(typ in [OPR_LOCAL,OPR_REFERENCE]) and (instr.operands[i].size=OS_32) then
|
||||||
|
instr.opsize:=S_FAR;
|
||||||
|
end;
|
||||||
{$endif i8086}
|
{$endif i8086}
|
||||||
if (MemRefInfo(instr.opcode).ExistsSSEAVX) and
|
if (MemRefInfo(instr.opcode).ExistsSSEAVX) and
|
||||||
(MemRefInfo(instr.opcode).MemRefSize in MemRefSizeInfoVMems) then
|
(MemRefInfo(instr.opcode).MemRefSize in MemRefSizeInfoVMems) then
|
||||||
|
Loading…
Reference in New Issue
Block a user