diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-11-29 17:17:35 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-11-29 17:17:35 -0800 |
commit | 3e30d5aefe59deba3da2aacccfd95aa24e31ae1c (patch) | |
tree | 78cbf6a878cb75cfc20d8bb23074d97cbab2fbc9 /doc/nasmdoc.src | |
parent | 52b4d6d7b015555ba2e6f1b060fef5d1cfadfbbe (diff) | |
download | nasm-3e30d5aefe59deba3da2aacccfd95aa24e31ae1c.tar.gz nasm-3e30d5aefe59deba3da2aacccfd95aa24e31ae1c.tar.bz2 nasm-3e30d5aefe59deba3da2aacccfd95aa24e31ae1c.zip |
Give an example on how Unix and Win64 count argument differently
Diffstat (limited to 'doc/nasmdoc.src')
-rw-r--r-- | doc/nasmdoc.src | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/nasmdoc.src b/doc/nasmdoc.src index 8a6c2b0..734e72b 100644 --- a/doc/nasmdoc.src +++ b/doc/nasmdoc.src @@ -6456,6 +6456,12 @@ All SSE and x87 registers are destroyed by function calls. On 64-bit Unix, \c{long} is 64 bits. +Integer and SSE register arguments are counted separately, so for the case of + +\c void foo(long a, double b, int c) + +\c{a} is passed in \c{RDI}, \c{b} in \c{XMM0}, and \c{c} in \c{ESI}. + \H{win64} Interfacing to 64-bit C Programs (Win64) The Win64 ABI is described at: @@ -6478,6 +6484,12 @@ return is \c{XMM0} only. On Win64, \c{long} is 32 bits; \c{long long} or \c{_int64} is 64 bits. +Integer and SSE register arguments are counted together, so for the case of + +\c void foo(long long a, double b, int c) + +\c{a} is passed in \c{RCX}, \c{b} in \c{XMM1}, and \c{c} in \c{R8D}. + \C{trouble} Troubleshooting This chapter describes some of the common problems that users have |