module Lc3Vm
Extended Modules
Defined in:
lc3_vm.crlc3_vm/flags.cr
lc3_vm/memory.cr
lc3_vm/registers.cr
lc3_vm/traps.cr
Constant Summary
-
MEMORY =
Memory.new
-
NOPS =
16
-
OP_FUNS =
[->(instruction : UInt16) do branch(instruction) end, ->(instruction : UInt16) do add(instruction) end, ->(instruction : UInt16) do load(instruction) end, ->(instruction : UInt16) do store(instruction) end, ->(instruction : UInt16) do jump_subroutine(instruction) end, ->(instruction : UInt16) do and(instruction) end, ->(instruction : UInt16) do load_from_register(instruction) end, ->(instruction : UInt16) do store_from_register(instruction) end, ->(instruction : UInt16) do end, ->(instruction : UInt16) do not(instruction) end, ->(instruction : UInt16) do load_indirect(instruction) end, ->(instruction : UInt16) do store_indirect(instruction) end, ->(instruction : UInt16) do jump(instruction) end, ->(instruction : UInt16) do end, ->(instruction : UInt16) do load_effective_address(instruction) end, ->(instruction : UInt16) do trap(instruction) end]
-
PC_START =
UInt16.new(12288)
-
REG =
Registry.new
-
TRAPS_VECTOR =
[Traps.get_char, Traps.put_char, Traps.puts_word, Traps.get_char_echo, Traps.puts_byte, Traps.halt, Traps.get_word, Traps.put_word]
-
VERSION =
"0.1.0"
Instance Method Summary
- #add(instruction : UInt16)
- #add_const(dr : UInt16, src : UInt16, val : UInt16)
- #add_reg(dr : UInt16, src1 : UInt16, src2 : UInt16)
- #and(instruction : UInt16)
- #and_const(dr : UInt16, src : UInt16, val : UInt16)
- #and_reg(dr : UInt16, src1 : UInt16, src2 : UInt16)
- #branch(instruction : UInt16)
- #debug_info
- #execute(instruction)
- #extract_dr(instruction : UInt16) : UInt16
- #extract_imm_mode(instruction : UInt16) : UInt16
- #extract_offset(instruction : UInt16, size : UInt16) : UInt16
- #extract_src1(instruction : UInt16) : UInt16
- #extract_src2(instruction : UInt16) : UInt16
- #extract_trap_vector(instruction)
- #extract_value(instruction : UInt16) : UInt16
- #jump(instruction : UInt16)
- #jump_subroutine(instruction : UInt16)
- #load(instruction : UInt16)
- #load_effective_address(instruction : UInt16)
- #load_from_register(instruction : UInt16)
- #load_image
- #load_indirect(instruction : UInt16)
- #not(instruction : UInt16)
- #operation(instruction : UInt16)
- #reset
- #running
- #set_flags(register : UInt16)
- #start
- #stop
- #store(instruction : UInt16)
- #store_from_register(instruction : UInt16)
- #store_indirect(instruction : UInt16)
- #trap(instruction : UInt16)