dasm-assembler / dasm

Macro assembler with support for several 8-bit microprocessors

Home Page:https://dasm-assembler.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Force using .wx broken

thrust26 opened this issue · comments

This code used to work in previous DASM versions (and using .wx was required):

RESP0 = $10
...
sta.wx  RESP0,x 

With latest DASM it results into: "...error: Illegal forced Addressing mode on 'sta'."

Same when using y-register.

No doubt fallout from the big merge.

As a work-around until this is fixed, "sta.w RESP0,x" seems to correctly generate the absolute x-indexed version of the opcode.

I guess it was my fault when I moved the opcode adjustment from main.c to ops.c.

Please take this commit 1b31c7a as correction

Maybe there are more hidden bugs that can be targeted to the same code region. This particular tricky piece of code is responsible to pick the right addressing mode out of 3 different sources

  • user forced addressing mode
  • addressing mode implied by the instruction
  • addressing mode implied by the size of the operands
    and matches the result against the adressing modes available to the processor.

I would be glad if I had some more testcases ... volunteers wanted.

I merged the fixes from thomas374b/dasm (commits 45b97e7, 2ac0d2d, 9090da1 and 1b31c7a).
The forced .wx mode is now working again.

As I know "sta.wx" is used in some X-positioning code examples on AtariAge, should we do an hotfix release after we're all happy with this?

@thomas374b Because of your non-matching dasm fork (accidently caused by me), could you please delete your existing fork and create a new one?

Fixed in release 2.20.14.1