I want to generate random words in MIPS. I know how to generate random numbers, I just want a random word from a word bank. I have tried this but I have no idea how to print them.
.data
### WORD BANK ###
a0: .asciiz "computer"
b1: .asciiz "processor"
c2: .asciiz "motherboard"
d3: .asciiz "graphics"
e4: .asciiz "network"
f5: .asciiz "ethernet"
g6: .asciiz "memory"
h7: .asciiz "microsoft"
i8: .asciiz "linux"
j9: .asciiz "transistor"
k10: .asciiz "antidisestablishmentarianism"
l11: .asciiz "protocol"
m12: .asciiz "instruction"
word: .word a0,b1,c2,d3,e4,f5,g6,h7,i8,j9,k10,l11,m12
.text
la $To,word
How may I choose a random word from a given list?
If you have a randomly generated number
nin the range of int, find the index of your number using the remainder ofndivided by word bank size (in this case, 13). If you have an upper bound for the RNG set it to the word bank size. Then just load the string using the index from memory.