Click to See Complete Forum and Search --> : passing parameters


GeoHoffman49431
March 23rd, 2006, 10:20 AM
If I have a c program with the main function and it is calling a subroutine in assembly how do I get the parameters passed? It is for SPARC processor. If the parameter is an int I can get it (it is passed in register 24). But if it is a double then it is not going to register 24 (probably because it is a double and does not fit in a register). How get the double that is passed in as a parameter? Off the stack?

GeoHoffman49431
March 23rd, 2006, 01:59 PM
figured it out myself. I had in the header file that the parameter was a float so it was being type cast and placed in only one register. Now it is passed as a 64 bit double and is passed in as 2 registers (%r24 and %r25).