Hi everyone!

I'm just setting up my environment to start developing also on my laptop, but 
I'm facing some problems compiling asm code that has variables on it in Apple 
silicon processors.

For example, in this case:
    
    
    var syscall*  : WORD
    
    proc NtAllocateVirtualMemory(ProcessHandle: HANDLE, BaseAddress: PVOID, 
ZeroBits: ULONG, RegionSize: PSIZE_T, AllocationType: ULONG, Protect: ULONG): 
NTSTATUS {.asmNoStackFrame.} =
        asm """
            mov r10, rcx
            mov eax, `syscall`
            syscall
            ret
        """
    
    
    Run

I get the following error when trying to compile with the following flags `nim 
c -d=mingw --app=console --cpu=amd64 HalosGate.nim`:
    
    
    relocation truncated to fit: R_X86_64_32S against `.bss`
    
    
    Run

The error only shows when I am using the special character "`" to include a 
variable inside asm code, basically when getting the syscall value.

Full code for debugging can be found in the following GitHub: 
<https://github.com/zimawhit3/HellsGateNim>

Reply via email to