作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有以下 ARM 汇编代码。
CMP R0, #0
ITT EQ
MOVEQ R0, #0x7FFFFFFF
BXEQ LR
CMP R0, #0
MOVEQ R0, #0x7FFFFFFF
BXEQ LR
最佳答案
你为什么不试试呢?
.cpu cortex-m3
.thumb
.syntax unified
CMP R0, #0
ITT EQ
MOVEQ R0, #0x7FFFFFFF
BXEQ LR
CMP R0, #0
MOVEQ R0, #0x7FFFFFFF
BXEQ LR
arm-none-eabi-as vectors.s -o vectors.o
vectors.s: Assembler messages:
vectors.s:13: Error: thumb conditional instruction should be in IT block -- `moveq R0,#0x7FFFFFFF'
vectors.s:14: Error: thumb conditional instruction should be in IT block -- `bxeq LR'
make: *** [vectors.o] Error 1
.cpu cortex-m3
.thumb
.syntax unified
CMP R0, #0
ITT EQ
MOVEQ R0, #0x7FFFFFFF
BXEQ LR
0: 2800 cmp r0, #0
2: bf04 itt eq
4: f06f 4000 mvneq.w r0, #2147483648 ; 0x80000000
8: 4770 bxeq lr
.cpu cortex-m3
.thumb
.syntax unified
CMP R0, #0
ITT EQ
MOV R0, #0x7FFFFFFF
BX LR
vectors.s:8: Error: instruction not allowed in IT block -- `mov R0,#0x7FFFFFFF'
vectors.s:9: Error: incorrect condition in IT block -- `bx LR'
.cpu cortex-m3
.thumb
.syntax unified
CMP R0, #0
IT EQ
MOVEQ R0, #0x7FFFFFFF
BX LR
0: 2800 cmp r0, #0
2: bf08 it eq
4: f06f 4000 mvneq.w r0, #2147483648 ; 0x80000000
8: 4770 bx lr
.cpu cortex-m3
.thumb
.syntax unified
CMP R0, #0
IT EQ
MOVSEQ R0, #0x7
BX LR
movs r0,#7
mov r0,#7
movs.w r0,#7
00000000 <.text>:
0: 2800 cmp r0, #0
2: bf08 it eq
4: f05f 0007 movseq.w r0, #7
8: 4770 bx lr
a: 2007 movs r0, #7
c: f04f 0007 mov.w r0, #7
10: f05f 0007 movs.w r0, #7
.syntax unified
CMP R0, #0
MOVSEQ R0, #0x7
BXEQ LR
movs r0,#7
mov r0,#7
00000000 <.text>:
0: e3500000 cmp r0, #0
4: 03b00007 movseq r0, #7
8: 012fff1e bxeq lr
c: e3b00007 movs r0, #7
10: e3a00007 mov r0, #7
.cpu arm7t
.thumb
.syntax unified
CMP R0, #0
MOVSEQ R0, #0x7
BX LR
movs r0,#7
vectors.s:7: Error: selected processor does not support Thumb mode `it EQ'
vectors.s:7: Error: thumb conditional instruction should be in IT block -- `movseq R0,#0x7'
关于assembly - IT指令点ARM汇编,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20886563/
我是一名优秀的程序员,十分优秀!