By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,659 Members | 1,945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,659 IT Pros & Developers. It's quick & easy.

what is the following assembly doing

P: 1
str fp,[sp, -4]!
add fp, sp, #0
sub sp, sp, #12
str r0, [fp, #-8]
str r1 [fp, #-12]

L5:
ldr r3, [fp, #-8]
ldrb r3, [r3]
cmp r3, #0
beq .L2
ldr r3, [fp, #-12]
ldrb r3, [r3]
cmp r3, #0
beq .L2
ldr r3, [fp, #-8]
ldrb r2, [r3]
ldr r3, [fp, #-12]
ldrb r3, [r3]
cmp r2, [r3]
bne .L8
ldr r3, [fp, #-8]
add r3, r3, #1
str r3, [fp, #-8]
ldr r3, [fp, #-12]
add r3, r3, #1
str r3, [fp, #-12]
b .L5

.L8
nop

.L2
ldr r3, [fp, #-8]
cmp r3, #0
bne .L6
ldr r3, [fp, #-12]
cmp r3, #0
bne .L6
mov r3, #0
b .L7

.L6
ldr r3, [fp, #-8]
ldrb r3, [r3]
mov r3, r3
ldr r3, [fp, #-12]
ldrb r3, [r3]
sub r3, r2, r3

.L7
mov r0,r3
add sp, fp, #0
ldr fp, [sp], #4
bx lr
3 Weeks Ago #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.