Step 1: Create a new ASSEMBLY project using Keil Software (1) Make sure you use the M3 option (2) Make sure you name the folder "COSC2440_Lab08 YourFirstName_YourLastName"

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please use Assembly File and please read the instructions given down below AND SEE WHAT YOU CAN USE ONLY IN THIS ONE.

Step 1: Create a new ASSEMBLY project using Keil Software
(1) Make sure you use the M3 option
(2) Make sure you name the folder "COSC2440_Lab08 YourFirstName_YourLastName"
Step 2:
"Write an ARM assembly language program that counts the number of l'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 O×2345ABCD 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 CENG 3371Microcontroller Programming Spring 2017
Step 3: Copy the template below to your assembly file
AREA Lab_08 YourFirstName_YourLastName, CODE, READONLY
EXPORT_main
_main
LDR RO, =0X2345ABCD; This is how you assign large value to RO. MOV will NOT work!
stop B 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 07!
1. LDR[*]
2. MOV[*]
3. В"1
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:
Hexadecimal: O×2345ABCD
Decimal: 591,768,525
Binary: 10 0011 0100 0101 1010 1011 1100 1101
The expected result will be 16 [Count # of 1 in the Binary Value above]
R1 should be 0x00000010
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.
Transcribed Image Text:Step 1: Create a new ASSEMBLY project using Keil Software (1) Make sure you use the M3 option (2) Make sure you name the folder "COSC2440_Lab08 YourFirstName_YourLastName" Step 2: "Write an ARM assembly language program that counts the number of l'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 O×2345ABCD 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 CENG 3371Microcontroller Programming Spring 2017 Step 3: Copy the template below to your assembly file AREA Lab_08 YourFirstName_YourLastName, CODE, READONLY EXPORT_main _main LDR RO, =0X2345ABCD; This is how you assign large value to RO. MOV will NOT work! stop B 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 07! 1. LDR[*] 2. MOV[*] 3. В"1 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: Hexadecimal: O×2345ABCD Decimal: 591,768,525 Binary: 10 0011 0100 0101 1010 1011 1100 1101 The expected result will be 16 [Count # of 1 in the Binary Value above] R1 should be 0x00000010 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.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY