[][src]Module pir_8_emu::isa::instruction

An instruction is a single byte, and can include some following immediate values purely for data.

Structs

DisplayInstruction

Helper struct for assembly-printing instructions with format!() and {}.

Enums

AluOperation

Any CPU instruction of the pattern 0011 FFFF will invoke some function of the ALU.

AluOperationShiftOrRotateDirection

If D is a 1, the shift is to the left, all bits will move to a higher value, if D is 0, it's a right shift, moving bits to lower values.

AluOperationShiftOrRotateType

All shifts can be performed left or right, as designated by the D bit of the instruction.

Instruction

Instructions will increase the PC by one, unless otherwise stated.

InstructionJumpCondition

This Instruction takes a three bit operand indicating under what condition the jump should be performed.

InstructionLoadImmediateWideRegisterPair

When performing a wide immediate load, two bytes are read from memory into a pair of registers, as indicated by the two bits RR.

InstructionMadrDirection

The D bit indicates the direction – 0 for write-to (MADR WRITE) and 1 for read-from (MADR READ) the ADR register.

InstructionPortDirection

The D bit specifies the direction - 1 for reading in from the port (PORT IN) and 0 for writing out to the port (PORT OUT).

InstructionRegisterPair

The R bit indicates the register pair; 0 for A & B and 1 for C & D.

InstructionStckDirection

The D bit indicates the direction; 0 for PUSH and 1 for POP.

ParseInstructionError

An error that could've occurred when parsing an Instruction or an AluOperation.