Question

Starting with the PROC directive and ending with the ENP directive, write an 80x86 procedure that...

Starting with the PROC directive and ending with the ENP directive, write an 80x86 procedure that implements the function described by the following C++ function header:

int arrMin(int arr[], int count);

// if count > 0 returns minimum of the first count elements of arr

// otherwise returns 99999

Follow 32-bit cdecl protocol.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

;ASSUME AX HAS COUNT

;ASSUME SI HAS POINTER TO ARRAY BEGINNING

;ASSUME IT IS A BYTE ARRAY

;RETURN MIN / RESULT IN DX

ARRMIN PROC NEAR

CMP AX,0

JL X1:

MOV CX,AX

MOV DX,[SI]

X2: CMP [SI],DX

JLE X4

JMP X5

X4: MOV DX,[SI]

X5: INC SI

DEC CX

JE X2

JMP X3

X1: MOV DX,99999D

X3:

ARRMIN ENDP

Add a comment
Know the answer?
Add Answer to:
Starting with the PROC directive and ending with the ENP directive, write an 80x86 procedure that...
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
  • PROC directive

    Starting with the PROC directive and ending with the ENP directive, write an 80x86 procedure that implements the function described by the following C++ function header:     void arrMix(int arr1[], int arr2[], int arr3[], int count);     // for i=0, 1,...,count-1 bits 0-7 and 16-23 of arr3[i] come     // from arr1[i] and bits 8-15 and 24-31 come from arr2[i]            Follow 32-bit cdecl protocol.

  • INTEL 80x86 ASSEMBLY LANGUAGE CODE Write a windows32 assembly language program that utilizes a recursive procedure....

    INTEL 80x86 ASSEMBLY LANGUAGE CODE Write a windows32 assembly language program that utilizes a recursive procedure. The main (_MainProc) procedure should: accept, from the user, a positive integer. Guard against non-positive integers being entered using a loop. call the sumseries sub-procedure using the cdecl protocol, receive the results of the sub-procedure, and display the results. The sumseries sub-procedure should: recursively find the sum of the series: 1*2 + 2*3 + 3*4 + ... + i*(i+1) (This is an iterative definition....

  • Suppose you want to determine if a string contains all lowercase letters. For this purpose you...

    Suppose you want to determine if a string contains all lowercase letters. For this purpose you are going to write a procedure allLower. A C++ header for this procedure might look like int allLower (char str[]) // precondition: str is a null terminated string // postcondition: // returns true (-1) if str contains nly ї we r case letters returns false (0) if str contains any other character Using 32-bit cdecl protocol, write assembly language code to implement hasLower

  • 5. (40 Points) Write a complete Java class named ArrayMethods that implements the methods listed below....

    5. (40 Points) Write a complete Java class named ArrayMethods that implements the methods listed below. All the methods accept the following parameters: Parameters: intar An array of int values. int firstIndex The index of the first element to include in the sum. int lastIndex The index of the last element to include in the sum. Please note that all methods must verify the validity of first Index and lastIndex. public static int sum(int[] arr, int first Index, int lastIndex)...

  • write a C program!! Q2 and Q3 Write the following functioned int search(int a[], int n,...

    write a C program!! Q2 and Q3 Write the following functioned int search(int a[], int n, int key, int **loc); a is an array to be searched, n is the number of elements in the array, key is the search key, and loc is a pointer to the first location of the search key in array a (if found) or NULL otherwise. The function returns 1 if key is found in a, and returns 0 otherwise. Write a main() and...

  • Write a client method that returns a count of the number of nodes in a binary...

    Write a client method that returns a count of the number of nodes in a binary search tree that contain scores less than or equal to a passed-in argument (parameter) value. The method header is: int countLowerScores (BinarySearchTree tree, int maxValue) The BinarySearchTree contains these methods in the picture. public class BinarySearchTreecT> implements BSTInterfacecT> //reference to the root of this BST public BSTNode<T> root; public Comparator<T> comp: IIused for all comparisons public boolean found: / used by remove public BinarYSearchTree()...

  • Write the code to dynamically allocate ONE integer variable using calloc (contiguous allocation) or malloc (memory...

    Write the code to dynamically allocate ONE integer variable using calloc (contiguous allocation) or malloc (memory allocation) and have it pointed to by a pointer (of type int * ) named ptr_1. Use ptr_1 to assign the number 7 to that dynamically allocated integer, and in another line use printf to output the contents of that dynamically allocated integer variable. Write the code to dynamically allocate an integer array of length 5 using calloc or malloc and have it pointed...

  • 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++ Algorithms) Given the following function declarations, write the definitions according to the specifications of each....

    (C++ Algorithms) Given the following function declarations, write the definitions according to the specifications of each. All of the algorithms you are being asked to implement operate on pointer ranges. A *pointer range* is a pair of pointers referring to a sequence of objects. For example: int a[] = {1, 2, 3, 4, 5}; int* first = a + 1; int* limit = first + 3; Here, first and limit are pointers to objects in or past the end of...

  • I need a c++ code please. 32. Program. Write a program that creates an integer constant...

    I need a c++ code please. 32. Program. Write a program that creates an integer constant called SIZE and initialize to the size of the array you will be creating. Use this constant throughout your functions you will implement for the next parts and your main program. Also, in your main program create an integer array called numbers and initialize it with the following values (Please see demo program below): 68, 100, 43, 58, 76, 72, 46, 55, 92, 94,...

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