Skip to main content
jduo.1
Associate
July 22, 2021
Question

About PUSH POP instructions。

  • July 22, 2021
  • 3 replies
  • 1717 views

I test push and pop instruction,some issue confuse me. ​

push cc #cc = 0

​

​when cc=0,and cc is push to stack,the value in stack is 0x28,this mean I1 I0 is set,why?

​

​

pop cc​ #cc=0

​

when​ cc in stack is 0x2b,after pop,cc change to be 0x3 ,this mean I1 I0 is cleared auto,why?

​

the behave is correct?Please help me.

thanks.​

    This topic has been closed for replies.

    3 replies

    SBEN .2
    Visitor II
    July 22, 2021

    Hello @jduo.1​ ,

    0693W00000D0JDGQA3.pngAre you sur that no interrupt happened while you're stepping?

    Could you disable the interrupts using SIM and retest your code?

    0693W00000D0JETQA3.png 

    Disclaimer: I've never used STM8, I've just skimmed through PM0044.

    Best regards,

    @SBEN .2​ 

    jduo.1
    jduo.1Author
    Associate
    July 22, 2021

    I use STVD to debug, the program is not exsit ....

    maybe this is caused by stm8-gdb.

    jduo.1
    jduo.1Author
    Associate
    July 22, 2021

    thank you very much