Documentation ¶
Index ¶
Constants ¶
View Source
const ( // FlagS Sign flag (bit 7) FlagSshift = 7 FlagS = 1 << FlagSshift // FlagZ Zero flag (bit 6) FlagZshift = 6 FlagZ = 1 << FlagZshift // FlagH Half Carry flag (bit 4) FlagHshift = 4 FlagH = 1 << FlagHshift // FlagP Parity (bit 2) (set if the result byte has an even number of bits set) FlagPshift = 2 FlagP = 1 << FlagPshift // FlagV Overflow (bit 2) FlagVshift = FlagPshift FlagV = 1 << FlagVshift // FlagN Add/Subtract flag (bit 1) FlagNshift = 1 FlagN = 1 << FlagNshift // FlagC Carry flag (bit 0) FlagCshift = 0 FlagC = 1 << FlagCshift )
constants for the flag register F
View Source
const ( NonZero Condition = (FlagZ<<8 | 0) Zero = (FlagZ<<8 | FlagZ) NoCarry = (FlagC<<8 | 0) Carry = (FlagC<<8 | FlagC) ParityEven = (FlagP<<8 | FlagP) ParityOdd = (FlagP<<8 | 0) SignPos = (FlagS<<8 | 0) SignNeg = (FlagS<<8 | FlagS) )
Constants for all possible conditions that can be tested for. High byte is mask, and low byte is result required for true evaluation
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Condition ¶
type Condition uint16
Condition represents the possible conditions that can be tested for by the ALU
type OP ¶
type OP struct {
// contains filtered or unexported fields
}
OP splits an op-code into its different parts according to the description in http://www.z80.info/decoding.htm
type R16 ¶
type R16 *uint16
R16 represents a 16-bit register
func NewR16Single ¶
func NewR16Single() R16
NewR16Single creates a new R16 register without returning any high and low R8 parts
type RAM ¶
type RAM struct {
// contains filtered or unexported fields
}
RAM represents the RAM in the Z80
func NewRAM ¶
func NewRAM() *RAM
NewRAM makes a new RAM object with size 64k and populates with the initial data supplied
type Z80 ¶
type Z80 struct {
// the 16 bit registers
AF, BC, DE, HL, IX, IY R16
// their high and low parts
A, F, B, C, D, E, H, L R8
IXL, IXH, IYL, IYH R8
// and their alternatives
AFa, BCa, DEa, HLa R16
// the stack pointer and program counter
SP, PC R16
// memory and IO device
Mem *RAM
IO io.Device
// internal flags
Halted, InterruptEnabled bool
// EnableBDOS controls whether or not a CALL 5 will act as normal or go to the CP/M BDOS
EnableBDOS bool
}
Z80 contains all internal registers and such for the Z80 processor
Click to show internal directories.
Click to hide internal directories.