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

how to use _push_(); _pop_();

hi,everybody,I'm using keil7.20,uvision3.and I have an ok project.but when I added
_push_(DPH);
_pop_(DPH);
to my main() func,
an err always ocurrs:
Build target 'Target 1'
linking...
*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
SYMBOL: __POP_
MODULE: Main.obj (MAIN)
Program Size: data=98.0 xdata=0 code=1730
creating hex file from "reset"...
"reset" - 0 Error(s), 1 Warning(s).

if move away _pop_(DPH);and everything will be ok;so I'm really confused. I think the to use _push_(); and _pop_(); are same. But what's going on with this?
waiting for your help and answers.

Parents
  • guys, thank you for ur replies.
    But now the situation is:
    first,I did include the header file: intrins.h in my main.c file.
    next,It's just ok for _push_(); but _pop_(); has the problem:(,I mean the linker could find _push_(); func prototype,why not for _pop_(); I check the asm file,just _push_(DPH);[PUSH DPH;] there,no _pop_();[POP DPH] at all:(,
    and what's more faint is: I did nothing ,but just build the target several times. and guys, guess what happened. the warning is still there:
    *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL: __POP_
    MODULE: Main.obj (MAIN)
    Program Size: data=98.0 xdata=0 code=1730
    creating hex file from "reset"...
    "reset" - 0 Error(s), 1 Warning(s).
    but the asm code is like this:
    112: InitSYS(); // initialize system;
    C:0x0581 120695 LCALL InitSYS(C:0695)
    113: _push_(DPH);
    C:0x0584 C083 PUSH DPH(0x83)
    114: _pop_(DPH);
    C:0x0586 D083 POP DPH(0x83)
    115: SetRxMode();
    C:0x0588 1206B5 LCALL SetRxMode(C:06B5)
    there it is,there POP DPH is!,so what's wrong with the compiler or with me?

    and thank you for your replies again.:)

Reply
  • guys, thank you for ur replies.
    But now the situation is:
    first,I did include the header file: intrins.h in my main.c file.
    next,It's just ok for _push_(); but _pop_(); has the problem:(,I mean the linker could find _push_(); func prototype,why not for _pop_(); I check the asm file,just _push_(DPH);[PUSH DPH;] there,no _pop_();[POP DPH] at all:(,
    and what's more faint is: I did nothing ,but just build the target several times. and guys, guess what happened. the warning is still there:
    *** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL: __POP_
    MODULE: Main.obj (MAIN)
    Program Size: data=98.0 xdata=0 code=1730
    creating hex file from "reset"...
    "reset" - 0 Error(s), 1 Warning(s).
    but the asm code is like this:
    112: InitSYS(); // initialize system;
    C:0x0581 120695 LCALL InitSYS(C:0695)
    113: _push_(DPH);
    C:0x0584 C083 PUSH DPH(0x83)
    114: _pop_(DPH);
    C:0x0586 D083 POP DPH(0x83)
    115: SetRxMode();
    C:0x0588 1206B5 LCALL SetRxMode(C:06B5)
    there it is,there POP DPH is!,so what's wrong with the compiler or with me?

    and thank you for your replies again.:)

Children
No data