Write an arm assembly function that takes an array of intege

Assignment Help Assembly Language
Reference no: EM13166983

Write an ARM assembly function that takes an array of integers and returns the index of the first occurrence of the integer in the array if it exists or -1 if it does not. Remember the initial integer in the array is at index zero.

 

The C language program is:

 

#include <stdio.h>

 

extern int intfind( int array[], int lookfor, int size ) ;

 

void main( int argc, char * argv[] )

{

            int numarray[] = { 113, 114, 252, 280, 332 };

int lookfor = 252 ;

int size = sizeof(numarray)/sizeof(int) ;

            int result ;

 

            result = intfind( numarray, lookfor, size ) ;

            printf( "Integer appears at %d\n", result ) ;

 

}

 

The input to the ARM assembly language function is a pointer to the first element of the array in register a1. The integer to look for is in a2 The size of the array is in a3and is the number of integers. Remember an integer is 4 bytes long.

 

 

Reference no: EM13166983

Questions Cloud

Creates a bus class : write a program that creates a bus class. create a constructor that initializes the number of passengers and number of seats. declare four objects. use the default copy constructor to initialize two of the objects.
A pattern detector has an input : A pattern detector has an input a 4 x 4 matrix whose elements take values a, b, c, or d. The output is 1 if the matrix contains one b surrounded by eight a's and 0 otherwise.
T prints out, on a clear screen, a table of temperatures : Create a MATLAB program (utilizing a temp-conversion function) that prints out, on a clear screen, a table of temperatures.
Write a java program that reads unspecified number : Write a java program that reads unspecified number of integers (the input 0 signifies the end of the input). Calculates and displays the sum and the average of the input value (not counting zero). The program also finds the maximum and minimum of ..
Write an arm assembly function that takes an array of intege : Write an ARM assembly function that takes an array of integers and returns the index of the first occurrence of the integer in the array if it exists or -1 if it does not. Remember the initial integer in the array is at index zero.
The radix sort algorithm : Show what happens to the radix sort algorithm if the counting sort is not a stable sorting algorithm. Bring a counter example
Create a program that will round a floating point : Create a program that will round a floating point value to a specified number of decimal places as input by the user. To perform the actual calculation, write a function that takes the user's value and the number of decimal places as input paramet..
First integer of input refers to the total weight the ship : First integer of input refers to the total weight the ship can carry. Second integer refers to the number of cargo present and the rest of the integers represents the individual weight of the cargo
First integer of input refers to the total weight the ship : First integer of input refers to the total weight the ship can carry. Second integer refers to the number of cargo present and the rest of the integers represents the individual weight of the cargo

Reviews

Write a Review

Assembly Language Questions & Answers

  Problems does an assembler have to overcome

What problems does an assembler have to overcome in order to produce complete binary code with only one pass over the source code? How would code written for a one-pass assembler be different from code written for a two-pass assembler?

  Program that ask the user to input a number between 0-10

Write a program that ask the user to input a number between 0-10 (n). Then your program finds the factorial of the number

  Implement a simple 32 bit calculator program

Operand A  and  Operand B  have to be  signed  32 bit integers. So an operand can be a negative number. For example, if you input is (-1 + 3), it should return 2. Operator  must be one of the characters(' + ', ' - ', ' * ', ' / ', ' % ')

  Design a calculator in assembly

Design a calculator in assembly that can handle +,-,/,%, * and expresses errors in the case of division by zero or invalid characters using the template below.

  Write a mips assembly language program

Write a MIPS assembly language program that prompts for a user to enter a series of floating point numbers and calls read_float to read in numbers and store them in an array. Then the program should display the array content on the console window. Th..

  Pseudo-code in assembly language

Implement the following pseudo-code in assembly language (assume unsigned numbers). Declare Apple and Pear as byte sized variables.

  Create simple 8-bit alu using add-subtract-shift functions

Create a simple 8-bit ALU. Requirements:The eight functions that you will implement are: add, subtract, and, or, shift left logical, less than, shift right logical.

  Program that converts the temperature

Write a program that converts the temperature F in Farenheit to C in Celsius using C = (F-32)*5/9. For ease of programming you can display the result in fractions

  Program a maze-type game using assembly language

This project requires you to program a maze-type game using Assembly Language. It is not acceptable to use any other programming language for this project. T

  Greatest common divisor of integers-masm assembly language

Must be done in MASM assembly language: Greatest common divisor of two integers is largest integer which will evenly divide both integers. GCD algorithm involves integer division in a loop.

  Create a assembly language subroutine

Create a assembly language subroutine MULSUM that takes an array named A containing n bytes of positive numbers, and fills two arrays, array B containing n words and array C containing n long words

  Relative addressing mode is a special way

Relative addressing mode is a special way to specify operands. Which instructions are associated with the relative addressing mode? Why do you think it was called "relative" addressing mode? Hint: Use a search engine to find out about "portable code"

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