This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Assembler instruction not working ok!

 

I tried the following instruction to push a structure member (with based on PUSH loc16 (page 6-291 of spru430).  XAR5 is pointer to the structure MYSTRUCT and member2 is a 16 bit quantity. I was basically trying to save (one additional instruction) a read into a intermediate register. It assembles OK. But it is not producing the intended effect. What is happening? Can someone explain.

 PUSH *+XAR5[MYSTRUCT.member2]

 POP *+XAR5[MYSTRUCT.member3]
Thanks
Sayee

 

  • This is what should occur for the PUSH.  The memory contents at the address (XAR5 + the offset of member2 in MYSTRUCT) are copied to the memory address in the SP, then the SP is incremented by one.  Do you see something else occurring?

    Thanks and regards,

    -George

  • George,

    Please note that I found this only in simulator mode. The watch window variable (structure member) is not updated (and shown to retain the current) after the pop instruction is executed. So I presumed that PUSH as well is not working. If I force an instruction after the pop to clear the source (originally, PUSHed member), then the effect of POP is also shown for that instruction.

    It is a bug only in simulation and in fact it is the POP that is problematic (it also takes additional F11 - "single-step" keystrokes as well). Not visually updating the affected item.!

    I hope you can recreate the .

    Sayee