This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Accessing the R13, R14 & R15 Registers for ARM7

Hi, I had written a function for accessing the Special Registers like R13, R14 & R15..
Here Im using LPC2387 controller and the Keil UVsion 3. Its compiled successfully when im entering into deubug mode its starts executing itself. So Im not able to see the register contents So can any one help me how to stop running(default) it in debug mode. If there are any bugs please tell me how to rectify

Thanks in Advance


#include <LPC23xx.H>
void printReg(void);

int main()
{
    printReg();
    while(1);
}


void printReg(void)
{
    unsigned int spReg, lrReg, pcReg;
    __asm
    {
        MOV spReg, __current_sp()
        MOV pcReg, __current_pc()
        MOV lrReg, __return_address()
    }
    printf("SP = 0x%X\n",spReg);
    printf("PC = 0x%X\n",pcReg);
    printf("LR = 0x%X\n",lrReg);
}