Write a inline assembly language program subroutine

Assignment Help Computer Engineering
Reference no: EM132200442

Question :

Write a inline assembly language program subroutine that searches for a character in a string and returns the first occurrence of the character in the string.

The subroutine must be called search and the string is passed in the ESI register. The character to search for should be placed in the AL register and the length of the string is in the ECX register.

The subroutine should return the location of the character in the EBX register, where the first character is 1 and if not found, returns 0.

For example, given a 10 character string in mystring = 'EXCELLENTE', locate the first 'X' character.

lea ESI,mystring
mov al,'X'
mov ecx,10
call search

------returns with EBX =2

lea ESI,mystring
mov al,'Y'
mov ecx,10
call search

------returns EBX = 0

The program must work for any sized string or character combination.

Having trouble writing this program on visual studio 2015 keep getting compile errors when i go by the example above. Need help on one that will compile and work correctly.

Reference no: EM132200442

Questions Cloud

Write a method that search an array using the linear-search : Write a generic method, Search, that searches an array using the linear-search algorithm.
Describe basic contributors that govern the trade system : What is the underlying economic theory upon which todays international trade system is based? Is it the best choice?
Excess of baruim chloride tot : Explain why it is essential that you add an excess of baruim chloride tot he mixture containing the unknown sulfate salt
Percent error to show the accuracy of the student : a.) Use percent error to show the accuracy of the student b.) Determine the range of the data to show the precision of the student
Write a inline assembly language program subroutine : Write a inline assembly language program subroutine that searches for a character in a string and returns the first occurrence of the character in the string.
What is the volume of the sand that was added : After the sand is added the water level in the cylinder is at 31.8 mL. What is the volume of the sand that was added to the cylinder?
Would a financial crisis have been averted : If the Argentine government had simply dollarized instead of erecting a currency board, would a financial crisis have been averted? Discuss.
Help me define corporate social responsibility : Help me conduct research on a Fortune 500 company and how do you determine just how (or if) the company ranks from a CSR perspective.
Write an inter process communication program : Write an inter process communication program in C language to exchange message between parent process and child processes.

Reviews

Write a Review

 

Computer Engineering Questions & Answers

  Develop your own string class

Develop and work with a C++ class, define constructors and destructors, define member functions outside .

  In privacy deborah g johnson presents arguments designed to

in privacy deborah g. johnson presents arguments designed to show that the greater capacity of computers to gather and

  Create a flash movie that animates two figures

Create a Flash movie that animates two figures, one from the top to the bottom of the left side of the stage and the other on the right side of the stage.

  Develop a class diagram for the system

CS 586; Spring 2017 ASSIGNMENT. Develop a class diagram for the system using the Observer design pattern. For each class list all operations with parameters and briefly specify them using pseudo-code

  When jameel compiles his program

When Jameel compiles his program, the compiler return a syntax error on the above statement. Why?

  Change is an integral part of an organization various

change is an integral part of an organization. various forces drive changes. all changes however are not successful

  Describes two organizations that perform work

Create a Web page that uses a table and describes two organizations that perform work related to Internet/Web standards and guidelines

  Describe the general organization of a relational database

Compare a database to a database management system. What is a database schema? Describe the general organization of a relational database.

  What is the rule of three and why is it important

What is the difference between a forward_iterator and a bidirectional_iterator? What is the rule of three? Why is it important to follow this rule?

  Write a program that calculates the amount of money

Write a program that calculates the amount of money a person would earn over a user-specified number of days if their salary is one penny the first day.

  Explain each step of the machine cycle

Explain (in detail) each step of the machine cycle. Show the contents of each of the registers and each of the memory cells after the execution of the code.

  Design logic for an application that outputs each host name

Design logic for an application that outputs each event number, host name, validated date, meal code, entrée name, number of guests gross total price for party.

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