C# Class DCPU16_ASM.Emulator.CDCPU16

DCPU-16 Computer class
显示文件 Open project: densitynz/DCPU-16-ASM.NET Class Usage Examples

Public Methods

Method Description
CDCPU16 ( ) : System

Constructor

CDCPU16 ( List &_machineCode ) : System

Constructor

ClearMemoryBuffers ( ) : void

Clears Video/Keyboard (and more to come) buffers

DebugShowRegisters ( ) : void

Write contents of Registers to Console.

ExecuteInstruction ( ) : void

Execute a DCPU-16 Instruction

InitCPU ( ) : void

Initialize DCPU-16 CPU. Allocates required memory space for RAM and General purpose Registers

ResetCPURegisters ( ) : void

Resets DCPU-16's Registers. NOTE: we do Video/Keyboard buffer clearing as well. Will shift soon :)

SetProgram ( List &_machineCode ) : void

Sets DPU-16 up with a program to execute

Private Methods

Method Description
ReadNextWord ( ) : ushort

Read next Word from DCPU-16's ram @ the program counter's Location.

ReadParamValue ( ushort _opParam ) : readParamValue

Read OpCode Parameter value. BBBBBB AAAAAA 0000 Will decode either A or B (based on what is given in _opParam) and populate data into a readParamValue struct. The PC register is automatically incremented based on what needs to be read.

SetResultValue ( readParamValue _resultValue ) : void

Stores Read param values back into RAM or Registers. This is normally called after resolving a OpCode instruction in ExecuteInstruction().

Method Details

CDCPU16() public method

Constructor
public CDCPU16 ( ) : System
return System

CDCPU16() public method

Constructor
public CDCPU16 ( List &_machineCode ) : System
_machineCode List list array containing DCPU-16 Program
return System

ClearMemoryBuffers() public method

Clears Video/Keyboard (and more to come) buffers
public ClearMemoryBuffers ( ) : void
return void

DebugShowRegisters() public method

Write contents of Registers to Console.
public DebugShowRegisters ( ) : void
return void

ExecuteInstruction() public method

Execute a DCPU-16 Instruction
public ExecuteInstruction ( ) : void
return void

InitCPU() public method

Initialize DCPU-16 CPU. Allocates required memory space for RAM and General purpose Registers
public InitCPU ( ) : void
return void

ResetCPURegisters() public method

Resets DCPU-16's Registers. NOTE: we do Video/Keyboard buffer clearing as well. Will shift soon :)
public ResetCPURegisters ( ) : void
return void

SetProgram() public method

Sets DPU-16 up with a program to execute
public SetProgram ( List &_machineCode ) : void
_machineCode List list array containing DCPU-16 Program
return void