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

How can i read R0 register?

I need information about task stack (R0).
How can i read R0 register?
Is it correct?

unsigned int Addr_0;
//************************************
void taskSupervisor (void) _task_ TSK_CONTROLLER _priority_ 2
{
#pragma asm
MOV WORD Addr_0,R0
#pragma endasm
RTXDebug[TSK_CONTROLLER] = (Addr_0);
.....



I

  • There is no need to resort to assembler here. In the C16x architecture, all registers are memory mapped. The address of R0 is stored in register CP (context pointer). So you can access R0 like so:

    #include <reg167.h>
    
    ...
    
    r0_val = *(unsigned int volatile sdata*)CP;
    
    You really should familiarize yourself with the C16x architecture if you are writing code for this microcontroller.

    Regards,
    - mike