Write an arm assembly code to implement a loop for factorial

Assignment Help Basic Computer Science
Reference no: EM13999555

Project 2:

Part-1:

Write an ARM assembly code to implement a loop for calculating factorial of an integer N. For example if the input N from the standard input is equal to 5, it should return 120 (i.e, 5! ); the result (i.e, 120) should be printed on the standard output.

Part-2:

1. Repeat part-1 for N factorial, by adding code to measure program execution time in
milliseconds. This can be achieved by reading system time and storing it into a General Purpose Register (GPR), or preferably in memory location, and before the program exits read system time again the difference is the time elapsed for execution. Write the elapsed time in the output file on the same line as the factorial number in tabular form. Example:
Number ---------- 5
Factorial ----------- 120
Time elapsed (ms) ---------------------- 351

Once you have your program working and creating the proper out file as shown in the example above, move to next step.

2. Repeat step 1 using by having the following numbers in your input file to calculate their factorial and the output file must have one entry for each number as shown in the example table in previous step. The numbers to use in your input file are:
5, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20

Note: add appropriate comments to your assembly code explaining what each instruction does in the context of your program.

Reference no: EM13999555

Questions Cloud

Calculate the rotational kinetic energy : Calculate the rotational kinetic energy, and the magnitude of the angular momentum of the disc. The centre-of-mass rotational inertia of a disc is Icm - mr2/2.
What is the mass of the airplane : An 1800-kg tractor exerts a force of 1.75 x 10^4 N backward on the pavement, and the system experiences forces resisting motion that total 2400 N. If the acceleration is 0.150 m/s2, what is the mass of the airplane?
What force would you have to exert perpendicular to center : Suppose your car was mired deeply in the mud and you wanted to use the method illustrated in Figure 4.29 to pull it out. (a) What force would you have to exert perpendicular to the center of the rope to produce a force of 12,000 N on the car if th..
How much energy is required to assemble given three charges : What is the magnitude and direction of the net electrostatic force on charge q1? How much energy is required to assemble these three charges?
Write an arm assembly code to implement a loop for factorial : Write an ARM assembly code to implement a loop for calculating factorial of an integer N. For example if the input N from the standard input is equal to 5, it should return 120 (i.e, 5! ); the result (i.e, 120) should be printed on the standard ou..
How much does the upper arm bone shorten in length : During a wrestling match, a 150 kg wrestler briefly stands on one hand during a maneuver designed to perplex his already moribund adversary. By how much does the upper arm bone shorten in length? The bone can be represented by a uniform rod 38.0 ..
Create a single record form using the employees table : The file will be renamed automatically to include your name. Change the project file name if directed to do so by your instructor. If necessary, enable active content again. Create a Single Record form using the Employees table as the record source
Calculate the magnetic field in the solenoid : An air-filled toroidal solenoid has 390 turns of wire, a mean radius of 15.0 cm , and a cross-sectional area of 5.00 cm2 . If the current is 5.40 A , calculate the magnetic field in the solenoid.
Find the tension in the rope and the steel beam : A mass of 120 kg is suspended on a rope and a steel beam as shown on the diagram below. d1 = 2 m, d2 = 4m, and d3 = 5m. Draw a diagram that shows all the forces involved in this problem. Find the tension in the rope and the steel beam.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Continuations in place of exceptions

In addition to continuations that represent the "normal" continued execution of a program, we can use continuations in place of exceptions. For example, consider the following function f that raises an exception when the argument x is too small:

  Analyze the potential readability

Analyze the potential readability problems with using closure reserved words for control statements that are the reverse of the corresponding initial reserved words

  Describe how you identified options for handling challenges

Describe how you identified/evaluated options for handling those challenges. Describe how you resolved/overcame the challenge(s)

  Write a program that reads from the external file

write a program that reads from the external file input.txt, counts the letters in every word , replaces the word by that number and then writes the numbers to an external file output.txt

  Write method "design" which takes integer size as parameters

Write the method "design" which takes an integer size as parameter, and prints a "design square" with the following characteristics:

  Snow fall program

Snow Fall Program: A Write a program that can be used by a ski resort to keep track if local snow conditions for one week. It should have two seven-element arrays to store the date and number of inches of snow. First, the program should ask the user ..

  Database security for the database software installed

Discuss with clear explanation the database security for the database software installed in thelaboratory in your center. Your discussion must cover the tools available for the customizationand the best practice for assigning of privileges, author..

  Physical vs. logical system models

Your intern is confused about the difference between physical and logical system models.  Explain the difference between the two models to her and give at least one example for each of the two models

  What is the q complexity of the sum

What is the Q complexity of the sum? Please give a detailed answer so that I may learn from it. Thank you!

  Integrate a sql statement in a php document

Do a PHP While Loop, and also integrate a SQL statement in a PHP document.

  Information system to support the business

As a part of the final project for this course you will be doing research for a medium size (approximately 200 employees) widget manufacturing company to do a complete evaluation of their computer needs and make recommendations to them about an in..

  Application that is widely used across many platforms

Discussion consist of Internet research and analysis by students on the typical uses of Microsoft Excel. Excel 2013 is Microsoft's spreadsheet application that is widely used across many platforms and for many uses, both professionally and per..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd