Question: Design an assembly program that includes a RECURSIVE function for computing the largest number in an array of 3 2 - bit integers. All function
Design an assembly program that includes a RECURSIVE function for computing the largest number in an array of bit integers. All function parameters must be passed in stack.
The first function MAXint array int from, int to should accept an array passed by reference and two indices "from" and to passed by value. It should be based on the divideandconquer approach to compute the maximum by splitting the array A into two almost equal parts A and A in the middle, recursively compute the maximum m over A and m over A and return the maximum of two numbers m and m It should be invoked as MAXA n where n is the array length. In other words, the recursive formula is as follows:
maxa a an maxm m maxmaxa an maxan an
where m maxa an and m maxan an
Please be in the form:
;
AREA RAM, DATA, NOINIT, READWRITE, ALIGN
; ;
AREA text CODE, READONLY
main PROC ; main user code
loop ; periodic task starts here
b loop ; repeat periodic task
ENDP
;
;prompt DCB "Enter a number:
ALIGN
END
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
