- #1
JAO012
- 3
- 0
Homework Statement
I need to create a program that will prompt for two integers, echo those integers, and then multiply them without using the multiplication operation and report the result.
Homework Equations
The following is what I have so far. The prompts and echoes work, however I do not know how to actually perform the successive addition. I know I need to set up some sort of loop, but I am new to MIPS and assembly and am stuck.
The Attempt at a Solution
.data
prompt_in:
.asciiz "Please input first integer: "
prompt_ina:
.asciiz "\nPlease input second integer: "
prompt_out:
.asciiz "\nThe result is "
num1:
.word 0
num2:
.word 0
echo:
.asciiz "You have input "
echo1:
.asciiz "You have input "
result:
.word 0
.text
.globl main
main:
la $a0,prompt_in
li $v0,4
syscall
li $v0,5
syscall
sw $v0,num1
la $a0,echo
li $v0,4
syscall
lw $a0,num1
li $v0, 1
syscall
la $a0,prompt_ina
li $v0,4
syscall
li $v0,5
syscall
sw $v0,num2
la $a0,echo1
li $v0,4
syscall
lw $a0,num2
li $v0,1
syscall