while working on my 68k CPU file, which is getting more and more stressful, i came across this:
error: potentially ambiguous token after parameter; try using a separating `,`
144 |
145 | ; Dn <- Dn + (D16/32)
146 | ADD.B {dest:D_REGS}, {src}.W -> 0b1101[3:0] @ {dest}[2:0] @ 0b000[2:0] @ 0b111[2:0] @ 0b000[2:0] @ {src}[15:0]
| ^
this is a problem because that is just how the 68k works.
0x00000000.W is interpreted as a word (16 bit), and 0x00000000.L is interpreted as a long (32 bit)
; Dn <- Dn + (D16/32)
ADD.B {dest:D_REGS}, {src}.W -> 0b1101[3:0] @ {dest}[2:0] @ 0b000[2:0] @ 0b111[2:0] @ 0b000[2:0] @ {src}[15:0]
ADD.W {dest:D_REGS}, {src}.W -> 0b1101[3:0] @ {dest}[2:0] @ 0b001[2:0] @ 0b111[2:0] @ 0b000[2:0] @ {src}[15:0]
ADD.L {dest:D_REGS}, {src}.W -> 0b1101[3:0] @ {dest}[2:0] @ 0b010[2:0] @ 0b111[2:0] @ 0b000[2:0] @ {src}[15:0]
ADD.B {dest:D_REGS}, {src}.L -> 0b1101[3:0] @ {dest}[2:0] @ 0b000[2:0] @ 0b111[2:0] @ 0b001[2:0] @ {src}[31:0]
ADD.W {dest:D_REGS}, {src}.L -> 0b1101[3:0] @ {dest}[2:0] @ 0b001[2:0] @ 0b111[2:0] @ 0b001[2:0] @ {src}[31:0]
ADD.L {dest:D_REGS}, {src}.L -> 0b1101[3:0] @ {dest}[2:0] @ 0b010[2:0] @ 0b111[2:0] @ 0b001[2:0] @ {src}[31:0]
ADD.B {dest:D_REGS}, {src:s16} -> 0b1101[3:0] @ {dest}[2:0] @ 0b000[2:0] @ 0b111[2:0] @ 0b000[2:0] @ {src}[15:0]
ADD.W {dest:D_REGS}, {src:s16} -> 0b1101[3:0] @ {dest}[2:0] @ 0b001[2:0] @ 0b111[2:0] @ 0b000[2:0] @ {src}[15:0]
ADD.L {dest:D_REGS}, {src:s16} -> 0b1101[3:0] @ {dest}[2:0] @ 0b010[2:0] @ 0b111[2:0] @ 0b000[2:0] @ {src}[15:0]
ADD.B {dest:D_REGS}, {src:i32} -> 0b1101[3:0] @ {dest}[2:0] @ 0b000[2:0] @ 0b111[2:0] @ 0b001[2:0] @ {src}[31:0]
ADD.W {dest:D_REGS}, {src:i32} -> 0b1101[3:0] @ {dest}[2:0] @ 0b001[2:0] @ 0b111[2:0] @ 0b001[2:0] @ {src}[31:0]
ADD.L {dest:D_REGS}, {src:i32} -> 0b1101[3:0] @ {dest}[2:0] @ 0b010[2:0] @ 0b111[2:0] @ 0b001[2:0] @ {src}[31:0]
the top 6 instructions are the same as the bottom 6, except that the size of the address is forced by the programmer (either .W(ord) or .L(ong))
the bottom 6 automatically use the best address size, if the address fits inside a 16 bit signed integer it uses the .W(ord) addressing mode, if it doesn't fit it uses the .L(ong) addressing mode.
(atleast i hope instruction pritory works from top to bottom and that i'm using the s16 and i32 things correctly)
currently my only real way around this is to comment out the forced address sizes and only have the automatically deciding ones. technically the forced ones aren't even nessesary so i don't know if this is worth "fixing".