Improved tokenizer

This commit is contained in:
2023-10-31 21:13:14 +01:00
parent 5c12992fca
commit c4b28fb66e
10 changed files with 57 additions and 53 deletions

View File

@ -1,23 +0,0 @@
package build
import (
"git.akyoto.dev/cli/q/src/asm"
"git.akyoto.dev/cli/q/src/linux"
"git.akyoto.dev/cli/q/src/register"
)
// Finalize generates the final machine code.
func (build *Build) Finalize(functions map[string]*Function) ([]byte, []byte) {
a := asm.New()
for _, f := range functions {
a.Merge(&f.Assembler)
}
a.MoveRegisterNumber(register.Syscall0, linux.Exit)
a.MoveRegisterNumber(register.Syscall1, 0)
a.Syscall()
code, data := a.Finalize(build.Verbose)
return code, data
}