arm-linux-gcc 交叉编译问题,代码是照着书抄的,版本arm-linux-gcc4.4.3,PC ubuntu11.10 40
AREABLOCK,CODE,READONLYnumEQU20ENTRYstartLDRR0,=srcLDRR1,=dstMOVR2,#numMOVSP,#0x400bl...
AREA BLOCK, CODE, READONLY
num EQU 20
ENTRY
start LDR R0, =src
LDR R1, =dst
MOV R2, #num
MOV SP, #0x400
blockcopy
MOVS R3,R2, LSR #3
BEQ copywords
STMFD SP!, {R4-R11}
octcopy
LDMIA R0!,{R4-R11}
STMIA R1!,{R4-R11}
SUBS R3,R3, #1
BNE octcopy
LDMFD SP!, {R4-R11}
copywords
ANDS R2, R2, #7
BEQ stop
wordcopy
LDR R3, [R0], #4
STR R3, [R0], #4
SUBS R2,R2, #1
BNE wordcopy
stop
MOV R0, #0x18
LDR R1, =0x20026
SWI 0x123456
AREA BlockData, DATA, READWRITE
src DCD 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4
dst DCD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
END
编译结果:
arm2.s:1: Error: bad instruction `area BLOCK,CODE,READONLY'
arm2.s:2: Error: bad instruction `num EQU 20'
arm2.s:3: Error: bad instruction `entry'
arm2.s:4: Error: bad instruction `start LDR R0,=src'
arm2.s:8: Error: bad instruction `blockcopy'
arm2.s:12: Error: bad instruction `octcopy'
arm2.s:18: Error: bad instruction `copywords'
arm2.s:21: Error: bad instruction `wordcopy'
arm2.s:26: Error: bad instruction `stop'
arm2.s:30: Error: bad instruction `area BlockData,DATA,READWRITE'
arm2.s:31: Error: bad instruction `src DCD 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4'
arm2.s:32: Error: bad instruction `dst DCD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0'
arm2.s:33: Error: bad instruction `end'
求前辈,高手指教 展开
num EQU 20
ENTRY
start LDR R0, =src
LDR R1, =dst
MOV R2, #num
MOV SP, #0x400
blockcopy
MOVS R3,R2, LSR #3
BEQ copywords
STMFD SP!, {R4-R11}
octcopy
LDMIA R0!,{R4-R11}
STMIA R1!,{R4-R11}
SUBS R3,R3, #1
BNE octcopy
LDMFD SP!, {R4-R11}
copywords
ANDS R2, R2, #7
BEQ stop
wordcopy
LDR R3, [R0], #4
STR R3, [R0], #4
SUBS R2,R2, #1
BNE wordcopy
stop
MOV R0, #0x18
LDR R1, =0x20026
SWI 0x123456
AREA BlockData, DATA, READWRITE
src DCD 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4
dst DCD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
END
编译结果:
arm2.s:1: Error: bad instruction `area BLOCK,CODE,READONLY'
arm2.s:2: Error: bad instruction `num EQU 20'
arm2.s:3: Error: bad instruction `entry'
arm2.s:4: Error: bad instruction `start LDR R0,=src'
arm2.s:8: Error: bad instruction `blockcopy'
arm2.s:12: Error: bad instruction `octcopy'
arm2.s:18: Error: bad instruction `copywords'
arm2.s:21: Error: bad instruction `wordcopy'
arm2.s:26: Error: bad instruction `stop'
arm2.s:30: Error: bad instruction `area BlockData,DATA,READWRITE'
arm2.s:31: Error: bad instruction `src DCD 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4'
arm2.s:32: Error: bad instruction `dst DCD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0'
arm2.s:33: Error: bad instruction `end'
求前辈,高手指教 展开
3个回答
展开全部
这是汇编代码啦,你应该用汇编交叉编译的,估计你用错了编译工具,所以才有这么多错误信息。
追问
用的是arm-linux-gcc4.4.3,配置就按网上的教程安装的,arm-linux-gcc -v,也显示了版本,安装方法
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在你的 label 前面加上 . 看看。
追问
唉,没用耶!
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询