clownassembler icon indicating copy to clipboard operation
clownassembler copied to clipboard

Default sizes for instructions without a size specifier suffix

Open WinFutureX opened this issue 2 months ago • 3 comments

For instructions that support multiple sizes but do not have a size suffix specified, the assembler should select a default size. For example:

move #0, d0      -> move.w #0, d0
addq #1, d1      -> addq.w #1, d1
subq #1, d1      -> subq.w #1, d1
btst #0, $FF0000 -> btst.b #0, $FF0000 ; the only size supported for addresses or register-indirect
btst #0, d0      -> btst.l #0, d0      ; the only size supported for registers

Both asm68k and vasm do this.

WinFutureX avatar Oct 19 '25 13:10 WinFutureX

This is currently enabled on a case-by-case basis, but it should be easily made universal.

Clownacy avatar Oct 19 '25 13:10 Clownacy

I updated the sources and rebuilt the assembler, but when I tried assembling an unsized MOVE instruction, I got an assertion failure: Assertion failed: cc_false, file C:\Users\Kelsey\Documents\clownassembler\semantic.c, line 3249

It seems that the size check has not been updated to account for this change.

WinFutureX avatar Oct 19 '25 14:10 WinFutureX

Whoops. And here I thought all instructions used ConstructSizeBits. That should be corrected now. I've also permitted more instructions to be unsized.

Clownacy avatar Oct 19 '25 14:10 Clownacy