Commit Graph

220 Commits

Author SHA1 Message Date
Virgil Dupras
5bf3baff05 editor: add edit buffer
Also, add word "C!+" and fix PSP leak in FILL.
2020-05-01 13:17:40 -04:00
Virgil Dupras
f38de1c151 Introduce the notion of Extra words 2020-04-29 21:52:18 -04:00
Virgil Dupras
0cf26547ff Add words FLUSH and COPY 2020-04-29 20:21:18 -04:00
Virgil Dupras
581f04a4bc Keep stage1 bootstrap bin instead of stage 0
XPACKed source needing to be kept in bootstrap bin didn't make
much sense. With the removal of stripfc, it makes more sense to keep
the compiled form of stage 1 in repository as a bootstrap binary.

Also, rename it to forth.bin.
2020-04-29 19:38:43 -04:00
Virgil Dupras
1b2c4b519e icore: add BIN+
This allows us to write LATEST at proper offset in emul/stage1.fs in
cases where we set a nonzero BIN(.
2020-04-29 11:42:09 -04:00
Virgil Dupras
61b2e02351 xcomp: remove XOFF and use ORG and BIN( instead 2020-04-28 09:37:00 -04:00
Virgil Dupras
4501313410 Add [IF] .. [THEN]
Will be useful as kinds of "#ifdef"s during xcomp.
2020-04-28 08:28:59 -04:00
Virgil Dupras
2b2ccad96c Add word FILL 2020-04-27 21:22:06 -04:00
Virgil Dupras
f605e2d85c Give CASE's default branch access to its input value
ref #97
2020-04-27 20:44:21 -04:00
Virgil Dupras
295b4b6e0a z80a: add BIN( parameter
Will be useful for assembling binaries for the TRS-80 which can't start
at addr 0.
2020-04-27 15:11:38 -04:00
Virgil Dupras
dee7eea497 Move link.fs to blkfs 2020-04-26 14:37:54 -04:00
Virgil Dupras
a2f164ecc3 emul: bootstrap to stage2 from within Collapse OS!
Big bootstrapping change which greatly reduces the role of the modern
operating system in the bootstrapping process.
2020-04-26 10:24:09 -04:00
Virgil Dupras
4b7247a971 emul: use LATEST instead of binary size as start addr in stage
More reliable.
2020-04-26 08:37:12 -04:00
Virgil Dupras
898684a795 emul: merge pre.fs and emul.fs into stage1.fs 2020-04-25 22:45:53 -04:00
Virgil Dupras
bc3aabc84e Update z80c.bin's LATEST during xcomp instead of using slatest 2020-04-25 22:02:44 -04:00
Virgil Dupras
389b23fe1a Change C<? mechanic
It's now a simple flag updated by the C< implementation. No more
routine pointer.

The goal is to avoid tons of "ok" during a LOAD operation.
2020-04-25 09:10:25 -04:00
Virgil Dupras
b5c370a936 emul: embed blkfs in forth binary
This will allow us to read from blkfs in tests.
2020-04-24 18:01:55 -04:00
Virgil Dupras
1bd191e86a Move /emul/forth/* to /emul
Less noisy this way
2020-04-24 17:53:58 -04:00
Virgil Dupras
816563e2e3 Stop LOADing on ABORT
This is done by adding a "C<* override" layer that is reset to 0 on
ABORT.

The problem was that when ABORT happened during a LOAD, we had a
resetted RSP and started from a clean INTERPRET, but LOAD didn't
have the opportunity to restore C<*, which caused it to continue
interpreting from the faulty BLK.

With a C<* override, we don't need to *restore* C<*, we just need to
clear the override.
2020-04-24 14:10:40 -04:00
Virgil Dupras
af39b37dd1 Replace the "> " prompt with the more traditional "ok" one
This is more than cosmetic, it's also highly usable. The presence
or absence of the "ok" message allows us to know whether the command
aborted. Previously, the "> " prompt appeared when the system expected
a prompt in the INTERPRET context, whether the previous command aborted
or not.

Also, this allows us to get rid of that ugly FLAGS global variable.
2020-04-24 12:10:07 -04:00
Virgil Dupras
44403c3d4c Move icore to blkfs
The way is clear for complete stage1 bootstrapping on the RC2014
target!
2020-04-23 15:14:14 -04:00
Virgil Dupras
dd6ce1b8fe Avoid using (xentry) outside xcomp config 2020-04-23 12:09:31 -04:00
Virgil Dupras
fcd77f80ab Use blk's boot.z80 2020-04-22 21:49:44 -04:00
Virgil Dupras
338769a0a8 z80a: add PUSH0, PUSH1, PUSHZ, macros 2020-04-22 19:03:32 -04:00
Virgil Dupras
7464c67c80 boot: fix (roll)
It didn't work for values over 0xff. Duh!
2020-04-22 10:47:23 -04:00
Virgil Dupras
7a0e63746f parse: don't validate 0x and 0b lengths
It doesn't serve much purpose and takes up many precious bytes. And,
after all, parsed didn't do it either...
2020-04-21 20:40:23 -04:00
Virgil Dupras
372524fd19 Move xcomp to blocks 2020-04-21 20:30:14 -04:00
Virgil Dupras
446ce574cd Add words "'S" and "S0" 2020-04-21 07:45:23 -04:00
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
6ae65940d2 Update bootstrap bin
It seems that I had forgotten in an earlier commit.
2020-04-19 20:57:09 -04:00
Virgil Dupras
a70366aa43 drv/sdc: Implement SDC!
This has been tested in the RC2014 emulator. I could edit blocks with
the Block Editor and they would correctly be written to SDC.
2020-04-18 19:39:28 -04:00
Virgil Dupras
c64a8a2e2b drv/sdc: new unit to drive SD card through SPI relay
Goes through initialization in RC2014 emulator.
2020-04-18 11:11:11 -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
82044454d5 Merge branch 'master' into forth 2020-04-17 20:39:08 -04:00
Virgil Dupras
9c41744e46 emul/hw/rc2014: implement blk write in sdc
All of that should help me implement sdc support much faster in
Forth.
2020-04-17 20:19:55 -04:00
Virgil Dupras
7544b3834b emul/hw/rc2014: implement blkread in sdc
I now get to "fls" in recipes/rc2014/sdcard!
2020-04-17 19:10:22 -04:00
Virgil Dupras
ae470397d7 emul/hw/rc2014: add sdc emulator (wip)
so far, it goes through initialization with the rc2014/sdcard recipe.
2020-04-17 15:11:32 -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
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
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
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