Fixed volatile registers on external calls

This commit is contained in:
Eduard Urbach 2025-02-12 12:47:08 +01:00
parent 2203b124b7
commit 77d354936c
Signed by: eduard
GPG key ID: 49226B848C78F6C8
2 changed files with 32 additions and 8 deletions

View file

@ -22,12 +22,13 @@ const (
)
var (
AllRegisters = []cpu.Register{RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15}
SyscallInputRegisters = []cpu.Register{RAX, RDI, RSI, RDX, R10, R8, R9}
SyscallOutputRegisters = []cpu.Register{RAX, RCX, R11}
GeneralRegisters = []cpu.Register{RCX, RBX, R11, R12, R13, R14, R15, RBP}
InputRegisters = SyscallInputRegisters
OutputRegisters = SyscallInputRegisters
WindowsInputRegisters = []cpu.Register{RCX, RDX, R8, R9}
WindowsOutputRegisters = []cpu.Register{RAX}
AllRegisters = []cpu.Register{RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI, R8, R9, R10, R11, R12, R13, R14, R15}
SyscallInputRegisters = []cpu.Register{RAX, RDI, RSI, RDX, R10, R8, R9}
SyscallOutputRegisters = []cpu.Register{RAX, RCX, R11}
GeneralRegisters = []cpu.Register{RBX, R12, R13, R14, R15, RCX, R11, RBP}
InputRegisters = SyscallInputRegisters
OutputRegisters = SyscallInputRegisters
WindowsInputRegisters = []cpu.Register{RCX, RDX, R8, R9}
WindowsOutputRegisters = []cpu.Register{RAX}
WindowsVolatileRegisters = []cpu.Register{RCX, RDX, R8, R9, R10, R11}
)