21 Commits

Author SHA1 Message Date
Aryadev Chavali
7a5eee932a Moved logging macros to base.h and use them everywhere
The macros used in the testing library are actually useful everywhere
so may as well use them.
2024-07-07 03:16:42 +01:00
Aryadev Chavali
6014620baa Changed fill-column to 80, so more space for comments. 2024-06-28 16:11:01 +01:00
Aryadev Chavali
3a09beb582 Change license agreement terming to ensure version 2 only. 2024-06-28 16:07:15 +01:00
Aryadev Chavali
a9f81992ab Update copyright notices and top level licenses 2024-06-25 00:48:43 +01:00
Aryadev Chavali
3cd2dbc2ac Registers are now fixed size
todo.org contains an explanation for this
2024-06-24 15:14:11 +01:00
Aryadev Chavali
bdc6e15ae9 Updated includes, README and TODO 2024-06-19 20:01:20 +01:00
Aryadev Chavali
11f79a84a3 Clean errors in compilation when VERBOSE > 0 2024-06-19 19:07:50 +01:00
Aryadev Chavali
4255c44a6a Propagated change in prog_t into vm
main now does error reporting for read errors
2024-04-27 17:43:42 +05:30
Aryadev Chavali
43d14d05cf Refactor type word -> word_t 2024-04-25 11:07:37 +05:30
Aryadev Chavali
1dfdbb3cd0 Refactor type byte -> byte_t
Simpler to read as a type.  This style will allow me to define signed
versions of the base types as simpler names than what they are
currently.
2024-04-25 10:48:51 +05:30
Aryadev Chavali
159501168c Split vm/runtime.c into two files
struct.c is used for the general construction, inspection and deletion
of the virtual machine structure (vm_t).  runtime defines the
execution routines, error enum, lookup tables, etc.
2024-04-25 03:18:23 +05:30
Aryadev Chavali
92f4f9011d Refactor vm/main to use refactor to program structure 2023-11-03 21:15:30 +00:00
Aryadev Chavali
4eee6e1a0a Implemented subroutine instructions in runtime
Very easy overall, printing the call stack not so much.
2023-11-02 23:25:33 +00:00
Aryadev Chavali
0f295221ca VM runtime now maintains a heap internally
Now need to create some instructions which manage the heap
2023-11-01 20:08:40 +00:00
Aryadev Chavali
c244e7c4a4 Use vm_stop and vm_load_registers
By default I initialise the registers with 8 words, though this may
not be necessary for your purposes.
2023-11-01 17:56:22 +00:00
Aryadev Chavali
6d35283ef0 Clearer VERBOSE messages 2023-11-01 15:22:47 +00:00
Aryadev Chavali
5d800d4366 Moved inst module to lib
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 21:14:14 +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
c8c5381cf2 vm/main takes a filename as input to execute bytecode
Also prints a usage for incorrect usage.
2023-10-26 10:18:53 +01:00
Aryadev Chavali
aa4a3b8614 Implemented simple example of a for loop in main 2023-10-23 03:59:34 +01:00
Aryadev Chavali
b44a61be41 src->vm, Makefile is now a bit more abstracted and pretty colours
Changed folder names for sake of clarity (will be introducing a new
build target soon), and Makefile can now easily support more targets.
2023-10-23 03:58:34 +01:00