Documentation ¶
Index ¶
- Constants
- func GetMnemonic(i int) (mnem string)
- func InstructionDecode(opcode dg.WordT, pc dg.PhysAddrT, lefMode bool, ioOn bool, atuOn bool, ...) (*decodedInstrT, bool)
- func InstructionsInit()
- func WsPop(cpu *CPUT) (dword dg.DwordT)
- type CPUStatT
- type CPUT
- func (cpu *CPUT) Boot(devNum int, pc dg.PhysAddrT)
- func (cpu *CPUT) CPUInit(devNum int, bus *devices.BusT, statsChan chan CPUStatT)
- func (cpu *CPUT) CompactPrintableStatus() string
- func (cpu *CPUT) DisassembleRange(lowAddr, highAddr dg.PhysAddrT) (disassembly string)
- func (cpu *CPUT) Execute(iPtr *decodedInstrT) (rc bool)
- func (cpu *CPUT) GetAc(ac int) (contents dg.DwordT)
- func (cpu *CPUT) GetAtu() (atu bool)
- func (cpu *CPUT) GetDebugLogging() (logging bool)
- func (cpu *CPUT) GetIO(segment int) (io bool)
- func (cpu *CPUT) GetInstrCount() (ic uint64)
- func (cpu *CPUT) GetLef(segment int) (lef bool)
- func (cpu *CPUT) GetOVK() bool
- func (cpu *CPUT) GetOVR() bool
- func (cpu *CPUT) GetPC() (pc dg.PhysAddrT)
- func (cpu *CPUT) GetSCPIO() (scp bool)
- func (cpu *CPUT) GetWFP() (wfp dg.PhysAddrT)
- func (cpu *CPUT) GetWSP() (wsp dg.PhysAddrT)
- func (cpu *CPUT) PrepToRun()
- func (cpu *CPUT) PrintableStatus() string
- func (cpu *CPUT) Reset()
- func (cpu *CPUT) Run(disassembly bool, deviceMap devices.DeviceMapT, breakpoints []dg.PhysAddrT, ...) (errDetail string, instrCounts [maxInstrs]int)
- func (cpu *CPUT) SetATU(atu bool)
- func (cpu *CPUT) SetAc(ac int, val dg.DwordT)
- func (cpu *CPUT) SetDebugLogging(logging bool)
- func (cpu *CPUT) SetLef(lef bool)
- func (cpu *CPUT) SetN(b bool)
- func (cpu *CPUT) SetOVK(newOVK bool)
- func (cpu *CPUT) SetOVR(newOVR bool)
- func (cpu *CPUT) SetPC(addr dg.PhysAddrT)
- func (cpu *CPUT) SetSCPIO(scp bool)
- func (cpu *CPUT) SetZ(b bool)
- func (cpu *CPUT) SetupStack(wfp, wsp, wsb, wsl, wsfh dg.PhysAddrT)
- func (cpu *CPUT) Vrun(instrCounts *[maxInstrs]int) (syscallTrap bool, errDetail string)
Constants ¶
const ( // MemSizeWords defines the size of MV/Em's emulated RAM in 16-bit words MemSizeWords = 8388608 // = 040 000 000 (8) = 0x80 0000 // MemSizeLCPID is the code returned by the LCPID to indicate the size of RAM in half megabytes MemSizeLCPID = ((MemSizeWords * 2) / (256 * 1024)) - 1 // 0x3F // MemSizeNCLID is the code returned by NCLID to indicate size of RAM in 32Kb increments MemSizeNCLID = ((MemSizeWords * 2) / (32 * 1024)) - 1 )
const ( SyscallNot = false SyscallTrap = true )
System call trap
const ( NOVA_MEMREF = iota NOVA_OP NOVA_IO NOVA_MATH NOVA_PC ECLIPSE_FPU ECLIPSE_MEMREF ECLIPSE_OP ECLIPSE_PC ECLIPSE_STACK EAGLE_DECIMAL EAGLE_IO EAGLE_PC EAGLE_OP EAGLE_MEMREF EAGLE_STACK EAGLE_FPU )
Instruction Types
const ( DERR_FMT = iota IMM_MODE_2_WORD_FMT IMM_ONEACC_FMT IO_FLAGS_DEV_FMT IO_TEST_DEV_FMT LNDO_4_WORD_FMT NOACC_MODE_2_WORD_FMT NOACC_MODE_3_WORD_FMT NOACC_MODE_IMM_IND_3_WORD_FMT NOACC_MODE_IND_2_WORD_E_FMT NOACC_MODE_IND_2_WORD_X_FMT NOACC_MODE_IND_3_WORD_FMT NOACC_MODE_IND_3_WORD_XCALL_FMT NOACC_MODE_IND_4_WORD_FMT NOVA_DATA_IO_FMT NOVA_NOACC_EFF_ADDR_FMT NOVA_ONEACC_EFF_ADDR_FMT NOVA_TWOACC_MULT_OP_FMT ONEACC_IMM_2_WORD_FMT ONEACC_IMMWD_2_WORD_FMT ONEACC_IMM_3_WORD_FMT ONEACC_IMMDWD_3_WORD_FMT ONEACC_MODE_2_WORD_E_FMT ONEACC_MODE_2_WORD_X_B_FMT ONEACC_MODE_3_WORD_FMT ONEACC_MODE_IND_2_WORD_E_FMT ONEACC_MODE_IND_2_WORD_X_FMT ONEACC_MODE_IND_3_WORD_FMT ONEACC_1_WORD_FMT UNIQUE_1_WORD_FMT UNIQUE_2_WORD_FMT SPLIT_8BIT_DISP_FMT THREE_WORD_DO_FMT TWOACC_1_WORD_FMT TWOACC_IMM_2_WORD_FMT WIDE_DEC_SPECIAL_FMT WSKB_FMT )
Instruction Formats
Variables ¶
This section is empty.
Functions ¶
func GetMnemonic ¶
GetMnemonic returns the mnemonic for a given opcode
func InstructionDecode ¶
func InstructionDecode(opcode dg.WordT, pc dg.PhysAddrT, lefMode bool, ioOn bool, atuOn bool, disassemble bool, devMap devices.DeviceMapT) (*decodedInstrT, bool)
InstructionDecode decodes an opcode
func InstructionsInit ¶
func InstructionsInit()
InstructionsInit initialises the instruction characterstics for each instruction(
Types ¶
type CPUStatT ¶
type CPUStatT struct { Pc dg.PhysAddrT Ac [4]dg.DwordT Carry, Atu, Ion bool InstrCount uint64 GoVersion string GoroutineCount int HostCPUCount int HeapSizeMB int }
CPUStatT defines the data we will send to the statusCollector monitor
type CPUT ¶
type CPUT struct {
// contains filtered or unexported fields
}
CPUT holds the current state of a CPUT
func (*CPUT) CompactPrintableStatus ¶
CompactPrintableStatus returns a concise CPU status
func (*CPUT) DisassembleRange ¶
DisassembleRange returns a DASHER-formatted string of the disassembled specified region
func (*CPUT) Execute ¶
Execute runs a single instruction A false return means failure, the VM should stop
func (*CPUT) GetDebugLogging ¶
GetDebugLogging is a getter for the debug logging flag
func (*CPUT) GetInstrCount ¶
GetInstrCount returns the instruction-counting array
func (*CPUT) PrintableStatus ¶
PrintableStatus returns a verbose status of the CPU
func (*CPUT) Run ¶
func (cpu *CPUT) Run(disassembly bool, deviceMap devices.DeviceMapT, breakpoints []dg.PhysAddrT, inputRadix int, tto *devices.TtoT) (errDetail string, instrCounts [maxInstrs]int)
Run is the main activity loop for the virtual CPU
func (*CPUT) SetDebugLogging ¶
SetDebugLogging is a setter for debug logging
func (*CPUT) SetupStack ¶
SetupStack is a group-setter for the Wide Stack