Question: MIPS Assembly language trying to make a paddle using a random x coordinate. Hello, I'm currently having trouble getting the value of a random int

MIPS Assembly language trying to make a paddle using a random x coordinate.

Hello, I'm currently having trouble getting the value of a random int for my code. I guess I don't know how to get the value of syscall 42.

Here is what i have:

draw_paddle: #draws the paddle using a saved x coordinate: s0 li a1, 50 #set upper bound li v0, 42 # 42 is system call code to generate random int syscall # your generated number will be at $a0

move t1, a0 li a0, t1 li a1, 54 li a2, 10 li a3, 2 li v0, COLOR_YELLOW jal Display_FillRect syscall

please tell me what i'm doing wrong. Thanks in advance.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!