News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

x64 conventions

Started by EduardoS, February 18, 2006, 09:32:58 PM

Previous topic - Next topic

EduardoS

Hi,
I ready a little about x64 calling conventions on the microsoft web site, but it's a little confusing, i don't understand very well how this convention works,
Inside any function the stack is 16 bytes aligned (must be right?) like 0xF0 (signed extended, i won't write the other 14 Fs every time).
if this function call another it must pass first 4 parameters in registers, and others in stack, but free the space in stack for this 4 registers (they don't need to be copied to these locations, or need?), then the calle function get the control (i think the stack will be unaligned due to the adress of RIP) and align the stack (is unaligned?), like:

.....
RCX
RDX
R8
R9
ret addr
(8 byte to be aligned)

I don't understand this part, can someone help me?