You are on page 1of 1

.data

aex: .word 3
bex: .word 4
cex: .word 2
dex: .word 1
eex: .word 10
msg1: .asciiz "This program evaluates a=a*b/c%d+e "
msg2: .asciiz "The answer: "
crlf: .byte 0xd,0xa,0
.text
.globl main
main:
li $v0,4
la $a0,msg1
syscall
lw $t0,aex
lw $t1,bex
lw $t2,cex
lw $t3,dex
lw $t4,eex
mult $t0,$t1
mflo $t0
div $t0,$t2
mflo $t0
div $t0,$t3
mfhi $t0
add $t0,$t0,$t4
li $v0,4
la $a0,msg2
syscall
sw $t0,aex
li $v0,1
lw $a0,aex
syscall
li $v0,10
syscall
.end main