Question

Write an assembly function to find the minimum number in an array of N integers. The inputs are: ...

  1. Write an assembly function to find the minimum number in an array of N integers. The inputs are: the address of an array and the number N; the output is the minimum value in this array. Please 1) Draw the stack frame of this function; and 2) implement the function in assembly and comment each line.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

*Assembly language program for finding the minimum number in a given array of N numbers. prnstr macro msg mov ah, 09h lea dx,buf4 db Oah, 2fh, : data ends code segment start: assume cs:code, ds:data mov ax, data mov ds, ax prnstr buf1 mov cx, 000ahmov ah, Oah lea dx, buf2 int 21h mov ax, 0000h mov si, offset buf22 sub byte ptr [si], 30h mov al, byte ptr [si] inc si sub bmov cx, Oah mov di, 0001h mov al, byte ptr [bx+di] next1: cmp al, byte ptr [bx+di] jb continue mov al, byte ptr [bx+di] contioutside add al, 30h add cl, 30h mov byte ptr [si], al mov byte ptr [si-1], cl prnstr buf3 prnstr buf2+2 mov ax, 4c00h int 21h

Add a comment
Know the answer?
Add Answer to:
Write an assembly function to find the minimum number in an array of N integers. The inputs are: ...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • MIPS CODE required to write an assembly program to find the maximum of an array of integers by...

    required to write an assembly program to find the maximum of anarray of integers by doing the following:1. Prompt user to input array size n (n <= 10)2. Prompt user to input element values of array A one by one3. Display the result on the console.This program must at least include one function. The main program will read the valuesof the array (as user inputs the element values) and stores them in the memory (datasegments section) and at the end...

  • Code in C++ please! Write a function that takes an array of integers as an input...

    Code in C++ please! Write a function that takes an array of integers as an input parameter (the address of the first value of the array). It returns nothing. It prints out the array as a single line, with commas between each number, and when the array is finished being printed, it prints an endl; so that we flush the buffer and move to a new line. (I’m having you write this function because you’ll be wanting to print out...

  • Write a C++ program which inputs an array of integers from user then pass array pointer...

    Write a C++ program which inputs an array of integers from user then pass array pointer to function which will return sum of whole array. Also do same action by using address-based argument of array to another function. Note: In this you need to declare two factions: 1. With argument of pointer type. 2.With argument type of address type

  • Need to write a MIPS assembly program that finds the minimum and maximum and sum of...

    Need to write a MIPS assembly program that finds the minimum and maximum and sum of a stored array. It also finds the locations of the minimum and maximum. The interaction between the main program and the function is solely through the stack. The function stores $ra immediately after being called and restores $ra before returning to main. The main program reserves a static C like array (index starts from 0) of 10 elements and initializes it. The maximum should...

  • (C++) Write a function, remove, that takes three parameters: an array of integers, the number of...

    (C++) Write a function, remove, that takes three parameters: an array of integers, the number of elements in the array, and an integer (say, removeItem). The function should find and delete the first occurrence of removeItem in the array. (Note that after deleting the element, the number of elements in the array is reduced by 1.) Assume that the array is unsorted. Also, write a program to test the function. Your program should prompt the user to enter 10 digits...

  • Write a function to have a user enter some number of integers into an array. The...

    Write a function to have a user enter some number of integers into an array. The integer values must be between -100 and +100 inclusive (+100 and -100 should be accepted as valid inputs). The integer array and the size of the array are passed into the function through parameters. Do not worry about includes. This is only a function, so there is no main routine. The function should fill the array with valid inputs. For invalid input values, inform...

  • Consider the following program that reads a number of nonnegative integers into an array and prints...

    Consider the following program that reads a number of nonnegative integers into an array and prints the contents of the array.   Complete the missing parts, add new function prototypes and function definitions, and test the program several times. Add the following to the program: Write a void function that prints the list of nonnegative integers in reverse. Write a void function that prints all the numbers stored in the list that are greater than 10. It will also print the...

  • Write a C Program that inputs an array of integers from the user along-with the length...

    Write a C Program that inputs an array of integers from the user along-with the length of array. The program then prints out the array of integers in reverse. (You do not need to change (re-assign) the elements in the array, only print the array in reverse.) The program uses a function call with array passed as call by reference. Part of the Program has been given here. You need to complete the Program by writing the function. #include<stdio.h> void...

  • Write a function shuffle that takes an array of 20 integers and then shuffles the integers...

    Write a function shuffle that takes an array of 20 integers and then shuffles the integers using the following algorithm. For each element X of the array, generate a random number N between 0 and 19, inclusive. swap X with the element that corresponds to N.

  • Write a C++ function printArray(A, m, n) that prints an m × n two dimensional array...

    Write a C++ function printArray(A, m, n) that prints an m × n two dimensional array A of integers, declared to be “int** A,” to the standard output. Each of the m rows should appear on a separate line.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT