Commit Graph

67 Commits

Author SHA1 Message Date
Aryadev Chavali
228f548bd9 Changed asm/parser instruction push-reg->push.reg 2023-10-31 20:37:11 +00:00
Aryadev Chavali
157c79d53c Added a "usage" message and colours for assembler
Prints useful and pretty messages when verbose being at least 1.
2023-10-29 16:59:31 +00:00
Aryadev Chavali
1c0bd20cba Introduce error reporting in asm/main
Pretty simple implementation, I've stopped printing the tokens cos I
think the lexer is done.
2023-10-28 18:22:18 +01:00
Aryadev Chavali
eac8cbf1da asm/parser supports all opcodes, introduced parse errors
Introduced some functions to parse differing types of opcodes.  Use
the same style of a.b.c... for namespacing or type specification for
certain opcodes.  Bit hacky and not tested, but does work.

Parse errors can be reported with an exact location using the token
column, line.
2023-10-28 18:21:09 +01:00
Aryadev Chavali
191fe5c6b8 Ignore comments (using semicolons) in lexer
Easier to do it here than at the parser.
2023-10-28 18:19:33 +01: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
fc81cda96b Plugged in asm/parser to asm/main
Just prints instructions so far.
2023-10-26 11:18:07 +01:00
Aryadev Chavali
2fe2af22a9 Implemented a rudimentary parser with support for 4 instruction types 2023-10-26 11:17:55 +01:00
Aryadev Chavali
dca51106a2 Added support in lexer for negative numbers
Though we deal with unsigned numbers internally, it should be possible
to read and manipulate negative numbers through 2s complement.  Later
on we'll add support for signed operations via 2s complement, so this
should be allowed.
2023-10-26 11:17:01 +01:00
Aryadev Chavali
c70a9d9879 asm/main now uses TOKEN_STREAM_AT 2023-10-26 10:23:00 +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
131d70a9a3 Started working on a parser
No implementations yet
2023-10-25 21:43:51 +01:00
Aryadev Chavali
94abb9e3d4 Separated lexer from main file in asm 2023-10-25 21:43:13 +01:00
Aryadev Chavali
dbbfac1236 Wrote lexer for assembly
Pretty simple tokeniser, doesn't do a lot and needs to error check better.
2023-10-24 18:20:59 +01:00
Aryadev Chavali
92855ebb3e Starting development on assembly language 2023-10-23 16:53:50 +01:00