0

From here for register order in System V calling conventions they suggest the mnemonic:

%rdi:   Diane's
%rsi:   Silk
%rdx:   dress
%rcx:   costs <------------ ???
%r8:    $8
%r9:    9

But in my understanding, the 4th register is r10, or am I incorrect in this? My source is: https://chromium.googlesource.com/chromiumos/docs/+/master/constants/syscalls.md#calling-conventions.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
samuelbrody1249
  • 4,379
  • 1
  • 15
  • 58
  • 3
    Your first link is the calling convention for regular functions, and your second link is the convention for system calls. The syscall convention can't be the same because the `syscall` instruction implicitly stores the calling address in `rcx`. – Nate Eldredge Oct 16 '20 at 04:18
  • @NateEldredge I see, thank you. So when I write an internal function in assembly I should be using `rcx` (and not `r10`) for the 4th param? – samuelbrody1249 Oct 16 '20 at 04:25
  • 2
    Yes, that's correct. – Nate Eldredge Oct 16 '20 at 05:17

0 Answers0