diff --git a/internal/cpu/opcodes.go b/internal/cpu/opcodes.go index c9160ed..841a58c 100644 --- a/internal/cpu/opcodes.go +++ b/internal/cpu/opcodes.go @@ -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 diff --git a/pkg/appleone/appleone.go b/pkg/appleone/appleone.go index a2d14ec..08d1f26 100644 --- a/pkg/appleone/appleone.go +++ b/pkg/appleone/appleone.go @@ -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()} }