Đang Thực Hiện

134325 Assembly Language Progam

. Write a program, [url removed, login to view], that displays the following menu:

1. Enter a string.

2. Display the string.

3. Display in reverse.

4. Display in caps.

5. Display in lower case.

6. Check for palindrome.

7. Sort ascending and display the letters.

8. Sort descending and display the letters.

9. Exit.

Enter your choice:

Have the program then accept user input (a value 1-9) and call the appropriate

procedure based on the user input. Stub in the 8 procedures named enterString,

displayString, displayReverse, displayCaps, displayLower, checkPalin,

sortAscending, and sortDescending. For example, the enterString procedure stub

should look like

enterString:

ret

After calling the appropriate procedure, the program should display the menu

again and accept another user input. The program ends only when 9 is input.

Assemble your code at this point and test and debug it.

2. Add code to the procedure enterString. Save the string as a character array. Allow

room for 128 characters.

Note: in all that follows, do not change the memory that contains the user input string. If necessary, make a copy in another area of memory and change the copy, but not the original.

3. Add code to the procedure displayString. Use a loop and with each pass use putChar

to display one character of the string. When you finish #3 you can assemble and test the work you have done so far.

4. Add code to the procedure displayReverse. You should be able to copy the code you

wrote in #3, make a few changes, and have it. Again, assemble, test, and debug.

5. Add code to the procedure displayCaps. You should be able to copy the code you

wrote in #3, make a few changes, and have it. Again, assemble, test, and debug.

6. Add code to the procedure displayLower. You should be able to copy the code you

wrote in #5, change one line, and have it. Again, assemble, test, and debug.

7. Add code to the procedure checkPalin.

A palindrome is the same sequence of letters forward or backward, like abba or

osteretso. If you have gotten this far, this one should be easy. You can start with

the code you wrote in #3 or #4. I would use two pointers, one pointing to the front of

the string and one pointing to the end. Compare the two target characters. If there is a

match, move the pointers toward the center and compare again. If there is ever a

mismatch, the string is not a palindrome. Inform the user whether or not the input

string is a palindrome.

8. Add code to the procedure sortAscending. Here is a suggestion - start comparing

all the characters in the input string to 'A' or 'a' and display any match. Go through

the input string again, this time comparing with 'B' or 'b' and display any match.

Continue until you have gone through the whole alphabet.

9. Add code to the procedure sortDescending. You should be able to copy the code you

wrote in #8, change a few lines, and have it. Again, assemble, test, and debug.

THIS IS WHAT IT HAS TO DO

Here is a screen shot:

c:/strings

1. Enter a string.

2. Display the string.

3. Display in reverse.

4. Display in caps.

5. Display in lower case.

6. Check for palindrome.

7. Sort ascending and display the letters.

8. Sort descending and display the letters.

9. Exit.

Enter your choice: 1

Enter a string of up to 128 characters:

Now is THE Time

1. Enter a string.

2. Display the string.

3. Display in reverse.

4. Display in caps.

5. Display in lower case.

6. Check for palindrome.

7. Sort ascending and display the letters.

8. Sort descending and display the letters.

9. Exit.

Enter your choice: 3

emiT EHT si woN

1. Enter a string.

2. Display the string.

3. Display in reverse.

4. Display in caps.

5. Display in lower case.

6. Check for palindrome.

7. Sort ascending and display the letters.

8. Sort descending and display the letters.

9. Exit.

Enter your choice: 8

wTTsoNmiiHEe

1. Enter a string.

2. Display the string.

3. Display in reverse.

4. Display in caps.

5. Display in lower case.

6. Check for palindrome.

7. Sort ascending and display the letters.

8. Sort descending and display the letters.

9. Exit.

IT HAS TO WORK ON A 86 COMPILER AND IOSUBS

Kỹ năng: Bất kì công việc gì, Lập trình C, Java, Javascript, PHP

Xem thêm: what programming language is this, what programming language, what is programming language, what is a string in programming, what is a programming language, what is a loop in programming, use case sequence, strings in c programming, string match, sort array c, programming pointers, programming loop, programming in assembly, programming compiler, programming center, programming array, pointers in c programming, pointers c programming, match string, make a programming language, loop programming, front end assembly, for loop in c programming, for loop c programming, easy programming language

Về Bên Thuê:
( 1 nhận xét )

Mã Dự Án: #1880497