Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i have this code and i have only one error code that is messing up everything please help this is the prompt i am wanting

i have this code and i have only one error code that is messing up everything please help this is the prompt i am wanting to achieve f =(g + h -3)-(i +7)
instead of starting with the variables in registers, instead read the 3 inputs from memory locations defined in a data section of your program, and output the result to another location in the data section this is my code below :
.data
g: .word 0 # g input
h: .word 0 # h input
i: .word 0 # i input
result: .word 0 # Result storage
.text
lw x10, g # Load g from memory into register x10
lw x11, h # Load h from memory into register x11
lw x12, i # Load i from memory into register x12
add x20, x10, x11 # Calculate (g+h)
addi x20, x20,-3 # Subtract 3 from (g+h), result in x20
addi x13, x12,7 # Calculate (i+7), store in temporary register x13
sub x20, x20, x13 # Subtract (i+7) from (g+h-3), result in x20
sw x20, result # Store the result in memory location 'result'
Error in C:\Users\fleno\OneDrive\Documents\Comp and arch\Hw7.asm line 17 column 5: "sw": Too few or incorrectly formatted operands. Expected: sw t1,-100(t2)
Assemble: operation completed with errors

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Structured Search For Big Data From Keywords To Key-objects

Authors: Mikhail Gilula

1st Edition

012804652X, 9780128046524

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago