Question
Keil uvision5 , m3 cortex how do i fix/resolve this warning shown below? code included below I need R1 to result to 0x0000000E . please
Keil uvision5 , m3 cortex
how do i fix/resolve this warning shown below? code included below
I need R1 to result to 0x0000000E . please test and confrim thanks
==code==
AREA name, CODE, READONLY
EXPORT __main
__main
LDR r0, = 0x7E0C0A2B ; MOV wont work
MOV r1, #0 ;r1 = 0
MOV r2,r0 ; r2 = r0
MOV r4, #0 ; r4 = 0
countone ; loop
MOVS r2, r2, LSR #1
CLZ r3, r2
ADD r1,r1,r4 ; Now Add carry bit
CMP r3, #0
BNE stop ; if r3 not equal to 0, then LSB is 0, dont perform ADD as adding 0 doesn't make sense
ADD r1, r1, #1 ; if r3 is set to 0 then LSB is 1,add 1 to r1
CMP r2, #0 ; compare r2 and 0
BNE countone ; branch if
stop B stop
END
5 ??Source Gro CMSIS Device 7 8 9 10 LDR r0, = Ox7E0C0A2B ; MOV wont work MOV r1, #0 MOV r2,r0 MOV r4, #0 ; r2 = r0 ;r4 = 0 11 countone : loop 12 13 14 15 16 17 18 19 20 21 Movs r2, r2, LSR #1 CLZ r3, r2 ADD r1,rl,r4 :Now Add carry bit CHP r3, #0 BNE stop : if r3 not equal to 0,t : if r3 is set to 0 then : compare r2 and 0 ADD r1, r1, #1 CHP r2, #0 BNE Countone 23 24 ; branch ifStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started