Question: MIPS function to read coordinates # Local variables for readCoords() function. strtRowPmt: .asciiz Enter Start Coordinates ROW: strtColPmt: .asciiz Enter Start Coordinates
MIPS function to read coordinates
# Local variables for readCoords() function.
strtRowPmt: .asciiz " Enter Start Coordinates ROW: "
strtColPmt: .asciiz " Enter Start Coordinates COL: "
endRowPmt: .asciiz " Enter End Coordinates ROW: "
endColPmt: .asciiz " Enter End Coordinates COL: "
err0: .ascii " Error, invalid coordinate value. "
.asciiz "Please re-enter. "
err1: .ascii " Error, end coordinates must be > then "
.ascii "the start coordinates. "
.asciiz "Please re-enter. "
spc: .asciiz " "
# Prompt for and read start and end coordinates.
# Also, must ensure that:
# each value is between 0 and COORD_MAX
# start coordinates are < end coordinates
# -----
# Arguments:
# startRow, address
# startCol, address
# endRow, address
# endCol, address
# Returns:
# startRow, startCol, endRow, endCol via reference
.globl readCoords
.ent readCoords
readCoords:
#CODE HERE
jr $ra
.end readCoords
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
