Arm Community
Site
Search
User
Site
Search
User
Groups
Education Hub
Open Source Software and Platforms
Research Collaboration and Enablement
Forums
AI and ML forum
Architectures and Processors forum
Arm Development Platforms forum
Arm Development Studio forum
Arm Virtual Hardware forum
Automotive forum
Compilers and Libraries forum
Graphics, Gaming, and VR forum
High Performance Computing (HPC) forum
Infrastructure Solutions forum
Internet of Things (IoT) forum
Keil forum
Morello forum
Operating Systems forum
SoC Design and Simulation forum
SystemReady Forum
Blogs
AI and ML blog
Announcements
Architectures and Processors blog
Automotive blog
Graphics, Gaming, and VR blog
High Performance Computing (HPC) blog
Infrastructure Solutions blog
Internet of Things (IoT) blog
Operating Systems blog
SoC Design and Simulation blog
Tools, Software and IDEs blog
Support
Arm Support Services
Documentation
Downloads
Training
Arm Approved program
Arm Design Reviews
Community Help
More
Cancel
Support forums
Architectures and Processors forum
CPSR status back to C variable
Jump...
Cancel
State
Not Answered
Locked
Locked
Replies
3 replies
Subscribers
349 subscribers
Views
6123 views
Users
0 members are here
Arm7
Compilers
C
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
CPSR status back to C variable
Luken8r Luken8r
over 10 years ago
Note: This was originally posted on 17th November 2008 at
http://forums.arm.com
Im using the TI Code Composer suite with an ARM 7 and Im looking for a way to get the CPSR back into a C variable. I was looking through the documentation that came with the compiler and it didnt have quite what I was looking for. What Im looking for is the state of the interrupt disable bit. I need to use this bit as a condition variable for something like:
if (interrupts enabled){
do this
}
the inline asm syntax is just
asm("assembly");
The problem is, Im not sure how to associate some C variable to the asm code to pass the CPSR back to the C code flow. Ive used other compilers in the past that have an option to pass arguments to the asm code like
_asm("tfr b, ccr",foo);
which passes the condition code register (for an HC12) to the var foo, but this compiler does not have that capability. How would I do the above with this compiler?
Parents
0
Peter Harris
over 10 years ago
Note: This was originally posted on 17th November 2008 at
http://forums.arm.com
I don't know anything about the TI compiler syntax, but the assembler instruction you are looking for is the "MSR" (move to status register from register) and "MRS" (move to register from status register).
Cancel
Up
0
Down
Cancel
Reply
0
Peter Harris
over 10 years ago
Note: This was originally posted on 17th November 2008 at
http://forums.arm.com
I don't know anything about the TI compiler syntax, but the assembler instruction you are looking for is the "MSR" (move to status register from register) and "MRS" (move to register from status register).
Cancel
Up
0
Down
Cancel
Children
No data