AnsweredAssumed Answered

facing issue with assembly instruction mtmsr

Question asked by Lakshmanan K on Jul 15, 2013
Latest reply on Jul 16, 2013 by Lakshmanan K

Hi All


I am facing some issue with mtmsr assembly instruction while trying to write into msr register of MPC8641D.


below is my code which is compiling successfully but get runtime error as illegal instruction.




register long toMSR;
register long fromMSR;


asm ("mfmsr %0;"

              : "=r" (fromMSR)  // output operand


printf("after mfmsr");


asm("mtmsr %0;"

           : "r" (toMSR) // input operand


printf(" after mtmsr");



after mfmsr

illegal instruction -- error



what could be the possible error in the above code?

is the syntax is correct?