computer

package
v0.0.0-...-8bbb003 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MaxNbIODevices int = 16

Variables

This section is empty.

Functions

func RNGIODevice

func RNGIODevice(C *Computer)

RNG: Device 1 A Random Number Generator. Places a random byte on the data bus, and saves in in RNGLast for testing purposes

func ROMIODevice

func ROMIODevice(C *Computer)

ROM: Device 2 A ROM module,

func ROMSizeIODevice

func ROMSizeIODevice(C *Computer)

ROMSize: Device 3 The size of the ROM module

func TTYIODevice

func TTYIODevice(C *Computer)

TTY: Device 0 An output-only TTY implementation, just grabs the ASCII code on the bus and prints the corresponding character to TTYWriter

Types

type Computer

type Computer struct {
	BB        *b.Breadboard
	IOAdapter *IOAdapter

	TTYWriter   io.Writer
	RNGLast     int
	ROMAddrLast int
	ROM         []int
	// contains filtered or unexported fields
}

COMPUTER

func NewComputer

func NewComputer(bits int, maxinsts int) *Computer

func (*Computer) BootAndRun

func (this *Computer) BootAndRun(insts []int) error

Place the instructions in the ROM and calls Run() with the booloader program. A HALT instruction is appeneded at the end to make sure the computer stops when the program is over.

func (*Computer) String

func (this *Computer) String() string

type IOAdapter

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

IOADAPTER

func NewIOAdapter

func NewIOAdapter(cpu *g.Bus, io *g.Bus) *IOAdapter

func (*IOAdapter) IsActive

func (this *IOAdapter) IsActive(n int) bool

func (*IOAdapter) IsRegistered

func (this *IOAdapter) IsRegistered(n int) bool

func (*IOAdapter) Register

func (this *IOAdapter) Register(BB *b.Breadboard, id int, name string, in func(), out func())

Register a new device

func (*IOAdapter) String

func (this *IOAdapter) String() string

type IODevice

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

IODEVICE

Jump to

Keyboard shortcuts

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