1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-17 15:38:07 +11:00
Commit Graph

98 Commits

Author SHA1 Message Date
Virgil Dupras
4939189233 emul: make blk operations much faster
It helps a bit with staging times.
2020-06-22 06:29:00 -04:00
Virgil Dupras
dbd283758c Refer to BOOT and (uflw) by addr in stable ABI
Was previously referred to by name+find, which was wasteful.
2020-06-21 11:41:10 -04:00
link2xt
d83d12899b
MOVE: do not crash when u is 0 (#126)
This commit adds ?DUP IF guards to MOVE and MOVE- that make them exit
when u is 0. Without these guards a DO loop was executed 65535 times
instead of 0.

In particular, this fixes a crash when "105 LOAD I " is executed
immediately after boot. Block editor word "I" passes IBUF length (0)
to MOVE- and MOVE in this case, causing a crash.
2020-06-21 05:49:45 -05:00
Virgil Dupras
397ee3e3e6 Simplify word ' 2020-06-20 14:13:41 -04:00
Virgil Dupras
aca9bc9058 z80: small optimization in cell execution 2020-06-18 08:02:45 -04:00
Virgil Dupras
035532acf7 z80: remove remaining indirections in execute calls
We now have a stable ABI that is pretty cleared up...
2020-06-18 07:50:20 -04:00
Virgil Dupras
42818d25be z80: remove layers of indirection of find calls 2020-06-18 07:40:20 -04:00
Virgil Dupras
76e698157c z80: remove layer of indirection in most "next" calls
The only calls still using the stable ABI indirection are those
made before the next routine is created.
2020-06-18 07:24:47 -04:00
Virgil Dupras
3d2dc041fb Make word routines into word types
Instead of having wordref point to core word routines, I made them
into word 4 word types. It liberates space into the stable ABI and
should make porting to other arches easier.

I'm also thinking of combining word type with the namelen field
for precious bytes saving, but not now...
2020-06-17 21:41:01 -04:00
Virgil Dupras
2be2f74a43 Make literal word routines into regular native words 2020-06-17 14:25:32 -04:00
Virgil Dupras
ea9833d4ff Remove LITA
It was useful when we still had the relinker, but now it has no use.
I was waiting a bit to see if the distinction would be useful again,
but it seems like it won't.
2020-06-17 13:50:42 -04:00
Virgil Dupras
abb4dc8bd7 Reduce the scope of the stable ABI
Only 2>R in actually needed in the RSP family (for LOOP). Reducing
the scope of the stable ABI makes porting to other arches easier.
2020-06-17 07:54:43 -04:00
Virgil Dupras
feeedcc55c z80: small optimization in execute
I had more ambitious goals, but I backed out of it: not worth it.
This small optimization is an easy picking though.
2020-06-16 16:37:21 -04:00
Virgil Dupras
85a0b87da3 z80: reorder compiledWord and doesWord, saving ourselves a jump 2020-06-14 10:12:56 -04:00
Virgil Dupras
38d5a9f303 z80: inline cellWord in stable ABI 2020-06-14 10:07:46 -04:00
Virgil Dupras
40f92b9bab z80: optimize chkPS
Inline it in next and make chkPS, call a newly reserved label for
it directly, removing a layer of indirection. This frees a spot in
the stable ABI.
2020-06-14 09:48:10 -04:00
Virgil Dupras
31095bc04d z80: remove call indirections in tight spots 2020-06-14 09:29:34 -04:00
Virgil Dupras
1871c46614 VE: add backspace support in replace mode 2020-06-11 22:29:05 -04:00
Virgil Dupras
838c88459b Make BLK@ FLUSH only if loading a different block
Otherwise, when editing a file with VE, we would constantly write
to disk, which is a bit inefficient.
2020-06-11 21:42:52 -04:00
Virgil Dupras
4146110e0d Move EMPTY to core words
It's a quite useful word and it doesn't make sense to reload it from
disk after each usage.
2020-06-11 19:04:03 -04:00
Virgil Dupras
7cad9ffe40 LIST: simplify logic
There wasn't much of a reason to leave a loop early on 0x0d or null.
The idea was that once you have a CR or null, the rest is garbage
and you shouldn't see it.

However, it brought a problem: In VE, you couldn't insert characters
past that limit. It would be written, but never displayed. So let's
get rid of this logic and simply always display a 64x16 grid.
2020-06-10 19:00:03 -04:00
Virgil Dupras
f53f91558b find: don't protect BC
not needed
2020-06-03 20:57:29 -04:00
Virgil Dupras
d8a6456206 (parsed): fix crash on parsing non-decimal staring with '-'
The address returned in the error condition would be off by one.
2020-05-25 21:15:07 -04:00
Virgil Dupras
2d17b4e8ec Make string length-prefixed instead of null-terminated
I'm not sure why I chose null-terminated initially. Probably because
the z80asm version had null-terminated strings.

Length-prefixes strings are the traditional form of strings in Forth
and it's a bit easier to work with them with traditional forth words
when they're under this form.
2020-05-25 20:34:52 -04:00
Virgil Dupras
6a507bcaac Add word MOVE, 2020-05-24 19:55:00 -04:00
Virgil Dupras
2d2a846b25 Inline SCPY
I'm planning a string reform and it's standing in the way.
2020-05-24 14:19:25 -04:00
Virgil Dupras
ed2b91411a Limit ourselves to 8-bit branching
I'm planning on going back to 8-bit branching. 16-bit br cells incur
a non-negligible penalty and, while at first 64 words (128 bytes
forward or backward) seemed a bit limiting, I now don't see why one
would ever construct such a big branch. It would be un-forthy.

Also, I looked at using BC instead of IY to hold IP and the transition
would be a lot easier with 8-bit branching.

In this commit, all I do is add overflow checks in IF. The mechanic
below doesn't change. I'll give myself some time to think it over so
that I avoid yet another back and forth.
2020-05-24 10:16:25 -04:00
Virgil Dupras
5bbc256faf Flush input buffer on QUIT
Prebiously, when encountering an error during a : ; definition from
input buffer, because the input buffer wasn't flushed, we would continue
interpreting and quit the whole program when encountering ;.
2020-05-24 09:23:19 -04:00
Virgil Dupras
02e6979a46 emul: implement AT-XY
VI, here we come!
2020-05-23 20:15:28 -04:00
Virgil Dupras
d041b91846 Optimize chkPS
Use EXX instead of the stack for HL protection and remove all
spurious uses of chkPS,

I wanted to inline chkPS in next because of its "tight loop" status,
but for reasons I don't understand, doing so breaks Collapse OS.
Later...
2020-05-22 23:12:03 -04:00
Virgil Dupras
6bff03a48b Move adev to core
It's small enough to be worth it.
2020-05-22 14:50:34 -04:00
Virgil Dupras
bb190f9665 Add word TUCK 2020-05-22 14:19:02 -04:00
Virgil Dupras
41d439376d Add word NIP 2020-05-22 14:19:02 -04:00
Virgil Dupras
f75b1c8864 Add word ?DUP 2020-05-22 14:19:02 -04:00
Virgil Dupras
863540f7c6 core: define H@ a bit sooner 2020-05-15 22:59:38 -04:00
Virgil Dupras
b6c039589f Don't emit BS when at beginning of input buffer 2020-05-15 20:51:09 -04:00
Virgil Dupras
1597f1e131 Don't generalize XYPOS just yet
It was ill-advised.
2020-05-15 14:09:31 -04:00
Virgil Dupras
db9885b8cf Rename (find) to FIND
I hadn't noticed that this word was almost ANS compliant.
2020-05-15 12:50:14 -04:00
Virgil Dupras
175b4bc497 sms: CollapseOS prompt! 2020-05-15 12:46:25 -04:00
Virgil Dupras
ca60685067 Streamline initialization process
Instead of letting each configuration taking care of RDLN$ and
"CollapseOS" prompt, move this to BOOT to simplify xcomp units.

Initialization source code is now only for driver initialization.
2020-05-15 11:34:35 -04:00
Virgil Dupras
0163af470a Fix EOT behavior after QUIT
Previously, calling quit would break EOT behavior and not properly
quit Collapse OS.
2020-05-15 10:19:39 -04:00
Virgil Dupras
87b51a6261 By default, allocate about 0x100 bytes for PSP+RSP
During "make updatebootstrap", we use less than 0x20 bytes on the
PSP side and less than 0x40 bytes on the RSP one. 0x100 bytes ought
to be enough for anybody.
2020-05-14 18:41:09 -04:00
Virgil Dupras
bf289b0a67 z80a: de-variable-ize
Use straight VARIABLE instead of Z80MEM+. Initially, I used this
system to allow z80a to be embedded in a system binary, but now
I don't think it's worth it. Compiled, z80a is 2.5k. Sure, it's a
sizeable amount of RAM, but I think that even with it in RAM, I'll
manage a bootstrap within my most constrained machine, the SMS with
8K.
2020-05-14 15:29:22 -04:00
Virgil Dupras
a5269a1c7c Make blk use system RAM 2020-05-14 14:51:20 -04:00
Virgil Dupras
eec9549bde Make rdln use system RAM 2020-05-14 14:26:56 -04:00
Virgil Dupras
8a58449776 Add word ERR 2020-05-14 11:57:26 -04:00
Virgil Dupras
9d4d9de511 emul: remove stage1 2020-05-14 10:49:24 -04:00
Virgil Dupras
e6bac985fa Cross-compiles in a single stage!
Finally got rid of the XPACKed core and managed to cross-compile
all core words, which greatly simplifies the bootstrapping process.
2020-05-14 10:17:38 -04:00
Virgil Dupras
68262f925b Almost done De-XPACKing! 2020-05-14 09:58:48 -04:00
Virgil Dupras
640e3321fc Move a bunch of words from XPACKed core to xcomp core 2020-05-14 09:54:33 -04:00