Question: Given this code, write the assembly code for this in Microsoft x 8 6 - 6 4 Windows. Given that data contains heap _ count:
Given this code, write the assembly code for this in Microsoft x Windows. Given that data contains heapcount: long
RECORD heapremove;
This function removes the smallest value in the heap, ie
the value at the root node at array index and returns
that smallest value which is a pointer to a record
Before returning, it writes the value of the last
leaf at index heapcount of the array into to the
root node and then calls siftdown above, to
restore the heap property.
RECORD heapremove
if heapcount
printfError: Heap is empty
;
exit;
RECORD result heap;
heapcount;
heap heapheapcount;
siftdown;
return result;
data
globl heapcount
heapcount:
long # Initialize heapcount to
errormsg:
asciz "Error: Heap is empty"
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
