Commit Graph

417 Commits

Author SHA1 Message Date
Virgil Dupras c912158744 Run "all" tests under the 8086 emulator 2020-10-24 23:38:06 -04:00
Virgil Dupras eafcb0c440 avrpgm: add EEPROM support
also, verify all 3 first bytes of SPI commands. I'm not sure why
I wasn't doing that, probably because I was getting a lot of AVR
err and thought that only 2 bytes of the cmd were echoed. But now,
with a reliable SPI setup, verifying 3 bytes seems to work.
2020-10-05 19:36:49 -04:00
Virgil Dupras dafcf72d5b Add ATmega328P definitions 2020-10-05 16:56:09 -04:00
Virgil Dupras 44bcdd4327 Document 8086 asm instructions list
Also, remove needless argtype in CALL and RET
2020-09-25 19:44:32 -04:00
Virgil Dupras 8bf6258673 Add word TICKS
Adding a delay such as the 20ms one we have in AVR programmer's
initialization routine is tricky without a word like TICKS.

This implementation is highly inaccurate, but more accurate and
reliable than a "ballpark" DO..LOOP...
2020-09-25 17:31:06 -04:00
Virgil Dupras 35840ad8e6 sdc: don't use ABORT"
ABORT" doesn't work in xcomp.

Also, improve xcomp docs and fix misdocumentation.
2020-09-24 13:10:41 -04:00
Virgil Dupras 25a35cf28e Move 8086 boot code from B800 to B440
That slims down blkfs a lot.
2020-09-21 20:09:42 -04:00
Virgil Dupras 037c10fc57 Move AVR programmer from B690 to B160
Also, remove leftovers from previous move.
2020-09-21 20:00:49 -04:00
Virgil Dupras faf088b397 Move AVR assembler from B650 to B50
And move its doc to doc/asm.txt
2020-09-21 19:52:53 -04:00
Virgil Dupras b21be43535 Move 8086 assembler from B730 to B30
Also, move doc to doc/asm.txt.

Also, fix the pcat recipe which was broken since the overlay change.
I hadn't noticed it because I didn't have to rebuild the MBR.
2020-09-21 19:24:54 -04:00
Virgil Dupras 91f79d1131 Move z80a from B200 to B5
The idea is to consider assemblers as "runtime" apps instead of
placing them in the "bootstrap" section of the blocks. These apps
will be used for much more than bootstrapping.

Moved its documentation to doc/asm.txt and made its code blocks
more compact.
2020-09-21 17:51:08 -04:00
Virgil Dupras a348ee9106 Remove Extra words
The few extra bytes they save in the core aren't worth the extra
complexity. This was initially done in a context where I had
troubles keeping the RC2014 binary with SDC inside the 8K limit.

At this point, even with the few extra bytes we add here, we're at
7200 bytes, so I'd say we're fine.
2020-09-21 14:51:46 -04:00
Virgil Dupras 7a5744a4c3 Remove BROWSE and CASE
With the Visual Editor, BROWSE is of dubious value. Even before that,
it was of dubious value. It's the only user of the CASE word, which
is also of dubious value: too complicated for its own good.

The CMD pattern used in VE is much better.
2020-09-21 14:13:34 -04:00
Virgil Dupras fea9beac1e recipes/pcat: move recipe blocks into local overlay 2020-09-20 20:48:52 -04:00
Virgil Dupras 475171d07b recipes/ti84: move recipe blocks into local overlay 2020-09-20 20:24:09 -04:00
Virgil Dupras 373d03e0b1 recipes/trs80: move recipe blocks into local overlay 2020-09-20 11:57:30 -04:00
Virgil Dupras 97ec2569a0 recipes/rc2014: move recipe blocks into local overlay 2020-09-20 10:50:13 -04:00
Virgil Dupras 8e624034bf recipes/sms: move recipe blocks into local overlay 2020-09-20 10:21:21 -04:00
Virgil Dupras b1a95648f1 De-stabilize EXIT
This marks the end of wordrefs in stable ABI. Nice.
2020-09-19 20:35:35 -04:00
Virgil Dupras 3aa681ceca Remove ";" word
The ":" now takes care of scanning for ";". Conceptually, having
";" as an immediate word is slightly simpler than the approach in
this commit, but when bootstrapping is involved, this simpler
approach gets murkier.

Moreover, it got even murkier-er when trying to de-stabilize EXIT,
so here we are.
2020-09-19 20:22:23 -04:00
Virgil Dupras 53239c8f84 De-stabilize (n) 2020-09-19 19:44:15 -04:00
Virgil Dupras 68dd800bd1 Remove LIT< in favor of LIT" exclusively
This duplicated feature existed because of bootstrapping issues
with LIT", but again, with careful threading, we can clean things
up.

We can now have a proper "Collapse OS" prompt :)
2020-09-19 18:51:29 -04:00
Virgil Dupras 0b11979b5e Fix LIT"
I've mistakenly broken it in previous commit.
2020-09-19 14:28:10 -04:00
Virgil Dupras eefbf66e95 De-stabilize (br), (?br), (loop), (s)
When writing the xcomp documentation, I realized that with careful
threading and by accepting a bit of code duplication in the xcomp
toolset, I could de-stabilize a couple of words.

(n) and EXIT are a bit trickier, but I think it can be done. It
would be nice to get rid of stable wordrefs...
2020-09-19 13:54:01 -04:00
Virgil Dupras 3295f1689e doc: add cross.txt 2020-09-19 10:32:28 -04:00
Virgil Dupras 495d2819d2 recipes/rc2014/sdcard: make spi relay design multi-devices
Also, fix the SPI relay driver to properly AND-away the result of
the CTL read.

