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

198 Commits

Author SHA1 Message Date
Virgil Dupras
e5255d22f9 zasm: make .org affect "@" symbol 2019-11-15 08:59:26 -05:00
Virgil Dupras
79e04189b0 Update bootstrap binaries 2019-11-14 21:25:11 -05:00
Virgil Dupras
6e714875dc zasm: Constants now override labels at all times
Will be important for a mega-commit I'm preparing.
2019-11-14 21:16:36 -05:00
Virgil Dupras
7cf3ed38da Extract str.asm from core.asm and make core included by userspace
Most of register fiddling routines (which is now the only thing contained
in care.asm) are used by almost all userspace apps, often in inner loops.

That makes the penalty of using jump tables for those a bit too high.
Moreover, it burdens jump tables needlessly.

Because this unit is very small (now that string routines are out), it makes
sense to always include it in binaries.
2019-11-14 10:14:15 -05:00
Virgil Dupras
0e79035d9c Disable test failing on Travis 2019-11-13 22:37:00 -05:00
Virgil Dupras
69750b4da6 Update bootstrap binaries 2019-11-13 22:28:47 -05:00
Virgil Dupras
82995eb346 zasm: have .fill generate an error on overflow
Can possibly avoid a lot of debugging pain.
2019-11-13 22:27:48 -05:00
Virgil Dupras
8d46895dd3 lib/parse: decimal ending with a whitespace are now valid
Also, make empty strings be parsed as invalid by parseDecimal.
2019-11-13 22:10:06 -05:00
Virgil Dupras
7274dccbe7 Move ASCII consts to ascii.h
And made them shorter in name. The new ascii.h file allow reuse in userspace
code.
2019-11-13 20:38:06 -05:00
Virgil Dupras
f3992ed598 basic: begin an implementation from sratch
Let's see where it will lead us...
2019-11-13 15:28:16 -05:00
Virgil Dupras
1ae51bea3a tests: remove instr blacklist
Because scas isn't used as a reference anymore, no need to blacklist its bugs
anymore.
2019-11-12 20:47:09 -05:00
Virgil Dupras
4de2ce3ceb zasm: add RST instruction 2019-11-12 14:07:45 -05:00
Virgil Dupras
cbc6fb5931 zasm: clean up jump table requirements
There was a little bit of cruft.
2019-11-11 20:21:13 -05:00
Virgil Dupras
17cc28e211 recipes/ti84: use a 3x5 font instead of a 5x7 one
This allow a lot more characters to fit on that tiny screen...

ref #41
2019-11-11 13:26:24 -05:00
Virgil Dupras
2bff486cd2 Update bootstrap binaries 2019-11-10 22:03:46 -05:00
Virgil Dupras
5f6b303e75 zasm: add IX/IY support to SRL, RR and RL 2019-11-10 22:03:18 -05:00
Virgil Dupras
506c3d0a96 zasm: generalize handling of IX/IY in 0xcb upcode family
There's a couple of bit fiddling instructions that didn't have their
IX/IY variant implemented yet and without this commit, each of them
would have required a special routine. Not anymore.
2019-11-10 21:02:18 -05:00
Virgil Dupras
d9d6093287 zasm: simplify (IX/Y+d) handling
We now require less special handling.
2019-11-10 20:16:50 -05:00
Virgil Dupras
c4658591bd ti/lcd: allow for fonts smaller than 5 pixels
That's a lot of code for such a small change, but there's a big difference
between 5 pixels and 4 pixels: 4 pixels requires compositing.
2019-11-09 22:55:15 -05:00
Virgil Dupras
a3c47f6272 Add tests for parseArgs 2019-11-08 10:53:52 -05:00
Virgil Dupras
e972dfe220 Add test documentation 2019-11-08 10:37:52 -05:00
Virgil Dupras
a13a94bbc7 fix typos 2019-11-07 12:13:00 -05:00
Virgil Dupras
ca84b5dac8 recipes/ti84: first step
This was mostly lifted from my "tihello" example, but it required significant
adjustments.

This commit also introduces a font management system. A lot of fonts are
available online, but sources aren't always clear so to avoid copyright
landmines, I re-created my first 5x7 font from scratch.

As it is now, this resulting ROM gets "Collapse OS>" to be displayed on the
LCD screen. Much work still left to do.

ref #41
2019-11-07 11:52:29 -05:00
Virgil Dupras
f395297874 Improve python tools' shebang
Most OS don't have python3 in /usr/bin/python...
2019-11-04 14:43:27 -05:00
Virgil Dupras
2a55bfd375 stdio: remove a layer of indirection in GetC/PutC
We use zasm's ability to use labels in .equ directive.

