Virgil Dupras
5c43988649
avra: code consolidation
2019-12-15 20:15:44 -05:00
Virgil Dupras
b130cac635
avra: code consolidation
2019-12-15 19:17:03 -05:00
Virgil Dupras
52359a4e42
avra: a little code deduplication
2019-12-15 18:52:00 -05:00
Virgil Dupras
e9c692ed50
avra: a litte bit of code deduplication
2019-12-15 18:34:14 -05:00
Virgil Dupras
2652c81519
avra: make CLR work properly
2019-12-15 16:43:32 -05:00
Virgil Dupras
20861767e6
avra: generalize arg swapping behavior
2019-12-15 16:36:43 -05:00
Virgil Dupras
14fbfa2967
avra: small _parseArgs refactoring
...
Take argspec pairs directly as an argument instead of taking a
pointer to an argspec pair.
2019-12-15 16:25:16 -05:00
Virgil Dupras
62eb5589c3
avra: refactor instruction tbl
...
The instruction table is now beefier and has redundant data, but
this simplifies processing. This should simplify upcoming work.
2019-12-15 15:53:28 -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
ab578159b7
avra: refactor args parsing
...
This costs us a bit of space for now but should make things a lot
simpler down the road, especially with "alias ops" which are simple
syntactic sugar for another op.
2019-12-14 15:17:55 -05:00
Virgil Dupras
fa75f30ffb
avra: add RJMP and RCALL instructions
2019-12-14 12:28:27 -05:00
Virgil Dupras
33c480a5dd
avra: remove useless instrBRBits table
...
I had written this when trying different approaches to adding BR and
I forgot to remove it.
2019-12-14 09:41:36 -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
Virgil Dupras
0d7693a163
core: remove writeHLinDE
...
It wasn't used much so I inlined it.
2019-12-13 09:56:23 -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
43f4c5200e
basic: don't choke on ':' in '"' literals
2019-12-12 12:22:38 -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
51c977f2ed
basic: allow multiple commands on the same line
2019-12-12 10:51:13 -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
1710c865dc
doc: refer to the new BASIC shell in example
...
ref #80
2019-12-11 14:57:07 -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
880775ae69
recipes/rc2014/sdcard: use BASIC shell
2019-12-11 11:18:32 -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
fb93fcd6e6
recipes/rc2014/eeprom: add usr.asm
...
A little life saver if your target shell doesn't have a proper at28w.
2019-12-09 21:03:31 -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
Virgil Dupras
b56d6ca1c7
Rewrite uploadb.py in perl
...
I know, this is silly, but I'm moving tools to something a bit closer to the
system. I consider perl to be more system-like than python for a simple reason:
perl is part of the OpenBSD base system and python is not.
Also, I'm learning perl and using this as an opportunity.
2019-12-08 08:32:19 -05:00
Virgil Dupras
5e0a548faa
kbd: squeeze out a few bytes
2019-12-06 22:45:39 -05:00
Virgil Dupras
b9292eb8d0
recipes/rc2014/ps2: Use BASIC shell
2019-12-06 20:00:29 -05:00
Virgil Dupras
3a68807cd4
kbd: make kbdGetC blocking
...
I forgot to update this when changing stdio GetC API.
2019-12-06 19:59:46 -05:00
Virgil Dupras
08392fee60
recipes/rc2014/eeprom: use BASIC shell
2019-12-02 23:00:35 -05:00
Virgil Dupras
0fb7995166
recipes/sms/romasm: add missing sentinel in .mycmds
2019-12-02 23:00:03 -05:00
Virgil Dupras
30a0f69101
Fix broken uploadb.py
...
putc didn't work well with any byte value on most terminal configuration. It
was a bad idea...
2019-12-02 22:57:22 -05:00
Virgil Dupras
270ad926c9
recipes/sms: use BASIC shell
2019-12-02 20:18:41 -05:00