aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-11-09Use constants in examples where possibleAryadev Chavali
Stuff like numeric limits can be codified in constants which act self documenting.
2023-11-09Mark off constants as done in TODO.orgAryadev Chavali
2023-11-08Makefile now assembles and interprets instruction-test.asm example firstAryadev Chavali
2023-11-08Added a preprocessing routine in assemblerAryadev 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-08Added log in assembler for reading a certain number of bytesAryadev Chavali
2023-11-08Lexer symbols now recognise macro constants and referencesAryadev Chavali
2023-11-08Fixed issue where, on error, runtime would show wrong instructionAryadev 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-06Current work on preprocessorAryadev Chavali
2023-11-05Current work on preprocessor implementationAryadev Chavali
Lots to refactor and test
2023-11-05Redefined proposed syntax for preprocessor in TODO.orgAryadev Chavali
2023-11-04Added TODO for inlining labelsAryadev Chavali
2023-11-04Added tags for TODO.orgAryadev Chavali
2023-11-04Did some more work on the specAryadev Chavali
2023-11-04Fixed up example comments and some assemblyAryadev Chavali
2023-11-03Added steps to creating an in memory instance of the VMAryadev Chavali
This would be useful when writing an interpreted language where the "assembly" and the "execution" occur within the same executable.
2023-11-03Updated LOCAryadev Chavali
2023-11-03Cleaned up How to build section of READMEAryadev Chavali
2023-11-03Added Makefile recipe to interpret all examplesAryadev Chavali
2023-11-03Symbols may now include digits in lexerAryadev Chavali
This is mostly so labels get to have digits. This won't affect number tokens as that happens before symbols.
2023-11-03Removed tabs from VERBOSE logs in asm/main.cAryadev Chavali
2023-11-03Used more subroutines in fib.asm to make code clearerAryadev 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-03Use label features and entry points for examplesAryadev Chavali
2023-11-03Added note in TODO.orgAryadev Chavali
Implementing start points has made features necessary for a standard library setup easier to see.
2023-11-03Completed start points TODOAryadev Chavali
2023-11-03Fixed bug where labels were off by oneAryadev Chavali
Was used in a previous fix but not necessary anymore
2023-11-03Fixed bug where runtime would not start program at the right placeAryadev Chavali
In vm_execute_all set the program pointer to the start address in the header of the program payload.
2023-11-03Added memory-print.asm to examples list in MakefileAryadev Chavali
2023-11-03Refactor assembler to use prog_t structureAryadev Chavali
Set the program structure correctly with a header using the parsed global instruction.
2023-11-03Refactor vm/main to use refactor to program structureAryadev Chavali
2023-11-03Use program structure for runtimeAryadev Chavali
Very barebones, essentially a simple refactor. I need to introduce a feature to append to a program as well, but as it's a flexible structure it will likely have to be functional.
2023-11-03Defined a `program` structureAryadev Chavali
Essentially a "program header", followed by a count, followed by instructions. Provides a stronger format for bytecode files and allows for better bounds checking on instructions.
2023-11-03Added a start address (equivalent to `main`) to assemblerAryadev Chavali
Creates a jump address to the label delegated by "global" so program starts at that point.
2023-11-03Added todo for making a standard libraryAryadev Chavali
Some considerations as to how to do this (dynamic or static linking) and changes needed in VM/assembler for this to work.
2023-11-03Added todo to make a "main routine" specification in assemblerAryadev Chavali
2023-11-03Mark off completed tasks in todo.orgAryadev Chavali
2023-11-03Started work on spec for data storage types in VMAryadev Chavali
2023-11-03Added TODO and WIP tags for specAryadev Chavali
2023-11-03Made test.asm an example asm programAryadev Chavali
2023-11-02Added comments to test.asmAryadev Chavali
2023-11-02Update spec footnotesAryadev Chavali
2023-11-02Updated LOC in READMEAryadev Chavali
2023-11-02Started working on a spec, still needs a lot of workAryadev Chavali
2023-11-02Added recipes to assemble or interpret individuallyAryadev Chavali
2023-11-02Implemented a routine which prints out a buffer of characters and use itAryadev Chavali
All in my assembly/virtual machine!
2023-11-02Better logs for assemblerAryadev Chavali
2023-11-02Implemented CALL(_STACK) and RET on the assemblerAryadev Chavali
2023-11-02Made lexer more error prone so parser is lessAryadev Chavali
Lexer now will straight away attempt to eat up any type or later portions of an opcode rather than leaving everything but the root. This means checking for type in the parser is a direct check against the name rather than prefixed with a dot. Checks are a bit more strong to cause more tokens to go straight to symbol rather than getting checked after one routine in at on the parser side.
2023-11-02Fixed bug where deleting a page meant not being able to allocate anotherAryadev Chavali
This was due to the beg or end page being not set correctly (dangling pointer).
2023-11-02Added memory leak dialog in vm_stopAryadev Chavali
Stack, call stack and heap are evaluated to check for leaks.
2023-11-02Implemented subroutine instructions in runtimeAryadev Chavali
Very easy overall, printing the call stack not so much.