module CPU

Extended Modules

Defined in:

components/cpu/cpu.cr

Instance Method Summary

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.


[View source]
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.


[View source]
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.


[View source]