This repository has been archived on 2025-11-10 . You can view files and clone it. You cannot open issues or pull requests or push a commit.
93d234cd48404867b1d80a727d17a4b4a0726e1b
More useful tokens, in particular for each opcode possible. This makes parsing a simpler task to reason as now we're just checking against an enum rather than doing a string check in linear time. It makes more sense to do this at the tokeniser as the local data from the buffer will be in the cache most likely as the buffer is contiguously allocated. While it will always be slow to do linear time checks on strings, when doing it at the parser we're having to check strings that may be allocated in a variety of different places. This means caching becomes a harder task, but with this approach we're less likely to have cache misses as long as the buffer stays there.
Oreo's Virtual Machine (OVM)
A stack based virtual machine in C11. Deals primarily in bytes, doesn't make assertions about typing and is very simple to target.
Instructions to target
You need to link with the object files for
base.c, darr.c and
inst.c to be able to properly target the OVM.
The basic idea is to create instructions via inst_t then using the
inst(s)_write_* API to generate bytecode (and write to a file).
Then to execute the program, the virtual machine interpreter ovm.out
is used.
For clarity, one may build lib (make lib) then use the resulting
object files to link and create bytecode for the virtual machine.
Description
Languages
C
70.2%
C++
26.5%
Makefile
3.3%