Write an assembly program macro WordLength that finds the length of the 1st word in a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write an assembly program macro WordLength that finds the length of the 1st word in a given string. 1. The string does not contain leading spaces (i.e. in the beginning). 2. A word is terminated by a single space or end of string. 3. The macro takes 2 parameters: P1 (the string label) and P2 (to store the length of the first word). 4. The macro should only modify the parameter P2. 5. Values of any registers used inside the macro should be retained. Code template: .686 model flat, stdcall option casemap: none .data VarS BYTE "Coding in MASM", 0 .code Write your macro here Sample IO data: Vars BYTE "Coding in MASM", 0 Final value in ebx 2 Vars BYTE "Hi machine-coders", 0 {{YOUR CODE COMES HERE }} End your macro before this line start: Final value in ebx 14 Vars BYTE "Have a nice day", 0 Final value in ebx 1 WordLength Vars, ebx Length of 1st. word word word lea eax, Vars add eax, ebx inc eax Index of 2nd WordLength [eax], ebx; Length of 2nd ret end start Write an assembly program macro WordLength that finds the length of the 1st word in a given string. 1. The string does not contain leading spaces (i.e. in the beginning). 2. A word is terminated by a single space or end of string. 3. The macro takes 2 parameters: P1 (the string label) and P2 (to store the length of the first word). 4. The macro should only modify the parameter P2. 5. Values of any registers used inside the macro should be retained. Code template: .686 model flat, stdcall option casemap: none .data VarS BYTE "Coding in MASM", 0 .code Write your macro here Sample IO data: Vars BYTE "Coding in MASM", 0 Final value in ebx 2 Vars BYTE "Hi machine-coders", 0 {{YOUR CODE COMES HERE }} End your macro before this line start: Final value in ebx 14 Vars BYTE "Have a nice day", 0 Final value in ebx 1 WordLength Vars, ebx Length of 1st. word word word lea eax, Vars add eax, ebx inc eax Index of 2nd WordLength [eax], ebx; Length of 2nd ret end start
Expert Answer:
Related Book For
Data Analysis and Decision Making
ISBN: 978-0538476126
4th edition
Authors: Christian Albright, Wayne Winston, Christopher Zappe
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
"One need not be concerned with reliability and validity in applied marketing research." Discuss this statement as a small group.
-
OptiSystems manufactures an optical switch that it uses in its final product. OptiSystems incurred the following manufacturing costs when it produced 72,000 units last year: Direct materials . . . ....
-
In problem, find bounds to the real zeros of each polynomial function. f(x) = 2x 3 - 7x 2 - 10x + 35
-
Amanda Forbes was hired as a nail technician by Showmann, Inc., in 2011. In 2017, Forbes attended a work-related holiday party where Showmann distributed raffle tickets to employees. One of the...
-
Evaluating Four Alternative Inventory Methods Based on Income and Cash Flow At the end of January 2011, the records of Donner Company showed the following for a particular item that sold at $16 per...
-
For October, the coat department did $26,800 in sales and took 30% markdowns. What are the markdown dollars for the coat department in October?
-
1. You just borrowed $300,000 and the annual interest rate on the loan is 4.5%. Assume you plan to repay the loan with 9 annual payments of equal amounts. What is your annual payment amount? 2. Stock...
-
If you were to construct a demand curve for a required text in a course, where would that demand curve intersect the horizontal axis?
-
What do you think accounts for where components of the iPod and Barbie are made?
-
In the context of supply and demand under international trade, when will a country decide to export a particular good? Import a good? Who gains and loses under each decision?
-
Network Rail is facing the biggest equal pay claim in its history only a week after it was found to have missed punctuality targets and amid protests that bonuses for senior male staff have topped...
-
How have U.S. policies and institutions influenced the countrys long-run economic growth?
-
Suppose you can only invest in the stock markets of two countries: US and China. The US has an expected return of 5.0% and a standard deviation of 15.0%. China has an expected return of 7.0% and a...
-
1. Firms may hold financial assets to earn returns. How the firm would classify financial assets? What treatment will such financial assets get in the financial statements in accordance with US GAAP...
-
A furniture company manufactures tables and chairs. Each table and chair must be made entirely out of oak or entirely out of pine. A total of 15,000 board feet of oak and 21,000 board feet of pine...
-
In the current no-backlogging problem, SureStep doesnt hire any workers, and it uses almost no overtime. This is evidently because of low demand. Change the demands to 6000, 8000, 5000, and 3000, and...
-
Based on Morrison and Wheat (1984). When his team is behind late in the game, a hockey coach usually waits until there is one minute left before pulling the goalie out of the game. Using simulation,...
-
A beam problem under the pure bending moment is solved using five rectangular finite elements, as shown in the figure. Assume \(E=200 \mathrm{GPa}\) and \(v=0.3\) are used. The thickness of the beam...
-
A study of 16,405 adult daughters of women who immigrated to California from other countries measured the economic status of the daughters by the median household income Y for the ZIP code they lived...
-
Explain why you either agree or disagree with this interpretation of the results from estimating a regression model: This study concludes that the data are statistically substantial because there are...
Study smarter with the SolutionInn App