Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Consider the AVR assembly code provided below. Read the code and use your knowledge of assembly instructions to answer the questions given at the

image text in transcribed

1. Consider the AVR assembly code provided below. Read the code and use your knowledge of assembly instructions to answer the questions given at the bottom of this page. .EQU vari = 0b11011010 .EQU var2 = 8 .DEF count = r17 .ORG 0x0000 RJMP init .ORG Ox0046 init: LDI XH, HIGH (resulta) LDI XL, LOW (resulta) LDI YH, HIGH (results) LDI YL, LOW (results) CLR r10 LDI r20, vari LDI count, var2 loop: CLC ROR r20 BRCC skip INC ri skip: ROL r10 DEC count BRNE loop ST ST done: RJMP X, r10 Y+, r1 done .DSEG .ORG Ox03 FE resultA: .BYTE 1 resultB: .BYTE 1 Answer the following questions (assuming that the code has executed and reached the done label): (a) What is the decimal value of the count register? (b) In total, how many times is the instruction "ROR r20" executed? (e) What are the hexadecimal values of r27 and r26? (d) What are the hexadecimal values of r 29 and r28? (e) What hexadecimal address does the assembler assign to the label results? (1) What 8-bit binary value is stored in SRAM at the memory location specified by resultA? (g) What decimal value is stored in SRAM at the memory location specified by results? 1. Consider the AVR assembly code provided below. Read the code and use your knowledge of assembly instructions to answer the questions given at the bottom of this page. .EQU vari = 0b11011010 .EQU var2 = 8 .DEF count = r17 .ORG 0x0000 RJMP init .ORG Ox0046 init: LDI XH, HIGH (resulta) LDI XL, LOW (resulta) LDI YH, HIGH (results) LDI YL, LOW (results) CLR r10 LDI r20, vari LDI count, var2 loop: CLC ROR r20 BRCC skip INC ri skip: ROL r10 DEC count BRNE loop ST ST done: RJMP X, r10 Y+, r1 done .DSEG .ORG Ox03 FE resultA: .BYTE 1 resultB: .BYTE 1 Answer the following questions (assuming that the code has executed and reached the done label): (a) What is the decimal value of the count register? (b) In total, how many times is the instruction "ROR r20" executed? (e) What are the hexadecimal values of r27 and r26? (d) What are the hexadecimal values of r 29 and r28? (e) What hexadecimal address does the assembler assign to the label results? (1) What 8-bit binary value is stored in SRAM at the memory location specified by resultA? (g) What decimal value is stored in SRAM at the memory location specified by results

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

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

Comment on the pH value of lattice solutions of salts.

Answered: 1 week ago

Question

Explain the chemical properties of acids with examples.

Answered: 1 week ago

Question

Experience with SharePoint and/or Microsoft Project desirable

Answered: 1 week ago

Question

Knowledge of process documentation (process flow charting)

Answered: 1 week ago