Question: Create a procedure named FindLargest that receives two parameters: a pointer to a signed doubleword array and the array's length. The procedure must return the

Create a procedure named FindLargest that receives two parameters: a pointer to a signed doubleword array and the array's length. The procedure must return the value of the largest array member in EAX. Use the PROC directive with a parameter list when declaring the procedure. Preserve all registers (except EAX) that are modified by the procedure. Write a test program that calls FindLargest and passes three different arrays of lengths. Be sure to include negative values in your arrays. Create a PROTO declaration for FindLargest.

INCLUDE Irvine32.inc

.data

.code

FindLargest PROC,

arrayNum: ptr dword,

arraySize: dword

mov esi, arrayNum

mov ecx, arraySize

mov eax, [esi]

dec ecx

ScanArray:

add esi, 5

mov ebx, [esi]

cmp ebx, eax

jle checkNumber

mov eax, ebx

CheckNumber:

loop scanArray

ret

exit

FindLargest ENDP

END FindLargest

Step by Step Solution

3.51 Rating (148 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!