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.
Aryadev Chavali cc84703725 Added runtime errors to virtual machine
Every vm routine now returns an err_t, which is an enumeration of
possible error states.  ERR_OK represents the good state and is 0 so
error checking seems very natural in terms of language `if (err) ...`.
Errors bubble up the runtime, with any callers forced to check if an
error occurred.

This does mean that routines that call other routines cannot provide
an accurate trace of the subcaller (based on the fact that an error is
generated for the current instruction), but this should be a non issue
as no instruction should be complex enough to need proper traces.
2023-10-22 21:45:38 +01:00
2023-10-15 01:25:24 +01:00
2023-10-15 01:25:24 +01:00
2023-10-15 01:25:24 +01:00

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'll need inst.h for the instruction API. You must convert user programs to instructions via inst_t, then emit bytecode via insts_write_bytecode*.

This is all that is necessary to create a language which targets this virtual machine. To execute that bytecode, a user must use my virtual machine program.

Description
No description provided
Readme 27 KiB
Languages
C 97%
Makefile 3%