Improved code generation
This commit is contained in:
parent
6e22febc01
commit
3c189a025f
23 changed files with 201 additions and 95 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue