Question: Write an ARM assembly language program that counts the number of 1s for any value in R0. The program must assemble/compile in KEIL and must
Write an ARM assembly language program that counts the number of 1s for any value in R0. The program must assemble/compile in KEIL and must be able to run in the KEIL simulator. Generally, R0 may contain any value, but for purpose of this exercise, you may move 0x2345ABCD into R0. The number in R0 does not need be preserved. You may use any other registers as you need. The result, total count of 1s in R0, should be in R1 when the program ends. You CAN USE ONLY the following commands: LDR, MOV, CMP, BEQ, CLZ, ADD, LSL, BNE. You MUST ALSO USE A LOOP."
(PLEASE WRITE THE ARM ASSEMBLY CODE FOR IT! I've asked this question already, but the person who answered it didn't give the ARM assembly code!)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
