Commit Graph

273 Commits

Author SHA1 Message Date
Virgil Dupras e3c885085d Consolidate tests
Also, removed leftover in runbin.c (what did it do there??) that
could result in tests falsely passing.
2019-12-30 20:08:08 -05:00
Virgil Dupras 7ca54d179d lib/expr: make EXPR_PARSE "tail" HL
Things are now much simpler.
2019-12-30 19:24:53 -05:00
Virgil Dupras 289037a3dd lib/parse: make parseDecimal "tail" HL
HL, instead of being preserved, is set to the character following
the last read character.
2019-12-30 10:13:55 -05:00
Virgil Dupras dcb96aefe9 lib/parse: remove parseHexPair
Also, make parseHexadecimal "tail" (HL). Soon, all routines in lib/parse
will do that, making the life of lib/expr easier.
2019-12-29 21:56:56 -05:00
Virgil Dupras 2503bdfced lib/args: remove 2019-12-29 21:05:09 -05:00
Virgil Dupras 981c93bfd4 lib/expr: fix stack imbalance on failure 2019-12-29 16:15:48 -05:00
Virgil Dupras 4760d044c0 test_expr: simplify 2019-12-29 15:39:39 -05:00
Virgil Dupras 213614af33 lib/expr: make recursion process a bit more orderly
Instead of going left and right, finding operators chars and replacing them
with nulls, we parse expressions in a more orderly manner, one chunk at a
time. I think it qualifies as "recursive descent", but I'm not sure.

This allows us to preserve the string we parse and should also make the
implementation of parens much easier.
2019-12-29 11:42:18 -05:00
Virgil Dupras 7410891ad1 lib/expr: fix unary minus
For some reason, I've mistakenly disabled tests in test_expr without noticing
and I also broke "-123" parsing. Fixed.
2019-12-23 20:53:31 -05:00
Virgil Dupras 6d88c3a754 parseExprDE --> parseExpr 2019-12-23 19:13:44 -05:00
Virgil Dupras 025b90909f Update bootstrap bin 2019-12-23 16:03:23 -05:00
Virgil Dupras aef96c5e96 Add missing common.asm test harness file 2019-12-23 16:02:26 -05:00
Virgil Dupras a034f63e23 test: begin adding common test harnessing code
This should make tests a bit more convenient to write and debug.

Moreover, begin de de-IX-ization of parseExpr. I have, in a local WIP, a
parseExpr implemented using a recursive descent algo, it passes all tests, but
it unfortunately assembles a faulty zasm. I have to find the expressions that
it doesn't parse properly.

But before I do that, I prefer to commit these significant improvements I've
been making to tests harness in parallel of this development.
2019-12-23 15:41:25 -05:00
Virgil Dupras 98ca338aba avra: add LD/ST 2019-12-22 21:50:20 -05:00
Virgil Dupras b955a67daa avra: add TST 2019-12-22 19:24:36 -05:00
Virgil Dupras 6e1e8e0e59 avra: add LSL 2019-12-22 18:36:15 -05:00
Virgil Dupras 8ded02bc78 avra: fix misordered MOV, MUL, NEG and NOP 2019-12-22 18:35:08 -05:00
Virgil Dupras f54e10f9fd avra: add CALL and JMP 2019-12-22 15:54:46 -05:00
Virgil Dupras 10b925e0e0 avra: add BCLR and BSET 2019-12-22 15:11:15 -05:00
Virgil Dupras 1771ee8da7 avra: add SER 2019-12-22 15:01:08 -05:00
Virgil Dupras 0a9ac27cf6 avra: add SBIC and SBIS 2019-12-22 14:55:38 -05:00
Virgil Dupras a9dcba5793 avra: add CBR instruction 2019-12-22 14:45:10 -05:00
Virgil Dupras c968995ec0 avra: add CBI and SBI
This completes instruction support for the Blink tn45 example.
2019-12-15 20:51:31 -05:00
Virgil Dupras 2652c81519 avra: make CLR work properly 2019-12-15 16:43:32 -05:00
Virgil Dupras aa8df95f7d Add "avr/" includes folder
Also, add a "real world" example in AVRA tests, a blink program on
a ATtiny45. Some instructions are commented out because they aren't
implemented yet, but not many.

