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

  What are the similarities between risc and cisc

What are the similarities between RISC and CISC

  Create a binary heap class in python

1. Create a binary heap class in python. 2.The Heap class should have a limited heap size.(the heap only keeps track of the n most important items) 3. pass the max heap size in the constructor. (If an element gets added to the heap that makes it grow..

  Privacy-related matrix

This assignment gives you an opportunity to analyze a key IT-related organizational ethical privacy issue subject to relevant laws, regulations, and policies. Both of the following sites provide sources and an excellent backdrop for issues relating t..

  Draw a circuit which implements a 1-to-2 decoder

Q1. Write the truth table for a 1-to-2 decoder. Draw a circuit which implements a 1-to-2 decoder using AND gates, OR gates and NOT gates only.

  Write a complete java program called parser

Write a complete Java program called Parser that gets a comma-delimited String of integers (eg "4,8,16,32,...") from the user at the command line and then converts the String to an ArrayList of Integers (using the wrapper class) with each element con..

  Explain the purpose of the program

If the return value of insurable in the InsureProcess module is true, the program asks for the year of the car. That year is passed to the checkYear module and returns a value of true to the insurable variable, if the car is new enough.

  Write program that will calculate square and cube of numbers

Write a program that will calculate square and cube of numbers ranging from 0 to 10. Print the output like the following table (hint: use for loop, to print as a table use printf formatting for width).

  Create a 3-d clustered column chart of the divisions

Create Line sparklines in column F in the Earnings sheet to show the trend by quarter for each division. Show the high point for each sparkline. Apply the Sparkline Style Colorful #5 style. Create a 3-D Clustered Column chart of the divisions and t..

  Program should display a menu

The program should display a menu allowing the user to enter pointer values by selecting option 1, then perform shallow or deep copy by selecting options 2 or 3. After whcich, your program needs to display the new results after the copy is performed.

  Prpoposed system design that would address any consequence

Describe in detail a proposed system design that would address any consequences of executing the code and how your design would impact the system.

  E-commerce for a building supply company

Capstone Project about E-Commerce for a Building Supply Company. It will consist of web-based front-end allowing customers to place orders and the store owner to see relevant views of the pending orders, together with a backend database in whi..

  Advantages of control structures with arrays

Describe some of the advantages of using repetition control structures with arrays. Provide an example to support your stated advantage.

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