Recent

Author Topic: Atari m68k inline assembler error (using vasm): the dc.* pseudo-instruction  (Read 375 times)

Cigydd

  • New Member
  • *
  • Posts: 22
  • Programming for fun
    • My GitHub
Hello folks,

I am trying to compile an Atari ST disassembly because the source is no more available.

Made a simple project with only the main lpr file and including all the assembler code in one huge asm/end; block.

Everything is working well until a dc.b/dc.w/dc.l pseudo-instruction is reached.

Are such instructions supported by FPC? If not then my effort is in vain, unless I compile the original assembler file itself. But I'd like to have the code inline since I want to rewrite it for Pascal and port it to other platforms. Well, a foolish task but it's one of my dreams.

All I need to know is what this error means, if it's possible to avoid it or fix it (on my side, on the FPC side, or finally on the vasm side).

Code: [Select]
WIME68KASM.lpr(368,11) Error: Internal error 200405011
Tried to change the pseudo-instruction to prepend a period: .dc.w, tried the std assembler dialect equivalent, .uhalf, tried to remove the .w extension, everything fails saying "Invalid or missing opcode."

Hope that I am really using vasm (because the FPC wiki says the GNU assembler is problematic with m68k). Added -XV and -Avasm to the compiler options.

Edit: Tried to compile the original source with vasm. It has no problems with the dc.* pseudo-instructions.

With kind regards,
Cigydd
« Last Edit: September 28, 2022, 05:26:15 pm by Cigydd »
Cigydd Bach

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10399
  • FPC developer.
Re: Atari m68k inline assembler error (using vasm): the dc.* pseudo-instruction
« Reply #1 on: September 28, 2022, 05:43:20 pm »
An Internal Error is a kind of assert. 200405011 is the first such assert added on 2004-05-01. I looked what it means and it is in an utility function in rautils that checks if a operand size is 1,2,4 or 8. Probably it also matters to know from where that utility routine was called. (iow where the false argument happened).

Please post a bugreport with the relevant source that triggers the IE on the gitlab bugtracker.

Cigydd

  • New Member
  • *
  • Posts: 22
  • Programming for fun
    • My GitHub
Re: Atari m68k inline assembler error (using vasm): the dc.* pseudo-instruction
« Reply #2 on: September 28, 2022, 05:44:53 pm »
Wow, thank you! Will try my best.
Cigydd Bach

Cigydd

  • New Member
  • *
  • Posts: 22
  • Programming for fun
    • My GitHub
Re: Atari m68k inline assembler error (using vasm): the dc.* pseudo-instruction
« Reply #3 on: September 28, 2022, 07:30:09 pm »
Adding the link to the Lazarus issue for reference: https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39934.

Edit: Wrong place. :-[ The right place is https://gitlab.com/freepascal.org/fpc/source/-/issues/39927
« Last Edit: September 29, 2022, 08:12:34 am by Cigydd »
Cigydd Bach

PascalDragon

  • Hero Member
  • *****
  • Posts: 4759
  • Compiler Developer
Re: Atari m68k inline assembler error (using vasm): the dc.* pseudo-instruction
« Reply #4 on: September 29, 2022, 09:03:26 am »
Edit: Tried to compile the original source with vasm. It has no problems with the dc.* pseudo-instructions.

As a workaround you can simply link in the generated object file using {$L YourFile.obj} and call the code with the help of external declarations.

Cigydd

  • New Member
  • *
  • Posts: 22
  • Programming for fun
    • My GitHub
Re: Atari m68k inline assembler error (using vasm): the dc.* pseudo-instruction
« Reply #5 on: September 29, 2022, 09:09:19 am »
As a workaround you can simply link in the generated object file using {$L YourFile.obj} and call the code with the help of external declarations.

Thanks for the tip!

Seems I could learn this way of programming. Every day something new.  ::)
Cigydd Bach

 

TinyPortal © 2005-2018