Added fibonacci example

This commit is contained in:
2024-07-09 10:28:14 +02:00
parent 1c019297d2
commit 5cbc3315a7
11 changed files with 107 additions and 16 deletions

View File

@ -47,6 +47,7 @@ func (f *Function) AddVariable(variable *Variable) {
}
f.variables[variable.Name] = variable
f.cpu.Reserve(variable.Register)
f.cpu.Use(variable.Register)
}
@ -85,6 +86,7 @@ func (f *Function) storeVariableInRegister(name string, value *expression.Expres
panic("no free registers")
}
f.cpu.Reserve(reg)
err := f.ExpressionToRegister(value, reg)
f.AddVariable(&Variable{