Writing an IA-32 Assembly Procedure for Finding K-th Root with Newton-Raphson - Prof. Vlad, Assignments of Computer Architecture and Organization

Instructions for writing an ia-32 assembly language procedure named 'find_kth_root' to estimate the k-th root of a number using the newton-raphson method. The procedure takes parameters x, k, and m, and returns the result in floating-point format in register eax. The document also includes a prototype model and references to textbooks for further study.

Typology: Assignments

2011/2012

Uploaded on 05/18/2012

koofers-user-gi7
koofers-user-gi7 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Web code:
Last name:
First name:
ECE 267 - Computer Organization and Programming
Homework #5
(Attach a typed version of your assembly language code for each part to this cover sheet; you need not run the code to
see if it actually works but this is recommended in order to get the bugs out.)
Write an IA-32 assembly language procedure "Find_Kth_Root" that performs m
iterations of the following recursion1 to estimate k
mxy :
+=
1
1
1)(
)1(
1
k
n
nn y
x
yk
k
y
Pass parameters x, k and m as parameters when invoking the procedure, and return ym
in register EAX in floating-point format. Initialize y0 = x.
Here is the prototype model that should be used:
Find_Kth_Root PROTO,
X:REAL4,
K:DWORD,
M:DWORD
Be sure to save and then restore the contents of all registers that are used for temporary
storage. A description of the floating-point coprocessor is found in our textbook's Ch.17
on the CDROM; another excellent source is Chapter 14 of the on-line text "Art of
Assembly Language" by Randall Hyde:
http://webster.cs.ucr.edu/AoA/DOS/AoADosIndex.html
1 This is the Newton-Raphson method of recursively solving for the k-th root of a number

Partial preview of the text

Download Writing an IA-32 Assembly Procedure for Finding K-th Root with Newton-Raphson - Prof. Vlad and more Assignments Computer Architecture and Organization in PDF only on Docsity!

Web code:

Last name:

First name:

ECE 267 - Computer Organization and Programming

Homework # (Attach a typed version of your assembly language code for each part to this cover sheet; you need not run the code to see if it actually works but this is recommended in order to get the bugs out.)

Write an IA-32 assembly language procedure "Find_Kth_Root" that performs m iterations of the following recursion 1 to estimate y (^) mkx :

− (^1) 1

k n

n n y k y x k

y

Pass parameters x , k and m as parameters when invoking the procedure, and return y (^) m in register EAX in floating-point format. Initialize y 0 = x.

Here is the prototype model that should be used:

Find_Kth_Root PROTO, X:REAL4, K:DWORD, M:DWORD

Be sure to save and then restore the contents of all registers that are used for temporary storage. A description of the floating-point coprocessor is found in our textbook's Ch. on the CDROM; another excellent source is Chapter 14 of the on-line text "Art of Assembly Language" by Randall Hyde:

http://webster.cs.ucr.edu/AoA/DOS/AoADosIndex.html

(^1) This is the Newton-Raphson method of recursively solving for the k -th root of a number