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
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
Register Organization of 8086 8086  has  a great  set  of registers  containing  special  purpose and general  purpose  registers.  All the 8086 resisters are 16-bit registers.

General terms for Cache : Cache Hits : When the cache consisted the information requested, the transaction is said to be a cache hit. Cache Miss : When the cache does n

Write a program that defines symbolic constants for all of the days of the week

RCR: Rotate Right through Carry:- This instruction rotates the contents  bit-wise of the destination operand right by the specified count through carry flag (CF). For each operati

Intel 8259 interrupt controller :  The 8088 processor has only two interrupt control inputs, and interrupt request (INTR) and non mask able interrupt (NMI). NMI are interrupts t

MyLocation SDWORD 14 TheTest        SDWORD 8     mov    eax,MyLocation     mov    ebx,TheTest     neg     eax,ebx     sub     eax,ebx Show exactly what lives in eax after executi

write a Mips program that read a string AND PRINT IT ON THE SCREEN

Addressing mode of 8086 : Addressing mode specify a way of locating operands or data. Depending on the data types used the memory  addressing  modes and in the instruction  ,

describes vertical and horizontal web services protocols. Next, identify the similarities and differences between vertical and horizontal web services protocols. Finally, explain w