Improved code generation

This commit is contained in:
2024-07-09 17:00:04 +02:00
parent 1204591cdc
commit 4386392844
23 changed files with 201 additions and 95 deletions

View File

@ -68,16 +68,6 @@ func (a *Assembler) Call(name string) {
})
}
// Jump jumps to a position that is identified by a label.
func (a *Assembler) Jump(name string) {
a.Instructions = append(a.Instructions, Instruction{
Mnemonic: JUMP,
Data: &Label{
Name: name,
},
})
}
// Return returns back to the caller.
func (a *Assembler) Return() {
if len(a.Instructions) > 0 && a.Instructions[len(a.Instructions)-1].Mnemonic == RETURN {