CS计算机代考程序代写 prolog .globl argmax

.globl argmax

.text
# =================================================================
# FUNCTION: Given a int vector, return the index of the largest
# element. If there are multiple, return the one
# with the smallest index.
# Arguments:
# a0 (int*) is the pointer to the start of the vector
# a1 (int) is the # of elements in the vector
# Returns:
# a0 (int) is the first index of the largest element
#
# If the length of the vector is less than 1,
# this function exits with error code 7.
# =================================================================
argmax:

# Prologue

loop_start:

loop_continue:

loop_end:

# Epilogue

ret