address_stmt
label
remote_label_stmt
filler_stmt
data_stmt
const_stmt
stack_stmt
goto_stmt
gosub_stmt
return_stmt
bit_shift_stmt
flag_set_stmt
logic_stmt
assign_stmt
arithmetic_stmt
~~bitmap
if then else
while
loop until
forever / infinite loop
include bin
include/import source
Self-modifying code (goto, gosub)
- @$400[x] Agregar referencias directas a memoria con @
- Agregar comentarios //
- Import / include
- Armado de proyecto con varios sources ... relocatables?
- Create tests for what's already implemented
- Add keywords
bit7
&bit6
?. See ref - Add
>
and<
operators for getting the high and low bytes of a label reference, respectively, as an immediate value - Integrate with Cpu6502 and make automated VM tests
-
Transforming names
.toLowerCase()
should be done ASAP, in the visit function that gets the name from the parser. This way, anywhere else we know the name is unique by means of ensured lowercase. -
Tipos de Statements:
-
Con addressing:
- Aritméticos: ADC, SBC, INC, DEC, INX, DEX, INY, DEY
- Lógicos: AND, EOR, ORA, BIT, CMP
- Shifting: ASL, LSR, ROR, ROL
- Asignación: LDA, STA, LDX, STX
-
Sin addressing:
- Stack: TSX, TXS, PHP, PHA, PLP, PLA
- Branches: BMI, BPL, BEQ, BNE, BVS, BVC, BCC, BCS
- Misc: SEC, CLC, SED, CLD, SEI, CLI, CLV, NOP, NOP3, BRK
-
Saltos: JMP, JSR, RTS, RTI
Removed Dart code because it was all already implemented in Typescript.
Se me fue de mambo el proyecto en complejidad. Tengo que volver a una clase sola.
Added forward reference info in the labels Hash, but there can be many forward references to the same label, so we have to record them separately.
Al pedo el SymbolPass porque también se pueden definir labels con forward references, además para saber la dirección de un label: hay que parsear todo el código :'( Mejor volver a la idea original, hacer una sola pasada, dejar el espacio y luego cuando se define la forward reference ir y completarlo.
We have a problem. Assembler distinguishes immediate values from addresses with the # sign.
We don't want that verbosity in FASS, that's why names are treated equally, when possible, whether they are a constant or a label.
So, instead of having both constants and direct label addressing defined as IDENFTIFIER, they'll be both integrated into a single rule called name
, to prevent ambiguity for Antlr.
Then we determine if the name refers to a constant or a label.
We also need to implement a way to use the individual bytes of a label's address as literals, like assembler does with < and >.
Implemented goto (JMP)
I implemented an if else
fully functional, even nestable. Great achievement!
Well, I forked a try to use visitors and the Dart language, let's see how this goes. Update: both seem like a very good idea.
Started implementing automated tests. Removed the grammar that was unimplemented, now I will add it as I go.
Just found out const
is failing and don't know when it started failing.
Should add unit tests for regression testing, so by running all tests on every commit I can spot regression errors easily.
Should add the keywords bit7
& bit6
.
In assembly you would check for these bits using BVC
, BVS
, BPL
& BMI
, most likely after BIT
& CMP
.
To explicitly state that you aren't really checking for sign or overflow as the mnemonics suggest, you would use if bit7 = 1
, etc.
That way you explicitly state that you are checking for arbitrary bits.
Of course the rest of the bits (0..5) don't have a corresponding CPU flag, so they must be tested with a more classical approach.
const and data are implemented, although some value types are not implemented yet.
Will implement all value types as they come up in tests or use cases.