Documentation ¶
Index ¶
Constants ¶
const ( // Define the named working registers. B = iota C D E H L A )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Intel8080 ¶
type Intel8080 struct {
// contains filtered or unexported fields
}
Intel8080 represents the Intel 8080 CPU.
func NewIntel8080 ¶
func NewIntel8080(mem MemReadWriter, opts ...Option) *Intel8080
NewIntel8080 returns an instantiated Intel 8080.
func (*Intel8080) Accumulator ¶
Accumulator returns the current state of the accumulator.
func (*Intel8080) Interrupt ¶
Interrupt sets the interrupt address which will be handled on the next step.
type MemReadWriter ¶
MemReadWriter is the interface that groups the basic Read and Write methods.
type MemReader ¶
MemReader is the interface that wraps the basic Read and ReadAll methods.
Read returns the value from memory at the given address.
ReadAll returns the full memory contents.
type MemWriter ¶
MemWriter is the interface that wraps the basic Write method.
Write writes the value v into memory at the given address.
type Option ¶
type Option func(*Intel8080)
Option is a functional option that modifies a field on the CPU.
func WithDebugEnabled ¶
func WithDebugEnabled() Option
WithDebugEnabled enables debug mode on the machine.
func WithInput ¶
func WithInput(input ifn) Option
WithInput sets input as the input handler function.
func WithOutput ¶
func WithOutput(output ofn) Option
WithOutput sets output as the output handler function.