문제

Of all possibilities in which the PC (program counter) register changes I found these:

1) PC increases its value with loading new instruction
2) with jumps and branches
3) with calling subroutine
4) with return from subroutine

Are those all or am I missing something?

I come from this article.

도움이 되었습니까?

해결책

There are a few more:

  • Hardware interrupts change PC to execute interrupt service routines and then return to the interrupted program.
  • Exceptional situations (exceptions like division by 0 or page fault) change PC in a similar fashion.
  • Debug interrupts do that too.
  • System calls (their invocation and return) change PC as well.

다른 팁

I believe that that is all, assuming non-local jumps are included as part of 2 (e.g. setjmp, longjmp).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top