| 1 |
==== |
| 2 |
BUGS |
| 3 |
==== |
| 4 |
|
| 5 |
A collection of bugs that would require major DASM surgery |
| 6 |
and are unlikely to get a fix soon. If possible we offer |
| 7 |
workarounds. |
| 8 |
|
| 9 |
--------------------- |
| 10 |
Broken HD6303 Opcodes |
| 11 |
--------------------- |
| 12 |
|
| 13 |
It has been reported several times (by Alan Nash in 2008, |
| 14 |
by Rob Hookham in 2014) that the AIM, OIM, EIM, and TIM |
| 15 |
opcodes are broken. These instructions are *three* bytes |
| 16 |
long according to the data sheets, yet in DASM they are |
| 17 |
treated as *two* byte instructions. |
| 18 |
|
| 19 |
It's my understanding that the instructions are supposed |
| 20 |
to work as follows (from Rob's email): |
| 21 |
|
| 22 |
tim #$10,$C2 |
| 23 |
tim #$80,$00,x |
| 24 |
|
| 25 |
So there's an immediate value *and* a zero-page address |
| 26 |
for these instructions! DASM, however, only accepts these: |
| 27 |
|
| 28 |
tim $10 |
| 29 |
tim $10,x |
| 30 |
|
| 31 |
I don't know what Matthew Dillon was thinking back in the |
| 32 |
day, but in retrospect it seems obvious that these opcodes |
| 33 |
simply don't fit into the "regular pattern" of 8-bit CPUs |
| 34 |
we deal with in DASM. Fixing this will require changes to |
| 35 |
DASM beyond just fixing the instruction table, I don't |
| 36 |
think the parser code is even remotely ready for this. :-/ |
| 37 |
|
| 38 |
The "workaround" for now is to use macros instead of the |
| 39 |
actual instructions, see ../test/broken6303hack.asm for |
| 40 |
details. |