fpc/tests/test/tasm23a.pp
florian 7cdb39b3f9 -- Aufzeichnung der Informationen für Zusammenführung von r43005 in ».«:
G   .
-- Aufzeichnung der Informationen für Zusammenführung von r43006 in ».«:
 G   .
-- Aufzeichnung der Informationen für Zusammenführung von r43007 in ».«:
 G   .
-- Aufzeichnung der Informationen für Zusammenführung von r43008 in ».«:
 G   .
-- Zusammenführen von r43000 in ».«:
U    compiler/pp.pas
-- Aufzeichnung der Informationen für Zusammenführung von r43000 in ».«:
 G   .
-- Zusammenführen von r43011 in ».«:
U    rtl/inc/system.inc
-- Aufzeichnung der Informationen für Zusammenführung von r43011 in ».«:
 G   .
-- Zusammenführen von r43012 in ».«:
U    rtl/i386/i386.inc
-- Aufzeichnung der Informationen für Zusammenführung von r43012 in ».«:
 G   .
-- Zusammenführen von r43013 in ».«:
U    rtl/linux/i386/si_c21.inc
-- Aufzeichnung der Informationen für Zusammenführung von r43013 in ».«:
 G   .
-- Zusammenführen von r43014 in ».«:
U    compiler/systems/i_linux.pas
-- Aufzeichnung der Informationen für Zusammenführung von r43014 in ».«:
 G   .
-- Zusammenführen von r43176 in ».«:
U    compiler/i386/cpupi.pas
U    compiler/i386/n386cal.pas
U    compiler/ncgcal.pas
U    compiler/ncgutil.pas
G    compiler/systems/i_linux.pas
U    compiler/systems.inc
C    compiler/systems.pas
G    tests/webtbs/tw7808.pp
-- Aufzeichnung der Informationen für Zusammenführung von r43176 in ».«:
 G   .
Konfliktübersicht:
  Textkonflikte: 1
Konfliktübersicht:
  Textkonflikte: 1

git-svn-id: branches/fixes_3_2@43434 -
2019-11-09 22:07:33 +00:00

84 lines
2.3 KiB
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ %CPU=i386 }
program tasm23a;
{$ASMMODE INTEL}
{$S-}
const
t_size = 19;
procedure t; nostackframe; assembler;
asm
mov eax, [ebx[5]][edi][54][-17][45][4] { mov eax, [ebx+edi+5Bh] }
mov eax, [[ebx+5]+[edi+54]+[-17]+[45]+[4]] { mov eax, [ebx+edi+5Bh] }
mov eax, [5[7]] { mov eax, [000Ch] }
mov eax, [5+[7]] { mov eax, [000Ch] }
end;
procedure t_verify; nostackframe; assembler;
asm
mov eax, [ebx+edi+5Bh] { mov eax, [ebx[5]][edi][54][-17][45][4] }
mov eax, [ebx+edi+5Bh] { mov eax, [[ebx+5]+[edi+54]+[-17]+[45]+[4]] }
mov eax, [000Ch] { mov eax, [5[7]] }
mov eax, [000Ch] { mov eax, [5+[7]] }
end;
const
t2_size = 34;
procedure t2; assembler;
var
locl: longword;
asm
mov eax, locl { mov еax, [еbp-04] }
mov eax, cs:locl { mov еax, cs:[еbp-04] }
mov eax, [cs:locl] { mov еax, cs:[еbp-04] }
mov eax, [cs:[locl]] { mov еax, cs:[еbp-04] }
mov eax, cs:locl[5] { mov еax, cs:[еbp+01] }
mov eax, cs:5[locl] { mov еax, cs:[еbp+01] }
end;
procedure t2_verify; assembler;
var
locl: longword;
asm
mov eax, [ebp-04] { mov еax, locl }
mov eax, cs:[ebp-04] { mov еax, cs:locl }
mov eax, cs:[ebp-04] { mov еax, [cs:locl] }
mov eax, cs:[ebp-04] { mov еax, [cs:[locl]] }
mov eax, cs:[ebp+01] { mov еax, cs:locl[5] }
mov eax, cs:[ebp+01] { mov еax, cs:5[locl] }
end;
{ This version works in all i8086 memory models }
function CompareCode(cp, cp2: CodePointer; sz: Integer): Boolean;
var
lastbyte: Byte;
begin
if CompareByte(cp^, cp2^, sz) <> 0 then
begin
CompareCode := False;
exit;
end;
{ check also that the last byte is a retn instruction }
lastbyte:=PByte(cp)[sz-1];
if lastbyte<>$C3 then
begin
CompareCode := False;
exit;
end;
CompareCode := True;
end;
procedure Error(N: Integer);
begin
Writeln('Error! ', N);
Halt(1);
end;
begin
if not CompareCode(CodePointer(@t), CodePointer(@t_verify), t_size) then
Error(1);
if not CompareCode(CodePointer(@t2), CodePointer(@t2_verify), t2_size) then
Error(2);
Writeln('Ok!');
end.