Implemented if statements

This commit is contained in:
Eduard Urbach 2024-07-07 12:30:57 +02:00
parent c139dced9e
commit 962a362578
Signed by: eduard
GPG key ID: 49226B848C78F6C8
16 changed files with 280 additions and 14 deletions

View file

@ -34,10 +34,10 @@ func (a *Assembler) Register(mnemonic Mnemonic, register cpu.Register) {
})
}
// Label adds a label at the current position.
func (a *Assembler) Label(name string) {
// Label adds an instruction using a label.
func (a *Assembler) Label(mnemonic Mnemonic, name string) {
a.Instructions = append(a.Instructions, Instruction{
Mnemonic: LABEL,
Mnemonic: mnemonic,
Data: &Label{
Name: name,
},