1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-05 20:20:55 +11:00
Commit Graph

227 Commits

Author SHA1 Message Date
Virgil Dupras
ae14c55feb boot: a little dereferencing to make things a bit faster 2020-04-20 23:30:08 -04:00
Virgil Dupras
e569e40665 Forth-ify 2DUP 2OVER 2SWAP
2DROP was left in boot.z80 because it's used in icore.
2020-04-20 23:18:57 -04:00
Virgil Dupras
0438cb92fe Add word "ROLL" 2020-04-20 23:06:39 -04:00
Virgil Dupras
4967c2add2 Merge z80c.fs and boot.fs into boot.z80 2020-04-20 21:27:34 -04:00
Virgil Dupras
41ed70f8cb z80c: Add word "PICK" 2020-04-20 21:22:07 -04:00
Virgil Dupras
353d12c27d boot: inline chkRS, make next a bit faster 2020-04-20 20:28:25 -04:00
Virgil Dupras
d466c6d95d emul: make stage2 load z80a from blkfs
This allows us to remove forth/z80a.fs. Another big step towards
self-hosting!
2020-04-19 21:31:41 -04:00
Virgil Dupras
0892193cbe Copy z80a.fs to disk blocks
I don't remove z80a.fs yet because build process needs it, but that
will change shortly.
2020-04-19 20:36:13 -04:00
Virgil Dupras
dfaa1dc101 link: add "offset" argument to RLDICT
As long as our target was the first word of the "user" dict, using
target's prev to compute offset was fine, but when the target is not
the first word, this system breaks down.

This is the case when, instead of including source code in our boot
binary, we paste it in Collapse OS' prompt.

Also, adjust RC2014 recipe to include stage 3 assembling instructions
with the "paste into prompt" method.
2020-04-19 16:28:40 -04:00
Virgil Dupras
29a6ee128d core: fix PSP leak in CASE..ENDCASE 2020-04-18 22:05:11 -04:00
Virgil Dupras
f3c92684a0 link: improve reliability by never relinking last word
It's not possible to reliably determine its end and with some memory
initialization scenarios, it makes RLDICT fail.
2020-04-18 16:51:48 -04:00
Virgil Dupras
b062a9092a parse: use "0<" instead of "0 <"
As I wrote in my "Clarify signed-ness" commit, "0 <" is broken.

Also, made this unit a bit more compact. The RC2014 stage1 can
really use some breathing room...
2020-04-18 09:18:09 -04:00
Virgil Dupras
66f65daa08 Add word LEAVE 2020-04-18 08:37:57 -04:00
Virgil Dupras
19d94dfb47 recipes/rc2014: stage1 is too big! saving some space
stripfc requires 2 spaces before "(" to strip a comment. This was
a low hanging fruit for me to get stage1.bin under the 8K line.

