assignment on Assembly Language
In this lab we are going to explore strings and array a bit more. Our goal for the lab will be to have the user input a string and then be able to make changes to the characters that are in the string until they are ready to stop. This means that we will need to read in several pieces of data from the user, including a string and multiple characters. You can set a maximum size for the user string, however, the specific size of the string can change and you can’t ask them how long the string is (see the sample runs). In order to work with characters, we need to remember that each ASCII character is stored using a single byte. So, we will now add in the instructions load byte (lb) and store byte (sb) in order to manipulate our character information.
(Note user input is bolded and underlined for ease of reading, it is not done in the program)
This program reads in a String from the user and then allows the user to make changes to it until they want to stop.
Please enter your string now (maximum of 40 characters):
We can input a fairly long string.
Your current string is: We can input a fairly long string.
Do you want to make any changes to the string? (Y/N): Y
Enter the character in the string would you like replaced: i
Enter what you would like to change the character to: 1 Your current string is:
We can 1nput a fa1rly long str1ng. Do you want to make any changes to the string? (Y/N): Y
Enter the character in the string would you like replaced: a
Enter what you would like to change the character to: @ Your current string is:
We c@n 1nput @ f@1rly long str1ng. Do you want to make any changes to the string? (Y/N): N
Your final string is:
We c@n 1nput @ f@1rly long str1ng.
-- program is finished running –