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

Set program counter

Hi,
how can i set program counter from variable in C code?

void func(void)
{
  uint32_t XADDR;
  XADDR = __current_pc();
  ...
  // need set PC from XADDR
  // msr pc, XADDR not compiled
}

Thanks in advance

Parents
  • It probably wouldn't get enough market shares that you need to intentionally avoid it.

    The ones who need to play interesting games with the PC outside of what a normal function call, a function pointer, loop constructs, if/case conditionals, a throw/catch or maybe long-jumps allows, are busy writing operating systems - and they don't need to ask a web forum how to do it.

    Assembler is the tool of choice for people who wants to "own" the PC.

Reply
  • It probably wouldn't get enough market shares that you need to intentionally avoid it.

    The ones who need to play interesting games with the PC outside of what a normal function call, a function pointer, loop constructs, if/case conditionals, a throw/catch or maybe long-jumps allows, are busy writing operating systems - and they don't need to ask a web forum how to do it.

    Assembler is the tool of choice for people who wants to "own" the PC.

Children