We didn't do it before because for a while, we were in between scas
and zasm (scas was used in automated tests) so we needed to use the
lowest common denominator: zasm doesn't have macros and scas can't
use labels in .equ directives.

This forced us to add this layer of indirection. But now that we are
completely cut from scas' dependency, we can use this nice zasm's
ability.
2019-11-04 09:55:12 -05:00
Virgil Dupras
a86234c87e Fix typo in shell's emul{Get,Put}C 2019-10-31 18:49:02 -04:00
Virgil Dupras
b745f49186 Rename blockdev's API routines to GetB/PutB
The goal is to avoid mixing those routines with "character devices"
(acia, vpd, kbd) which aren't block devices and have routines that
have different expectations.

This is a first step to fixing #64.
2019-10-30 16:59:35 -04:00
Virgil Dupras
a7aa2fc702 Improve test_parse_z coverage
Will help with #45
2019-10-20 18:19:02 -04:00
Virgil Dupras
f41ccdbc81 Update bootstrap binaries 2019-10-17 15:47:39 -04:00
Virgil Dupras
3b1bbc1751 zasm: support negative displacement for IX/IY
Needed by #30.
2019-10-17 15:38:11 -04:00
Jorde Kang
5460f28cfb Removed unnecessary import sys (#46) 2019-10-15 22:41:44 -04:00
James Stanley
7f7251d57f Fix buffer overrun in shell emulator (#51) 2019-10-15 21:21:40 -04:00
Virgil Dupras
8926c33ab1 Fix tools/tests/zasm/runtests.sh shebang
It needs bash after all. On OpenBSD, /usr/sh works, but not on Ubuntu.
2019-10-10 15:22:21 -04:00
Keith Stellyes
4180b5873d Fix for tools/zasm.sh being dependent on readlink -f (an issue on macOS, preventing builds) (#28)
* Fix for tools/zasm.sh being dependent on readlink -f (an issue on macOS, preventing builds)

* Wrap zasm.sh shebang in /usr/bin/env ; remove comment about BSDs
2019-10-10 15:21:37 -04:00
Virgil Dupras
83b314c450 zasm: lower RAM requirements
I've tested RAM usage when self-assembling and there weren't as high
as I thought. zasm's defaults now use less than 0x1800 bytes of RAM,
making it possible, theoretically for now, for a Sega Master System
to assemble Collapse OS from within itself.
2019-10-06 15:42:09 -04:00
Virgil Dupras
e4732d79dc zasm: tighten directive detection a bit 2019-10-06 14:39:47 -04:00
Virgil Dupras
f4b6c7637d zasm: rename #inc to .inc
scas, it's not needed any more.
2019-10-06 14:32:23 -04:00
Virgil Dupras
340a474941 emul/shell: use '@' symbol in jump table 2019-10-04 20:29:42 -04:00
Virgil Dupras
612323f714 zasm: add "last value" symbol (@) 2019-10-04 20:26:21 -04:00
Virgil Dupras
d1735c3a73 zasm: remove last remnants of "old style" variables
This makes zasm suitable to run from ROM.
2019-07-25 14:02:04 -04:00
Virgil Dupras
1c6a7caeae recipes/sms/romasm: make zasm's memory usage fit the SMS 2019-07-23 16:50:19 -04:00
Virgil Dupras
c2d84563dd zasm: allow duplicate const definition
This will allow interesting override scenarios, adding flexibility.
2019-07-23 16:01:23 -04:00
Virgil Dupras
1dec33e02a zasm: make symbol registry a bit more straightforward
Instead of strings of variable length driving the iteration of the
registry, we do so through records that keep track of lengths and
counts.
2019-07-23 15:21:42 -04:00
Virgil Dupras
02c7eb0161 zasm: clarify strlen's API 2019-07-23 14:59:38 -04:00
Virgil Dupras
cdb206b7a5 zasm: fix nasty (iy+d) misparsing bug
*sob*...
2019-07-23 13:58:18 -04:00
Virgil Dupras
b95f4c8c24 zasm: remove SYM_CTX_PTR 2019-07-22 16:34:40 -04:00
Virgil Dupras
f4f91ebd79 zasm: remove SYM_CTX 2019-07-22 16:13:00 -04:00
Virgil Dupras
311d04e9aa zasm: make symbol registry easily parametrizable
I'm about to split the global registry in two (labels and consts)
and the previous state of registry selection made things murky.
Now it's much better.
2019-07-22 15:13:09 -04:00
Virgil Dupras
34f499184d zasm: add ".bin" directive
Also, remove zasm/test7 because it changes too much all time time
(whenever zasm changes) and isn't precise enough. Too much noise,
not worth it.
2019-07-21 12:58:02 -04:00
Virgil Dupras
01031a780a ed: Add 'w' command 2019-07-21 11:40:26 -04:00