mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 13:49:39 +02:00
+ added test for i8086 inline asm access to procedure data
git-svn-id: trunk@32186 -
This commit is contained in:
parent
885b0034c5
commit
1eaa77d2f9
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11480,6 +11480,7 @@ tests/test/cpu16/i8086/tmml.pp svneol=native#text/pascal
|
|||||||
tests/test/cpu16/i8086/tmmm.pp svneol=native#text/pascal
|
tests/test/cpu16/i8086/tmmm.pp svneol=native#text/pascal
|
||||||
tests/test/cpu16/i8086/tmms.pp svneol=native#text/pascal
|
tests/test/cpu16/i8086/tmms.pp svneol=native#text/pascal
|
||||||
tests/test/cpu16/i8086/tmmt.pp svneol=native#text/pascal
|
tests/test/cpu16/i8086/tmmt.pp svneol=native#text/pascal
|
||||||
|
tests/test/cpu16/i8086/tprcdat1.pp svneol=native#text/plain
|
||||||
tests/test/cpu16/i8086/tptrcon.pp svneol=native#text/pascal
|
tests/test/cpu16/i8086/tptrcon.pp svneol=native#text/pascal
|
||||||
tests/test/cpu16/i8086/tptrsize.pp svneol=native#text/pascal
|
tests/test/cpu16/i8086/tptrsize.pp svneol=native#text/pascal
|
||||||
tests/test/cpu16/i8086/tretf1.pp svneol=native#text/plain
|
tests/test/cpu16/i8086/tretf1.pp svneol=native#text/plain
|
||||||
|
41
tests/test/cpu16/i8086/tprcdat1.pp
Normal file
41
tests/test/cpu16/i8086/tprcdat1.pp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{ %cpu=i8086 }
|
||||||
|
|
||||||
|
{ test for local procedure data access from within inline asm }
|
||||||
|
|
||||||
|
{ this test is Turbo Pascal 7 compatible }
|
||||||
|
|
||||||
|
program tprcdat1;
|
||||||
|
|
||||||
|
procedure TestProc; far; assembler;
|
||||||
|
asm
|
||||||
|
dw $1234
|
||||||
|
dw $4321
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
a,a_,a__,
|
||||||
|
a2,a2_,a2__: Word;
|
||||||
|
begin
|
||||||
|
asm
|
||||||
|
mov ax, word [TestProc]
|
||||||
|
mov a, ax
|
||||||
|
mov ax, word ptr [TestProc]
|
||||||
|
mov a_, ax
|
||||||
|
mov ax, word ptr TestProc
|
||||||
|
mov a__, ax
|
||||||
|
mov ax, word ptr [TestProc + 2]
|
||||||
|
mov a2, ax
|
||||||
|
mov ax, word ptr TestProc + 2
|
||||||
|
mov a2_, ax
|
||||||
|
mov ax, word ptr [2 + TestProc]
|
||||||
|
mov a2__, ax
|
||||||
|
end;
|
||||||
|
if (a=$1234) and (a_=$1234) and (a__=$1234) and
|
||||||
|
(a2=$4321) and (a2_=$4321) and (a2__=$4321) then
|
||||||
|
Writeln('Ok!')
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Writeln('Error');
|
||||||
|
Halt(1);
|
||||||
|
end;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user