mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 05:00:07 +02:00
+ added test for local label data access from i8086 inline asm
git-svn-id: trunk@32178 -
This commit is contained in:
parent
83d90c7888
commit
ce7672b750
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11474,6 +11474,7 @@ tests/test/cpu16/i8086/thugeptr5.pp svneol=native#text/pascal
|
||||
tests/test/cpu16/i8086/thugeptr5a.pp svneol=native#text/pascal
|
||||
tests/test/cpu16/i8086/tintr1.pp svneol=native#text/pascal
|
||||
tests/test/cpu16/i8086/tintr2.pp svneol=native#text/pascal
|
||||
tests/test/cpu16/i8086/tlbldat1.pp svneol=native#text/plain
|
||||
tests/test/cpu16/i8086/tmmc.pp svneol=native#text/pascal
|
||||
tests/test/cpu16/i8086/tmml.pp svneol=native#text/pascal
|
||||
tests/test/cpu16/i8086/tmmm.pp svneol=native#text/pascal
|
||||
|
38
tests/test/cpu16/i8086/tlbldat1.pp
Normal file
38
tests/test/cpu16/i8086/tlbldat1.pp
Normal file
@ -0,0 +1,38 @@
|
||||
{ %cpu=i8086 }
|
||||
|
||||
{ test for local label data access from within inline asm }
|
||||
|
||||
{ this test is Turbo Pascal 7 compatible }
|
||||
|
||||
program tlbldat1;
|
||||
label
|
||||
lbl;
|
||||
var
|
||||
a, a2, b, b2: Word;
|
||||
begin
|
||||
asm
|
||||
mov ax, word ptr [lbl]
|
||||
mov a, ax
|
||||
mov ax, word ptr [lbl + 2]
|
||||
mov a2, ax
|
||||
mov ax, word ptr [@@loc_lbl]
|
||||
mov b, ax
|
||||
mov ax, word ptr [@@loc_lbl + 2]
|
||||
mov b2, ax
|
||||
jmp @@GoOn
|
||||
lbl:
|
||||
dw $1234
|
||||
dw $4321
|
||||
@@loc_lbl:
|
||||
dw $5678
|
||||
dw $8765
|
||||
@@GoOn:
|
||||
end;
|
||||
if (a=$1234) and (a2=$4321) and (b=$5678) and (b2=$8765) then
|
||||
Writeln('Ok!')
|
||||
else
|
||||
begin
|
||||
Writeln('Error');
|
||||
Halt(1);
|
||||
end;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user