mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-04 04:58:05 +11:00
a7dcb522c2
The 1 byte limitation has been effective for a while now, but I hadn't made the move yet, I wanted to see if the limitation would cause me problems. It doesn't. Doing this now slightly facilitates the IY->BC move in z80. Bootstrapping: if you try to recreate the CVM binary from the previous commit with this code, you'll have bootstrapping problems. The first bootstrap will compile a binary with 2-bytes wide cells but branching conditionals that yields 1-byte cells. That's bad. I got around the issue by temporarily inserting a "397 399 LOADR" instruction in cvm/xcomp.fs, right before the xcomp overrides. This way, I force 1-byte cells everywhere on the first compiliation, which then allows me to apply the logic change in cvm/vm.c and have a properly running binary.
10 lines
230 B
Plaintext
10 lines
230 B
Plaintext
CODE (loop)
|
|
PC 0x47 - ORG @ 0x45 + ! ( stable abi )
|
|
[BP] 0 INC[w]+, ( I++ )
|
|
( Jump if I <> I' )
|
|
AX [BP] 0 MOVx[]+, AX [BP] -2 CMPx[]+,
|
|
JNZ, L1 @ RPCs, ( branch )
|
|
( don't branch )
|
|
BP 4 SUBxi, DX INCx,
|
|
;CODE
|