Question

Define 2 variables vx and vy. Initialize vx and vy with numbers 100 and 200 respectively....

Define 2 variables vx and vy. Initialize vx and vy with numbers 100 and 200 respectively. Prompt user to enter 2 numbers, save them into vx and vy.

This is meant to be done in MIPS assembly language.

Homework Answers

Answer #1

.data
   ask_v1:    .asciiz "Enter v1: "
   ask_v2:    .asciiz "Enter v2: "
   result:    .asciiz "You entered "
   and_s: .asciiz " and "
   
   vx:    .word 100
   vy:    .word 200
.text
   la $a0, ask_v1
   li $v0, 4
   syscall
   
   li $v0, 5
   syscall
   sw $v0, vx
   
   la $a0, ask_v2
   li $v0, 4
   syscall
   
   li $v0, 5
   syscall
   sw $v0, vy
   
   la $a0, result
   li $v0, 4
   syscall
   
   lw $a0, vx
   li $v0, 1
   syscall
   
   la $a0, and_s
   li $v0, 4
   syscall
   
   lw $a0, vy
   li $v0, 1
   syscall



Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
2. Write a java program to: Define 3 integer variables var4, var5, and var6. Initialize these...
2. Write a java program to: Define 3 integer variables var4, var5, and var6. Initialize these variables with numbers input from console Right shift values in var4, var5 and var6, so var6 will get var5’s value, var5 will get var4’s value and var4 will get var6’s value Calculate the average of these numbers and save it into variable avg Display the following message: “the average of numbers value4, value5 and value6 is average-value”. (value4, value5, value6 and average-value should be...
please write the code in java so it can run on jGRASP import java.util.Scanner; 2 import...
please write the code in java so it can run on jGRASP import java.util.Scanner; 2 import java.io.*; //This imports input and output (io) classes that we use 3 //to read and write to files. The * is the wildcard that will 4 //make all of the io classes available if I need them 5 //It saves me from having to import each io class separately. 6 /** 7 This program reads numbers from a file, calculates the 8 mean (average)...
2. SECURING THE WORKFORCE Diversity management in X-tech, a Japanese organisation This case is intended to...
2. SECURING THE WORKFORCE Diversity management in X-tech, a Japanese organisation This case is intended to be used as a basis for class discussion rather than as an illustration of the effective or ineffective handling of an administrative situation. The name of the company is disguised. INTRODUCTION In light of demographic concerns, in 2012, the Japanese government initiated an effort to change the work environment in order to secure the workforce of the future. Japan is world renowned for its...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...