Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeInstruction ¶
func DecodeInstruction(memory *Memory, address int) (*asm.EvaluatedInstruction, error)
Gets the value of the given memory address, as an EvaluatedLine.
Types ¶
type CPU ¶
type CPU struct { // Registers ProgramCounter *Register InstructionRegister *Register AddressRegister *Register Accumulator *Register // Other Instructions map[asm.Opcode]Instruction }
func CreateLmcCpu ¶
func CreateLmcCpu() *CPU
type Instruction ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
A representation of RAM within an emulated system.
func CreateMemory ¶
Creates memory with the provided initial values
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
A representation of a register within a CPU.
func CreateRegister ¶
Creates a register, using the provided data
func (*Register) Increment ¶
func (r *Register) Increment()
Increments the integer value of the register by 1.
func (*Register) IncrementAndGet ¶
Gets the integer value of the register returns it, then increments by 1.
Click to show internal directories.
Click to hide internal directories.