Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started