Question
Please read carefully: To see the usefulness of indexed addressing, consider a simple example involving a list of test scores for students taking a given
Please read carefully:
To see the usefulness of indexed addressing, consider a simple example involving a list of test scores for students taking a given course. Assume that the list of scores, beginning at location LIST. Each record consists of the student's identification (ID) number (4 bytes), followed by the scores the student earned on 3 tests (each test 4 byte). There are n students in the class, and the value n is stored in location LOCN immediately in front of the list. The addresses given for the student IDs and test scores assume that the memory is byte addressable and that the word length is 32 bits.
Write a subroutine that find the address of a certain student by matching his/her student identification number and calculate the average of his/her three tests. Parameters should be passed on the stack; the address of the student id and the average should be also returned on the stack. The content of registers should not be affected by the subroutine.
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