Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer the Problem 4 Problem #4 [25 pts] Consider the AVR assembly code in Problem #3 with its equivalent (partially completed) address and binaries on

Answer the Problem 4

image text in transcribed

image text in transcribed

Problem #4 [25 pts] Consider the AVR assembly code in Problem #3 with its equivalent (partially completed) address and binaries on the right. Determine the values for (a) KKKK dddd KKKK @ address S0047) (b) rd dddd rrrr @ address S004A) (c) kk kkkk k (@address $0050) (d) r rrrr @ address $0051) (e) kkkk kkkk kkkk kkkk (as part of the JMP instruction @ address S0052 and 50053) ORG 0x0046 LDI XH, high (CTR) LDI XL, low (CTR) LDI R31, Oxla LDI R17, 8 CLR R6 LOOP: CLC ROR R31 BRCC NEXT INC R6 NEXT: DEC R17 BRNE LOOP ST X, R6 DONE: JMP DONE Address 0046: 0047: 0048: 0049: 004A: 004B: 004C: 004D: 004E: 004F: 0050: 0051: 0052: 0053: Binary 1110 0000 1011 0001 1110 KKKK dddd KKKK 1110 0001 1111 1010 1110 0000 0001 1000 0010 01rd visa rrrr 1001 0100 1000 1000 1001 0101 1111 0111 1111 0100 0000 1000 1001 0100 0110 0011 1001 0101 0001 1010 1111 01kk kkkk k000 1001 001rrrrr 1100 1001 0100 0000 1100 kkkk kkkk kkkk kkkk . DSEG .org CTR: $0104 BYTE 1 Problem #3 [25 pts] Consider the following code written in AVR assembly. Explain in words what the program accomplishes when it is executed. That is, explain what it does, how it does it, and how many times it does it. What is the value of location CTR when the execution completes and how many times is the LOOP executed? How much memory is allocated in SRAM? .ORG Ox0046 LDI XH, high (CTR) LDI XL, low (CTR) LDIR31, Oxla LDI R17, 8 CLR R6 LOOP: CLC ROR R31 BRCC NEXT INC R6 NEXT: DEC R17 BRNE LOOP ST X, R6 DONE: JMP DONE .DSEG .org $0104 CTR: .BYTE 1 Extra Credit [2 pts] Considering the portion of AVR code above that is shown in bold text. Which assembly instruction is unnecessary? In other words, which assembly instruction in the bold section) could be deleted while still retaining the exact same program functionality? Problem #4 [25 pts] Consider the AVR assembly code in Problem #3 with its equivalent (partially completed) address and binaries on the right. Determine the values for (a) KKKK dddd KKKK @ address S0047) (b) rd dddd rrrr @ address S004A) (c) kk kkkk k (@address $0050) (d) r rrrr @ address $0051) (e) kkkk kkkk kkkk kkkk (as part of the JMP instruction @ address S0052 and 50053) ORG 0x0046 LDI XH, high (CTR) LDI XL, low (CTR) LDI R31, Oxla LDI R17, 8 CLR R6 LOOP: CLC ROR R31 BRCC NEXT INC R6 NEXT: DEC R17 BRNE LOOP ST X, R6 DONE: JMP DONE Address 0046: 0047: 0048: 0049: 004A: 004B: 004C: 004D: 004E: 004F: 0050: 0051: 0052: 0053: Binary 1110 0000 1011 0001 1110 KKKK dddd KKKK 1110 0001 1111 1010 1110 0000 0001 1000 0010 01rd visa rrrr 1001 0100 1000 1000 1001 0101 1111 0111 1111 0100 0000 1000 1001 0100 0110 0011 1001 0101 0001 1010 1111 01kk kkkk k000 1001 001rrrrr 1100 1001 0100 0000 1100 kkkk kkkk kkkk kkkk . DSEG .org CTR: $0104 BYTE 1 Problem #3 [25 pts] Consider the following code written in AVR assembly. Explain in words what the program accomplishes when it is executed. That is, explain what it does, how it does it, and how many times it does it. What is the value of location CTR when the execution completes and how many times is the LOOP executed? How much memory is allocated in SRAM? .ORG Ox0046 LDI XH, high (CTR) LDI XL, low (CTR) LDIR31, Oxla LDI R17, 8 CLR R6 LOOP: CLC ROR R31 BRCC NEXT INC R6 NEXT: DEC R17 BRNE LOOP ST X, R6 DONE: JMP DONE .DSEG .org $0104 CTR: .BYTE 1 Extra Credit [2 pts] Considering the portion of AVR code above that is shown in bold text. Which assembly instruction is unnecessary? In other words, which assembly instruction in the bold section) could be deleted while still retaining the exact same program functionality

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

Describe Generation

Answered: 1 week ago