Write an assembly program for the MiniRISC processor based on your homework code. (Homework code: 6521743) [требует правки]
177
04 декабря 2017, 17:26
Your task is to write an assembly program for the MiniRISC processor. Based on your homework
code (the same as in homework #1) the task is the following:
a. (Preparation: no assembly code is needed, you just have to select your task) If the first digit of your
code is <=4 if the digit is odd you have to find the second smallest value in an array stored in the data
memory at a given address and a given length. If it is even, you have to find the index of the second
smallest value.
If the first digit of your code is >4, then you subtract it from 8. If the resulting digit is odd you have to
find the second largest value in an array stored in the data memory at a given address and a given
length. If it is even, you have to find the index of the second largest value.
The code have to show the resulting value on the LEDs.
The starting address of the array is the sum of the 2nd, 3rd, 4th digit of your code. The length of the
data is the sum of the remaining four bits.
For the homework assignment you can assume that every value stored in the array is different. You can
use any algorithm to solve the task, only: it should work correctly on any array stored in the memory.