I am converting a C++ project in Mips assembly language. In c++ you can initialize an array like
int array[5]={1,2,3,4,5};
How can I initialize an array of characters in MIPS assembly language?
I am converting a C++ project in Mips assembly language. In c++ you can initialize an array like
int array[5]={1,2,3,4,5};
How can I initialize an array of characters in MIPS assembly language?
In MIPS assembly you would instruct the assembler to statically allocate enough memory for the array, and its initial value using the directives
.data
and.word
. E.g:This works for compile-time defined variables. If your intent is to dynamically allocate the array you'd have to do it yourself.