Assembly Language HW.

profileBryanAdams
hw10_.pdf

ELEC 385: Computer System Design Homework #10

Due: March 27, 2015 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.

�(𝑥𝑖 − 82.0116)2 𝑁

𝑖=1

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.