I'm trying to call a golang function from my C code. Golang does not use the standard x86\_64 calling convention, so I have to resort to implementing the transition myself. As gcc does not want to mix cdecl with the x86\_64 convention,
I'm trying to call the function using inline assembly:

```
void go_func(struct go_String filename, void* key, int error){
    void* f_address = (void*)SAVEECDSA;
    asm volatile("  sub     rsp, 0xe0;           \t\n\
                    mov     [rsp+0xe0], rbp;   \t\n\
                    mov     [rsp], %0;            \t\n\
                    mov     [rsp+0x8], %1;       \t\n\
                    mov    [rsp+0x18], %2;       \t\n\
                    call    %3;                     \t\n\
                    mov     rbp, [rsp+0xe0];   \t\n\
                    add     rsp, 0xe0;"          
                    :
                    : "g"(filename.str), "g"(filename.len), "g"(key), "g"(f_address)
                    : );
    return;
}

```

Sadly the compiler always throws an error at me that I dont understand:

```
./code.c:241: Error: too many memory references for `mov'

```

This corresponds to this line: `mov [rsp+0x18], %2; \t\n\` If I delete it, the compilation works. I don't understand what my mistake is...

I'm compiling with the -masm=intel flag so I use Intel syntax. Can someone please help me?