The output of the program has been verified against AVRA's own
output.
2019-12-15 09:38:01 -05:00
Virgil Dupras 64935d8b40 avra: add IN and OUT instructions 2019-12-15 08:43:59 -05:00
Virgil Dupras fa75f30ffb avra: add RJMP and RCALL instructions 2019-12-14 12:28:27 -05:00
Virgil Dupras a5efc695e9 avra: add "Rd + bit" instructions 2019-12-14 09:33:46 -05:00
Virgil Dupras c696fcbce4 avra: add "with immediate" instructions 2019-12-14 09:05:38 -05:00
Virgil Dupras 4b9712a224 avra: add branching instructions 2019-12-13 22:49:15 -05:00
Virgil Dupras 57c1a10434 avra: first steps 2019-12-13 17:38:40 -05:00
Virgil Dupras e691dab070 zasm: little drive-by optimization
Use IX directly for argspec rows instead of going through DE. It saves a bit
of processing. The code was this way because I initially didn't use IX at all,
so as code evolved, that DE translation stayed as an artifact.
2019-12-13 10:54:01 -05:00
James Stanley 1b8b113536 Fix filesystem in shell emulator
We now treat the block device as fixed-size rather than trying to grow it in response
to kernel activity.

Previously, if you tried to create 2 files in a row, only the first 1 would actually appear,
because the device only ever got larger when a byte was written immediately past the end of
the device.

Now we just let the kernel write bytes to the disk anywhere, so new files can be created even
when the previous file is not completely full.

Also, fix buffer overrun in reading filesystem image, and use a more idiomatic fgetc loop.
2019-12-12 16:58:17 -05:00
Virgil Dupras 948a06cb41 tools/tests: add missing doc about shell tests 2019-12-12 16:31:52 -05:00
Virgil Dupras 4f7a05e3b7 core: remove cpHLDE
It wasn't used much, so I replaced its use in the kernel with direct code
and moved the routine in apps/ed, the only other place where it was used.
2019-12-12 15:53:14 -05:00
Virgil Dupras c002c69208 Include tools/tests/shell/test.cfs in repo
The order in which cfspack includes its file depend on the platform. To have
tests that reliably pass, test.cfs has to be committed in.
2019-12-12 14:49:09 -05:00
Virgil Dupras 9ab292a6d5 Add shell automated tests 2019-12-12 14:32:47 -05:00
Virgil Dupras 5b155a5c15 tools: use BASIC's new while loop
Also, increase STDIO_BUFSIZE to 0x40 so that those while loops work.
2019-12-12 12:04:56 -05:00
Virgil Dupras 3db38b0d89 basic: add while command 2019-12-12 11:17:10 -05:00
Virgil Dupras 5d33d165a2 cfspack: allow multiple patterns and multiple paths in args
Also, always end the CFS chain with a stop block.

fixes #55 #56 #57
2019-12-11 21:08:46 -05:00
Virgil Dupras 888395d496 tools: replace tools for old shell with tools for new shell
ref #80
2019-12-11 14:58:50 -05:00
Virgil Dupras 25d25d017c Replace old shell with BASIC shell
fixes #80
2019-12-11 14:05:34 -05:00
Virgil Dupras 20151a97f8 recipes/rc2014/zasm: use BASIC shell
Also made Makefile actually portable.
2019-12-11 13:01:51 -05:00
Virgil Dupras 7907687abf tools/uploadb: make it much much faster
By uploading a BASIC loop and then run it, we can reduce the serial
communication to pure content which greatly reduces the overhead and make
the process much much faster.
2019-12-11 09:27:05 -05:00
Virgil Dupras b40b39f45c tools: add blkdumpb 2019-12-10 10:33:29 -05:00
Virgil Dupras 9ec71ecfee tools/uploadb: rewrite in C 2019-12-09 22:05:39 -05:00
Virgil Dupras fcee98ee4e tools: use the new "puth" BASIC command 2019-12-09 21:17:45 -05:00
Virgil Dupras beaea6f978 basic: add puth command 2019-12-09 14:34:14 -05:00
Virgil Dupras d9db0a824e Make makefiles and shell scripts portable
It's no longer required to use `gmake` under OpenBSD and shell scripts
no longer require bash.
2019-12-09 09:45:22 -05:00
Virgil Dupras 8ff4b18c51 tools: add memdumpb
In C this time. Python/Perl code is barely terser than C for these little
tools. Why bother with interpreted?
2019-12-08 22:33:33 -05:00