Write an assembly language program to perform operation

Assignment Help Programming Languages
Reference no: EM131737166

Project Description: In this assignment, you will write an assembly language program to perform the following operation: Input a positive integer N, then compute the sum of the integers equal to N.

SUM=1+4+9+?+N

The user input will ALWAYS be a two-digit number (between 01 and 10). You do NOT need to check the correctness of the input. For example, if the user input is "10", then your program will output "385". 

SUM=1+4+9+16+25+36+49+64+81+100=385

Design Document Specifications

To process the input, I will read the first input as an ASCII symbol and store in Register A.  I will then convert the ASCII in Register A to a number using the formula; Register B = Register A - '0'.  I will then read the second ASCII symbol and store it in Register A.  The ASCII in Register A will be converted to a number by the formula; Register A = Register A - '0'.  Multiply the value in Register B and add it with the value that is stored in Register A as follows; Register B = (Register B * 10) + Register A.  After these steps, we have converted a two digit ASCII input into a two digit number and stored it in Register B.

For computing the sum, we will need to handle a loop.  To handle the loop, we use a separate register as a counter.  i.e. Register C, and Register D are used to maintain the sum.  After each loop, the value in register C is increased by 1 until it equals the value in Register B and the loop will stop.  In each loop, we will use Register E to calculate the square of register C, then add the current value of Register D and Register E.  The resulting sum is stored in Register D.  Finally, the value in register D is the sum we need to calculate; Sum = 1 + 4 + 9 + ... + N.

Attachment:- Assignment Files.rar

Reference no: EM131737166

Questions Cloud

Lenders try to estimate the expected rate of inflation : To protect themselves from the effects of inflation, lenders try to estimate the expected rate of inflation. True or False?
How the implementation and use of cac will impact : you are the Coding Supervisor at Rasmussen Hospital and Clinics. Your staff consists of five coders who code inpatient, outpatient, and the professional fees
What is monopolistic about monopolistic competition : What is "monopolistic" about monopolistic competition? What is "competitive" about a monopolistically competitive market? Please explain.
Analyze the change from the current and prior years : Analyze the change from the current and prior years in each of these key areas and determine if the changes would be positive or negative from an investor.
Write an assembly language program to perform operation : Write an assembly language program to perform the following operation: Input a positive integer N, then compute the sum of the integers equal to N
Impact of monetary and fiscal policy on consumer spending : In 2001.3, the Bush Administration directed the Treasury to send checks of $300 to $600 to most taxpayers as an ‘‘advance'' payment on the 2002 tax reduction.
Discuss what causes malnutrition or nutritional deficiencies : How does malnutrition affect the body and an individual's development
Economy affect its income and output : How do injections and withdrawals into an economy affect its income and output?
Compare two sources of financing you might obtain : Suppose you need $1 million dollars to start your Dream Business. Compare two sources of financing you might obtain. Identify risks and benefit of your choices.

Reviews

len1737166

11/25/2017 1:54:20 AM

Attached are the directions to now complete the actual program for the design document that was created previously. Follow what is written in the design document specifications and the project description attached. Please use Assembler.jar as the simulator for the code to run. Instructions for its use and example code is attached.

Write a Review

Programming Languages Questions & Answers

  Design and draw a ladder diagram circuit

Design and draw a ladder diagram circuit suitable for a PLC which will fulfil the following control requirement and explain briefly the technique of multiplexed switching of analogue signals

  Pseudocode for linear search by using clrs3e style

Write pseudocode for linear search by using CLRS3e style used in, which scans through the sequence, looking for v.

  Write application to input numbers in one dimensional array

Use a one dimensional array to solve the following problem: Write an application that inputs five numbers, each between 10 and 100, inclusive.

  Choose two different formats for audio and with each record

Choose two different formats for audio and with each record a short passage of speech and a short passage of music. Try to discern any difference in quality. What do you think?

  Historical principle for loss to the company is minimal

A colleague of yours frequently takes small amounts of office supplies, noting that the loss to the company is minimal. Your rationale expresses which historical principle?

  Conduct experimental study on free and damped vibrations

Conduct an experimental study on the free and damped vibrations - Prepare a report with made for an experiment

  What mistakes did the designer make when designing it

What won't users be able to do with this file, given the way in which it's designed?

  Difference between the 2 graphics

It is the business that has the knowledge about their entities (things of importance) and what kind of unique information that separate them (invoice numbers, customer IDs, and so on).

  Design application to declare an array

Design an application that declares an array of 10 HousePlants. Prompt the user user for data for each of the HousePlants, then display all the values.

  A java inputstram object called x

A java inputstram object called X how do I extract a string from this object?

  Prepare a mips program to perform the operations

prepare a MIPS program to perform the operations - Write and debug a MIPS program that performs the  operations.

  Perform the unknown mathematical operation

Loop the program using a WHILE LOOP to get the next equation to be tested and repeat the process - Write a program to test for the case of a math equation entered via the keyboard using the SWITCH-CASE operator.

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