+ added 2 tests for absolute var access to a 2-dimensional array from within inline asm

git-svn-id: trunk@37562 -
This commit is contained in:
nickysn 2017-11-06 16:47:07 +00:00
parent 20f905db6c
commit 3cbe377f40
3 changed files with 94 additions and 0 deletions

2
.gitattributes vendored
View File

@ -12130,6 +12130,8 @@ tests/test/cpu16/i8086/tasm16_32_4.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tasmabs1.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tasmabs2.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tasmabs3.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tasmabs4.pp svneol=native#text/pascal
tests/test/cpu16/i8086/tasmabs5.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

View File

@ -0,0 +1,46 @@
{ %cpu=i8086 }
program tasmabs4;
{ NOT TP7 compatible (TP7 doesn't support absolute with an index) }
{$ASMMODE INTEL}
{$ASMCPU 80386}
var
barr: array [8..12, -7..100] of byte;
l: longint absolute barr[9];
w: word absolute barr[10];
b: byte absolute barr[11];
begin
FillChar(barr, SizeOf(barr), $ff);
asm
mov l, 4
end;
if (barr[9,-7] <> 4) or (barr[9,-7+1] <> 0) or (barr[9,-7+2] <> 0) or
(barr[9,-7+3] <> 0) or (barr[9,-7+4] <> 255) or (barr[8,100] <> 255) then
begin
Writeln('Error!');
Halt(1);
end;
FillChar(barr, SizeOf(barr), $ff);
asm
mov w, 2
end;
if (barr[10,-7] <> 2) or (barr[10,-7+1] <> 0) or (barr[10,-7+2] <> 255) or
(barr[9,100] <> 255) then
begin
Writeln('Error!');
Halt(1);
end;
FillChar(barr, SizeOf(barr), $ff);
asm
mov b, 1
end;
if (barr[11,-7] <> 1) or (barr[11,-7+1] <> 255) or (barr[10,100] <> 255) then
begin
Writeln('Error!');
Halt(1);
end;
Writeln('Ok!');
end.

View File

@ -0,0 +1,46 @@
{ %cpu=i8086 }
program tasmabs5;
{ NOT TP7 compatible (TP7 doesn't support absolute with an index) }
{$ASMMODE INTEL}
{$ASMCPU 80386}
var
barr: array [8..12, -7..100] of byte;
l: longint absolute barr[9,17];
w: word absolute barr[10,53];
b: byte absolute barr[11,62];
begin
FillChar(barr, SizeOf(barr), $ff);
asm
mov l, 4
end;
if (barr[9,17+0] <> 4) or (barr[9,17+1] <> 0) or (barr[9,17+2] <> 0) or
(barr[9,17+3] <> 0) or (barr[9,17+4] <> 255) or (barr[9,17-1] <> 255) then
begin
Writeln('Error!');
Halt(1);
end;
FillChar(barr, SizeOf(barr), $ff);
asm
mov w, 2
end;
if (barr[10,53] <> 2) or (barr[10,54] <> 0) or (barr[10,55] <> 255) or
(barr[10,52] <> 255) then
begin
Writeln('Error!');
Halt(1);
end;
FillChar(barr, SizeOf(barr), $ff);
asm
mov b, 1
end;
if (barr[11,62] <> 1) or (barr[11,63] <> 255) or (barr[11,61] <> 255) then
begin
Writeln('Error!');
Halt(1);
end;
Writeln('Ok!');
end.