Recent

Author Topic: Compiler doesn't recognize an opcode  (Read 11115 times)

RodneyK

  • New Member
  • *
  • Posts: 16
Compiler doesn't recognize an opcode
« on: December 18, 2010, 12:07:23 am »
I'm a complete newbie to Lazarus and the FPC although I've been a Delphi developer for 15 years.
I'm porting an application to Lazarus from Delphi in order to compile a 64 bit version.
I've converted the files and I'm trying to compile the application.

The compiler reports an error in the pastoc unit (part of the fpc as far as I can see), as follows.

"pastoc.pas (64,5) Error: Unrecognized opcode MOVE"


This is the code:

FUNCTION fpcAllocRemember(VAR rememberKey : pRemember; size : ULONG; flags : ULONG) : POINTER;
BEGIN
  {$ASMMODE intel}
  ASM
    MOVE.L  A6,-(A7)     // This is the line it stops on.
    MOVEA.L rememberKey,A0
    MOVE.L  size,D0
    MOVE.L  flags,D1
    MOVEA.L _IntuitionBase,A6
    JSR -396(A6)
    MOVEA.L (A7)+,A6
    MOVE.L  D0,@RESULT
  END;
END;         

I'm using Lazarus v0.9.28.2
FPC Version 2.2.4
SVN #22279

On an x86_64 Windows 7 Home machine.

I can't find anything on the web that gives me a clue.

Rodney

Laksen

  • Hero Member
  • *****
  • Posts: 755
    • J-Software
Re: Compiler doesn't recognize an opcode
« Reply #1 on: December 18, 2010, 03:29:10 am »
I'm pretty sure that's m68k assembler... :P

And since I'm pretty sure there aren't any 64bit m68k processors, then you are probably messing something up where you shouldn't be messing something up

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4474
  • I like bugs.
Re: Compiler doesn't recognize an opcode
« Reply #2 on: December 18, 2010, 11:40:49 am »
@Laksen, you are right, it is for Amiga.
From file PasToC:

History:
  Added the define use_amiga_smartlink.
  13 Jan 2003.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

RodneyK

  • New Member
  • *
  • Posts: 16
Re: Compiler doesn't recognize an opcode
« Reply #3 on: December 18, 2010, 08:27:35 pm »
So what do I put where to stop it using the Amiga code?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4474
  • I like bugs.
Re: Compiler doesn't recognize an opcode
« Reply #4 on: December 19, 2010, 05:22:49 pm »
So what do I put where to stop it using the Amiga code?

Good question. How did you end up with the situation in the first place?
Do you have multiple versions of FPC installed?
I would uninstall all versions of FPC and Lazarus including their local config files.
Then I would make a clean install of FPC 2.4.2.
Then I would install the latest Lazarus development version which is good and stable now before the release.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Compiler doesn't recognize an opcode
« Reply #5 on: December 19, 2010, 06:50:12 pm »
Quote
So what do I put where to stop it using the Amiga code?
Check your target OS in compiler options.

RodneyK

  • New Member
  • *
  • Posts: 16
Re: Compiler doesn't recognize an opcode
« Reply #6 on: December 20, 2010, 11:46:21 pm »
I have uninstalled both fpc and lazarus.
I reinstalled Lazarus.

The version information from Help|About is the same as in my first post.
I set the compiler options to target Win64.
When I build it still stops on the line containing the MOVE instruction inPasToC.pas

I even removed the    {$define use_amiga_smartlink}
 line in useamigasmartlink.inc

I still get the same error on compile.

I can only imagine that use_amiga_smartlink is defined somewhere else.
has anybody any suggestions as to where I go from here?

Laksen

  • Hero Member
  • *****
  • Posts: 755
    • J-Software
Re: Compiler doesn't recognize an opcode
« Reply #7 on: December 20, 2010, 11:59:11 pm »
The problem is that you are using the PasToC unit(or using another unit that's using it). It's an Amiga unit, using inline m680x0 assembler even, which obviously won't work on a x86_64
« Last Edit: December 21, 2010, 12:02:31 am by Laksen »

RodneyK

  • New Member
  • *
  • Posts: 16
Re: Compiler doesn't recognize an opcode
« Reply #8 on: December 21, 2010, 12:25:37 am »
I've realised that. My problem is I don't know why. I've tried various settings in the Compiler Options but nothing seems to work.

RodneyK

  • New Member
  • *
  • Posts: 16
Re: Compiler doesn't recognize an opcode
« Reply #9 on: December 21, 2010, 01:34:30 am »
Problem solved as far as using the Amiga code is concerned. The unit path in the compiler options was pointing to the Amiga graphics.pas instead of the Delphi graphics.pas.
Thanks to all of you for the assistance.

 

TinyPortal © 2005-2018