That thing is getting tight...
2020-04-17 21:10:48 -04:00
Virgil Dupras
9edab10a3a blk: add dirty flag and auto write blocks on fetch
Also, fix some PSP leaks related to LOAD.
2020-04-16 20:59:20 -04:00
Virgil Dupras
5cb4a7de9a Add word "C@+" 2020-04-16 18:58:11 -04:00
Virgil Dupras
eefa8e6de5 Add word "BLK!"
as well as emulator support for it. We can now write an edited
block back to "blkfs".
2020-04-16 17:22:18 -04:00
Virgil Dupras
57e20f0532 Block explorer upgraded to block editor! 2020-04-16 15:59:43 -04:00
Virgil Dupras
5067d40e3b Add CASE..OF words 2020-04-16 15:07:31 -04:00
Virgil Dupras
65bc3b73ad link: adjust (br) and (?br) hardcoded offsets
They changed in my earlier commit.
2020-04-16 09:26:01 -04:00
Virgil Dupras
5d4155aa32 Add words 1+ 2+ 1- 2- and consts 0 1 -1
Saves quite a few bytes in the final binary.
2020-04-15 21:29:39 -04:00
Virgil Dupras
e1e634c815 boot: compaction
It's more hassle than it seems to move the stable ABI...
2020-04-15 20:57:46 -04:00
Virgil Dupras
f6727f8e34 boot: use CODE where possible
Now that we use xcomp unit, boot entry creation can be a bit
cleaner.
2020-04-15 20:17:28 -04:00
Virgil Dupras
a56ace4d3e boot: optimize (br) 2020-04-15 20:03:56 -04:00
Virgil Dupras
0750e8d0c0 Use IY for IP instead of RAM+06 2020-04-15 17:01:15 -04:00
Virgil Dupras
2a84a426b4 Strip usages of IY register 2020-04-15 16:53:04 -04:00
Virgil Dupras
2b0186fd58 boot: make routine field 1b
I forgot to do it earlier. NOP having an opcode of 0, it didn't have
any effect.
2020-04-15 16:24:03 -04:00
Virgil Dupras
6884c5cbe3 boot: use 3 labels instead of 4 2020-04-15 16:13:10 -04:00
Virgil Dupras
d2ec5e271c Optimize boot binary's word execution code
Should be significantly faster now. Less push/popping and usage of
DE instead of IY.
2020-04-15 16:09:10 -04:00
Virgil Dupras
d8de8a058a Make word routine refs 1b instead of 2
Saves quite a bit of binary space. More than 300 bytes in forth1.bin
2020-04-15 15:16:11 -04:00
Virgil Dupras
e40c059c26 Make word routines all in the <0x100 range 2020-04-15 14:00:59 -04:00
Virgil Dupras
728e4ce123 Bring EXECUTE word outside of stable ABI 2020-04-15 13:36:28 -04:00
Virgil Dupras
22f132094a Clarify signed-ness
And fix broken negative display in ".".
2020-04-15 12:29:47 -04:00
Virgil Dupras
b73e1a5f7a z80a: invert the meaning of IFZ, IFNZ, IFC, IFNC,
It is much less confusing when "IFZ," means "If Z is set, continue
into IF, else, jump to THEN,".
2020-04-15 12:20:09 -04:00
Virgil Dupras
2439f1ed86 Change SCMP for S=
Remove flagsToBC boot routine.
2020-04-15 12:19:58 -04:00
Virgil Dupras
c40f336959 icore: extract "_pdacc" from "(parsed)"
Makes boot binary a bit bigger, but that "_pdacc" word will be
reused in high level apps.
2020-04-15 10:41:27 -04:00
Virgil Dupras
415bd7a169 Support nested LOAD 2020-04-14 21:04:07 -04:00
Virgil Dupras
aec19e5c87 Add word "LOAD" 2020-04-14 18:15:07 -04:00
Virgil Dupras
a67101fb8b Add word "EMPTY" 2020-04-14 16:07:07 -04:00
Virgil Dupras
add3b6629b Make DO .. LOOP binary code more compact
Only a few bytes saved in forth1.bin, but the DO .. LOOP construct
isn't used much yet. It's still significant savings per LOOP call.
2020-04-14 14:59:01 -04:00
Virgil Dupras
f59cac0588 blk: first steps 2020-04-14 09:07:20 -04:00
Virgil Dupras
7292d486dc z80a: add stuctured flow words
Allow us to rely a little less on labels. We now only need 4.
2020-04-13 20:34:53 -04:00
Virgil Dupras
7d184b9e70 Use SUBHLss, macro more 2020-04-13 19:31:23 -04:00
Virgil Dupras
d08a9711c5 boot: make HERE point to RAMEND instead of CURRENT
The former was only used in the peculiar context of "/emul". The
regular case is actually HERE pointing to RAMEND on boot.
2020-04-13 11:43:15 -04:00
Virgil Dupras
1e0b40a876 Add word "FORGET" 2020-04-13 08:09:36 -04:00
Virgil Dupras
76e4422796 Add adev unit 2020-04-12 21:49:20 -04:00
Virgil Dupras
d996dd8c9e Add one layer of indirection in subsystem memory management
This allows optional subsystems to not needlessly reserve too much
system memory and it also reduces offsets bookkeeping.
2020-04-12 20:42:00 -04:00
Virgil Dupras
420836276d readln: rename (c<) to (rdln<)
so that it isn't picked up automatically at boot. Only when (c<$) is
called do we override (c<). This fixes tricky boot problems.
2020-04-12 14:01:54 -04:00
Virgil Dupras
06d0a02c12 link: fix LITA processing 2020-04-12 09:36:10 -04:00
Virgil Dupras
9390479d49 link: minor tweaks 2020-04-11 18:43:43 -04:00