Page 1 of 1

Overview In this question, you will create an amd64/x86-64 assembly language program that loops through an array of inte

Posted: Wed Apr 27, 2022 5:04 pm
by answerhappygod
Overview In This Question You Will Create An Amd64 X86 64 Assembly Language Program That Loops Through An Array Of Inte 1
Overview In This Question You Will Create An Amd64 X86 64 Assembly Language Program That Loops Through An Array Of Inte 1 (108.45 KiB) Viewed 18 times
extern printf
extern scanf
global main
section .text
main:
; YOUR CODE GOES HERE
ret
section .data
Overview In this question, you will create an amd64/x86-64 assembly language program that loops through an array of integers between 1 and 1000, and calculates and prints the minimum of the all even integers in the array. Instructions For your convenience, this zip file contains the outline code (finalexam_assembly.asm) and a Makefile which will build a program with the name finalexam_assembly.asm, and creates an executable named finalexam_assembly.out: • starter code.zip (you will need to extract this file into a known location on your system) Put your code into the file called (finalexam_assembly.asm; to prevent accidentally uploading the wrong file). The outline for this part is as follows: 1. Declare an array of integers, called "nums" o The values should be: 1, 18, 5, 36, 19, 25, 22, 37, 24, 32 2. Declare an integer, called "length" This will contain the length of the array, 10 3. Declare an integer, called "userMinimum" . Only array elements strictly greater than this minimum will be considered 4. Declare a variable to store the minimum even value of those larger than userMinimum) in the array, called "minimum" 5. Display a prompt to the user, asking for a minimum threshold, put this value into userMinimum 6. Find the minimum of all even elements in the array that are greater than userMinimum o Put this value into minimum • Exit the loop when you have examined length numbers from the array 7. Generate a search summary, which displays the minimum of the even array elements greater than user Minimum (minimum) (see sample output, below) Note: You are not required to, and should not, input numbers from the user. You must initialize your array with the numbers given above. Expected Output: Enter a minimum threshold: 11 The minimum even number greater than 11 is 18.