HW5 - 0306-250 Assembly Language Programming Fall 2009...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0306-250 Assembly Language Programming Fall 2009 Homework Five 1. Write an assembly language macro (called Total) according to these specifications: a. Accepts a pointer to an array of words in an index register; b. Accepts the number of array elements to total as a word value in another index register; c. Returns the sum of the array elements as a word in the accumulator register. d. Except for the obvious need to modify the register used to return the result, leaves all other registers unchanged after the execution of the expanded macro is complete. 2. Write assembly language code that uses a stack frame to implement the following C function and its call. Do not optimize the function, (i.e., write all intermediate results to variables on the stack frame as indicated in the C code). word MemWord; word IncMemW (word *Pointer) { word MemW; MemW = *Pointer; MemW = MemW + 1; return MemW; } MemWord = IncMemW (&MemWord); Grading Criteria · · · 20 points: Overall presentation—includes macro and subroutine code specified with appropriate comments. 40 points: Macro (Total) - 15 points: Correct parameter usage - 15 points: Correct sum - 10 points: No side effects 40 points: Stack frame subroutine (IncMemW) - 15 points: Correct subroutine call setup and return completion/cleanup - 15 points: Correct subroutine implementation - 10 points: No side effects Page 1 of 1 ...
View Full Document

This note was uploaded on 05/06/2010 for the course EECC 0306-250 taught by Professor Roymelton during the Fall '10 term at RIT.

Ask a homework question - tutors are online