Added fibonacci example
This commit is contained in:
@ -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{
|
||||
|
Reference in New Issue
Block a user