Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please keep hashtags the same here is the skeleton code .data # allocating space for both strings str: .space 128 res: .space 128 .globl main
Please keep hashtags the same here is the skeleton code
.data | |
# allocating space for both strings | |
str: .space 128 | |
res: .space 128 | |
.globl main | |
.text | |
main: | |
# load address of strings | |
la s0, str | |
la s1, res | |
# we do not need LA pseudoinstructions from now on | |
# read a string into str | |
addi a0, s0, 0 | |
addi a1, x0, 120 | |
addi a7, x0, 8 | |
ecall | |
# str's addres is already in s0 | |
# copy res's address to a1 | |
addi a1, s1, 0 | |
# TODO | |
# remove spaces in str | |
# print res | |
# your code assumes str's address is in a0 and res's address is in a1 | |
exit: addi a7, x0, 10 | |
ecall |
Step 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