Recent

Author Topic: Atari m68k inline assembler error: encoding absolute displacement directly  (Read 581 times)

Cigydd

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

I am trying to compile a Motorola 68000 Assembler source in an inline block (asm … end;).

I have such an instruction:

Code: Pascal  [Select][+][-]
  1.     move.w    -48(pc,d0.w),d0    // 303B 00D0

Getting the following error:

Code: [Select]
Error: warning 2069 in line 475 of "<path>/<file>.s": encoding absolute displacement directly

As you can see, it's originally a warning from the assembler layer but it becomes and error on the compiler level.

What could I do to get rid of this warning/error? I know what displacement is but in this case I think that the D0 register used (-48(pc,d0.w)) makes the displacement relative (unless its content is somehow known to the assembler?).

How do I make the displacement absolute? Or is there an error on the inline assembler side?

Tried this:

Code: Pascal  [Select][+][-]
  1.     move.w    H544(pc,d0.w),d0    // 303B 00D0

where H544 is a label but that kind of syntax doesn’t seem to be supported. Getting an Assembler syntax error.

« Last Edit: October 13, 2022, 12:29:38 am by Cigydd »
Cigydd Bach

Cigydd

  • New Member
  • *
  • Posts: 22
  • Programming for fun
    • My GitHub
Tried with a simple sample project and noticed that it actually compiles, even though it complains about an error.

But the question remains because in the original project, I get spammed with these messages and hardly get to the actual errors that block the compilation.
Cigydd Bach

PascalDragon

  • Hero Member
  • *****
  • Posts: 4765
  • Compiler Developer
I have such an instruction:

Code: Pascal  [Select][+][-]
  1.     move.w    -48(pc,d0.w),d0    // 303B 00D0

Getting the following error:

Code: [Select]
Error: warning 2069 in line 475 of "<path>/<file>.s": encoding absolute displacement directly

As you can see, it's originally a warning from the assembler layer but it becomes and error on the compiler level.

What version of the compiler do you use? And what is your assembler? How does the assembly generated by the compiler look like (the assembly files are kept if you use the option -al for example).

Cigydd

  • New Member
  • *
  • Posts: 22
  • Programming for fun
    • My GitHub
What version of the compiler do you use? And what is your assembler? How does the assembly generated by the compiler look like (the assembly files are kept if you use the option -al for example).

Created a repository with the sample project: https://gitlab.com/pavel.reznicek/displacement-test/

I use vasm and vlink.

As for the compiler version, I have compiled it from the main/trunk git branch, commit 2b63c02bc503dc1b1081c90dec770bf78473ecbd.

All other information you requested is included in the repository. See the bash build script and the build.log file.
Cigydd Bach

 

TinyPortal © 2005-2018