Added basic support for arm64
This commit is contained in:
parent
cc1c990dc8
commit
dfe807c2e2
25 changed files with 270 additions and 33 deletions
|
@ -5,14 +5,14 @@ import "git.urbach.dev/cli/q/src/cpu"
|
|||
// Call places the return address on the top of the stack and continues
|
||||
// program flow at the new address.
|
||||
// The address is relative to the next instruction.
|
||||
func Call(code []byte, address uint32) []byte {
|
||||
func Call(code []byte, offset uint32) []byte {
|
||||
return append(
|
||||
code,
|
||||
0xE8,
|
||||
byte(address),
|
||||
byte(address>>8),
|
||||
byte(address>>16),
|
||||
byte(address>>24),
|
||||
byte(offset),
|
||||
byte(offset>>8),
|
||||
byte(offset>>16),
|
||||
byte(offset>>24),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -30,4 +30,13 @@ var (
|
|||
WindowsInputRegisters = []cpu.Register{RCX, RDX, R8, R9}
|
||||
WindowsOutputRegisters = []cpu.Register{RAX}
|
||||
WindowsVolatileRegisters = []cpu.Register{RCX, RDX, R8, R9, R10, R11}
|
||||
|
||||
CPU = cpu.CPU{
|
||||
General: GeneralRegisters,
|
||||
Input: InputRegisters,
|
||||
Output: OutputRegisters,
|
||||
SyscallInput: SyscallInputRegisters,
|
||||
SyscallOutput: SyscallOutputRegisters,
|
||||
NumRegisters: 16,
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue