Consider the following program: nop dc.w $1000-* ds.b $1000-$ moveq #0,d0 Assembling this, the dc.w will produce what's expected, i.e. subtract 2 from $1000 for a result of $ffe. The ds.b on the other hand will fail with the error "Error: illegal relative address". "Why's that?" I wondered. Taking a peek at the source, I saw that the implementation of d_ds() makes a call to abs_expr() to calculate the value. This has a clause that makes it fail if the expression is in a TEXT/DATA/BSS segment (which is considered relative). I think this check was there due to ds.X in the past being legal only in the BSS segment, or something close to that. I think that we can replace that to a plain call to expr() so it can be more flexible. I'll attach a patch in a bit, let me know if you can think of any reasons why we shouldn't do this!
Created attachment 159 [details] The patches!
Thanks for the patch! :-)