This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

error for a reentrant function when generate assembler source file option is active

Hi,
I've used the following code for onecyle delays :

	#pragma asm
	nop;//;simple delay
	#pragma endasm

So in the options tab of the file that contains the function I checked "generate assembler source file" & "Assemble source file".
Till now I've no problem (no error)
In the same file I've another function that is called from main & isr so a warnig is generated.
To avoid this I made the function reentrant & configured the reentrant stack -including STARTUP.A51 & modifiying it as follows:
;  Stack Space for reentrant functions in the LARGE model.
XBPSTACK        EQU     1;0       ; set to 1 if large reentrant is used.
XBPSTACKTOP     EQU     300h;0FFFFH+1; set top of stack to highest location+1.

that results in: error A45: UNDEFINED SYMBOL (PASS-2)
it mentions to the following code in the .src file that the compiler has generated
	LCALL	?C0023

What's wrong ?!!
Thanks for your attention in advance

  • Instead of this:

    #pragma asm
    nop;//;simple delay
    #pragma endasm
    

    Why don't you use the __nop__() intrinsic function? It doesn't require that you generate a SRC file.

    Jon

  • Hi
    Thanks Jon for your hint.
    Could you tell me why activating the .SRC generation option results in the error?
    Is the procedure I've gone through for making my function reentrant correct?

    Best Regards,
    A.E.

  • Could you tell me why activating the .SRC generation option results in the error? Is the procedure I've gone through for making my function reentrant correct?

    I don't know. I haven't seen the source code and Ihaven't seen the procedure. So, I can't really comment on either. IF you want help with that kind of stuff, maybe you should contact technical support.

    Jon