* fix most m68k errors due to intel assembler code

This commit is contained in:
pierre 2001-08-03 23:48:20 +00:00
parent 502f7cce52
commit 43b4274a6d
29 changed files with 93 additions and 13 deletions

View File

@ -1,3 +1,5 @@
{ %CPU=i386 }
{ %OPT=-O2 }
{ Old file: tbs0002.pp }
{ tests for the endless bugs in the optimizer OK 0.9.2 }

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0034.pp }
{ shows wrong line numbering when asmbler is parsed in direct mode. }

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ %OPT= -Rintel }
{ Old file: tbs0042.pp }

View File

@ -1,3 +1,6 @@
{ %CPU=i386 }
{ %OPT=-Ratt -Anasm }
{ %NOTE=This test requires an installed Nasm }
{ Old file: tbs0043.pp }
{ shows assembler nasm output fpu opcodes problem OK 0.99.6 (PFV) }

View File

@ -1,12 +1,19 @@
{ %OPT=-Rintel }
{ Old file: tbs0078.pp }
{ Shows problems with longint constant in intel asm OK 0.99.1 (CEC) }
{ shows error with asm_size_mismatch }
Begin
{$ifdef CPUI386}
{$asmmode intel }
asm
mov eax, 2147483647
mov eax, 2000000000
end;
{$endif CPUI386}
{$ifdef CPU68K}
asm
move.l #2147483647,d0
move.l #2000000000,d1
end;
{$endif CPU68K}
end.

View File

@ -1,14 +1,28 @@
{ %OPT= -Rintel }
{ Old file: tbs0079.pp }
{ Shows problems with stackframe with assembler keyword OK 0.99.1 (CEC) }
{ This test does not really
give a good result
because you need to look into
the assembler to see if there is an error or not :( PM }
{$ifdef CPUI386}
{$asmmode intel}
{$endif CPUI386}
procedure nothing(x,y: longint);assembler;
{$ifdef CPUI386}
asm
mov eax,x
mov ebx,y
end;
{$endif CPUI386}
{$ifdef CPU68K}
asm
move.l x,d0
move.l y,d1
end;
{$endif CPU68K}
{procedure nothing(x,y: longint);
begin

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0123.pp }
{ Asm, problem with intel assembler (shrd) OK 0.99.11 (PM) }

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ %OPT= -Aas }
{ Old file: tbs0124.pp }

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0124b.pp }
{ }

View File

@ -19,9 +19,16 @@ procedure tpo.pi2;
begin
end;
procedure crushesi;assembler;
{$ifdef CPUI386}
asm
movl %eax,%esi
end ['EAX','ESI'];
{$endif CPUI386}
{$ifdef CPU68K}
asm
move.l d0,a5
end ['d0','a5'];
{$endif CPU68K}
var
p1 : tpt;
begin

View File

@ -11,6 +11,11 @@ end;
begin
asm
{$ifdef CPUI386}
call {$ifdef dummy}free1{$else}free2{$endif}
{$endif CPUI386}
{$ifdef CPU68K}
jsr {$ifdef dummy}free1{$else}free2{$endif}
{$endif CPU68K}
end;
end.

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0174.pp }
{ Asm, offsets of fields are not possible yet OK 0.99.9 (PFV) }
@ -12,7 +13,9 @@ var
procedure kl;assembler;
asm
{$ifdef CPUI386}
movl tobj.l,%eax // tobj.l should return the offset of l in tobj
{$endif CPUI386}
end;

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0175.pp }
{ Asm, mov word,%eax should not be allowed without casting emits a warning (or error with range checking enabled) OK 0.99.11 (PM) }
@ -10,4 +11,4 @@ begin
asm
movl w,%ecx
end;
end.
end.

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ %OPT= -Ratt }
{ Old file: tbs0201.pp }

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0226.pp }
{ Asm, offset of var is not allowed as constant OK 0.99.11 (PFV) }

View File

@ -4,10 +4,17 @@
function getheapsize:longint;assembler;
var
heapsize : longint;external name 'HEAPSIZE';
sbrk : longint;external name '___sbrk';
// sbrk : longint;external name '___sbrk';
asm
{$ifdef CPUI386}
movl HEAPSIZE,%eax
end ['EAX'];
{$endif CPUI386}
{$ifdef CPU68K}
move.l HEAPSIZE,d0
end ['D0'];
{$endif CPU68K}
begin
writeln(getheapsize);

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0228.pp }
{ Asm, wrong warning for size OK 0.99.11 (PFV) }

View File

@ -1,7 +1,9 @@
{ %OPT= -O1}
{ %CPU=i386 }
{ %OPT= -O1 }
{ Old file: tbs0259.pp }
{ problem with optimizer for real math (use -O1) OK 0.99.12 (PM) }
{ -O1 is not allowed for m68k }
VAR time1,time2 : Real;
BEGIN

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0276.pp }
{ Asm, intel reference parsing incompatibility OK 0.99.13 (PFV) }

View File

@ -1,3 +1,5 @@
{ %OPT=-al }
{ this forces use of GNU as }
{ Old file: tbs0282.pp }
{ long mangledname problem with -Aas OK 0.99.13 (PFV) }

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0285.pp }
{ Asm, TYPE not support in intel mode OK 0.99.13 (PFV) }

View File

@ -8,6 +8,7 @@ var
cb : word;
procedure A(B: word); assembler; inline;
{$ifdef CPUI386}
asm
MOV AX,B
CMP AX,[CB]
@ -15,8 +16,18 @@ asm
MOV [CB],AX
@@10:
end;
{$endif CPUI386}
{$ifdef CPU68K}
asm
move.w b,d0
cmp.w cb,d0
beq @L10
move.w d0,cb
@L10:
end;
{$endif CPU68K}
begin
a(1);
a(2);
end.
end.

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0316.pp }
{ }

View File

@ -1,4 +1,4 @@
{ %OPT=-Sen }
{ %OPT=-Sen -vnw }
{ %RESULT=217 }
{ Old file: tbs0318.pp }

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{ Old file: tbs0322.pp }
{ }
@ -24,4 +25,4 @@ end;
writeln('Wrong size for TYPE');
halt(1);
end;
end.
end.

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{$asmmode att}
const
@ -31,4 +32,4 @@ begin
movl %fs:(0x46c),%eax
{$endif}
end;
end.
end.

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{$asmmode intel}
const
@ -26,4 +27,4 @@ begin
mov fs:[046ch],eax
{$endif}
end;
end.
end.

View File

@ -1,7 +1,8 @@
{ %CPU=i386 }
{$IFDEF FPC}
{$ASMMODE INTEL}
{$ENDIF}
{$N+}
{$N+}
FUNCTION Floor(M2:Comp):LONGINT;assembler;

View File

@ -1,3 +1,4 @@
{ %CPU=i386 }
{$ifdef fpc}
{$mode delphi}
{$asmmode intel}