c++ - Simple Assembly Language doubts -
i had worked out code assignment , tells me i'm not doing correctly.. hope can take @ it. thank you!
area reset, code, readonly entry ldr r1, = 0x13579ba0 mov r3, #0 mov r4, #0 mov r2, #8 loop cmp r2, #0 bge done ldr r5, [r1, r4] , r5, r5, #0x00000000 add r3, r3, r5 add r4, r4, #4 sub r2, r2, #1 b loop ldr r0, [r3] done b done end
write arm assembly program add hexadecimal digits in register 1 , save sum in register 0. example, if r1 initialized follows:
ldr r1, =0x120a760c
when program has run completion, register 0 contain sum of 1+2+0+a+7+6+0+c.
you need use following in solution: · 8-iteration loop · logical shift right instruction · , instruction (used force selected bits 0)
i know did not use lsr. should put it? i'm getting started on assembly hope makes improvements on code..
Comments
Post a Comment