WTF? Its supposed to be instrinsic. I check the assembler listing and I see the resulting "pop" op-code, yet when the program links it gives the following error: *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: __POP_ MODULE: BLA BLA BLA NOTE: The "Intrins.h" file is included (obviously), and preceeding the _pop_(.), I'm using _push_(.), ...yet push does not produce the error. Info: IDE-Version: µVision2 V2.40a Copyright (c) Keil Elektronik GmbH / Keil Software, Inc. 1995 - 2003 Tool Version Numbers: Toolchain Path: C:\Keil\C51\BIN\ C Compiler: C51.Exe V7.20 Assembler: A51.Exe V7.09 Linker/Locator: BL51.Exe V5.11 Librarian: LIB51.Exe V4.24 Hex Converter: OH51.Exe V2.6 CPU DLL: S8051.DLL V2.43 Dialog DLL: DP51.DLL V2.43
I just tried the following and it seems to work just fine.
#include <intrins.h> sfr XXX = 0xFF; void main (void) { _push_(XXX); XXX = 1; XXX = 2; XXX = 3; _pop_(XXX); while (1); }
I am in fact pushing an SFR, albeit a Philips 66x SFR. Here's the actual code that produced the error.
_push_( IEN0 ); *( (unsigned int *)&commandBuf[ REPLY_DATA ] ) = ISR_max_time; _pop_( IEN0 );
0047 C0A8 PUSH IEN0 ; SOURCE LINE # 435 0049 A3 INC DPTR 004A E500 E MOV A,ISR_max_time 004C F0 MOVX @DPTR,A 004D A3 INC DPTR 004E E500 E MOV A,ISR_max_time+01H 0050 F0 MOVX @DPTR,A ; SOURCE LINE # 436 0051 D0A8 POP IEN0
*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: __POP_ MODULE: .\Output\main.obj (MAIN)
More Info: I think this problem is originating in the compiler rather than the linker, considering the .LST file contains the following symbol reference:
__pop_ . . . . . . . . . . . . . . . . EXTERN CODE PROC ----- -----
( Do I get a cupie doll for finding this? :D ) No. I stopped playing with dolls a long time ago and so should you. :-) I tried V7.20 and sure enough it does generate that warning. It also generates the correct code, so the warning is superfluous, but annoying. C51 V7.50 does not generate the warning and it, too, generates the correct code. Have you tried to download the latest update (V7.50a) and use it? Jon
I hate to bring this up just now, but this problem was already documented in our knowledgebase quite a while ago. http://www.keil.com/support/docs/2847.htm Even I didn't look there first. Jon
Thanks for digging into this and providing an answer. Sorry for not checking the KB. The reason I didn't bother checking is because I assumed 7.20 was the latest and greatest as (I believe) we received the upgrade probably less than two months ago ??? Thanks again. I'll make sure to inform all coworkers.
Do I get a cupie doll for finding this? Just for the sake of pedantry, it's "Kewpie" doll. The spelling is important because it is (or was) a trademark. http://www.badfads.com/pages/collectibles/kewpie.html