cpu

package
v0.20.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package cpu contains common components for CPU emulators

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPU

type CPU interface {
	// Clock gets the CPU Clock
	Clock() device.Clock
	// Init initializes the CPU
	Init()
	// Reset resets the CPU
	Reset()
}

CPU is the central processor unit

type Reg16

type Reg16 = uint16

Reg16 is a 16bit register (uint16 alias)

type Reg8

type Reg8 = uint8

Reg8 is a 8bit register (uint8 alias)

type Register16

type Register16 struct {
	// contains filtered or unexported fields
}

Register16 is a pair of 8bit registers

func NewRegister16

func NewRegister16(h, l *Reg8) Register16

NewRegister16 creates a new Register16

func (*Register16) Dec

func (r *Register16) Dec()

Dec decrements by 1 the 16bit register

func (*Register16) Get

func (r *Register16) Get() uint16

Get the 16bit value of a regpair

func (*Register16) GetH

func (r *Register16) GetH() byte

GetH obtains the upper 8bit value

func (*Register16) GetL

func (r *Register16) GetL() byte

GetL obtains the lower 8bit value

func (*Register16) H

func (r *Register16) H() *Reg8

H obtains the upper 8bit register

func (*Register16) Inc

func (r *Register16) Inc()

Inc increments by 1 the 16bit register

func (*Register16) IsZero

func (r *Register16) IsZero() bool

IsZero register is a 0 value

func (*Register16) L

func (r *Register16) L() *Reg8

L obtains the lower 8bit register

func (*Register16) Set

func (r *Register16) Set(value uint16)

Set the 16bit value of a regpair

func (*Register16) SetH

func (r *Register16) SetH(value byte)

SetH obtains the upper 8bit register

func (*Register16) SetL

func (r *Register16) SetL(value byte)

SetL obtains the lower 8bit register

func (*Register16) Swap

func (r *Register16) Swap(o *Register16)

Swap exchanges the register values

Directories

Path Synopsis
Package z80 a Zyxel Z80 CPU emulator
Package z80 a Zyxel Z80 CPU emulator

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL