Improved assembler
This commit is contained in:
@ -20,8 +20,8 @@ func (c *CPU) IsFree(reg Register) bool {
|
||||
return c.usage&(1<<reg) == 0
|
||||
}
|
||||
|
||||
func (c *CPU) FindFree() (Register, bool) {
|
||||
for _, reg := range c.General {
|
||||
func (c *CPU) FindFree(registers []Register) (Register, bool) {
|
||||
for _, reg := range registers {
|
||||
if c.IsFree(reg) {
|
||||
return reg, true
|
||||
}
|
||||
|
Reference in New Issue
Block a user