The MASM Forum

General => The Campus => Topic started by: dusty on February 27, 2013, 02:11:37 AM

Title: lost variable
Post by: dusty on February 27, 2013, 02:11:37 AM
c++ function = void tryme(struct * astruct, char * cpnt, char* cdesc, double d1, double d2, double d3)

astruct is in rcx
cpnt is in rdx
cdest is in R8

but

d1 is in xmm3
d2 is in xmm0
what the heck happened to d3 ?

I looked in my pockets and under the bed  ::)

Title: Re: lost variable
Post by: qWord on February 27, 2013, 02:37:55 AM
assuming M$ FASTCALL, only the first 4 arguments are passed in registers. Therefore d2 is passed on the stack and xmm0 "accidentally" contain that value (probably it was used to store/copy the value). d1 is placed as 4. FP argument in xmm3.