mirror of
https://github.com/bradford-hamilton/apple-1.git
synced 2024-06-11 08:29:35 +00:00
docs: add/update some godoc comments
This commit is contained in:
parent
3ff2e7f9ab
commit
17df9a44f0
|
@ -1,5 +1,7 @@
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
|
// op represents an operation. It includes the name of the op, it's 8 bit hexidecimal
|
||||||
|
// opcode, how many bytes it occupies (it's size), as well as it's addressing mode.
|
||||||
type op struct {
|
type op struct {
|
||||||
name string
|
name string
|
||||||
opcode uint8
|
opcode uint8
|
||||||
|
@ -16,6 +18,8 @@ func newOp(name string, opcode, size uint8, addressingMode addressingMode) op {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// opcodes represent all of the Apple 1 opcodes available. Each 8 bit opcode is mapped to a corresponding
|
||||||
|
// "op" which is just a struct holding metadata about the operation.
|
||||||
var opcodes = map[uint8]op{
|
var opcodes = map[uint8]op{
|
||||||
// BRK Force Break
|
// BRK Force Break
|
||||||
// addressing assembler opc bytes cyles
|
// addressing assembler opc bytes cyles
|
||||||
|
|
|
@ -2,12 +2,12 @@ package appleone
|
||||||
|
|
||||||
import "github.com/bradford-hamilton/apple-1/internal/cpu"
|
import "github.com/bradford-hamilton/apple-1/internal/cpu"
|
||||||
|
|
||||||
// Appleone TODO docs
|
// Appleone represents our virtual Apple 1 computer
|
||||||
type Appleone struct {
|
type Appleone struct {
|
||||||
cpu *cpu.Mos6502
|
cpu *cpu.Mos6502
|
||||||
}
|
}
|
||||||
|
|
||||||
// New TODO: docs
|
// New returns a pointer to an initialized Appleone with a brand spankin new CPU
|
||||||
func New() *Appleone {
|
func New() *Appleone {
|
||||||
return &Appleone{cpu: cpu.New()}
|
return &Appleone{cpu: cpu.New()}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user