enso wrote:
... One crazy idea I had was to monitor the instruction execution to catch an unlikely sequence of instructions [...] Say, LDA $100 followed by another LDA $100. The following STA (to anywhere) could also write the IO page register. Hmm.
First let me say, great work on the CHOCHI and DILDAR systems, enso!! As for crazy ideas, you know I enjoy those
But with this one you'd need to somehow deal with the possibility of an interrupt occurring in the midst of the instruction sequence that's your "key." That's not impossible to do, but here's a variation to kick around:
As Arlet pointed out, the "set IO page" operation isn't something that'll happen frequently. In fact, a single instance is probably sufficient. That suggests a simple solution, one that stipulates that the only way to
repeat the "set IO page" operation would be to reset the processor. Looking at things that way, RESET would be the first part of your "key" -- it would set a flipflop whose function is to allow the "set IO page" operation to occur. And after it did occur, the flipflop would be cleared.
The second part of the key could be a LDA $100, as you suggest, but there are other options. For example, the logic could watch for a CPX# instruction, and
snag the Immediate operand as the value written to the IO page register.
Obviously the initialization code would have to execute the "set IO page" operation before any other instance of CPX# occurs -- this would be the programmer's responsibility.
nyef wrote:
I'd almost suggest the approach taken in the 6280
Interesting to contemplate! I like how the
Hudson Soft HuC6280 has dedicated opcodes that "talk" directly to the memory mapping hardware (as does my
KimKlone computer). But it's probably more solution than is required for the problem at hand. And those new opcodes might better be reserved for other purposes anyway.
cheers,
Jeff
_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html