문제

asm("stw r4, %0": "=m" (returnCode)) 

The above call is made from c to a Nios2 where return code is variable in C. I get stw stores from one register to another or from memory, but I'm not sure what the %0 or the "=m" represent.

도움이 되었습니까?

해결책

I'm pretty sure this is GCC inline assembly, so with that in mind... And note... My GCC inline days are long behind me, but...

stw The instruction to be executed

r4 Looks like the name of a register

%0 Refers to the list of variables/registers/parameters after the colon

=m Is a constraint. =m means constrain operations on %0 to memory writes, if I'm readng the docs correctly.

See here for better explanations of GCC inline assembly.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top