21 lines
390 B
Go
21 lines
390 B
Go
package z
|
|
|
|
import (
|
|
"git.akyoto.dev/cli/q/src/build/asm"
|
|
"git.akyoto.dev/cli/q/src/build/cpu"
|
|
)
|
|
|
|
func (f *Compiler) RegisterNumber(mnemonic asm.Mnemonic, a cpu.Register, b int) {
|
|
if f.CurrentScope().IsUsed(a) && isDestructive(mnemonic) {
|
|
f.SaveRegister(a)
|
|
}
|
|
|
|
f.Assembler.RegisterNumber(mnemonic, a, b)
|
|
|
|
if mnemonic == asm.MOVE {
|
|
f.CurrentScope().Use(a)
|
|
}
|
|
|
|
f.postInstruction()
|
|
}
|