project3MIPS - la $a0, Space syscall li $v0, 1 lw $a0,...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 .data Larger:.word0 Smaller:.word0 Remainder:.word0 Heading:.asciiz"LargerSmallerRemainder" Words:.asciiz"The greatest common divisor is " Space:.asciiz" " NextLine:.asciiz"\n" .text li $t0, 7764 sw $t0, Larger li $t1, 3648 sw $t1, Smaller li $t2, 0 sw $t2, Remainder # Prints out heading for Program # li $v0, 4 la $a0, Heading syscall li $v0, 4 la $a0, NextLine syscall #Loop for the Euclidean Algorithm Loop:div $t0, $t1 mfhi $t2 sw $t2, Remainder li $v0, 1 lw $a0, Larger syscall li $v0, 4 la $a0, Space syscall li $v0, 1 lw, $a0, Smaller syscall li $v0, 4
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: la $a0, Space syscall li $v0, 1 lw $a0, Remainder syscall li $v0, 4 la $a0, NextLine syscall move $t0, $t1 sw $t0, Larger Sheet1 Page 2 move $t1, $t2 sw $t1, Smaller beq $t1, 0, done j Loop done: li $v0, 4 la $a0, NextLine syscall li $v0, 4 la $a0, Words syscall li $v0, 1 lw $a0, Larger syscall #End Program li $v0, 10 syscall #LargerSmallerRemainder #7764 3648 468 #3648 468 372 #468 372 96 #372 96 84 #96 84 12 #84 12 #The greatest common divisor is 12 #-- program is finished running --...
View Full Document

This note was uploaded on 04/17/2008 for the course CS 312 taught by Professor Mcdowell during the Spring '08 term at Rhode Island College.

Page1 / 2

project3MIPS - la $a0, Space syscall li $v0, 1 lw $a0,...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online