Tested with a real prototype, works fine.
2020-09-18 19:22:56 -04:00
Virgil Dupras 1a6a549857 Make the SPI Relay protocol support multiple devices
Working on programming AVR chips exposes a glaring omission in my
first design of the SPI Relay: not allowing multiple devices make
this task hard. I constantly have to unplug my SD card before, plug
the AVR chip holder, then play a bit, then unplug the AVR holder,
then replug the SD card...

My prototype for a SPI relay design is built, but I haven't tested
it yet. I need to adapt the code first, which is what I do here.

When the prototype is tested, I'll update the SDC recipe with a new
schema.
2020-09-17 09:48:55 -04:00
Virgil Dupras 5b4917dbe9 avr: allow writing to flash 2020-09-05 14:07:13 -04:00
Virgil Dupras 4910b9caef core: add AMOVEW 2020-08-31 12:11:17 -04:00
Virgil Dupras 3a84a3871b core: make parse and format words a bit tighter 2020-08-30 20:15:55 -04:00
Virgil Dupras 9c36885503 Fix doc innacuracies 2020-08-30 16:53:27 -04:00
Virgil Dupras 85f8543e17 avrspi: first steps
After having done my initial handshaking, I thought the rest of the
job was only a matter of implementing the protocol, but I was wrong.
There were many issues to fix before I could reliably communicate
with my 328P, mostly timing.

Now, I seem to be able to reliably extract fuse information, but
only in batch mode (that is, run "asp$ aspfl@" directly, then
running "(spid)" before running the next command). If I try to
interact with the chip in a single asp$ session, I sometimes get
wrong values (but no sync error! that's worrying...).
2020-08-30 08:01:09 -04:00
Virgil Dupras 7359717000 z80: add missing chkPS, calls
chkPS, used to be only for words that pushed back to PS, but I've
recently removed underflow checks from next and I forgot to add
missing chkPS, calls that go with this change.
2020-08-23 08:43:51 -04:00
Virgil Dupras 46676547d9 spi: add SPI_DELAY decl
AVR chips often run at less than z80's system clock. This means that
our SPI relay needs to have its own clock to properly communicate
with it. This means that the delay between OUT and IN can't be
hardcoded to 2 NOPs anymore. It needs to be configurable.
2020-08-23 07:55:17 -04:00
Virgil Dupras 5f9fccfa8c rc2014: make SIO actually work on real hardware
my previous commit was only tested in emulation, I had init wrong.
2020-08-18 15:33:15 -04:00
Virgil Dupras 124da6adec Move SD Card subsystem outside of RC2014 recipe and add protocols
Although the SPI Relay driver is RC2014-specific, the SD Card driver
is generic enough to be a subsystem. That's the second subsystem we
add and this warrants, I think, the formalization of a new concept:
protocols.
2020-08-16 14:30:33 -04:00
Virgil Dupras 44a4c59525 Indicate unused blocks in master index
It gives a better idea of where stuff can be moved/added to.
2020-08-16 09:38:50 -04:00
Virgil Dupras 007252e459 Move SIO driver into RC2014 recipe 2020-08-16 09:31:02 -04:00
Virgil Dupras ab72a4f383 doc: take bootstrap guide out of blkfs 2020-08-16 08:33:02 -04:00
Virgil Dupras fd69195799 doc: take dictionary out of blkfs 2020-08-16 08:22:41 -04:00
Virgil Dupras d03d93668f doc: take implementation notes out of blkfs 2020-08-16 08:08:23 -04:00
Virgil Dupras 5c4bbaabf4 doc: move usage documention out of the system 2020-08-15 19:40:36 -04:00
Virgil Dupras 31a58d00f1 z80: fix tricky memory initialization issue
Among random "better safe than sorry" changes, the real fix is in
changing "4" for "5" above _find declaration. This off-by-one error
had that word, which is the root word in z80, have a 0x01 prev field
instead of a 0x00 one.

When all memory was initialized to zero, it didn't matter, we ended
up hitting 0 prev and considered ourselves properly at the end of
dict.

When memory wasn't initialized, however, we would end up jumping at
all kinds of places, leading to random behavior.
2020-08-15 16:37:58 -04:00
Virgil Dupras ddb934813e sio: new driver 2020-08-15 09:44:19 -04:00
Virgil Dupras 7ace3032ef zasm: complete mnemonic argspecs harmonization 2020-08-15 08:11:48 -04:00
Virgil Dupras a9ed8da0b2 acia: simplify driver
The previous approach of maintaining R> and W> pointers was
conceptually simple, but made INT handler code actually quite
complex.

Now, we maintain indexes instead. It's much easier to perform
bounds checks and to compare for equality, something we have to
do quick in the INT handler.
2020-08-14 22:58:05 -04:00
Virgil Dupras 73623fff53 zasm: rename LDdd(n) to LDd(n)
it seems I left my asm argument harmonization half done here.

Instructions list at B208 doesn't correspond to many actual
mnemonics. This mnemonic here was the worst offender.
2020-08-14 21:45:25 -04:00
Virgil Dupras c4db9d4420 8086: implement stack overflow error condition
Also, remove RSP underflow check from next for the same reason as
in the previous commit in z80.
2020-08-08 10:18:43 -04:00
Virgil Dupras 5adbf88591 z80: move lbluflw code around
with uflw checks not being in next anymore, we can save ourselves
a forward jump.
2020-08-08 08:19:31 -04:00
Virgil Dupras d1de99d8c9 z80: implement stack overflow error condition
Also, remove underflow checks from next: it's taxing and useless
because underflow check already takes place in each relevant native
word.
2020-08-08 08:08:05 -04:00