Question: Write an assembly program (template is given below) that efficiently perform the following operation under the constraints given. Part A: Count the number of 1's

Write an assembly program (template is given below) that efficiently perform the following operation under the constraints given. Part A: Count the number of 1's in RO and store in R1. RO should have its original value at the end of the code fragment. You can only use one register other than RO and R1. You must use the ADD instruction, not the ADC instruction. Part B: Repeat Part A, except you must use the ADC instruction, not the ADD instruction. AREA FLASH, CODE, READONLY ARM INCLUDE LPC23xx.inc ;MMR definitions EXPORT __main __main ; PARTA LDR RO, =0x8F01010E ; test case ; PART B LDR RO, =0x8F01010E ; test case wait B wait END
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
