1ARM
2ARM汇编指令集
2.1
2.1.1【MOV】
area reset, code, readonly
code32
entry
mov r0, #1
end
2.1.2【SUB】
area reset, code, readonly
code32
entry
mov r0, #0x02
sub r1, r0, #1
end
2.1.3【ORR】
preserve8
area reset, code, readonly
code32
entry
mov r0, #0X0F
mov r1, #2
orr r3, r0, #0X10;将r0寄存器第4位置1,结果放入r3
end
2.1.4【BIC】
preserve8
area reset, code, readonly
code32
entry
mov r0, #0X0F
mov r1, #2
bic r2, r0, #0X08;将r0寄存器第3位清0,结果放入r2
end
2.1.5【cmp】
/*比较2个数大小,并找到大的数*/
area reset, code, readonly
code32
entry
mov r1, #1
mov r2, #2
cmp r1, r2
movge r4, r1
movlt r4, r2
end
2.1.6【b】文章来源:https://www.toymoban.com/news/detail-851466.html
area reset, code, readonly
code32
entry
;demo4
mov r1, #1
mov r2, #2
cmp r1, r2
bge greater
blt less
greater
mov r3, r1
b finish
less
mov r3, r2
finish
b finish
end
area reset, code, readonly
code32
entry
;demo5
mov r1, #0
mov r2, #0
loop
add r2, r2, r1
add r1, #1
cmp r1, #128
ble loop
finish
b finish
end
2.1.6.2【bl】文章来源地址https://www.toymoban.com/news/detail-851466.html
area reset, code, readonly
code32
entry
mov r1, #0
mov r2, #0
bl asm_add
nop
nop
nop
asm_add
add r1, r1,r2
mov pc, lr
;bx lr
finish
b finish
end
//【bl】指令完成数的累加
到了这里,关于ARM-SC2440的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!