OpenCores
Issue List
PUSH/POP SR bug #4
Closed iiahim opened this issue over 13 years ago
iiahim commented over 13 years ago

Based on the TI documentation when a 'push' instruction is executed 1st thing that happens is R1(stack pointer) decremented by 2. The current (svn 100) openmsp430 is fetching the data from RAM //prior// R1 update.

e.g. the code: push 4(r1) push 4(r1)

should replicate last 2 elements from the stack.

gcc is generating such a code ... programs will fail to execute correctly.

iiahim

olivier.girard commented over 13 years ago

Hi Mihai,

Thanks a lot for the report. That was a tricky one :-P

I had a closer look and the bug occurs only when the push instruction is executed with the stack pointer (SR/R1) as an operand with an addressing mode which is either:

  • indexed mode: PUSH x(R1)
  • indirect register mode: PUSH @R1
  • indirect autoincrement: PUSH @R1+

This bug will be fixed shortly.

Thanks again, Olivier

olivier.girard commented over 13 years ago

Fixed in SVN revision 102

olivier.girard closed this over 13 years ago
olivier.girard commented over 13 years ago

It is to be noted that the POP instruction is not concerned by this bug.


Assignee
No one
Labels
Bug