Question

CMPE 263-SPRING 2019-HW-3 Hint. For all the codes required, run them in the Basic Computer Simulator...

CMPE 263-SPRING 2019-HW-3 Hint. For all the codes required, run them in the Basic Computer Simulator with two print screens, one shows code, registers, memory involved before run, and the second after run. Without them, the mark will reduce to ½.

Q2. Write a subroutine code to divide two positive numbers by repeated subtraction method. For example, to divide 100 over 8 by subtracting 8 from 100 until the reminder be less than 8, then count the times of the subtractions, to give the result. The first number, second number, and then the result locations must follow the calling code.


assembly language
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer :


Program to add two 128 bit data:-

class Add
{
public static void main (String args[])
{
Add operator + (const Add & rhs)
{
int High;
int Low,
Add Sum;
sum.High = High + rhs.High;
sum.Low = Low + rhs.Low;

// now check for overflow of low 64 bits and add a carry to high
if (sum.Low < Low)
++Sum.High;
return Sum;
}
Add operator-(const Add & rhs)
{
Add diff;
diff.High= High- rhs.High;
diff.Low = Low - rhs.Low;
// now check for underflow condition of low 64 bits and subtract carry to high
if (diff.Low> Low)
--diff.High;
return diff;
}

private:
INT64 High;
UINT64 Low;
};


Add a comment
Know the answer?
Add Answer to:
CMPE 263-SPRING 2019-HW-3 Hint. For all the codes required, run them in the Basic Computer Simulator...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • CMPE 263-SPRING 2019-HW-3 Hint. For all the codes required, run them in the Basic Computer Simula...

    CMPE 263-SPRING 2019-HW-3 Hint. For all the codes required, run them in the Basic Computer Simulator with two print screens, one shows code, registers, memory involved before run, and the second after run. Without them, the mark will reduce to ½. Q1.Write a program loop using a pointer and a counter that get the negative of the contents of memory locations 300through 30F.

  • CMPE 263-SPRING 2019-HW-3 Hint. For all the codes required, run them in the Basic Computer Simula...

    CMPE 263-SPRING 2019-HW-3 Hint. For all the codes required, run them in the Basic Computer Simulator with two print screens, one shows code, registers, memory involved before run, and the second after run. Without them, the mark will reduce to ½. Q3. Assume in locations A and B resides two 8 bit signed magnitudenumbers. Write an assembly subroutine code to multiply them and saves the result in C location. Start your code from 100. The code should be general for...

  • Write a subroutine code to divide two positive numbers by repeated subtraction method. For exampl...

    Write a subroutine code to divide two positive numbers by repeated subtraction method. For example, to divide 100 over 8 by subtracting 8 from 100 until the reminder be less than 8, then count the times of the subtractions, to give the result. The first number, second number, and then the result locations must follow the calling code. I need the solution using assembly language not java or c++, please..!!!!

  • Write a subroutine code in ASSEMBLY LANGUAGE (Mano format) to divide two positive numbers by repe...

    Write a subroutine code in ASSEMBLY LANGUAGE (Mano format) to divide two positive numbers by repeated subtraction method. For example, to divide 100 over 8 by subtracting 8 from 100 until the reminder be less than 8, then count the times of the subtractions, to give the result. The first number, second number, and then the result locations must follow the calling code. PLEASE WRITE YOUR ANSWER IN ASSEMBLY LANGUAGE ONLY.

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • summarizr the followung info and write them in your own words and break them into different...

    summarizr the followung info and write them in your own words and break them into different key points.   6.5 Metering Chamber: 6.5.1 The minimum size of the metering box is governed by the metering area required to obtain a representative test area for the specimen (see 7.2) and for maintenance of reasonable test accuracy. For example, for specimens incorporating air spaces or stud spaces, the metering area shall span an integral number of spaces (see 5.5). The depth of...

  • This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation...

    This C++ Program consists of: operator overloading, as well as experience with managing dynamic memory allocation inside a class. Task One common limitation of programming languages is that the built-in types are limited to smaller finite ranges of storage. For instance, the built-in int type in C++ is 4 bytes in most systems today, allowing for about 4 billion different numbers. The regular int splits this range between positive and negative numbers, but even an unsigned int (assuming 4 bytes)...

  • summatize the following info and break them into differeng key points. write them in yojr own...

    summatize the following info and break them into differeng key points. write them in yojr own words   apartus 6.1 Introduction—The design of a successful hot box appa- ratus is influenced by many factors. Before beginning the design of an apparatus meeting this standard, the designer shall review the discussion on the limitations and accuracy, Section 13, discussions of the energy flows in a hot box, Annex A2, the metering box wall loss flow, Annex A3, and flanking loss, Annex...

  • Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin...

    Code is in C# Your instructor would like to thank to Marty Stepp and Hélène Martin at the University of Washington, Seattle, who originally wrote this assignment (for their CSE 142, in Java) This program focuses on classes and objects. Turn in two files named Birthday.cs and Date.cs. You will also need the support file Date.dll; it is contained in the starter project for this assignment. The assignment has two parts: a client program that uses Date objects, and a...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT