Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help me with an error in my code, in the moveRobot Function:Error in C:UsersDownloadsFinalPJ.asm line 169: Runtime exception at 0x004001dc: address out of range 0x10400000.

Help me with an error in my code, in the moveRobot Function:Error in C:\Users\Downloads\FinalPJ.asm line 169: Runtime exception at 0x004001dc: address out of range 0x10400000. Here is line sw $v0, 0($s1) # Update robot's y-coordinate.

Here is the entire ASM code MARS4 MIP:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

\# \# A proper program header goes here... \# \# . data x:.word 0:4#x-coordinates of 4 robots y: .word 0:4 \# y-coordinates of 4 robots str1: .asciiz "Your coordinates: 25 25 n" str2: asciiz "Enter move ( 1 for +x,1 for x,2 for +y,2 for y ):" str3: .asciiz "Your coordinates: " sp: .asciiz" " endl: .asciiz " \ n" str4: .asciiz "Robot at" str5: .asciiz "A.A.ARRRRGHHHH... Game over " #i$s0 \#myX $s1 #myY$s2 \#move $53 \#status $s4 \#temp, pointers \$s5,\$s6 . text \# .globl inc \# .globl getNew main: 1i$s1,25#myX=25 1i$s2,25#myY=25 li $4,1 \# status =1 la $s5,x la $s6,Y sw $0,($55)#x[0]=0;y[0]=0; sw $0,($s6) sw $0,4($s5)#x[1]=0;y[1]=50; li $7,50 sw $s7,4($s6) sw $s7,8($s5)#x[2]=50;y[2]=0; Sw $0,8($s6) SW $s7,12($s5)#x[3]=50;y[3]=50; sw $s7,12($s6) la \$a0,str1 \# cout "Your coordinates: 2525 "; li $vO,4 syscall bne $44,1, main_exitw \# while (status ==1)( main_while: la $a0, str2 \# cout "Enter move (1 for +x, li $v0,4 \# -1 for x,2 for +y,2 for y):", syscall li $v0,5 \# cin move; syscall move $s3,$v0 bne $s3,1, main_elsel \# if (move == 1) add \$sl, \$sl,1 \# myX++; b main_exitif main_elsel: bne \$\$3,-1,main_else2 \# else if (move == -1) add \$s1,\$s1,-1 \# myX--; b main_exitif main_else2: bne \$s3,2,main_else3 \# else if (move ==2 ) add \$s2,\$s2,1 \# #yY++; b main_exitif main_else3: bne $3,2,main_exitif \# else if (move ==2 ) add \$s2,\$s2,-1 \# myY--; main_exitif: la $a0,x status = moveRobots \( (\& x[0], \varangle y[0], m y X, m y Y) \); la $al,y move $a2,$s1 move $a3,$s2 jal moveRobots move $s4,$v0 la $a0,str3 \# cout "Your coordinates: " myX li $v0,4#"m myY endl; syscall move $a0,$s1 li $vo,1 syscall la $a0,sp li $v0,4 syscall move $a0,$s2 li $vo,1 syscall la $a0, endl li $v0,4 syscall la $55,x la $s6,y li $s0,0 for (i=0;i=10, the robot \# coordinate moves 10 units closer to the human coordinate. \# If the absolute difference is $v0,$a0,10# result =arg010; j exitgelse gelsel: blez \$to,gelse2 \# else if (temp > 0) sub $vo,$a0,1 \# result =arg01; j exitgelse gelse2: \# else if (temp == 0) \# result =arg; gelse3: \# else if (temp > -10) \# result =arg0+1; gelse4: bgt $t0,10, exitgelse \# else if (temp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Object Oriented Databases Prentice Hall International Series In Computer Science

Authors: John G. Hughes

1st Edition

0136298745, 978-0136298748

More Books

Students also viewed these Databases questions

Question

Differentiate 3sin(9x+2x)

Answered: 1 week ago

Question

Compute the derivative f(x)=(x-a)(x-b)

Answered: 1 week ago