Where do you put data segment in MIPS?

Into the .data section. Check this quick tutorial. The error is telling you you can’t put data (.word 3, 2) in the code segment. “Text segment” is an old style term meaning “code segment” http://en.wikipedia.org/wiki/Code_segment The assembler wants you to declare a data segment and put the array there.
For More Information Please Refer:
You May Also Like to Read:
How to sort an array in MIPS assembly?