Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Step 2: Write an ARM assembly language program that counts the number of 1's for any value in RO. The program must assemble/compile in KEIL
Step 2: "Write an ARM assembly language program that counts the number of 1's for any value in RO. The program must assemble/compile in KEIL and must be able to run in the KEIL simulator. Generally, RO may contain any value, but for purpose of this exercise, you may move 0x2345ABCD into RO. The number in RO does not need be preserved. You may use any other registers as you need. The result, total count of 1's in RO, should be in R1 when the program ends." UHCL: Unwala ENG 3371Microcontroller Programming Spring 2017 Step 3: Copy the template below to your assembly file AREA Lab_09_YourFirstName_YourLastName, CODE, READONLY EXPORT _main _main LDR RO, =0x2345ABCD; This is how you assign large value to RO. MOV will NOT work! stop stop END Step 3: Change YourFirstName to your first name. Change YourLastName to your last name. Step 4: You are allowed to use ONLY the instructions below: Pay attention: This is different than Lab 08! 1. LDR[*] 2. MOVI] 3. B[*] 4. ADC[" 5. LSR[") What does [*] means? This means that you may use any combination of the given instruction. Example: LDR[*] means that you may use LDR or LDRLE or LDREQ or LDRS or any other combinations. You may use Keil ARM documentation to learn about any of the instructions listed above. http://www.keil.com/support/man/docs/armasm/armasm dom1361289850039.htm Step 5: Results: Step 6: Hints. 1. The tricks in solving this lab are dealing with flags and carry! 2. You will need to use one loop 3. Use Windows Calculator to convert between hexadecimal to binary to save yourself time as shown in previous labs. For the first fill in the blank add all of your code that is inside your main. You can do this with copy and paste, try to leave one blank/space between the lines of code. For the second fill in the blank add any lines of code that use LDR() : For the third fill in the blank add any lines of code that use MOVI). For the fourth fill in the blank add any lines of code that use Bl*) For the fifth fill in the blank add any lines of code that use ADC*). For the sixth fill in the blank add any lines of code that use LSRE*). QUESTION 2 Take a screen shot of your whole screen (Keil) and submit it here. Make sure we can see the ARM code. Also make sure you include the registers and show that R1 is 10. Failure to submit a screen shot will result in at least a 10 point deduction Attach File Browse My Computer Browse Content Collection
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
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