Improved documentation

This commit is contained in:
Eduard Urbach 2024-07-13 14:18:55 +02:00
parent 1b75529bb3
commit 96078f40d8
Signed by: eduard
GPG key ID: 49226B848C78F6C8
6 changed files with 49 additions and 26 deletions

View file

@ -4,12 +4,12 @@ import "maps"
// Assembler contains a list of instructions.
type Assembler struct {
Instructions []Instruction
Data map[string][]byte
Instructions []Instruction
}
// Merge combines the contents of this assembler with another one.
func (a *Assembler) Merge(b Assembler) {
a.Instructions = append(a.Instructions, b.Instructions...)
maps.Copy(a.Data, b.Data)
a.Instructions = append(a.Instructions, b.Instructions...)
}

View file

@ -8,8 +8,8 @@ import (
// RegisterLabel operates with a register and a label.
type RegisterLabel struct {
Register cpu.Register
Label string
Register cpu.Register
}
// String returns a human readable version.