arm汇编语言实现下列c语言语句 if(a>=b) x=(a+b)*8 ;else y=(a-c)*b; 20
展开全部
GNU汇编语法:
a: .word 1
b: .word 2
c: .word 3
x: .word
y: .word
prog:
ldr r0, =a
ldr r1, [r0]
ldr r0, =b
ldr r2, [r0]
ldr r0, =c
ldr r3, [r0]
cmp r1, r2
bge true
sub r1, r1, r3
mul r1, r1, r2
ldr r0, =y
b end
true:
mov r4, #8
add r1, r1, r2
mul r1, r1, r4
ldr r0, =x
end:
str r1, [r0]
a: .word 1
b: .word 2
c: .word 3
x: .word
y: .word
prog:
ldr r0, =a
ldr r1, [r0]
ldr r0, =b
ldr r2, [r0]
ldr r0, =c
ldr r3, [r0]
cmp r1, r2
bge true
sub r1, r1, r3
mul r1, r1, r2
ldr r0, =y
b end
true:
mov r4, #8
add r1, r1, r2
mul r1, r1, r4
ldr r0, =x
end:
str r1, [r0]
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询