Age | Commit message (Collapse) | Author | |
---|---|---|---|
2024-04-09 | Reworking todos on library linking | Aryadev Chavali | |
2024-04-09 | Some rewording of spec.org | Aryadev Chavali | |
2024-04-09 | Added some TODOs to lib/inst.c to enforce endian | Aryadev Chavali | |
2024-04-09 | Mid-work through documenting darr.h | Aryadev Chavali | |
2024-04-09 | Done TODO: Comment coverage > lib > base.h | Aryadev Chavali | |
Pretty simple | |||
2024-04-09 | Fixed code in vm_pop_hword DWORD -> DHWORD | Aryadev Chavali | |
Though practically this would work, as the storage for the half word is not limited in any way, nevertheless it isn't syntactically right and it's better to fix now. | |||
2024-04-09 | Completed TODO: Rigid Endian | Aryadev Chavali | |
Just used the endian.h functions to convert host endian to and from big endian. | |||
2024-04-09 | Added todo to force an endian convention | Aryadev Chavali | |
I've flip flopped a bit on this but I believe the virtual machine bytecode format must have a convention on endianness. This is because of the issue stated in the TODO which may very well happen. | |||
2024-04-08 | Added better documentation to TODO list | Aryadev Chavali | |
2024-04-07 | Changed limit for examples/factorial.asm | Aryadev Chavali | |
Did some analysis and found that 21! takes above 64 bit integers to store hence set the limit to 20 instead. | |||
2023-11-29 | Use a limit on $I rather than on $B for examples/fib.asm | Aryadev Chavali | |
2023-11-29 | Fixed issues with getting and setting words for heap pages | Aryadev Chavali | |
Because I was using the hword macros instead of word macros, this causes truncation of bytes when I didn't want it. | |||
2023-11-29 | Fixed logs in vm/runtime | Aryadev Chavali | |
Just changing some messages and the format of heap printing | |||
2023-11-29 | Cleaned up logs in assembler/parser | Aryadev Chavali | |
2023-11-29 | Easier to read documentation in examples | Aryadev Chavali | |
2023-11-29 | Fixed incorrect free of tokens in error for preprocess_use_blocks | Aryadev Chavali | |
Also error now points to the correct place in the file. | |||
2023-11-29 | Report some stats of the actual program when working | Aryadev Chavali | |
2023-11-29 | Refactored preprocessor to preprocess_(use|macro)_blocks and process_presults | Aryadev Chavali | |
We have distinct functions for the use blocks and the macro blocks, which each generate wholesale new token streams via `token_copy` so we don't run into weird errors around ownership of the internal strings of each token. Furthermore, process_presults now uses the stream index in each presult to report errors when stuff goes wrong. | |||
2023-11-29 | Refactored presult_t to include a stream pointer | Aryadev Chavali | |
So when a presult_t is constructed it holds an index to where it was constructed in terms of the token stream. This will be useful when implementing an error checker in the preprocessing or result parsing stages. | |||
2023-11-29 | Added parse errors for %USE calls | Aryadev Chavali | |
So %USE <STRING> is the expected call pattern, so there's an error if there isn't a string after %USE. The other two errors are file I/O errors i.e. nonexistent files or errors in parsing the other file. We don't report specifics about the other file, that should be up to the user to check themselves. | |||
2023-11-29 | Fixed tokenise_string_literal | Aryadev Chavali | |
Forgot to increment buffer->used and memcpy call was just incorrect. | |||
2023-11-29 | Added function to copy tokens | Aryadev Chavali | |
This essentially just copies the internal string of the token into a new buffer. | |||
2023-11-29 | Added TOKEN_PP_USE to lexer with implementation | Aryadev Chavali | |
2023-11-29 | Moved preprocessor>Constants to Completed and started work on %USE | Aryadev Chavali | |
2023-11-29 | Added todo for preprocessor "%MACRO" | Aryadev Chavali | |
This is different to "%CONST" in that it can take token parameters and use them. This allows the construction of user code at compile time, which can be very useful for a variety of use cases. | |||
2023-11-29 | Added todo for preprocessor "%USE" blocks | Aryadev Chavali | |
Essentially importing another file *literally* into the file. This would happen before parse results are gathered, similar to how "%CONST" is implemented currently. | |||
2023-11-29 | Cleaned up todos standard library a bit more | Aryadev Chavali | |
2023-11-11 | Added string literals in tokeniser | Aryadev Chavali | |
Doesn't do much, invalid for most operations. | |||
2023-11-09 | Use constants in examples where possible | Aryadev Chavali | |
Stuff like numeric limits can be codified in constants which act self documenting. | |||
2023-11-09 | Mark off constants as done in TODO.org | Aryadev Chavali | |
2023-11-08 | Makefile now assembles and interprets instruction-test.asm example first | Aryadev Chavali | |
2023-11-08 | Added a preprocessing routine in assembler | Aryadev Chavali | |
Preprocessor handles macros and macro blocks by working at the token level, not doing any high level parsing or instruction making. Essentially every macro is recorded in a registry, recording the name and the tokens assigned to it. Then for every caller it just inserts the tokens inline, creating a new stream and freeing the old one. It leaves actual high level parsing to `parse_next` and `process_presults`. | |||
2023-11-08 | Added log in assembler for reading a certain number of bytes | Aryadev Chavali | |
2023-11-08 | Lexer symbols now recognise macro constants and references | Aryadev Chavali | |
2023-11-08 | Fixed issue where, on error, runtime would show wrong instruction | Aryadev Chavali | |
When an error occurred, because prog->ptr was incremented beforehand the trace would show the next instruction as the culprit rather than the actual instruction. This commit fixes that by incrementing the program if and only if the command was run successfully. | |||
2023-11-06 | Current work on preprocessor | Aryadev Chavali | |
2023-11-05 | Current work on preprocessor implementation | Aryadev Chavali | |
Lots to refactor and test | |||
2023-11-05 | Redefined proposed syntax for preprocessor in TODO.org | Aryadev Chavali | |
2023-11-04 | Added TODO for inlining labels | Aryadev Chavali | |
2023-11-04 | Added tags for TODO.org | Aryadev Chavali | |
2023-11-04 | Did some more work on the spec | Aryadev Chavali | |
2023-11-04 | Fixed up example comments and some assembly | Aryadev Chavali | |
2023-11-03 | Added steps to creating an in memory instance of the VM | Aryadev Chavali | |
This would be useful when writing an interpreted language where the "assembly" and the "execution" occur within the same executable. | |||
2023-11-03 | Updated LOC | Aryadev Chavali | |
2023-11-03 | Cleaned up How to build section of README | Aryadev Chavali | |
2023-11-03 | Added Makefile recipe to interpret all examples | Aryadev Chavali | |
2023-11-03 | Symbols may now include digits in lexer | Aryadev Chavali | |
This is mostly so labels get to have digits. This won't affect number tokens as that happens before symbols. | |||
2023-11-03 | Removed tabs from VERBOSE logs in asm/main.c | Aryadev Chavali | |
2023-11-03 | Used more subroutines in fib.asm to make code clearer | Aryadev Chavali | |
Looks way more high level but parses down to a very simple bytecode. However, because of lack of inline code processing, it relies on the call stack quite heavily. With inline labels this would be a much more compact bytecode. | |||
2023-11-03 | Use label features and entry points for examples | Aryadev Chavali | |