Added CPU type
This commit is contained in:
@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"git.akyoto.dev/cli/q/src/build/arch/x64"
|
||||
"git.akyoto.dev/cli/q/src/build/asm"
|
||||
"git.akyoto.dev/cli/q/src/build/cpu"
|
||||
"git.akyoto.dev/cli/q/src/build/expression"
|
||||
"git.akyoto.dev/cli/q/src/build/fs"
|
||||
"git.akyoto.dev/cli/q/src/build/token"
|
||||
@ -21,6 +21,7 @@ type Function struct {
|
||||
Body token.List
|
||||
Variables map[string]*Variable
|
||||
Assembler asm.Assembler
|
||||
CPU cpu.CPU
|
||||
Error error
|
||||
}
|
||||
|
||||
@ -169,12 +170,12 @@ func (f *Function) CompileFunctionCall(expr *expression.Expression) error {
|
||||
}
|
||||
|
||||
n, _ := strconv.Atoi(variable.Value.Token.Text())
|
||||
f.Assembler.MoveRegisterNumber(x64.SyscallArgs[i], uint64(n))
|
||||
f.Assembler.MoveRegisterNumber(f.CPU.Syscall[i], uint64(n))
|
||||
|
||||
case token.Number:
|
||||
value := parameter.Token.Text()
|
||||
n, _ := strconv.Atoi(value)
|
||||
f.Assembler.MoveRegisterNumber(x64.SyscallArgs[i], uint64(n))
|
||||
f.Assembler.MoveRegisterNumber(f.CPU.Syscall[i], uint64(n))
|
||||
|
||||
default:
|
||||
panic("Unknown expression")
|
||||
|
Reference in New Issue
Block a user