1. Create a program that will go through a NULL-terminated string of ASCII characters and convert...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Create a program that will go through a NULL-terminated string of ASCII characters and convert any uppercase letters to lowercase letters. (The ASCII NULL character is Ox00.) Any changes should replace the original values within the string in memory. The program should be able to process strings of arbitrary length, although you may assume that the maximum length is no more than 20 characters. Therefore, you should allocate 20 bytes of memory in the data section to accommodate the worst-case string length. Things to consider: How far apart are uppercase and lowercase ASCII code values? You don't want to modify every single character. If you read a lowercase letter, a numeric digit, a space, or punctuation, there's nothing that needs to be modified. When you reach the NULL value, there's nothing left to change. Code must be commented well enough for a reader to know what you're doing and why. 2. Test the program on a string containing an assortment of character types. You can allocate memory for the character string and set it to an initial value with the asciz directive, or you can allocate memory with the .space directive and use the GDB set command in the Debugger Console to write a character string to the memory. (GDB set command examples are presented in section F of the debugging tutorial.) Run the program twice, using two different strings of different lengths between 12 and 19 characters, each containing some uppercase letters, some lowercase letters, and at least one numeric digit, one punctuation character, and one space. (Sounds like a password?) 3. Submit: The source program The two debugger memory views, circling the final strings after the program has run. Use memory rendering format ASCII to display the strings. 1. Create a program that will go through a NULL-terminated string of ASCII characters and convert any uppercase letters to lowercase letters. (The ASCII NULL character is Ox00.) Any changes should replace the original values within the string in memory. The program should be able to process strings of arbitrary length, although you may assume that the maximum length is no more than 20 characters. Therefore, you should allocate 20 bytes of memory in the data section to accommodate the worst-case string length. Things to consider: How far apart are uppercase and lowercase ASCII code values? You don't want to modify every single character. If you read a lowercase letter, a numeric digit, a space, or punctuation, there's nothing that needs to be modified. When you reach the NULL value, there's nothing left to change. Code must be commented well enough for a reader to know what you're doing and why. 2. Test the program on a string containing an assortment of character types. You can allocate memory for the character string and set it to an initial value with the asciz directive, or you can allocate memory with the .space directive and use the GDB set command in the Debugger Console to write a character string to the memory. (GDB set command examples are presented in section F of the debugging tutorial.) Run the program twice, using two different strings of different lengths between 12 and 19 characters, each containing some uppercase letters, some lowercase letters, and at least one numeric digit, one punctuation character, and one space. (Sounds like a password?) 3. Submit: The source program The two debugger memory views, circling the final strings after the program has run. Use memory rendering format ASCII to display the strings.
Expert Answer:
Related Book For
Computer Organization and Design The Hardware Software Interface
ISBN: 978-0124077263
5th edition
Authors: David A. Patterson, John L. Hennessy
Posted Date:
Students also viewed these programming questions
-
Year,Sex,Min degree,Total,White, Black, Hispanic, Asian, Pacific Islander, American Indian/Alaska Native, Two or more races 1940,A,high school, 38.1,41.2,12.3,- 1920,A,high school,---,22.0,6.3,-...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
In this assignment, you will create a program that allows theuser to draw in a window using brushes of different sizes andcolors. The user will be able to change the size and color of thebrush using...
-
Describe and sketch the surface. 16x + 16y -9z = 0
-
Contrast the scheduling policies you might use when trying to optimize a time-sharing system with those you would use to optimize a multiprogrammed batch system.
-
The following "cycle of copper" experiment is performed in some general chemistry laboratories. The series of reactions starts with copper and ends with metallic copper. The steps are as follows: (1)...
-
True or False: A rotor that has been balanced down to the G specification is considered ready to ship.
-
A 50.0-kg block and a 100-kg block are connected by a string as in Figure P8.36. The pulley is frictionless and of negligible mass. The coefficient of kinetic friction between the 50.0 kg block and...
-
Non-current liabilities Bonds payable Equity Share capital-ordinary, 1.00 par, authorized 400,000 shares, issued 295,500 Share premium-ordinary Retained earnings 505,500 295,500 165,500 ? Prepare a...
-
Complete the requirements of P 610, assuming that Westgate Constructions contract with Santa Clara County does not qualify for revenue recognition over time. Data from in P 6-10 In 2024, the Westgate...
-
Give an output statement to write one line of a table containing a product description, quantity, unit price, and total price in dollars and cents. You want the columns to line up, like this: Item ....
-
Mr. Catarroja, the owner of Catarroja Hardware, invested P105,000 cash from the business. What type of special journal would be used to record this transaction?
-
During year-end planning session, they are considering another packaging supplier. 2023 annual sales projection would equate to 478,100 jars for their gourmet ketchup product. Purchase quantity Unit...
-
What are some of the areas of public life that psychology is contributing to in the present day? What are some of the areas that psychology might or should be contributing to?
-
Bo Linball rolls a 8 . 1 kg bowling ball down the alley for the league championships. One pin is standing still, and Bo hits it head - on with a ( forward ) unknown velocity. The 2 . 4 kg pin...
-
How have views on evolutionary psychology changed over the history of psychology? How has the idea of the individual differences changed?
-
The F statistic calculated from a multiple regression analysis is equal to 6.89 and the p-value of the F statistic is 0.036. If so, then a) all of the slope coefficients are significantly different...
-
In the series connection below, what are the respective power consumptions of R, R2, and R3? R R www 4 V=6V P1-3 W; P2=3W; and P3= 3 W OP10.5 W; P2-1 W; and P3= 1.5 W P1=1.5 W; P2=1 W; and P3= 0.5 W...
-
Consider the following piece of C code: for (j=2;j <1000;j++) D[j] = D[j1]+D[j2]; Th e MIPS code corresponding to the above fragment is: Instructions have the following associated latencies (in...
-
Download the CUDA Toolkit and SDK from http://www.nvidia.com/object/ cuda_get.html. Make sure to use the ?emurelease? (Emulation Mode) version of the code (you will not need actual NVIDIA hardware...
-
Refer to Figure 6.14b, which shows an n-cube interconnect topology of order 3 that interconnects 8 nodes. One attractive feature of an n-cube interconnection network topology is its ability to...
-
Explain the difference between isotropic total cross-section and the transport crosssection as in Eq. (5.49). Why transport cross-section is not used in the transport theory? Data From Equation...
-
Following up on question number 3, assume the school conducts a manifestation determination meeting. Tim attends the meeting with his parents. At the meeting, Tim tells the team that smoking helps...
-
Which of the following is not a characteristic of a defined benefit plan? A. A guaranteed retirement benefit. B. Risk of preretirement inflation assumed by employer. C. Benefits based upon the...
Study smarter with the SolutionInn App