8. (12 Points) Convert the following assembly language program to C/C++. Note that you do NOT...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
8. (12 Points) Convert the following assembly language program to C/C++. Note that you do NOT need to specify in the C program the code memory locations for the MAIN (0x100) subroutine. .ORG 0 LDI R16, HIGH(RAMEND) OUT SPH, R16 LDI R16, LOW (RAMEND) OUT SPL, R16 SBI DDRB, 2 LDI R17, 0x00 LDI R16, 0x04 LDI R20, 0 OUT TCNTO, R20 LDI R20, 160 OUT OCRO, R20 MAIN: OUT PORTB, R17 RCALL DELAY EOR R17, R16 RJMP MAIN .ORG 0x100 DELAY: LDI R20, 0x09; OUT TCCRO, R20 AGAIN: IN R20, TIFR SBRS R20, OCF0; RJMP AGAIN; LDI R20, 0x00 OUT TCCRO, R20; LDI R20, 1<<OCF0; OUT TIFR, R20; RET 8. (12 Points) Convert the following assembly language program to C/C++. Note that you do NOT need to specify in the C program the code memory locations for the MAIN (0x100) subroutine. .ORG 0 LDI R16, HIGH(RAMEND) OUT SPH, R16 LDI R16, LOW (RAMEND) OUT SPL, R16 SBI DDRB, 2 LDI R17, 0x00 LDI R16, 0x04 LDI R20, 0 OUT TCNTO, R20 LDI R20, 160 OUT OCRO, R20 MAIN: OUT PORTB, R17 RCALL DELAY EOR R17, R16 RJMP MAIN .ORG 0x100 DELAY: LDI R20, 0x09; OUT TCCRO, R20 AGAIN: IN R20, TIFR SBRS R20, OCF0; RJMP AGAIN; LDI R20, 0x00 OUT TCCRO, R20; LDI R20, 1<<OCF0; OUT TIFR, R20; RET
Expert Answer:
Answer rating: 100% (QA)
Part 1 Assembly to C Conversion Analyze the assembly code instructions and ... View the full answer
Related Book For
Computer organization and architecture designing for performance
ISBN: 978-0136073734
8th edition
Authors: william stallings
Posted Date:
Students also viewed these programming questions
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
How can staff review the effectiveness of their work, the services they provide and the social and cultural factors impacting on clients, groups or communities?
-
Dolly is a cash basis taxpayer. In 2015, she filed her 2014 South Carolina income tax return and received a $2,200 refund. Dolly took the standard deduction on her 2014 Federal income tax return, but...
-
Consider the rest of the world with free trade (production at 5, and consumption at C,), as shown in the graph on the right in Figure 4.4A. The international relative price of cloth now changes to...
-
The data obtained in a two-plane balancing procedure are given in the table below. Determine the magnitude and angular position of the balancing masses, assuming that all angles are measured from an...
-
Galen Stoller was killed at a railroad crossing when an AMTRAK train hit his car. The crossing was marked with a stop sign and a railroad-crossing symbol, but there were no flashing lights. Galens...
-
The volume of water in Lake Tahoe is 151 cubic kilometers. If the water temperature increased from 5 degrees Celsius to 20 degrees Celsius, what would be the change in the volume of water in the lake...
-
Sundream Travel Agency Ltd. is a company that sells vacation packages and has a new Chief Executive Officer (CEO) who is reviewing the draft December 31 year-end financial statements prepared by the...
-
Explain the differences among law office billing procedures, specifically, the differences involved in billing on a contingency basis, a flat fee basis, and an hourly basis. Discuss the advantages...
-
Tartan Technologies insists on planning on a weekly basis, as they produce 50 weeks out of the year. Tartan Technologies produces three finished goods: the economical model A, the midrange model B,...
-
Rothera Point Utilities operates Rothera Point Power Plant, a coal-fired generation facility that operates continuously, provid- ing electricity to nearly 700,000 households in its service area....
-
The Fine Crate Company has several machines that cut wooden planks used for building storage pallets and automatically load them into rolling bins for trans- portation and handling. Each bin holds...
-
Darden Company uses a kanban loop to control SKU #303, which is produced on stamping machines. They have six kanban cards circulating in the loop. Next month Darden will replace its stamping machines...
-
What type of audit report does a company hope to include with its annual report? a. Conservative report b. Qualified report c. Comparable report d. Unqualified report
-
How is the micro economic model build?
-
B made an issue of 150,000 $1 ordinary shares at a premium of 20% the proceeds of which is received by cheque. What is the correct journal to record this? A. Bank Share capital Share premium B. Bank...
-
In general, what are the strategies for exploiting spatial locality and temporal locality? Discuss.
-
The Intel 8086 is a 16-bit processor similar in many ways to the 8-bit 8088. The 8086 uses a 16-bit bus that can transfer 2 bytes at a time, provided that the lower-order byte has an even address....
-
The x86 includes the following instruction: IMUL op1, op2, immediate This instruction multiplies op2, which may be either register or memory, by the immediate operand value, and places the result in...
-
How would each of the following liabilities be classified (current, non-current, or both) at the end of the financial year? Unearned revenue Accrued expenses Provision for warranty repair costs...
-
The following were among transactions of Everluck Enterprises Ltd during the financial years ending 30 June 2023 and 30 June 2024. Required Record in general journal form all the above transactions,...
-
At 30 June 2024, the accountant for Woodbine Construction, Mary Ellam, is preparing the financial statements for the year ended on that date. To calculate the annual leave payable, the accountant had...
Study smarter with the SolutionInn App