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.
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
"One need not be concerned with reliability and validity in applied marketing research." Discuss this statement as a small group.
-
Honacker Fashions sells both designer and moderately priced fashion accessories. Top management is deciding which product line to emphasize. Accountants have provided the following data:...
-
Certification refers to a process or decision that always brings a lawsuit to an end. Is that statement true? Explain your answer.
-
The W14 \(\times 26\) structural A-36 steel member is used as a column that is assumed to be fixed at its top and pinned at its bottom. If the 15-kip load is applied at an eccentric distance of 10...
-
Reeves Supply Co. has the following transactions related to notes receivable during the last 2 months of 2014. Nov. 1 Loaned $15,000 cash to Norma Jeanne on a 1-year, 9% note. Dec. 11 Sold goods to...
-
In the figure, two blocks are connected over a pulley. The mass of block A is 5.10 kg and the coefficient of kinetic friction between A and the incline is 0.220. Angle 0 of the incline is 45.0. Block...
-
Illustrate how fine-line inventory classification can be used with product and market segments. What are the benefits and considerations when classifying inventory by product, market, and...
-
One person has carried out the roles of CEO and chairman since the incorporation of Value Pty (Ltd) 10 years ago. Recently, analysts have begun to criticise this policy explaining that since the CEO...
-
Like problem in the text, this exercise shows how the money supply can be changed. The focus of this exercise is open-market policy. Suppose the Fed wants to expand the money supply using open-market...
-
3. IS-MP/Phillips (20 pts). By 2021, vaccines were becoming available and it seemed that the country was moving past the Covid outbreak. Consumers were out shopping and travelling again. However,...
-
Price Level AS Long-run aggregate supply Short-run aggregate supply AS Aggregate demand Long Run Equilibrium The question starts with the economy in Long Run Equilibrium at the Natural Rate of...
-
I need help on this economics assignment , can someone please help Complete the weekly cost schedule for Jill's Pizza Restaurant Graph the ATC, AVC, and MC curves in the space below. 0 Quantity of...
-
Workforce diversity is now recognized as essential to improving access to care, delivery of care, and overall health. Assume you are the Chief Diversity Officer for your organization. Your health...
-
Rod AB is the firing pin for the right-hand barrel of a side-by-side shotgun. During firing, end A is struck by the hammer, which imparts a force F to the firing pin. The force F lies in a plane...
-
During the month, services performed for customers on account amounted to $7,500 and collections from customers in payment of their accounts totaled $6,000. At the end of the month, the Accounts...
-
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 company with a price-earnings ratio of 14 has an earnings yield closest to: A. 7.14% B. 14.00% C. 92.86%
-
The role of the 8-K filing with the Securities and Exchange Commission is best described as to disclose: A. the annual report. B. executive compensation. C. holdings of beneficial owners.
-
Which of the following is not produced by a company to communicate its financial results? A. Schedule 13D. B. Annual report. C. 10-K statement.
Study smarter with the SolutionInn App