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 ----- -----
View all questions in Keil forum