Computes the integral square root - assembly program, Assembly Language

Computes the integral square root:

Problem: Square Root:
 
For this problem you will write a short assembly program that computes the integral square root of an input number, A, which is initially stored in R0.  When the program has terminated the square root should be stored in R1, if the input number is negative the output should be -1.  A pseudo-code version of the required algorithm is shown below:
 
Input A: The number whose square root is to be computed

Output B: The approximate square root  - the largest integer such that B*B <= A
 
B=0
If (A >= 0) {
While (B*B <= A) {
    B = B+1
}
}

B = B-1
 
As part of your script function you should set R0 to the input number A. That way you can rerun your program on different inputs by just editing the script file and rerunning.
 
While this algorithm is quite simple, you must comment your assembly code.  If you do not provide some minor comments, points will be taken off your work.  It is best to learn to being using comment appropriately now when it is simple, before it gets complex.  This is going to be true for all programs you author in this class.
 
For this part you should turn in two files: sqrt.asm and sqrt_script.txt

Posted Date: 2/11/2013 2:47:02 AM | Location : United States







Related Discussions:- Computes the integral square root - assembly program, Assignment Help, Ask Question on Computes the integral square root - assembly program, Get Answer, Expert's Help, Computes the integral square root - assembly program Discussions

Write discussion on Computes the integral square root - assembly program
Your posts are moderated
Related Questions
The Intel Processors :         The Intel Corporation is the biggest manufacturer  of microchips  in the world,  in addition  to being  the leading provider of chips for PCs. I

Interrupt System Based on Single 8259 A The 8259A is contained in a 28-pin dual-in-line package that need only a + 5-V supply voltage.  Its organization is shown in given figur

64-bit integer calculator, which processes using 16-bits at a time (reg/mem16 operands)

OR: Logical OR: The OR instruction carries out the OR operation in the similar way as described in case of the AND operation. The restriction on source and destination operands ar

Cache Memory Caching is a technology based on the memory subsystem of any computer. The majoraim of a cache is to accelerate the computer while keeping the cost of the computer

Signal descriptions of 8086 : described below are common for the maximum andminimum mode bothdata lines AD15 -AD0: These are the time multiplexed andmemory I/O address. Addre

Why is the capability to relocate processes desirable?

I am running a small minecraft server off of my old mac mini, and am having a big issue. My computer isn''t very good, and even just running this server is an issue. I use a comma

Overview of Intel Pro-Pentium : The 2 chief players in the PC CPU market are Motorola and Intel.  Intel has enjoyed incredible success with its processors since the early 1980

The addressing modes for the sequential control transfer instructions are described below:   1. Immediate: Immediate data is a part of instruction,in this type of addressin