michaelcmartin / Ophis

A cross-assembler for the 6502 series of microprocessors.
http://michaelcmartin.github.io/Ophis/
Other
96 stars 26 forks source link

Add missing (ZP),Z addressing mode support for 45xx CPUs #32

Closed gardners closed 3 months ago

gardners commented 5 years ago

As promised, completely re-implemented the missing (ZP),Z addressing modes for 45xx CPUs, to replace old pull request #29

michaelcmartin commented 5 years ago

This looks like it's adding two addressing modes that are not valid for any particular instructions according to the opcode tables. This needs a little reworking to really do the job, but what reworking is necessary depends on what the intended behavior actually is, and I'm not familiar with the 4502 so this isn't immediately obvious to me. Obvious gaps so far are:

I'm willing to provide some guidance and support on some of this but my unfamiliarity with the chip variant means I'll mostly only be of any use with the "integrating with the rest of the internals" part.

michaelcmartin commented 3 months ago

After cross-checking with the Steil's documentation, the VICE techdocs, and ca65's behavior, I'm fairly confident that these capabilities are already present in Ophis 2.1, and the syntax described above is present in the unit tests as well. This cross-check found some ISA anomalies along the way but they've now been fixed in the code generator itself as part of the fix for issue #38.