Updated README for targeting VM

This commit is contained in:
2023-10-26 10:22:26 +01:00
parent d1f84a6a2c
commit 3200e97324

View File

@@ -5,10 +5,11 @@
A stack based virtual machine in C11. Deals primarily in bytes, A stack based virtual machine in C11. Deals primarily in bytes,
doesn't make assertions about typing and is very simple to target. doesn't make assertions about typing and is very simple to target.
* Instructions to target * Instructions to target
You'll need [[file:src/inst.h][inst.h]] for the instruction API. You You need to link with the object files for
must convert user programs to instructions via ~inst_t~, then emit [[file:lib/base.c][base.c]], [[file:lib/darr.c][darr.c]] and
bytecode via ~insts_write_bytecode*~. [[file:vm/inst.c][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).
This is all that is necessary to create a language which targets this Then to execute the program, the virtual machine interpreter ~ovm.out~
virtual machine. To execute that bytecode, a user must use my virtual is used.
machine program.