65c816: assorted low level fixes
With these fixed we get to a shell prompt and can run some commands. To get
further is going to need cc65 modifications as cc65 generates the following
code in /bin/ls
STA $08 3
STX $09 3
JMP $0008 5
which of course goes castors up on the 65C816 set up because DP is not B:0000
nor can it be.
So far this seems to be the only problem case and it looks as if generating a
PHX 3
PHA 3
RTS 6
would be within one clock for 65C02 or later. 6502 compatible code
will need an uglier fixup I fear.
STA $08 3
TXA 2
PHA 3
LDA $08 3
PHA 3
RTS 6
or similar which isn't pretty but works (self modifying code isn't on
because we might re-enter mid execution)