1. Write an assembly language program to calculate the following sum for N single precision floating point numbers. Use assembly directives to initialize meaningful test data and use variable names within the code. Use a system call to print the result to the I/O window instead of writing the result to memory (this makes it easier to view). Submit a hard copy of your commented source file (.asm) and a screen shot of the
result. Compare the result with your hand calculated sum.
nΣ??=1 (???? - 82.0116)2
2. Translate the following instruction into machine code, replacing pseudo-code where necessary. Show all your work in binary, but report the machine code for each instruction in hexadecimal.
.data
Array: .double 100.198,-0.983,10000.5,0.00745,8
Constant: .double 0.1
Result: .double 0
.text
ldc1 $f0,Constant
lwc1 $f2,100($t1)
sub.d $f20,$f22,$f24
sdc1 $f0,Result
Show all work. And, as always, homework is to be single-sided and stapled.