mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 14:18: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:
parent
c8c337fd58
commit
7aa1be070b
@ -15,10 +15,10 @@ $(SLATEST):
|
|||||||
$(BIN2C):
|
$(BIN2C):
|
||||||
$(MAKE) -C ../tools
|
$(MAKE) -C ../tools
|
||||||
|
|
||||||
# z80c.bin and boot.bin are not in the prerequisites because they're bootstrap
|
# z80c.bin is not in the prerequisites because it's a bootstrap
|
||||||
# binaries that should be updated manually through make updatebootstrap.
|
# binary that should be updated manually through make updatebootstrap.
|
||||||
forth/forth0.bin: $(SLATEST)
|
forth/forth0.bin: $(SLATEST)
|
||||||
cat forth/boot.bin forth/z80c.bin > $@
|
cp forth/z80c.bin $@
|
||||||
$(SLATEST) $@
|
$(SLATEST) $@
|
||||||
cat forth/emul.fs >> $@
|
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
|
cat $(FORTHSRC_PATHS) ./forth/stop.fs | $(STRIPFC) | ./forth/stage1 | tee $@ > /dev/null
|
||||||
|
|
||||||
forth/forth1.bin: forth/core.bin $(SLATEST)
|
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) $@
|
$(SLATEST) $@
|
||||||
|
|
||||||
forth/forth1-bin.h: forth/forth1.bin $(BIN2C)
|
forth/forth1-bin.h: forth/forth1.bin $(BIN2C)
|
||||||
@ -60,10 +60,11 @@ emul.o: emul.c
|
|||||||
$(CC) -c -o 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
|
.PHONY: updatebootstrap
|
||||||
updatebootstrap: forth/stage2
|
updatebootstrap: forth/z80c.bin
|
||||||
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
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
Binary file not shown.
@ -14,7 +14,5 @@
|
|||||||
|
|
||||||
CURRENT @ XCURRENT !
|
CURRENT @ XCURRENT !
|
||||||
|
|
||||||
( dummy entry for dict hook )
|
|
||||||
(xentry) _
|
|
||||||
H@ 256 /MOD 2 PC! 2 PC!
|
H@ 256 /MOD 2 PC! 2 PC!
|
||||||
H@ ' _bend - XOFF !
|
H@ XOFF !
|
||||||
|
Binary file not shown.
@ -381,5 +381,4 @@ NOP, NOP, NOP, NOP, NOP,
|
|||||||
'_' A, 'b' A, 'e' A, 'n' A, 'd' A,
|
'_' A, 'b' A, 'e' A, 'n' A, 'd' A,
|
||||||
PC L2 @ - A,, ( prev )
|
PC L2 @ - A,, ( prev )
|
||||||
5 A,
|
5 A,
|
||||||
|
H@ XCURRENT ! ( set current tip of dict )
|
||||||
H@ 256 /MOD 2 PC! 2 PC!
|
|
||||||
|
@ -95,9 +95,20 @@ VARIABLE XOFF
|
|||||||
,
|
,
|
||||||
THEN
|
THEN
|
||||||
ELSE ( w a )
|
ELSE ( w a )
|
||||||
( maybe number )
|
( not found? it might be an immediate that isn't yet defined in our
|
||||||
DROP ( w )
|
cross-compiled dict. It's alright, we can find-and-execute it. )
|
||||||
(parse*) @ EXECUTE LITN
|
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
|
THEN
|
||||||
AGAIN
|
AGAIN
|
||||||
;
|
;
|
||||||
|
Loading…
Reference in New Issue
Block a user