Simplified file structure

This commit is contained in:
2024-08-07 19:39:10 +02:00
parent 1b13539b22
commit 66569446b1
219 changed files with 453 additions and 457 deletions

21
src/asm/Label.go Normal file
View File

@ -0,0 +1,21 @@
package asm
// Label represents a jump label.
type Label struct {
Name string
}
// String returns a human readable version.
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,
},
})
}