Hi, I'm looking at calling an ASM routine from some C code. I'd like to pass some parameters into the ASM routine, and have it return a value. I don't believe function arguments are passed on the stack, but am not sure of the general mechanism that is used. Any advice? Thanks David
Take a look at the following URL: http://www.keil.com/support/docs/50.htm Jon
A very easy way to do this is to write a skeleton function in "C", the using SRC get the assembly code, cut and paste, insert the assembly guts and voils! you have it. Erik
I agree with you, however, this does not mean you have an authoritative document on the C51 ABI. You can grab a copy of the PowerPC EABI spec. for an example of what an ABI spec. should detail. I'll put the file on my website if anyone cares. Should I write an ABI document for C51? - Mark
This is already well documented in the C51 User's Guide. Jon
"This is already well documented in the C51 User's Guide." One thing missing from the User's Guide (and noted some time back on this forum) is how C51 implements returning a struct from a function. Also, is there a definitive statement of how C51 handles assigning a larger value (eg, char, int) to a bit? We've had some guesses & opinions at http://www.keil.com/forum/docs/thread1315.asp - but what is the defined behaviour?
A struct that is returned from a function:
struct bob_st func (void) { . . . }
void func (struct bob_st) { . . . }
View all questions in Keil forum