Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In MIPS: How do I convert integers to characters and then add them, one by one, to a string (array)? Below is the original print
In MIPS: How do I convert integers to characters and then add them, one by one, to a string (array)?
Below is the original print loop I created (and renamed to addtoString) to print the integers themselves to the screen:
Ealt Execute mipsl.asm* 72 73 binLoop1: 74 75 76 78 79 80 81 82 83 84 85 addtoString: 86 87 and $t1, $t0, $t2 #uses AND operation to obtain binary value of input value beq $t1, $zero, addtost ring #prints if AND operation value is 0 add $t1, $0, $zero#otherwise adds 0 to $t1 addi $t1, $0, 1 #adds 1 to $t1 i addtoString 89 90 91 92 93 #addtoString adds the values of binLoopl to a string as they are found addi $v0, $0, 1 #uses syscall code 1 to print integer add $a0, $0, $t1 #move sti to argument register $a0 syscall j binLoop2 94 95 96 Line: 89 Column: 86Show Line Numbers Mars Messages Run I/O Ealt Execute mipsl.asm* 72 73 binLoop1: 74 75 76 78 79 80 81 82 83 84 85 addtoString: 86 87 and $t1, $t0, $t2 #uses AND operation to obtain binary value of input value beq $t1, $zero, addtost ring #prints if AND operation value is 0 add $t1, $0, $zero#otherwise adds 0 to $t1 addi $t1, $0, 1 #adds 1 to $t1 i addtoString 89 90 91 92 93 #addtoString adds the values of binLoopl to a string as they are found addi $v0, $0, 1 #uses syscall code 1 to print integer add $a0, $0, $t1 #move sti to argument register $a0 syscall j binLoop2 94 95 96 Line: 89 Column: 86Show Line Numbers Mars Messages Run I/OStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started