Arm Community
Site
Search
User
Site
Search
User
Support forums
Architectures and Processors forum
Of exceptions and aborts..
Jump...
Cancel
State
Accepted Answer
+1
person also asked this
people also asked this
Locked
Locked
Replies
9 replies
Subscribers
349 subscribers
Views
9040 views
Users
0 members are here
Arm7
Arm7tdmi
Options
Share
More actions
Cancel
Related
How was your experience today?
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
Of exceptions and aborts..
Felix Varghese
over 12 years ago
Note: This was originally posted on 21st January 2009 at
http://forums.arm.com
The ARM reference manual specifies sometimes MOV PC,R14 and sometimes SUBS PC,R14, #4 for returning from exceptions. But they have not mentioned why. Can somebdy expain?
Also, when exactly does the PC get incremented? During the Fetch ?
And exactly when (Fetching / Decoding / Executing) does an exception get generated?
Does an undefined instruction get generated when the instruction is decoded or when it is executed?
What about Data and Prefetch aborts?
Top replies
Felix Varghese
over 12 years ago
+1
verified
Note: This was originally posted on 10th February 2009 at http://forums.arm.com The core is ARM7TDMI. Yes, they've given the return instruction for each exception. I was just looking for an explanation...
Parents
0
Jack12345 Jack12345
over 12 years ago
Note: This was originally posted on 29th January 2009 at
http://forums.arm.com
The ARM reference manual specifies sometimes MOV PC,R14 and sometimes SUBS PC,R14, #4 for returning from exceptions. But they have not mentioned why. Can somebdy expain?
Ans:
SUBS PC,R14, #4 , this instruction is used for debugging. After the execution of this instruction , pc will point to the instruction which caused the exception. Hence one can debug the cause of exception.
Mov pc, lr is intended to be the last instruction off all the subroutines. Execution of this instruction is similar to a return statement in C.
Cancel
Vote up
0
Vote down
Cancel
Reply
0
Jack12345 Jack12345
over 12 years ago
Note: This was originally posted on 29th January 2009 at
http://forums.arm.com
The ARM reference manual specifies sometimes MOV PC,R14 and sometimes SUBS PC,R14, #4 for returning from exceptions. But they have not mentioned why. Can somebdy expain?
Ans:
SUBS PC,R14, #4 , this instruction is used for debugging. After the execution of this instruction , pc will point to the instruction which caused the exception. Hence one can debug the cause of exception.
Mov pc, lr is intended to be the last instruction off all the subroutines. Execution of this instruction is similar to a return statement in C.
Cancel
Vote up
0
Vote down
Cancel
Children
No data