Question
There should be no other functions within main. You are required to define the following at the top of your program: (1) An input array
There should be no other functions within main. You are required to define the following at the top of your program:
(1) An input array label, Array; put this label at address 0x400. (2) The actual array values (see below for sample input)
CREATE A Y86 ASSEMBLY LANGUAGE PROGRAM THAT WILL COUNT THE NUMBER OF ELEMENTS IN AN ARRAY; FIND THE MIN ELEMENT AND THE MAX ELEMENT; THEN WRITE OUT THOSE THREE VALUES IN THE ORDER COUNT, MIN, MAX.
Mandatory filename: lab4.ys PROBLEM:
Write an assembly language program using Y86. DO NOT USE FUNCTIONS. The program should have an input array, defined at the top of the program, with an indeterminate number of values (at least 1 but no more than 25), which appear in unsorted order. The program will need a Main procedure that
counts the number of array elements, then
finds the Min value, then
finds the Max value, then
writes the three values to output.
(3) A label at the end of the input array, Done, with no data value (i.e., the label only) (4) An output label, Output; put this label at address 0x500.
(5) A stack label, Stack, at a high enough address so that the stack will not grow into the output data, the input data, or the code; put this label at address 0xF00.
Example input and memory for output and stack:
#Use appropriate .pos and .align directives here Array:
.quad 12 .quad 2 .quad 16 .quad 10 .quad 13 .quad 27 .quad 10
Done:
#Use appropriate .pos and .align directives here Output:
#Use appropriate .pos and .align directives here Stack:
INPUT:
There are no data errors that need to be checked as all the data will be assumed correct. You can assume that the values in the input array are signed integers, which may be negative, positive, or zero.
Your program should be able to handle an unknown number of array values (between 1 and 25) and still work. That is, you cannot assume that you know how many input values there will be. The grader will change the number of input values in the input array, and the values themselves, to test your program.
You must use the Done label at the end of the input to detect the end of the input array when calculating the count.
You must use the calculated count when parsing through the static array for all other reasons.
You should not change the names of the labels, but you can use any addresses you wish, as long as your program executes correctly, although the addresses given above will definitely work.
CONSTRAINTS:
Your program must have one procedure labeled Main. There should be no other procedures
OUTPUT:
To output data in this program, you must write it to a specified area in memory that starts with the label Output. This area of memory in your program is required to be at the top of your program with the descriptive label given above associated with it.
The output is the number of values in the input Array, the minimum value in the input array, and the maximum value in the input array. For the data given in the problem section above, the output, in hexadecimal, should be:
0x00000007 0xffffffe5 0x00000010
#Number of values in Array #Minimum value #Maximum value
Obviously, the #
0x00000007 0xffffffe5 0x00000010
LAB SUBMISSION
You should submit all your lab assignments electronically using the submit command. Be sure that all
the files you are submitting are in the directory from which you run submit (you should create a lab4 directory and put all files for this lab there) Here are the submit commands for the lab4 assignment:
10:20 submit c2421ad lab4 lab4Readme lab4.ys 1:50 submit c2421aa lab4 lab4Readme lab4.ys 3:00 submit c2421ab lab4 lab4Readme lab4.ys
NOTE:
All of the files in a lab MUST be submitted using one command. If you use two submit commands, the files submitted by the second submit will erase the files from the first submission. Therefore, if you make changes to your files and decide to resubmit the lab assignment before the deadline, be sure to submit all of the required files with a single submit command. Do not press the enter key in the middle of your submit command line; let it wrap to the following line if necessary. Your programs MUST be submitted in source code form. Make sure that you submit a .ys file. Do NOT submit the object file (.yo file).
DO NOT submit a directory rather than individual files. Your score will be a zero if you do.
It is YOUR responsibility to make sure your code can assemble and run on the CSE department server stdlinux.cse.ohiostate.edu using yas and yis as specified earlier in this lab description.
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