Assembly 未知操作码';CBZ&x27;使用uVision ARM编译器
最近在我的计算机课上,我们谈到了如何使用uVision ARM编译器。现在,我已经做java多年了,并且了解如何编程,但ARM给我带来了麻烦 我的目标是创建一个程序,我们将大写字母转换为小写字母,反之亦然 我的代码如下。除了两个if语句外,其他所有语句都是由老师提供的Assembly 未知操作码';CBZ&x27;使用uVision ARM编译器,assembly,compiler-errors,arm,thumb,Assembly,Compiler Errors,Arm,Thumb,最近在我的计算机课上,我们谈到了如何使用uVision ARM编译器。现在,我已经做java多年了,并且了解如何编程,但ARM给我带来了麻烦 我的目标是创建一个程序,我们将大写字母转换为小写字母,反之亦然 我的代码如下。除了两个if语句外,其他所有语句都是由老师提供的 AREA mydata,DATA output SPACE 50 AREA mycode,CODE,ALIGN=2 THUMB EXPORT _
AREA mydata,DATA
output SPACE 50
AREA mycode,CODE,ALIGN=2
THUMB
EXPORT __main
input DCB "The QUICK brown fOx",0
DCD 0
__main PROC
LDR R0,=input ;R0 has input ptr
LDR R1,=output ;R1 has output ptr
loop LDRB R2,[R0] ;R2 has the next character
CBZ R2,exit ;if r2 == 0 go to exit
STRB R2,[R1] ;store R2 @ R1 (output ptr)
if(R1>91 )
SUB R1, #32
else if(R1<91)
ADD R1, #32
B loop ;do the next character
exit MOV R2,#0 ;put in my byte of zero
STRB R2,[R1]
done B done ;end
ENDP
END
我在uVision的网站上搜索解决方案,但似乎找不到任何方向。请帮忙!
第一篇关于堆栈溢出的文章!希望我做得好 您应该检查正在编译的目标CPU。CBZ仅在ARMv6T2及更高版本中可用,如its中所示 是你写的,还是你被给予这个,并试图理解它?你有一些arm文档,里面有指令集是吗?有CBZ指令吗?你有汇编程序的文档是吗?该汇编程序是否有if()then else语法?汇编语言不使用
if()
语法,您必须自己“编译”成cmp
/bgt
(比较并分支指令),或者使用ARM谓词执行来无分支地执行。
*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Build target 'Target 1'
assembling (fileName).s...
(fileName).s(12): error: A1854E: Unknown opcode 'CBZ', maybe wrong target CPU?
(fileName).s(14): error: A1163E: Unknown opcode if(R1>91 , expecting opcode or Macro
(fileName).s(15): error: A1859E: Flag preserving form of this instruction not available
(fileName).s(16): error: A1157E: Syntax error following directive
(fileName).s(17): error: A1859E: Flag preserving form of this instruction not available
(fileName).s(20): error: A1859E: Flag preserving form of this instruction not available
".\Objects\new.axf" - 6 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed: 00:00:00