Improved separation of concerns

This commit is contained in:
Eduard Urbach 2024-07-23 16:41:21 +02:00
parent dc5456b820
commit abba962455
Signed by: eduard
GPG key ID: 49226B848C78F6C8
36 changed files with 243 additions and 236 deletions

16
src/build/z/Register.go Normal file
View file

@ -0,0 +1,16 @@
package z
import (
"git.akyoto.dev/cli/q/src/build/asm"
"git.akyoto.dev/cli/q/src/build/cpu"
)
func (f *Compiler) Register(mnemonic asm.Mnemonic, a cpu.Register) {
f.Assembler.Register(mnemonic, a)
if mnemonic == asm.POP {
f.CurrentScope().Use(a)
}
f.postInstruction()
}