{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw4 - ECE 332 Due Homework 4 Fall 2009 1 Create macros that...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 332 Homework 4 Fall 2009 Due: 9/16/2009 Page 1 of 3 1. Create macros that implement the following instructions. These macros should not use any registers other than those specified as operands. Example problem Incr increment Operation: rA rA + 1 Assembler Syntax: incr rA Example: incr r6 Solution .macro incr rA addi \rA,\rA,1 .endm a. decr decrement Operation: rA rA - 1 Assembler Syntax: decr rA Example: decr r6 b. rori rotate right immediate Operation: rB rA rotated right IMM5 bit positions Assembler Syntax: rori rB, rA, IMM5 Example: rori r6, r7, 3 c. halt halt execution Operation: PC PC Assembler Syntax: halt Example: halt d. comp one’s complement Operation: rB ~rA Assembler Syntax: comp rB, rA Example: comp r2, r8
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
ECE 332 Homework 4 Fall 2009 Due: 9/16/2009 Page 2 of 3 2. Create macros that implement the following instructions. These macros may require the usage of additional registers. When a temporary register is needed for temporary values use register r1 . (5 points extra credit each if you use no extra registers)
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern