Write a program larger that reads two numbers

Assignment Help Programming Languages
Reference no: EM131263296

Write the following simple programs in ARM assembly language. You cannot use gcc-S as a "template". You have to write your own programs by hand in assembly.

1. Write a program larger.s that reads two numbers from stdin, and prints the larger of the two numbers. The numbers can be positive, negative, or zero. To input the numbers to your program, you can use 'scanf' or something similar. Type one number followed by the enter key, then type the second number followed by the enter key, and then print the result to the terminal by using 'printf' or something similar. An example of what the output should look like is shown below.

pi@raspberrypi:∼/cs250/lab-src$ ./larger

-5

7

7

pi@raspberrypi:∼/cs250/lab7-src$ ./larger

1501

0

1501

2. Write a program length.s that reads a string Morn stdin and prin. the length of the string. You cannot use the C library function "strlen in this assignment. The length of the string is guaranteed to be less than 100 characters long, and there will be no while space. Type the string in the terminal and output the length to the terminal. An example output is shown below.

pi@raspberrypi:∼/cs250/lab7-src$ ./length

HelloWorld!

11

pi@raspberrypi:∼/cs250/lab7-src$ ./length

12345678901234567890

20

3. Write a program sumarray.s that reads 5 numbers from stdin and prints the sum of the numbers. The number of inputs is arbitrary and could be many more, so use a loop to read in the 5 numbers. For example, a loop would look like this. In other words, do not copy/paste the scanf and format character 5 times in your Program.

while x < 5

input [x] = scanf("%d")

x++

Reference no: EM131263296

Questions Cloud

What they are doing to support the sustainability effort : At least 3 sources of information as footnotes or separate bibliography, As a conclusion of your report, state your opinion whether this company is using the right (or wrong) approach and should other companies start adopting their methods?
Journal entries to record the initial capital investments : On February 1, 2014, Tessa Williams and Audrey To formed a partnership in the province of Ontario. Williams contributed $90,000 cash and To contributed land valued at $130,000 and a small building valued at $190,000. Present General Journal entries t..
Business productivity and cost reduction : According to the text, the authors asserted that business productivity and cost reduction were the top concerns by a wide margin among the top five management concerns. Give your opinion on whether or not you agree with this assertion. Justify yo..
Find the transition matrix p and the matrices q and r : For the Markov chain of Exercise , find the average number of years a first-year, second-year and third-year. - Find the transition matrix P and the matrices Q and R.
Write a program larger that reads two numbers : Write a program larger.s that reads two numbers from stdin, and prints the larger of the two numbers. The numbers can be positive, negative, or zero
Use positive or negative accounts receivable confirmations : What best describes the situation for the auditor to use positive or negative accounts receivable confirmations? Use negative requests if accounts receivable consists of many small accounts and positive confirmations if accounts receivable consists o..
What is the optimal amount of output the ?rm : Solve for the marginal cost function using your result from part a). Suppose p = 50 and that the ?rm is a price taker. What is the optimal amount of output the ?rm should produce?
Annual cost data at full capacity : The Dorilane Company specializes in producing a set of wood patio furniture consisting of a table and four chairs. The set enjoys great popularity, and the company has ample orders to keep production going at its full capacity of 4,100 sets per year...
Evaluate the level of impact of it on information management : Evaluate the level of impact of IT / enterprise architecture on information management (e.g., the flow of information throughout the company / organization, etc.) within a company or industry of your choice.

Reviews

len1263296

11/2/2016 5:56:05 AM

This assignment should be completed on a Raspberry Pi 3. It would be great if you can add some comment on the code, explain how the instruction works. Write the following simple programs in ARM assembly language. You cannot use gcc-S as a "template". You have to write your own programs by hand in assembly.

Write a Review

Programming Languages Questions & Answers

  Find x from n by n matrix of sorted integers

We want to find out if x is present in M.  It is straightforward to do this in O(n log n) time. Explain such algorithm. (b) Can you do better? Describe your solution

  Implement a single pole-filter design program

This lab requires you to use C++ class composition to implement a single pole-filter design program. The program will allow the user to specify resistor and capacitor values and filter type

  Write pseudocode for procedure construct-optimal-bst

Write pseudocode for procedure Construct-Optimal-BST (root) which, table root, outputs structure of the optimal bimary search tree.

  Design a bigger and harder maze

E91: Humanoid Robotics - Spring 2013 - Assignment 1. Design a bigger and harder maze for the 2D and/or translation/rotation problems and see how it affects planning

  Write a program that reads an initial investment balance

Write a program that reads an initial investment balance and an interest rate. Then print the number of years it takes for the investment to reach one million dollars.

  Create a project displays aisle number of movie category

A Search Button should located the correct location. from the array and display it in a lable. Make sure that the user has selected a category from the list and use the list box SelectedIndex property to find the appropriate aisle number.

  Console application for a furniture company

Write a C# console application for a furniture company.  Ask the user to choose P for pine, O for oak, and M for mahogany. Show the price of a table manufactured with the chosen wood.

  Program to compute total price of items before tax

Program is to compute total price of items before tax and then tax payable on those items. Tax payable is computed by applying tax rate percentage to total price.

  Use the linked stack class to support

Use the Linked stack class to support an application that tracks the status of an online auction. Budding begins at 1(dollars, pounds, euros, or whatever) and proceeds in increments of at least 1

  Accuracy and completeness of computations

Analysis right and you have to develop a plausible argument to "prove" that your analysis is correct

  Write a definition for the following terms

Write a definition for the following terms

  Example on message-passing style

Write a procedure that produces independent first-in-first-out queue objects, using a message-passing style.

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