Aryadev Chavali
c9f684cc7d
Added string literals in tokeniser
...
Doesn't do much, invalid for most operations.
2023-11-11 10:16:37 +00:00
Aryadev Chavali
6e524569c3
Current work on preprocessor
2023-11-06 08:16:15 +00:00
Aryadev Chavali
4ae6c05276
Current work on preprocessor implementation
...
Lots to refactor and test
2023-11-05 16:21:09 +00:00
Aryadev Chavali
b5a1582976
Added a start address (equivalent to main) to assembler
...
Creates a jump address to the label delegated by "global" so program
starts at that point.
2023-11-03 19:01:31 +00:00
Aryadev Chavali
6c4469958e
Implemented CALL(_STACK) and RET on the assembler
2023-11-02 23:29:23 +00:00
Aryadev Chavali
9afeed6d61
Made separate tokens for JUMP_ABS and JUMP_STACK
...
Makes more sense, don't need to fiddle around with strings as much in
the parser due to this!
2023-11-02 20:54:26 +00:00
Aryadev Chavali
d5e311c9d4
Started work on preprocessing jump addresses
2023-11-02 20:31:22 +00:00
Aryadev Chavali
740627b12d
Implemented MALLOC_STACK and SUB in the assembler
2023-11-01 22:56:40 +00:00
Aryadev Chavali
90e04542a2
Implemented stack versions of MGET and MSET in assembler
2023-11-01 22:09:39 +00:00
Aryadev Chavali
44125d7ad9
Implemented OP_MSIZE into lexer/parser of ASM
2023-11-01 21:47:19 +00:00
Aryadev Chavali
7564938113
Implemented lexer and parser for new memory management instructions
2023-11-01 21:40:25 +00:00
Aryadev Chavali
83678ad29a
Add MULT to lexer and parser for assembler
2023-11-01 18:09:00 +00:00
Aryadev Chavali
93d234cd48
Lexer now returns more descriptive tokens
...
More useful tokens, in particular for each opcode possible. This
makes parsing a simpler task to reason as now we're just checking
against an enum rather than doing a string check in linear time.
It makes more sense to do this at the tokeniser as the local data from
the buffer will be in the cache most likely as the buffer is
contiguously allocated. While it will always be slow to do linear
time checks on strings, when doing it at the parser we're having to
check strings that may be allocated in a variety of different places.
This means caching becomes a harder task, but with this approach we're
less likely to have cache misses as long as the buffer stays there.
2023-11-01 15:09:47 +00:00
Aryadev Chavali
75dc36cd19
Lexer now returns errors on failure
...
Currently only for invalid character literals, but still a possible
problem.
2023-10-31 20:39:26 +00:00
Aryadev Chavali
d2429aa549
Introduced a column and line for each token
...
Accurate error reporting can be introduced using this.
2023-10-28 18:19:30 +01:00
Aryadev Chavali
b152365561
Lexer forces uppercase for symbols
2023-10-26 10:22:53 +01:00
Aryadev Chavali
a07b571da2
Auto fill licenses
2023-10-26 08:01:26 +01:00
Aryadev Chavali
7bf6b53230
Unified literal for numbers, main program now tokenises
2023-10-26 07:15:52 +01:00
Aryadev Chavali
94abb9e3d4
Separated lexer from main file in asm
2023-10-25 21:43:13 +01:00