1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-24 14:28:06 +11:00

emul: build boot binary in one pass

... instead of building boot.fs, and then z80c.fs/icore.fs in separate
passes. This strengten xcomp by making it support 2 completely separate
dicts (that is, the X dict is *not* connected to the system dict. The chain
now stops at EXIT def in boot.fs).
This commit is contained in:
Virgil Dupras 2020-04-10 09:55:58 -04:00
parent c8c337fd58
commit 7aa1be070b
6 changed files with 24 additions and 15 deletions

View File

@ -15,10 +15,10 @@ $(SLATEST):
$(BIN2C):
$(MAKE) -C ../tools
# z80c.bin and boot.bin are not in the prerequisites because they're bootstrap
# binaries that should be updated manually through make updatebootstrap.
# z80c.bin is not in the prerequisites because it's a bootstrap
# binary that should be updated manually through make updatebootstrap.
forth/forth0.bin: $(SLATEST)
cat forth/boot.bin forth/z80c.bin > $@
cp forth/z80c.bin $@
$(SLATEST) $@
cat forth/emul.fs >> $@
@ -37,7 +37,7 @@ forth/core.bin: $(FORTHSRC_PATHS) forth/stage1
cat $(FORTHSRC_PATHS) ./forth/stop.fs | $(STRIPFC) | ./forth/stage1 | tee $@ > /dev/null
forth/forth1.bin: forth/core.bin $(SLATEST)
cat forth/boot.bin forth/z80c.bin forth/core.bin > $@
cat forth/z80c.bin forth/core.bin > $@
$(SLATEST) $@
forth/forth1-bin.h: forth/forth1.bin $(BIN2C)
@ -60,10 +60,11 @@ emul.o: emul.c
$(CC) -c -o emul.o emul.c
forth/z80c.bin: forth/stage2
cat ./forth/conf.fs ../forth/xcomp.fs ./forth/xcomp.fs ../forth/boot.fs ../forth/z80c.fs ../forth/icore.fs | ./forth/stage2 | tee $@ > /dev/null
.PHONY: updatebootstrap
updatebootstrap: forth/stage2
cat ./forth/conf.fs ../forth/boot.fs | ./forth/stage2 | tee forth/boot.bin > /dev/null
cat ./forth/conf.fs ../forth/xcomp.fs ./forth/xcomp.fs ../forth/z80c.fs ../forth/icore.fs | ./forth/stage2 | tee forth/z80c.bin > /dev/null
updatebootstrap: forth/z80c.bin
.PHONY: clean
clean:

Binary file not shown.

View File

@ -14,7 +14,5 @@
CURRENT @ XCURRENT !
( dummy entry for dict hook )
(xentry) _
H@ 256 /MOD 2 PC! 2 PC!
H@ ' _bend - XOFF !
H@ XOFF !

Binary file not shown.

View File

@ -381,5 +381,4 @@ NOP, NOP, NOP, NOP, NOP,
'_' A, 'b' A, 'e' A, 'n' A, 'd' A,
PC L2 @ - A,, ( prev )
5 A,
H@ 256 /MOD 2 PC! 2 PC!
H@ XCURRENT ! ( set current tip of dict )

View File

@ -95,9 +95,20 @@ VARIABLE XOFF
,
THEN
ELSE ( w a )
( maybe number )
DROP ( w )
(parse*) @ EXECUTE LITN
( not found? it might be an immediate that isn't yet defined in our
cross-compiled dict. It's alright, we can find-and-execute it. )
DROP ( w )
( system CURRENT )
0x02 RAM+ @ SWAP ( cur w )
_find ( a f )
IF
( found. It *must* be an IMMED )
DUP IMMED? NOT IF ABORT THEN
EXECUTE
ELSE
( not found. maybe number )
(parse*) @ EXECUTE LITN
THEN
THEN
AGAIN
;