Question: CREATE A ASSEMBLY PROJECT USING KEIL SOFTWARE A. copy paste the following code and do the steps B and C. ; Your First Macro. ;

CREATE A ASSEMBLY PROJECT USING KEIL SOFTWARE

A. copy paste the following code and do the steps B and C.

; Your First Macro. ; Your Second macro. AREA Lab_10_YourFirstName_YourLastName, CODE, READONLY EXPORT __main __main LDR R1, =0x2345ABCD LDR R2, =0x2345ABCD Case_1_Lab_08 Count1s_Lab08 R4, R3, R1 Case_1_Lab_09 Count1s_Lab09 R5, R2 LDR R1, =0x0 LDR R2, =0x0 Case_2_Lab_08 Count1s_Lab08 R6, R3, R1 Case_2_Lab_09 Count1s_Lab09 R7, R2 LDR R1, =0xFFFFFFFF LDR R2, =0xFFFFFFFF Case_3_Lab_08 Count1s_Lab08 R8, R3, R1 Case_3_Lab_09 Count1s_Lab09 R9, R2 stop B stop END

B.Replace ; Your First Macro by writing the actual macro that will count the number of 1s.

1. You must use the solution posted in Blackboard for Lab 08. 2. The counts will be displayed in R4, R6, R8

C.Replace ; Your Second Macro by writing the actual macro that will count the number of 1s.

1. You must use the solution posted in Blackboard for Lab 09. 2. The counts will be displayed in R5, R7, R9

The solution for lab_09 is

AREA Lab_09_YourFirstName_YourLastName, CODE, READONLY

EXPORT __main

__main

LDR R0, =0x2345ABCD

MOV R1, #0

loop

LSRS R0, #1

ADC R1, #0

BNE loop

stop B stop

END

The solution for lab_08 is

AREA Lab_08_YourFirstName_YourLastName, CODE, READONLY

EXPORT __main

__main

LDR R0, =0x2345ABCD

MOV R1, #0

loop

CMP R0, #0

BEQ stop

CLZ R2, R0

ADD R2, #1

ADD R1, #1

LSL R0, R2

BNE loop

stop B stop

END

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!