The integer is moved to in the register file


Read an integer, say x, from the spim console window by printing the message "enter an integer." You do not need to write this part, it is already given to you as part of the homework. The integer is moved to $s0 in the register file.

My question is:
1.Store x in memory location 0x10000020.
2. Multiply x by 8 and store it to the next integer memory location, loc1.
3 Subtract 1 from result of #2 and put the result in $t0.

#this is part of code
.text
.globl __start
__start:
la $a0, msg1
li $v0, 4
syscall

#read integer into $s0
li $v0, 5
syscall
#value read from keyboard returned in register $v0.

add $s0, $zero, $v0 #move $vo to $s0

#########################################################
#Do not touch anything above this line. Write program below.#
#########################################################


####################################
#Do not touch anything below this line.#
####################################

la $a0, msg2
li $v0, 4
syscall
li $v0, 1
= $t0
syscall

# Start of the data segement.

msg1: .asciiz "Enter an integer: "
msg2: .asciiz "The computed result is (hw2_sol): "
#end of hw2_sol.asm 

Request for Solution File

Ask an Expert for Answer!!
Operating System: The integer is moved to in the register file
Reference No:- TGS0119247

Expected delivery within 24 Hours