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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In MIPS assembly you would instruct the assembler to statically allocate enough memory for the array, and its initial value using the directives
.dataand.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.