English 中文(简体)
ARM7TDMI不支持所要求的特殊用途登记册
原标题:ARM7TDMI does not support requested special purpose register

我需要把与ARMASM共同编纂的一些法典转换成(编码来源海合会-4.6.2 eabi)。 我使用了ARM7TDMI,我的汇编是论点。

arm-none-eabi-gcc -c -march=armv4t -mcpu=arm7tdmi -mlittle-endian -g -O1 

(我略去了——I和――D论点......)

在我的一份档案中,我有这一法典,它收集了:

extern inline void ngEnable( void)
{
    int tmp;
    asm volatile(
        "msr %[tmp], CPSR
	"
        "bic %[tmp], %[tmp], #0xC0
	"
        "msr CPSR_c, %[tmp]"
        : [tmp] "+r" (tmp)
    );
}

我发现这一错误:

C:DOCUME~1MALLAR~1.ISCLOCALS~1TempccA9cCgQ.s: Assembler messages:
C:DOCUME~1MALLAR~1.ISCLOCALS~1TempccA9cCgQ.s:267: Error: selected processor does not support requested special purpose register -- `msr r3,CPSR 
make: *** [cdbini.o] Error 1

根据这一员额,Re:麻烦建筑 (我以窗口为基础,但问题可能相同?) I m已经使用了不使用——等级=全部......的工作环境。

我的问题是什么想法?

最佳回答

阅读特殊用途登记册,请使用<代码>mrs指示:

extern inline void ngEnable(void)
{
  int tmp;
  asm volatile(
    "mrs %[tmp], CPSR
	"
    "bic %[tmp], %[tmp], #0xC0
	"
    "msr CPSR_c, %[tmp]"
    : [tmp] "=r" (tmp)
  );
}

在这项法令之后,法典对我只做了罚款。

Also, since you don t use the value of tmp, and you don t in fact even set it, you should use =r (output only) instead of +r (input-output).

问题回答

暂无回答




相关问题
gcc -fPIC seems to muck with optimization flags

Following along from this question: how-do-i-check-if-gcc-is-performing-tail-recursion-optimization, I noticed that using gcc with -fPIC seems to destroy this optimization. I am creating a shared ...

Generate assembler code from C file in linux

I would like to know how to generate assembler code from a C program using Unix. I tried the gcc: gcc -c file.c I also used firstly cpp and then try as but I m getting errors. I m trying to build an ...

Getting rid of pre-compiled headers

OK, I have old Metrowerks code for Mac and Windows where the previous developer used pre-compiled headers for every project that this code base builds. How does one get rid of Pre-compiled headers, ...

Include a .txt file in a .h in C++?

I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....

How to compile for Mac OS X 10.5

I d like to compile my application for version 10.5 and forward. Ever since I upgraded to Snow Leopard and installed the latest XCode, gcc defaults to 10.6. I ve tried -isysroot /Developer/SDKs/...

热门标签