On Friday, 4 March 2022 at 17:18:56 UTC, rempas wrote:
When I try to compile, I'm getting the following error message:

```
source/time.d: In function ‘sys_clock_nanosleep’:
source/time.d:132:31: error: matching constraint references invalid operand number
  132 |       : "memory", "rcx", "r11";
```

Any ideas?

GCC doesn't have constraints for registers %r8 .. %15. As D doesn't have register variables either, you'll have to set-up r10 in the instruction string.
```
asm {
  "mov %[rem], %%r10; syscall"
  : "=a" (ret_code)
: "a" (230), "D" (clock), "S" (flags), "d" (req), [rem] "r" (rem)
  : "memory", "rcx", "r10", "r11";
}
```

Reply via email to