I have a reentrant function that is passed a single parameter as follows:
void Filt_QR ( FilterDataType * FilterData ) reentrant { unsigned char aucTemp40[5]; memcpy( aucTemp40, /* void * dest */ FilterData->aucYpterm_40, /* void * src */ 5); /* int len */ ...
Did you initialize the reentrant stack pointer in the STARTUP.A51 file?
Reentrant function and memcpy() Are you sure the '51 is the right chip for you? You are using two things that the '51 is singularily lousy at. Erik
Yes, the stack pointer is set up correctly. As to selection of the 8051, this is what I am stuck with. It is a Mentor Graphics E-Warp core in a custom ASIC (on-chip 24-bit A/D). Just can't figure out why it doesn't like to apply the correct address to local variables...
By the way, I'm using uVision2 V2.38a, C Compiler V7.06.
Please send your test code to support.intl@keil.com
Can you post the assembler code generated for this function from the .lst file? By "always gets the destination wrong", you mean "not anywhere in the reentrant stack"? What happens if you do this:
void Filt_QR ( FilterDataType * FilterData ) reentrant { unsigned long aucTemp40_4; unsigned char aucTemp40_1; memcpy( &aucTemp40_4, /* void * dest */ FilterData->aucYpterm_40, /* void * src */ 5); /* int len */