I am assigned to write a program that should multiply and then add four double precision points values in MIPS I wrote the following code,
.data
doubleval1: .double 7.2
doubleval2: .double 6.7
doubleval3: .double 3.3
doubleval4: .double 1.2
.text
l.d $f0,doubleval1
l.d $f2,doubleval2
mul.d $f12, $f0, $f2
li $v0, 3
syscall
l.d $f4,doubleval3
l.d $f6,doubleval4
mul.d $f12, $f4, $f6
li $v0, 3
syscall
This code multiply all the predefined inputs, I want to ask can I add them all together? as it is the question requirement “then add four double precision points values”, Thank you.