Syntax: MSR {<cond>} <CPSR | SPSR>_<fields>, <value> | <operand1>
Operation: chosen PSR = old chosen PSR + selective changes
Flags: Depandant on <field>
This instruction transfers the <immediate> or <operand1> into the chosen fields of the CPSR or SPSR.
Fields:
c the control field (PSR bits 7..0)
x the extension field (PSR bits 15..8)
s the status field (PSR bits 23..16)
f the flags field (PSR bits 31..24)
Example:
MRS R0, CPSR ; Get CPSR into R0
BIC R0, R0, #&1F ; Remove mode bits from flags
ORR R0, R0, #&13 ; Force SVC32 mode
MSR CPSR_c, R0 ; Set supervisor mode (leaving other flags unchanged)
Accessing the SPSR from user or system mode is unpredictable as is attempting to alter the T(humb) field.
Note that in user mode,writes to CPSR bits 23..0 are ignored so that user mode code may not swap into priviledged mode - the above example will only have effect in another priviledged mode.
This instruction was introduced in ARM architecture 3.
|
|
|