Simple fix hopefully. Keil M3 i need to edit this code so that im not using ADC, and instead some instruction that is allowed, listed
Simple fix hopefully. Keil M3
i need to edit this code so that im not using ADC, and instead some instruction that is allowed, listed below.
i got the Warning below when i replaced ADC with ADD. It caused me to get a different result.
The result im looking for is for R1 to be E. Depicted in the last picture here. thanks
good answer = thumbs up!
==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
ADC r1,r1, r4 ; r1 = r1 + r4
CMP r2, #0 ; compare r2 and 0
BNE countone ; branch if
stop B stop
END
(9 Target 1 2 3 EXPORT main Source Gro CMSIS main ?+ Device 6 7 8 LDR r0, = Ox7E0C0A2B ; MOV wont work MOV r1, #0 MOV r2,ro MOV r4, #0 ;r4 = 0 10 l1countone 12 13 14 15 16 17 18 stop B stop 19 20 : loop MOVS r2, r2, LSR #1 rl,rl, r4 CHP r2, #0 BNE countone : compare r2 and 0 ; branch ifStep by Step Solution
There are 3 Steps involved in it
Step: 1
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