AnsweredAssumed Answered

How to use General purpose registers in C code with MPC574x?

Question asked by Kshitij Dadhekar on Aug 1, 2019
Latest reply on Aug 5, 2019 by Kshitij Dadhekar

I am trying to port the MC33771 library which was written for S32K144(ARM architecture) to a MPC574x(Power architecture) controller. A piece of MC33771's sample code in bcc_wait.c is writtten in assembly where it waits for cycles in multiples of 4.



From the Power architecture instruction set I understand that "movs" needs to be changed to "mr" or some other equivalent instruction and "r0" can be a general-purpose register like GPR0 to GPR31.

But when I try to use GPR0-31 it throws a relocation error

Martin Kovar Tomas Vaverka



1. What is the correct syntax to use the GPR registers inline with C-code?

2. What are other ways to count cycles in MPC574x? 

Thanks in advance