Using the GNU Tools, i can output the value of PC (R15) using the following code: //Declaring Variable register unsigned int R15 asm ("pc"); //Outputing the value printf("The Current location of the Program Counter is : 0x%08X\n","PC"); When I change to using Keil Tools however, this no longer works, I get errors with the variable definition. Does anyone know how I can make this work using the Keil compiler Tools?
Apologies, the original line i posted: printf("The Current location of the Program Counter is : 0x%08X\n","PC"); was incorrect, it should have read printf("The Current location of the Program Counter is : 0x%08X\n",R15); i had changed the line as an experiment to try get the code working and forgot to change it back