module CPU
Extended Modules
Defined in:
components/cpu/cpu.crInstance Method Summary
-
#exec(opcode : Int32, inputs : Array(Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Symbol), registers : Array(Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128)) : Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Nil
Executes a single operation and returns result as Int?.
-
#exec_full(opcode : Int32, inputs : Array(Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Symbol), registers : Array(Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128)) : Hash(String, Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Nil)
Executes a single operation, with memory access and state changes returned.
-
#run(program : String) : Array(Hash(String, Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Nil))
Run program, returning a chronological array of hashes containing memory accesses and state changes.
Instance Method Detail
def exec(opcode : Int32, inputs : Array(Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Symbol), registers : Array(Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128)) : Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Nil
#
Executes a single operation and returns result as Int?. Pure function. No outside access or state changes allowed.
def exec_full(opcode : Int32, inputs : Array(Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Symbol), registers : Array(Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128)) : Hash(String, Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Nil)
#
Executes a single operation, with memory access and state changes returned. CPU.exec result is in ret
value.
def run(program : String) : Array(Hash(String, Int8 | Int16 | Int32 | Int64 | Int128 | UInt8 | UInt16 | UInt32 | UInt64 | UInt128 | Nil))
#
Run program, returning a chronological array of hashes containing memory accesses and state changes.