mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 17:48:46 +02:00
* fix for inline asm of instructions with 32-bit constant operands on i8086
git-svn-id: trunk@37519 -
This commit is contained in:
parent
2af5c9d508
commit
325e66287c
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12105,6 +12105,7 @@ tests/test/cg/variants/tvarol9.pp svneol=native#text/plain
|
||||
tests/test/cg/variants/tvarol91.pp svneol=native#text/plain
|
||||
tests/test/cg/variants/tvarol94.pp svneol=native#text/plain
|
||||
tests/test/cg/variants/tvarol96.pp svneol=native#text/plain
|
||||
tests/test/cpu16/i8086/tasm16_32_1.pp svneol=native#text/pascal
|
||||
tests/test/cpu16/i8086/tasmseg1.pp svneol=native#text/pascal
|
||||
tests/test/cpu16/i8086/tfarcal1.pp svneol=native#text/pascal
|
||||
tests/test/cpu16/i8086/tfarcal2.pp svneol=native#text/pascal
|
||||
|
@ -50,11 +50,13 @@ type
|
||||
TOprRec = record
|
||||
case typ:TOprType of
|
||||
OPR_NONE : ();
|
||||
{$ifdef AVR}
|
||||
{$if defined(AVR)}
|
||||
OPR_CONSTANT : (val:word);
|
||||
{$else AVR}
|
||||
{$elseif defined(i8086)}
|
||||
OPR_CONSTANT : (val:longint);
|
||||
{$else}
|
||||
OPR_CONSTANT : (val:aint);
|
||||
{$endif AVR}
|
||||
{$endif}
|
||||
OPR_SYMBOL : (symbol:tasmsymbol;symofs:aint;symseg:boolean;sym_farproc_entry:boolean);
|
||||
OPR_REFERENCE : (varsize:asizeint; constoffset: asizeint;ref_farproc_entry:boolean;ref:treference);
|
||||
OPR_LOCAL : (localvarsize, localconstoffset: asizeint;localsym:tabstractnormalvarsym;localsymofs:aint;localindexreg:tregister;localscale:byte;localgetoffset,localforceref:boolean);
|
||||
|
@ -2862,7 +2862,11 @@ implementation
|
||||
}
|
||||
|
||||
var
|
||||
{$ifdef i8086}
|
||||
currval : longint;
|
||||
{$else i8086}
|
||||
currval : aint;
|
||||
{$endif i8086}
|
||||
currsym : tobjsymbol;
|
||||
currrelreloc,
|
||||
currabsreloc,
|
||||
@ -2932,7 +2936,11 @@ implementation
|
||||
end;
|
||||
top_const :
|
||||
begin
|
||||
{$ifdef i8086}
|
||||
currval:=longint(oper[opidx]^.val);
|
||||
{$else i8086}
|
||||
currval:=aint(oper[opidx]^.val);
|
||||
{$endif i8086}
|
||||
currsym:=nil;
|
||||
currabsreloc:=RELOC_ABSOLUTE;
|
||||
currabsreloc32:=RELOC_ABSOLUTE32;
|
||||
|
33
tests/test/cpu16/i8086/tasm16_32_1.pp
Normal file
33
tests/test/cpu16/i8086/tasm16_32_1.pp
Normal file
@ -0,0 +1,33 @@
|
||||
{ %cpu=i8086 }
|
||||
|
||||
{ i8086 test for correct assembly of 32-bit instructions on the i8086 target }
|
||||
|
||||
{ this one tests an instruction with a 32-bit const operand }
|
||||
|
||||
program tasm16_32_1;
|
||||
|
||||
{$asmmode intel}
|
||||
{$asmcpu 80386}
|
||||
|
||||
var
|
||||
lo_word, hi_word: Word;
|
||||
begin
|
||||
asm
|
||||
db 66h, 31h, 0c0h { xor eax, eax }
|
||||
|
||||
{ the actual instruction being tested: }
|
||||
mov eax, 12345678h
|
||||
|
||||
db 66h, 50h { push eax }
|
||||
|
||||
pop word ptr [lo_word]
|
||||
pop word ptr [hi_word]
|
||||
end;
|
||||
if (lo_word=$5678) and (hi_word=$1234) then
|
||||
Writeln('Ok!')
|
||||
else
|
||||
begin
|
||||
Writeln('Error!');
|
||||
Halt(1);
|
||||
end;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user