Improved tokenizer
This commit is contained in:
parent
8549aedc60
commit
8de28852cd
10 changed files with 57 additions and 53 deletions
|
@ -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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue