Calculate the number of elements in an array not counting

Assignment Help Computer Engineering
Reference no: EM132214032

Write a subroutine which satisfies the following:

Name: NElements When the subroutine is entered it expects the stack to look as follows (as looked in word increments):

Top of the stack -> PC counter value

Space for output

Input

Runs Properly on launch pad using Code Composer w/ Assembly Language

Subroutine expects the Input on the stack as shown above: The input is the starting address of an array consisting of word length elements. The last element of the array is expected to be -999.

Subroutine will place one word of output on the stack in the space as shown above: Output is the number of words in the array (not counting the last word which equals -999) whose starting address is in the input.

The subroutine only works with arrays whose last element is -999. It calculates the number of elements in an array not counting the last element -999.

For example the array: 2, 45, 67,-34, 1, -999 has 5 number of elements.

The subroutine should save all local variables on the stack. You will need to use Indirect Register Mode for iterating through the array for which you will need to use a core register. Use R10 for this purpose. As soon as you enter the subroutine, save the existing value of R10 by pushing it on the stack. Just before exiting the subroutine pop the saved value back into R10.

Test this subroutine in main code by using an array Named MyArray with word elements [2, 3, 67, -34, 1, -999] placed in the .text region and storing the output in a variable named "Result". Use loops for repeated tasks.

Include pseudo code (subroutine only), flow chart (subroutine only) and the text of the assembly file (main program + subroutine). Also include a screen shot of the memory browser which shows the variable "Result" clearly.

Reference no: EM132214032

Questions Cloud

Write a stored procedure that inserts a new row : Write a stored procedure that inserts a new row into the Supplier table and then adds at least one new product that the new supplier stocks.
Compute the checksum for a data table : Write a subroutine that computes the CHECKSUM for a data table (by XO Ring all the data bytes).
Find the cyclic rotation that is the smallest lexicographic : Write a SuffixArray client that, given a string, finds the cyclic rotation that is the smallest lexicographically in linear time.
Write and test a data structures template : Write the template for an array of capacity =2 (default constructor) of unspecified type.
Calculate the number of elements in an array not counting : MSP430G2553 :Subroutine expects the Input on the stack as shown above: The input is the starting address of an array consisting of word length elements.
Remove occurrences of a given character in a string : Write a subroutine in assembly that removes occurrences of a given character in a string if it is after or before the space.
Write and test a c implementation of the mobius function : Write and test a C implementation of the Mobius function M(n) defined as follows.
Determine your clients net capital gain or net capital loss : HI6028 Taxation Theory, Practice & Law - Advise Rapid-Heat of its FBT consequences arising out of the above information, including calculation of any FBT
Write the assembly language for the subroutine : Write the assembly language for the subroutine (called by a main program) and simulate using the sample data table: 24, 65, F0.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Define the work performed by a parallel algorithm

Define the work performed by a parallel algorithm. When can we say that a parallel algorithm is work-efficient with respect to another algorithm?

  Develop hardening checklist for windows

Develop Hardening Checklist for Windows, One of the most useful tools you will use in your role as an Information Security professional is a hardening checklist

  Is the can-spam law working

What actions, if any, have you taken to limit the permissions of the sender? Why or why not?

  Create a human readable output file that shows the time

As part of the mission of the CS student you have been commissioned to help clean up some of the data recently collected at Aquarena Springs.

  Create a folder called raw data to store collected raw data

NIT6130 Introduction to Research Assignment - Experiment Design & Result Analysis. Create a folder called "raw data" to store the collected raw data

  Dscribe the impact and the vulnerability of the scada

scada wormprotecting the nations critical infrastructure is a major security challenge within the u.s. likewise the

  The application must have at least one class

A salesperson can also receive a commission as a sales incentive. Commission is a percentage of the salesperson's annual sales. The current commission is 5 percentof total sales.

  Construct state diagram for sequence detectors

Construct state diagram for sequence detectors that can detect the following sequences: 10010 (sequences may overlap).

  A gui application where the user enters the wholesale cost

Create a GUI application where the user enters the wholesale cost of an item and its markup percentage into text fields.

  How you would start a threat modeling project

For this assignment explain in detail how you would start a threat modeling project. Please provide explanations for each step stated.

  Determine the centroids of the quantization regions

[Determining the Centroids] Determine the centroids of the quantization regions for a zero-mean, unit-variance Gaussian distribution.

  Describe how the two processors can share the computation

Suppose we have a two-processor distributed memory system in which floating point arithmetic proceeds at R flops per second. Assume that when one processor.

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