Improved code generation
This commit is contained in:
parent
75672c1e16
commit
0a661b4345
9 changed files with 70 additions and 23 deletions
|
@ -27,7 +27,8 @@ func (f *Function) SaveRegister(register cpu.Register) {
|
|||
return
|
||||
}
|
||||
|
||||
newRegister := f.cpu.MustUseFree(f.cpu.General)
|
||||
newRegister := f.cpu.MustFindFree(f.cpu.General)
|
||||
f.cpu.Use(newRegister)
|
||||
|
||||
if config.Comments {
|
||||
f.assembler.Comment(fmt.Sprintf("save %s to %s", register, newRegister))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue