Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

image text in transcribed

image text in transcribed

image text in transcribed

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 not equal to loop

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 if END Build Output * Using Compiler 'vs.06 update 5 (build 528) ', folder: 'C:Keil_v5 ARMNARMCC1B Build target 'Target l' assembling assembly.s... assembly.s (20) warning: A1581W: Added 2 bytes of padding at address 0x16 linking. .. Program Size: Code-132 RO-data-192 RW-data4 ZI-data4100 ".\Objects\Lab 08.axf" -0 Error(s), 1 Narning (3). Build Time Elapsed: 00:00:00 (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 if END Build Output * Using Compiler 'vs.06 update 5 (build 528) ', folder: 'C:Keil_v5 ARMNARMCC1B Build target 'Target l' assembling assembly.s... assembly.s (20) warning: A1581W: Added 2 bytes of padding at address 0x16 linking. .. Program Size: Code-132 RO-data-192 RW-data4 ZI-data4100 ".\Objects\Lab 08.axf" -0 Error(s), 1 Narning (3). Build Time Elapsed: 00:00:00

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students explore these related Databases questions