100% compliant1 MUHI VM written in JS. With support for the paging extension2.
node src/index.js program.out
The VM itself is portable since it outsources all of it's IO and gives the caller full control over execution.
The node driver in src/index.js
contains example IO callback implementations.
The class takes 3 main arguments:
rom
- anUint16Array
of the program you wish to executeinCb
- a callback used for reading (can be async)outCb
- a callback used for writing
To run the simulation, call vm.cycle()
in a loop. The machine will throw an Error once it halts.