I came across these ASM instructions recently and am trying to figure out what they do. I went through a few ARM assembly books (such as THIS) and was able to figure out what a couple of instructions do.
For instance, MRS (Move to Register from Status)
copies status from the PSR (Program Status Register)
register to %0
(which I believe is register 0).
I am not able to understand what : "=r" (Cs)
and other similar instructions do.
UINT32 Cp;
if((Cp & 0x1) == 0)
{
UINT32 Cs;
__asm
(
" MRS %0, PSR\n"
"BIC %1, %2, #0x80\n"
"cpsie i"
: "=r" (Cs), "=r" (Cp)
: "r" (Cs)
);
}
Can someone please explain?
Edit 1: This is inside a GlobalLock release function. cpsie i
enables the interrupts.