Writing IA-32 Assembly Procedure for Complex Square Root with Newton-Raphson, Assignments of Computer Architecture and Organization

Instructions for writing an ia-32 assembly language procedure named 'find_complex_square_root'. The procedure uses the newton-raphson method to estimate the complex square root of a given complex number. The procedure takes the real and imaginary parts of the complex number as input in eax and ebx, and the number of iterations as an unsigned integer in ecx. The procedure returns the estimated complex square root in eax and ebx. The textbook's ch.17 on the cdrom and chapter 14 of the on-line text 'art of assembly language' by randall hyde are recommended resources for understanding the floating-point coprocessor used in this procedure.

Typology: Assignments

2011/2012

Uploaded on 05/18/2012

koofers-user-u8h
koofers-user-u8h 🇺🇸

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 #4
(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_Complex_Square_Root" that
performs m iterations of the following recursion1 to estimate 2xym (where x and y
are complex numbers):
+=
1
1
2
1
n
nn y
x
yy
Pass parameters xreal, ximag in EAX and EBX as REAL4 codes; pass m in ECX as an
unsigned integer code. Return yreal, yimag in EAX and EBX as REAL4 codes
(overwriting x). Initialize y0 = x.
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 IA-32 Assembly Procedure for Complex Square Root with Newton-Raphson 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_Complex_Square_Root" that performs m iterations of the following recursion 1 to estimate y (^) m ≅ 2 x (where x and y are complex numbers):

− 1

1 2

n

n n y

x y y

Pass parameters x (^) real , x (^) imag in EAX and EBX as REAL4 codes; pass m in ECX as an unsigned integer code. Return y (^) real , y (^) imag in EAX and EBX as REAL4 codes (overwriting x ). Initialize y 0 = x.

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