Arm Community
Site
Search
User
Site
Search
User
Groups
Arm Research
DesignStart
Education Hub
Graphics and Gaming
High Performance Computing
Innovation
Multimedia
Open Source Software and Platforms
Physical
Processors
Security
System
Software Tools
TrustZone for Armv8-M
中文社区
Blog
Announcements
Artificial Intelligence
Automotive
Healthcare
HPC
Infrastructure
Innovation
Internet of Things
Machine Learning
Mobile
Smart Homes
Wearables
Forums
All developer forums
IP Product forums
Tool & Software forums
Pelion IoT Platform
Support
Open a support case
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Developer Community
IP Products
Processors
Jump...
Cancel
Processors
Classic processors forum
Of exceptions and aborts..
Blogs
Forums
Videos & Files
Help
Jump...
Cancel
New
State
Accepted Answer
+1
person also asked this
people also asked this
Replies
9 replies
Subscribers
2 subscribers
Views
4265 views
Users
0 members are here
Arm7
Arm7tdmi
Related
Of exceptions and aborts..
Offline
Felix Varghese
over 7 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
Offline
Felix Varghese
over 7 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
Offline
Jack12345 Jack12345
over 7 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
Up
0
Down
Reply
Accept answer
Cancel
Reply
0
Offline
Jack12345 Jack12345
over 7 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
Up
0
Down
Reply
Accept answer
Cancel
Children
No data
More questions in this forum
By title
By date
By reply count
By view count
By most asked
By votes
By quality
Descending
Ascending
All recent questions
Unread questions
Questions you've participated in
Questions you've asked
Unanswered questions
Answered questions
Questions with suggested answers
Questions with no replies
Answered
Program Counter, Stack Pointer and Link Register Status During an Interrupt Service in ARM based Processors
+1
3475
views
2
replies
Latest
over 1 year ago
by
Aman007kc
Answered
ARM Assembly how to print numbers instead of their ascii representation of that number
+1
Armv6
Arm Assembly Language (ASM)
5910
views
2
replies
Latest
over 1 year ago
by
Kanan Jarrus
Not Answered
Why there is no translation tables concatenation for stage 1 of VA translation?
0
1499
views
0
replies
Started
over 1 year ago
by
Uzi Shvadron
Answered
Arm Cortex-A8 program flow prediction
+1
Armv7-A
Cache
Out-of-order Execution
Cortex-A
1789
views
1
reply
Latest
over 1 year ago
by
Andy Neil
Suggested Answer
Shifted binary generated by arm-none-eabi-objcopy
0
GCC
Cortex-A
Cortex-M
Baremetal
4959
views
8
replies
Latest
over 1 year ago
by
en2senpai
<
>
View all questions in Classic processors forum