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
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
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?
-
Mio was transfer from New York to Germany. He lived and worked in Germany for 340 days in 2015. Mio's salary for 2015 is $190,000. In your computation, round any division to four decimal places...
-
Calculate the wavelength in centimeters of (a) An airport tower transmitting at 118.6 MHz. (b) A VOR (radio navigation aid) transmitting at 114.10 kHz. (c) An NMR signal at 105 MHz. (d) An infrared...
-
What is the internal rate of return of the following cash flow diagram? a. 20 percent b. 18.2 percent c. 17.5 percent d. 15 percent $30 $31 0 1 2 3 $30 $15
-
Ratio Analysis How ser Inc. is a manufacturer of electronic components and accessories with total assets of $20,000,000. Selected financial ratios for how ser and the industry averages for firms of...
-
Our company makes school buses. Here is some data on the cost of producing these vehicles. Monthly Production Data Output 0 1 2 3 4 5 6 7 8 9 10 Total cost 200,000 400,000 575,000 725,000 850,000...
-
A guest who offers a credit card at the time of check-in is: A)Just a regular guest B)Part of a wholesaler's package C)A member of a single-entity group D)Now a city-ledger account E)A...
-
What taxes may be imposed on an S corporation?
-
When the built-in gains tax is imposed on an S corporation, how is the tax passed through to the shareholders?
-
In 2018, Jason Products Co., a calendar year taxpayer, purchased business equipment (7-year property) for \(\$ 3,400,000\). No other personal property was purchased during the year. Jason wants to...
-
For an ordinary annuity with five annual payments of $100 and a 10% interest rate, how many years will the first payment earn interest? What will this payments value be at the end? Answer this same...
-
Comprehensive Problem. What is the total tax due for 2018 , including selfemployment tax, for Stuart, assuming that he earned \(\$ 20,000\) in wages, earned \(\$ 24,000\) in self-employment income...
-
Cisco Systems Develops a Collaborative Approach to Organizing Until the mid-2000s John Chambers, CEO of Cisco Systems, had a control and command, mechanistic approach to organizing. Chambers was...
-
[a] Two foam blocks, each with a charge of 19 micro coulombs (1 C = 10-6 C), are both held in place 19 cm apart in the east-west direction. A foam ball with a charge 49 C is placed 55 cm north of the...
-
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...
-
The IT implementation project is bogging down and falling behind schedule. The department heads are complaining that the project cannot help them if it is not implemented in a reasonable time frame....
-
This isnt what I need! objected the admissions officer at Northwest Regional Hospital. Judy sighed, But this is the software you asked us to create for you. I dont care what I said at the time, this...
-
Assume the network diagram shown in Figure 11.19. Megan is responsible for activities A and C. Use the critical chain methodology to resource-level the network. What are two options for redrawing the...
Study smarter with the SolutionInn App