Synacor::VM
Inherits Reference < Object
Constants
INVALID_VALUE = MAX_VALUE + 8
MAX_VALUE = (2 ** 15).to_u16
REGISTERS = MAX_VALUE...INVALID_VALUE
Constructors
new(input : IO::Memory, output : Athena::Console::Output::Interface)
SourceInstance methods
input
Sourceinput=(input : IO::Memory)
Sourceload(binary_path : String)
Sourcemain_loop
Sourcemain_loop
Sourcememory=(memory : StaticArray(UInt16, 32768))
memory with 15-bit address space storing 16-bit values
op_add(reg : Int32, a : UInt16, b : UInt16, &)
Sourceop_and(reg : Int32, a : UInt16, b : UInt16, &)
Sourceop_call(a : UInt16)
Sourceop_eq(reg : Int32, a : UInt16, b : UInt16, &)
Sourceop_gt(reg : Int32, a : UInt16, b : UInt16, &)
Sourceop_halt
Sourceop_in(reg : Int32, &)
Sourceop_jf(a : UInt16, b : UInt16, &block : -> )
Sourceop_jmp(value : UInt16)
Sourceop_jt(a : UInt16, b : UInt16, &block : -> )
Sourceop_mod(reg : Int32, a : UInt16, b : UInt16, &)
Sourceop_mult(reg : Int32, a : UInt16, b : UInt16, &)
Sourceop_noop
Sourceop_not(reg : Int32, value : UInt16, &)
Sourceop_or(reg : Int32, a : UInt16, b : UInt16, &)
Sourceop_out(value : UInt16, &)
Sourceop_pop(reg : Int32, &block : -> )
Sourceop_push(value : UInt16, &)
Sourceop_ret
Sourceop_rmem(reg : Int32, addr : UInt16, &)
Sourceop_set(reg : Int32, value : UInt16, &)
Sourceop_wmem(addr : UInt16, value : UInt16, &)
Sourceoutput
Sourceoutput=(output : ACON::Output::Interface)
Sourceregister_at(index : Int32) : Int32
Sourceto_register(value : UInt16) : Int32
Sourceto_value(value : UInt16) : UInt16
Sourcevalue_at(index : Int32) : UInt16
Source