Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q: Write, simulate, and demonstrate using AVRStudio7 an assembly code for the AVR ATMEGA328p microcontroller that performs the following functions 1. Store 200 numbers starting
Q: Write, simulate, and demonstrate using AVRStudio7 an assembly code for the AVR ATMEGA328p microcontroller that performs the following functions 1. Store 200 numbers starting from the STARTADDS=Ox0300 location. Populate the value of the memory location by adding high(STARTADDS) and low(STARTADDS). Use the X/Y/Z registers as pointers to fill up 200 numbers that are greater than 25 and less than 226. The numbers can be consecutive or random numbers. 2. Use X/Y/Z register addressing to parse through the 200 numbers, if the number is divisible by 7 store the number starting from memory location Ox0500, if the number is divisible by 3 store the number starting from memory location Ox0600, if they are divisible by both store them at Ox0700, else store at location starting at Ox0800. 3. Use X/Y/Z register addressing to simultaneously add numbers from memory location Ox0500, Ox0600, Ox0700 and Ox0800 and store the sums at R18 R17 R16 and R21 R20:R19 respectively. Pay attention to the carry overflow. Q: Write, simulate, and demonstrate using AVRStudio7 an assembly code for the AVR ATMEGA328p microcontroller that performs the following functions 1. Store 200 numbers starting from the STARTADDS=Ox0300 location. Populate the value of the memory location by adding high(STARTADDS) and low(STARTADDS). Use the X/Y/Z registers as pointers to fill up 200 numbers that are greater than 25 and less than 226. The numbers can be consecutive or random numbers. 2. Use X/Y/Z register addressing to parse through the 200 numbers, if the number is divisible by 7 store the number starting from memory location Ox0500, if the number is divisible by 3 store the number starting from memory location Ox0600, if they are divisible by both store them at Ox0700, else store at location starting at Ox0800. 3. Use X/Y/Z register addressing to simultaneously add numbers from memory location Ox0500, Ox0600, Ox0700 and Ox0800 and store the sums at R18 R17 R16 and R21 R20:R19 respectively. Pay attention to the carry overflow
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