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

Problem with __ASM

I'm trying to access the cpsr on the arm, so I wrote the following code (actaully copied the assembly part out of the help file on MRS):

__asm {MRS   R0, CPSR}
It gives me the following error:
compiling armVIC.c...
*** MRS   R0, CPSR
ARMVIC.C(28): error C197: inline-asm: undefined identifier
*** MRS   R0, CPSR
ARMVIC.C(28): error C197: inline-asm: Syntax error
Can someone point out to be the problem with this. It seems straight forward.

Thanks,
Peter

Parents
  • I don't know if this was the reason or not, but it was compiling it to thumb mode. When I unchecked the box it started working, but now I have the flipside not working (it didn't work before either).

    __asm {MSR	CPSR, R0}
    compiling armVIC.c...
    *** MSR CPSR, R0
    ARMVIC.C(29): error C197: inline-asm: Syntax error
    Any ideas?

Reply
  • I don't know if this was the reason or not, but it was compiling it to thumb mode. When I unchecked the box it started working, but now I have the flipside not working (it didn't work before either).

    __asm {MSR	CPSR, R0}
    compiling armVIC.c...
    *** MSR CPSR, R0
    ARMVIC.C(29): error C197: inline-asm: Syntax error
    Any ideas?

Children