X16Community / x16-rom

Other
46 stars 27 forks source link

MONitor utility 65C816 support #260

Open tomxp411 opened 10 months ago

tomxp411 commented 10 months ago

Discussion of 65C816 support for the built-in MONitor utility.

These changes seem less important if we do not support native mode execution, but the community seems pretty intent on making native mode work, so we have some things to consider:

  1. MON will need a new command to select 65C02, 65C816-emulation and 65C816-native mode, due to the additional register count, wider registers, and changed flag labels. These will be called: C02, 816e, and 816n.
  2. MON needs a way to actively track .a and .x flags (Memory Width and Index Width) during disassembly. This will require a new command, as well, to set the expected state of those flags prior to disassembly.
  3. The new 65C816 instructions will need to be added to the assembly/disassembly table
  4. The new address modes will need to be added
  5. The status line needs to be extended, with 2-byte words for the wider registers, the additional bank registers, and the new labels for the flags (which will vary depending on the emulation flag.) This includes extending the memory space used as a proxy for the register values.
  6. When assembling and disassembling, MONITOR will need to track the expected state of the Accumulator Register Width (.a) and Index Register Width (.x) flags, in addition to the .e flag (which forces .a and .x to 8-bits when in 65C02 emulation mode.)

The toughest nut to crack might be the BRK issue. We can't simply BRK in native mode, which means we lose access to the 16-bit registers. If we add a ROM routine named "brk16", a dev can JSR brk16, which will

tomxp411 commented 9 months ago

I found a 65816 port of Supermon. This might be easier than re-implementing the 65816 changes.

http://forum.6502.org/viewtopic.php?f=2&t=2949&start=15#p34022