Question: Basic Example Program The following is a basic example program that allocates an array of 2 integers on the stack, puts random numbers in it
Basic Example Program
The following is a basic example program that allocates an array of integers on the
stack, puts random numbers in it and prints it out.
data
NEWLINE: asciiz
text
globl main #required
main: #required
addi $sp $sp # make space for ints, bytes on the stack
li $a #set up random number system call. use generator
li $a # max random number is
li $v # syscall is random number in a range
syscall # random number is now in
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
