emulator.dcpu.execution

Members

Functions

basicInstruction
void basicInstruction(ref Cpu dcpu, ref Instruction instr)

Performs basic instruction.

handleInterrupt
void handleInterrupt(ref Cpu dcpu)

Handles interrupt from interrupt queue if reg_ia != 0 && intQueue.length > 0 Handles interrupts only when interrupt queuing is disabled. It may be enabled by interrupt handler or manually in time critical code.

pop
ushort pop(ref Cpu dcpu)

Pops value from stack increasing reg_sp.

push
void push(ref Cpu dcpu, ushort value)

Pushes value onto stack decreasing reg_sp.

queryHardwareInfo
void queryHardwareInfo(ref Cpu dcpu, ushort deviceIndex)

Sets A, B, C, X, Y registers to information about hardware deviceIndex

sendHardwareInterrupt
void sendHardwareInterrupt(ref Cpu dcpu, ushort deviceIndex)

Sends an interrupt to hardware deviceIndex

skipIfs
void skipIfs(ref Cpu dcpu)

Skips instructions if conditional opcode was failed. + The conditional opcodes take one cycle longer to perform if the test fails. + When they skip a conditional instruction, they will skip an additional + instruction at the cost of one extra cycle. This continues until a non- + conditional instruction has been skipped. This lets you easily chain + conditionals. Interrupts are not triggered while the DCPU-16 is skipping.

specialInstruction
void specialInstruction(ref Cpu dcpu, ref Instruction instr)

Performs special instruction.

triggerInterrupt
void triggerInterrupt(ref Cpu dcpu, ushort message)

Adds interrupt with message 'message' to dcpu.intQueue or starts burning DCPU if queue grows bigger than 256

Meta

Authors

Andrey Penechko.