CIS 21JA - Assignment 8In addition to covering string instructions and 2D arrays, this last lab also reviews concepts that are covered this quarter. Class notes from earlier modules can be...

1 answer below »



I'm working on a assembly language multi-part question and need an explanation and answer to help me learn.













Using Irvine32.io library and MASM solve the assignment













Requirements: just minimum documentation | .doc file



CIS 21JA - Assignment 8 In addition to covering string instructions and 2D arrays, this last lab also reviews concepts that are covered this quarter. Class notes from earlier modules can be helpful. Overview Write a program that stores user input strings in a 2D array. Then the program tells the user whether a specified string is a palindrome. A palindrome is a string that reads the same forward and backward.  (Here's a humorous view of a palindrome) Requirements Here are the ordered steps to complete your program: 1. Create 2 constants called ROW and COL that specify the size of the 2D array. · Set ROW to 4, COL to 20 · Make sure ROW and COL are constants (not memory variables), and define them at the top of the program so they're easily found. To test your program you will set these 2 constants to different values, so the easier it is to find them, the faster you can test. 2. Write a macro that accepts an integer as input, and then prints the integer followed by a space character. 3. In the .data section, define a 2D array with ROW and COL size. Make sure you use ROW and COL to define the array, don't use immediate values (literal constants) like 3 or 5. During testing, when you set ROW and COL to different values, the 2D array should change size accordingly and your code should change behavior accordingly. Below is an example of a 2D array with ROW = 3, COL = 10, filled with 2 strings: "21JA" and "123454321" 2 1 J A 0 0 0 0 0 0 1 2 3 4 5 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 Other than the 2D array and text strings, the .data section should not contain any other memory variable. 4. Write the main procedure that does 2 tasks: A. Call a fillArray procedure that uses the stack to pass data. 1. Pass to it the 2D array and any necessary text string addresses 2. Receive a return value which is the number of text strings that are in the array (the return value is 2 for the example array above) B. Loop to ask the user to select a string from the array and print whether the string is a palindrome or not. 1. The user can keep selecting a string location (a number) until -1 is entered 2. Check that the string location is within the valid number of strings or keep prompting (see sample output below) 3. When the user selection is valid, call the checkString procedure: a. Use the stack to pass to it the 2D array, the number of strings, and the user selection b. Receive a return value of 1 (palindrome) or 0 (not a palindrome) 4. Based on the return value, main prints the appropriate text. 5. Write the fillArray procedure   · Loop to ask for a string and store it in the next available row of the array. You can assume the user will enter a string that is shorter than the COL number. · Stop the loop when one of these conditions occurs: · when all rows of the array are filled, or, · when the user chooses to stop by hitting the enter key only · When the loop to input strings is done, call a printArray procedure that uses registers to pass data. · Pass to it the 2D array, the number of strings in the array, and any necessary text string addresses · See the sample output for how the array is printed 6. Write the printArray procedure · print a header line (see sample output below) · for each string, print a number and a space (use the macro), and then print the string. Numbering starts at 1 and increments. 7. Write the checkString procedure  · Use the input parameters (2D array and user input number) to get to the correct string · Use string instructions to check if the string is palindrome. · Return 1 for palindrome, 0 for not a palindrome Testing Here are the test cases I will run with your program: · change ROW and COL · strings that are: not palindrome, palindrome with even string length, palindrome with odd string length · try to enter more strings than ROW · enter invalid string number Sample output Enter text string: 12321 Enter text string: abc Enter text string: noon Enter text string: List of strings 1 12321 2 abc 3 noon Enter string number (-1 to end): 0 Enter string number (-1 to end): -2 Enter string number (-1 to end): 1 Palindrome Enter string number (-1 to end): 2 Not a palindrome Enter string number (-1 to end): 3 Palindrome Enter string number (-1 to end): 4 Enter string number (-1 to end): -1 Press any key to continue . . . Additional reminders - Use string instructions when you need to walk a string and access data. - Procedures should pass data through the stack or through registers as required. - Except for main, no other procedure should directly access data defined in .data. - Other than the 2D array and text strings, you should not use any other memory variables in .data
Answered 2 days AfterDec 02, 2022

Answer To: CIS 21JA - Assignment 8In addition to covering string instructions and 2D arrays, this last lab...

Nidhi answered on Dec 05 2022
41 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here