Virgil Dupras
72357fec86
Move "emul" folder to root
hace 4 años
Virgil Dupras
40f56dd6dc
cfspack: silence compilation warning
hace 4 años
Virgil Dupras
c5c6ef4c6c
Move "tests" folder to root
hace 4 años
Virgil Dupras
e3c885085d
Consolidate tests
Also, removed leftover in runbin.c (what did it do there??) that
could result in tests falsely passing.
hace 4 años
Virgil Dupras
7ca54d179d
lib/expr: make EXPR_PARSE "tail" HL
Things are now much simpler.
hace 4 años
Virgil Dupras
73a5275b1e
lib/parse: make parseBinaryLiteral "tail" HL
hace 4 años
Virgil Dupras
289037a3dd
lib/parse: make parseDecimal "tail" HL
HL, instead of being preserved, is set to the character following
the last read character.
hace 4 años
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.
hace 4 años
Virgil Dupras
2503bdfced
lib/args: remove
hace 4 años
Virgil Dupras
5f2615a134
at28w: don't use lib/args
hace 4 años
Virgil Dupras
346bcc3d3d
zasm: don't use lib/args
This unit is being removed.
hace 4 años
Virgil Dupras
d0f031939f
lib/parse: make parseLiteral a little tighter
Sub-parsers are seldom used by themselves, except for parseDecimal.
I'm tightening the code of this unit for two reasons:
1. Optimization
2. Upcoming API change where HL won't be preserved anymore, but will
point to char following the last parse char. This will allow us
to simplify lib/expr.
hace 4 años
Virgil Dupras
15628da7de
lib/expr: make EXPR_PARSE put result in DE instead of IX
Finally getting rid of this bad mistake of using IX for this.
hace 4 años
Virgil Dupras
981c93bfd4
lib/expr: fix stack imbalance on failure
hace 4 años
Virgil Dupras
4760d044c0
test_expr: simplify
hace 4 años
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.
hace 4 años
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.
hace 4 años
Virgil Dupras
6d88c3a754
parseExprDE --> parseExpr
hace 4 años
Virgil Dupras
5301200d6f
basic: parseExpr --> parseExprDE
hace 4 años
Virgil Dupras
476178ee7c
zasm: parseExpr --> parseExprDE
hace 4 años
Virgil Dupras
025b90909f
Update bootstrap bin
hace 4 años
Virgil Dupras
aef96c5e96
Add missing common.asm test harness file
hace 4 años
Virgil Dupras
cc754e12aa
parseExpr --> parseExprDE: easy ones
Those replacements were trivially equivalent. For the other ones, an
examination of the context is necessary.
hace 4 años
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.
hace 4 años
Virgil Dupras
98ca338aba
avra: add LD/ST
hace 4 años
Virgil Dupras
51e500e8da
avra: avoid pgm addr truncation error on first pass
hace 4 años
Virgil Dupras
b955a67daa
avra: add TST
hace 4 años
Virgil Dupras
6e1e8e0e59
avra: add LSL
hace 4 años
Virgil Dupras
8ded02bc78
avra: fix misordered MOV, MUL, NEG and NOP
hace 4 años
Virgil Dupras
f54e10f9fd
avra: add CALL and JMP
hace 4 años
Virgil Dupras
10b925e0e0
avra: add BCLR and BSET
hace 4 años
Virgil Dupras
1771ee8da7
avra: add SER
hace 4 años
Virgil Dupras
0a9ac27cf6
avra: add SBIC and SBIS
hace 4 años
Virgil Dupras
a9dcba5793
avra: add CBR instruction
hace 4 años
Virgil Dupras
c968995ec0
avra: add CBI and SBI
This completes instruction support for the Blink tn45 example.
hace 4 años
Virgil Dupras
5c43988649
avra: code consolidation
hace 4 años
Virgil Dupras
b130cac635
avra: code consolidation
hace 4 años
Virgil Dupras
52359a4e42
avra: a little code deduplication
hace 4 años
Virgil Dupras
e9c692ed50
avra: a litte bit of code deduplication
hace 4 años
Virgil Dupras
2652c81519
avra: make CLR work properly
hace 4 años
Virgil Dupras
20861767e6
avra: generalize arg swapping behavior
hace 4 años
Virgil Dupras
14fbfa2967
avra: small _parseArgs refactoring
Take argspec pairs directly as an argument instead of taking a
pointer to an argspec pair.
hace 4 años
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.
hace 4 años
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.
hace 4 años
Virgil Dupras
64935d8b40
avra: add IN and OUT instructions
hace 4 años
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.
hace 4 años
Virgil Dupras
fa75f30ffb
avra: add RJMP and RCALL instructions
hace 4 años
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.
hace 4 años
Virgil Dupras
a5efc695e9
avra: add "Rd + bit" instructions
hace 4 años
Virgil Dupras
c696fcbce4
avra: add "with immediate" instructions
hace 4 años