Age | Commit message (Collapse) | Author | |
---|---|---|---|
2023-10-31 | Added flag which forces the printing of hexes | Aryadev Chavali | |
Anything other than char (which can just use print.byte to print the hex) and byte (which prints hexes anyway), all other types may be forced to print a hex rather than a number if PRINT_HEX is 1. | |||
2023-10-31 | Allow hex literals for numbers | Aryadev Chavali | |
As strto(ul|ll) allow the parsing of hex literals of the form `0x`, we allow lexing of hex literals which start with `x`. They're lexed into C hex literals which work for strtol. | |||
2023-10-31 | Use macros to stop duplication of code | Aryadev Chavali | |
I've made a single macro which defines a function through some common metric, removing code duplication. Not particularly readable per se, but using a macro expansion in your IDE allows one to inspect the code. | |||
2023-10-31 | Introduced 3 new union members to data_t | Aryadev Chavali | |
These new members are just signed versions of the previous members. This makes type punning and usage for signed versions easier than before (no need for memcpy). | |||
2023-10-31 | Remove duplicated code | Aryadev Chavali | |
2023-10-31 | Implemented all the comparators | Aryadev Chavali | |
So much reused code, I definitely need to find a way to make this cleaner. | |||
2023-10-31 | Use standardised signed version of word type from base.h | Aryadev Chavali | |
2023-10-31 | Introduced signed versions of common types | Aryadev Chavali | |
For each type T there is the signed version s_T | |||
2023-10-31 | Fixed README for change in inst module | Aryadev Chavali | |
2023-10-31 | Moved inst module to lib | Aryadev Chavali | |
As it has no dependencies on vm specifically, and it's more necessary for any vendors who wish to target the virtual machine, it makes more sense for inst to be a lib module rather than a vm module. | |||
2023-10-31 | Implemented new types of EQ, forced all comparators to push bytes | Aryadev Chavali | |
Just need to call their unsigned versions. All comparators should push bytes as it makes return types uniform. | |||
2023-10-31 | vm_execute_all: Print every cycle on VERBOSE >= 2, just print final state ↵ | Aryadev Chavali | |
otherwise Changed VERBOSE checks to ensure a degree of information. | |||
2023-10-31 | Created routines for new comparator opcodes (not implemented) | Aryadev Chavali | |
Will cause error if used currently, which is fine. | |||
2023-10-31 | Introduced new instructions for comparison | Aryadev Chavali | |
Comparing signed and unsigned versions of numbers. Same for EQ as well. Notice the irregular pattern of BYTE, CHAR, INT, HWORD,LONG,WORD as OPCODE_IS_TYPE requires the subcodes to be surrounded by BYTE and WORD. | |||
2023-10-31 | asm/main logs are now indented and look prettier | Aryadev Chavali | |
2023-10-31 | Lexer now returns errors on failure | Aryadev Chavali | |
Currently only for invalid character literals, but still a possible problem. | |||
2023-10-31 | parse_word deals with characters now | Aryadev Chavali | |
Just takes the character literally as a number. | |||
2023-10-31 | Changed asm/parser instruction push-reg->push.reg | Aryadev Chavali | |
2023-10-29 | Make Verbose a universal flag | Aryadev Chavali | |
All objects target LIB anyway, so VERBOSE is a universal macro for this code base. | |||
2023-10-29 | Added a "usage" message and colours for assembler | Aryadev Chavali | |
Prints useful and pretty messages when verbose being at least 1. | |||
2023-10-29 | Fixed bug where JUMP_REGISTER couldn't be in bytecode read | Aryadev Chavali | |
2023-10-29 | Fixed bug where reading operand bytecode may stop prematurely | Aryadev Chavali | |
This is due to checking for equality instead of just greater than in darr->used against darr->available. | |||
2023-10-29 | Added some examples to instruction-test for positive/negative literals | Aryadev Chavali | |
Use the push.* instructions to see this. | |||
2023-10-29 | Introduced an example source file for all instructions | Aryadev Chavali | |
Provides calling conventions, ensures parser and lexer are working correctly. Will be updated as more instructions are introduced and supported in the assembler. | |||
2023-10-29 | Auto-fill copyright notice in examples/fib.c | Aryadev Chavali | |
2023-10-28 | Introduce error reporting in asm/main | Aryadev Chavali | |
Pretty simple implementation, I've stopped printing the tokens cos I think the lexer is done. | |||
2023-10-28 | asm/parser supports all opcodes, introduced parse errors | Aryadev Chavali | |
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 | Ignore comments (using semicolons) in lexer | Aryadev Chavali | |
Easier to do it here than at the parser. | |||
2023-10-28 | Introduced a column and line for each token | Aryadev Chavali | |
Accurate error reporting can be introduced using this. | |||
2023-10-28 | Added macro to do safe subtractions on a word | Aryadev Chavali | |
Default C just lets overflows occur for subtraction, so this macro will default to 0 if the subtraction causes an overflow. | |||
2023-10-26 | Plugged in asm/parser to asm/main | Aryadev Chavali | |
Just prints instructions so far. | |||
2023-10-26 | Implemented a rudimentary parser with support for 4 instruction types | Aryadev Chavali | |
2023-10-26 | Added support in lexer for negative numbers | Aryadev Chavali | |
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 | Fixed bug where printing hword of an instruction prints number not hex | Aryadev Chavali | |
This is an easy fix. | |||
2023-10-26 | asm/main now uses TOKEN_STREAM_AT | Aryadev Chavali | |
2023-10-26 | Lexer forces uppercase for symbols | Aryadev Chavali | |
2023-10-26 | Updated README for targeting VM | Aryadev Chavali | |
2023-10-26 | Makefile now prints dependencies on successful compilation | Aryadev Chavali | |
2023-10-26 | Moved base functions from inst.c to dedicated file | Aryadev Chavali | |
Doesn't make sense for them to be in the VM module when they have a more general purpose now. | |||
2023-10-26 | vm/main takes a filename as input to execute bytecode | Aryadev Chavali | |
Also prints a usage for incorrect usage. | |||
2023-10-26 | Auto fill licenses | Aryadev Chavali | |
2023-10-26 | Unified literal for numbers, main program now tokenises | Aryadev Chavali | |
2023-10-25 | Started working on a parser | Aryadev Chavali | |
No implementations yet | |||
2023-10-25 | Separated lexer from main file in asm | Aryadev Chavali | |
2023-10-24 | Wrote lexer for assembly | Aryadev Chavali | |
Pretty simple tokeniser, doesn't do a lot and needs to error check better. | |||
2023-10-24 | Removed assertion in darr_read_file | Aryadev Chavali | |
If an empty file is read, we want to deal with it in later user code rather than just failing immediately. | |||
2023-10-23 | Starting development on assembly language | Aryadev Chavali | |
2023-10-23 | Make root directory an include path, set #include's properly | Aryadev Chavali | |
Easier to write includes now just using < with the module name, in comparison to using relative paths. | |||
2023-10-23 | Reintroduced example fib.c via examples/ folder | Aryadev Chavali | |
2023-10-23 | Added lib folder for general stuff, introduced as target to Makefile | Aryadev Chavali | |