Preview:
# MIPS Lab Assignment 5
# A program to calculate the factorial of a number
.data
x:.asciiz"Enter a number "
.text
li $v0,4
la $a0,x
syscall


li $v0,5
syscall


move $s0,$v0
move $s1,$v0
li $t0,1
loop:
mul $t0,$t0,$s0
addi $s0,$s0,-1
bgtz $s0,loop
li $v0,1
move $a0,$t0
syscall
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter