65c816: assorted low level fixes
authorAlan Cox <alan@linux.intel.com>
Sun, 1 Oct 2017 23:48:17 +0000 (00:48 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 1 Oct 2017 23:48:17 +0000 (00:48 +0100)
commit36765fc8ae1dc3fae66d8e17a02d48343bff52a9
tree8509fc09280a1ea4265bd59f15f3d2915e8e56a1
parent1157ea28b1e192df7fcc983e77eba70ed605e49f
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)
Kernel/lib/65c816.s
Kernel/lowlevel-65c816.s
Kernel/usermem_std-65c816.s