Question

The AVR provides a rich instruction set to support high-level languages. The AVR address- ing modes also simplify the access of complex data structures. The AVR has a version of the ADD instruction that includes the C flag as one of the source operands, which enables multiple- precision addition operation. The AVR also has a version of the SUB instruction that includes the C flag as one of source operands and hence is used to perform multiprecision subtraction operation. The arithmetic and logical operations can only be performed on operands in registers. Memory operands must be loaded into a register before these operations can be performed 2.9 Exercises E2.1 Write an instruction sequence to swap the contents of registers rO and rl. A third register such as r2 or another can be used to facilitate the swap operation. E2.2 Write an instruction sequence to swap the contents of data memory locations at 0x2000 and 0x2001 E2.3 Write an instruction sequence to copy three bytes from data memory location at 0x1000-0x1002 to data memory locations at 0x2000-0x2002, respectively E2.4 Write an instruction sequence to store I, 3, and 5 at data memory locations at 0x2000, 0x2005, and 0x200A, respectively E25 Write a sequence of instructions to add S to data memory locations at 0x2000, 0x2001, and 0x2002, respectively E2.6 Write a sequence of instructions to suberact 10 from data memory locations at 0x2000, Ox2005, and Ox200A, respectively E2.7 Write a sequence of instructions to add the three numbers stored in data memory loca tions at 0x2000, 0x2001, and 0x2002 and store the sum at data memory location at 0rx2010o. E2s Write an instruction sequence to add 35 to the two-byte value stored at data memory loca tions 0x200010x2001 E2.9 Write an instruction sequence to ourput the value 0xAA to PORTC E2.10 Write a sequence of instructions to copy the three bytes from program memory locations 0x2000-0x2002 to data memory locations at Ox2000-0x2002, respectively E2.11 Write an instruction at 0x1000 and 0x1005 together and leave the sum in the data memory location at 0x2000 E2.12 Write an instruction sequence to swap the 16-bit value stored in data memory location at 0x2000-0x2001 with the 16-bit value stored in the data memory at 0x2020-0x2021. E213 Write an instruction sequence to subtract the value stored at data memory location sequence to add the two s-bit numbers stored in program memory Ox2000 from the sum of the values stored at data memory locations ox2010 and oxzoll and leave the difference in ro. E2.14 Write an instruction sequence to subtract the sum of data memoty locations at 0x2000 and 0x2001 from the sum of the data memory locations ar Ox2010 and 0x2011 and leave the difference at data memory location 0x2020 Write an instruction sequence to add the 16-bit value stored at data memory locations 0x2000-0x2001 and the 16-bit value stored at program memory locations Ox2010-0x2011 and store the sum at data memory locations 0x2020-0x2021
0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
The AVR provides a rich instruction set to support high-level languages. The AVR address- ing modes...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Please explain what each step in the sequence is doing Write an instruction sequence to swap...

    Please explain what each step in the sequence is doing Write an instruction sequence to swap the 16-bit word stored at $1000-$1001 with the 16-bit word stored at $1100-$1101. Write an instruction sequence to add the content of registrar B to the 16-bit word stored at memory locations $1000-$1001. Assume sum is still 16 bits.

  • 1.Write the "destination" register in the instruction 671A in a string of 4 bits. 2.The instruction...

    1.Write the "destination" register in the instruction 671A in a string of 4 bits. 2.The instruction 9158 uses two registers as operands, and a third register as a destination for the result. Which registers are used for the operands?   9 and 1   1 and 5   5 and 8   9 and 8 3. Translate the following instruction into English: 54F2 Add the bit patterns in registers F and 2 together as if they were presented in two's complement and leave the...

  • High-level computer languages are created to be understood by humans. As a result, the keywords and...

    High-level computer languages are created to be understood by humans. As a result, the keywords and the commands of these languages are easy to understand. Machine languages are harder to understand and operate. For this assignment, you should assume that the memory cells at addresses F0 to F9 are in the machine described in FIGURE 1, and that it contains the hexadecimal bit patterns described in the following table. Note: Each memory address contains 2 values that must be used...

  • Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at...

    Section B - ARM Assembly Language (25 marks) An ARM instruction set summary is provided at the end of this paper 1. (5 marks) Consider the following assembly instruction STMFD r13!, (r5-6} Before executing this instruction, registers hold the following values: Register Value Register r9 Value r4 0x00400040 0x00000000 r5 r10 0x11223344 0x00800080 r6 0x55667788 r11 0x10001000 r7 0x99aabbcc r12 0x20002000 r8 exddeeff00 r13 ex40004000 What memory locations are affected after executing the above instruction? In a table, with a...

  • Please help by showing steps. Question 4. (continued) (b) Consider a 16-bit binary number stored in AVR registers r1...

    Please help by showing steps. Question 4. (continued) (b) Consider a 16-bit binary number stored in AVR registers r15:r14 which the programmer considers to be a two's complement value. (r15 holds the most significant byte, r14 holds the least significant.) Write down a sequence of AVR assembly language instructions which perform each of the following operations The result should end up in r15:r14. Other registers can be used freely if required i) Sets r15:r14 to the constant value-1 (2 marks)...

  • Please answer the list questions above with explanation. Thank you LOAD-STORE PROGRAM EXAMPLE Write an Assembly...

    Please answer the list questions above with explanation. Thank you LOAD-STORE PROGRAM EXAMPLE Write an Assembly program to add two 8-bit numbers. C A+B lds r16, A lds rl7, B : 1. Load variables add E16, :172 Do something 2. Do something sts C, r16 : 3. Store answer Identify the operation, source operand, destination operand in the first Data Transfer insiruction. Identify the source/destination operand in the Arithmetic and Logic (ALU) instruction. .What addressing mode is used by the...

  • Modify the circuit to support a MFCC instruction. MFCC Rd instruction: Move From Condition Codes MFCC copies into the fo...

    Modify the circuit to support a MFCC instruction. MFCC Rd instruction: Move From Condition Codes MFCC copies into the four rightmost bits of Rd the values of the ALU signals Carry (C), Overflow (O), Zero (Z) and Negative (N) as they were set by the previous R- type instruction. The remaining 28 bits of Rd are set to zero. Describe the changes and additions needed for the single-cycle MIPS processor datapath and control to support this instruction. Hints: 1) MFCC...

  • 1) We would like to design a bus system for 32 registers of 16 bits each....

    1) We would like to design a bus system for 32 registers of 16 bits each. How many multiplexers are needed for the design? Select one: 5 16 1 4 32 2) The basic computer can be interrupted while another interrupt is being serviced. Select one: True False 3) If the Opcode bits of an instruction is 111, then the basic computer instruction type is either memory-reference or input-output. Select one: True False 4) The content of AC in the...

  • computer analysis

    Questions1.  The function L is defined as L(1) = 2,L(2) = 1,L(3) = 3,L(4) = 4 and for n ≥ 4,L(n + 1) = L(n) + L(n − 1) + L(n − 2)L(n − 3)i.e., the (n + 1)-th value is given by the sum of the n-th, n − 1-th and n − 2-th values divided by the n − 3-th value.(a)  Write an assembly program for computing the k-th value L(k), where k is an integer bigger than...

  • 1.) a.) Using the simplified instruction set shown for part b, write code for the following....

    1.) a.) Using the simplified instruction set shown for part b, write code for the following. Suppose memory locations 1400 to 1449 contain 16-bit words. Each word represents 2 ASCII characters. Write code to read in and write out these 100 characters. Left-side character from location 1400 should be first, right-side character from location 1400 should be second, and remaining characters follow in numeric order. Assume you have access to 4 registers: R1, R2, R3, R4. Each register holds one...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT