Implemented data labels

This commit is contained in:
2024-07-13 00:13:13 +02:00
parent 7b18056006
commit 9df899cb52
18 changed files with 428 additions and 327 deletions

View File

@ -9,3 +9,13 @@ type Label struct {
func (data *Label) String() string {
return data.Name
}
// Label adds an instruction using a label.
func (a *Assembler) Label(mnemonic Mnemonic, name string) {
a.Instructions = append(a.Instructions, Instruction{
Mnemonic: mnemonic,
Data: &Label{
Name: name,
},
})
}