docs: add/update some godoc comments

This commit is contained in:
Bradford Lamson-Scribner 2020-05-27 14:59:16 -06:00
parent 3ff2e7f9ab
commit 17df9a44f0
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,7 @@
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 {
name string
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{
// BRK Force Break
// addressing assembler opc bytes cyles

View File

@ -2,12 +2,12 @@ package appleone
import "github.com/bradford-hamilton/apple-1/internal/cpu"
// Appleone TODO docs
// Appleone represents our virtual Apple 1 computer
type Appleone struct {
cpu *cpu.Mos6502
}
// New TODO: docs
// New returns a pointer to an initialized Appleone with a brand spankin new CPU
func New() *Appleone {
return &Appleone{cpu: cpu.New()}
}