I did put this question already but the answer wasnt what i was looking for so I
ID: 3769895 • Letter: I
Question
I did put this question already but the answer wasnt what i was looking for so I will ask again because I cant reply to my question. The exercise program I have to do is this: the user has to input a string and the letters that are in uppercase change them to lowercase and the character that are in lowercase change them to uppercase . The exercise asks me to do this plus or minus 32 to the ASCII value in the string enter by the user because that will give me the oposite letter (Uppercase or lowercase) . my question is how I obtained the ASCII value of each character enter by the user because i need that for adding or substracting 32 to get the letter opposite to uppercase or lowercase .If you can see in the example indicated by the red arrow. The String entered by the user: I love MIPS Assembly! is reverted in the result :i lOVE mips aSSEMBLY! altering the character uppercase for lowercase and lowercase for uppercase.
The string that i want to look the ASCII value of each character is love MIPS Assembly!. In the photo is indicated by the red arrow.
.data Using .space 81 for the long of the string that the user can enter
In case you need it 65-90 is the ASCI value for each uppercase character. Starting in 65 with the A.
97-122 ASCII value for the lowercase character. My question is how can i obtained these value in Assembly code for adding or substracting 32 to get the opposite character (to get the uppercase or lowercase). Documents Undo 2. (20 puntos) Escriba un programa (togglecase.asm) para el lenguaje de ensamblaje del procesador MIPS que le pida al usuario una cadena de caracteres y muestre la cadena, intercambiando las mayúsculas por minúsculas y viceversa. A continuación se muestra un ejemplo de la ejecución del programa: Enter string: I love MIPS Assembly! The reault is LOVE mips asSEMBLY Utilice el siguiente segmento de datos: .data prompt: asciiz "Enter string:" str: .space 81 toggle msg: .asciiz "The result is" Pista: Como los caracteres se almacenan utilizando ASCII, la diferencia entre una letra mayúscula y su equivalente como letra minúscula siempre será 32. Por ejemplo, si el código de·A'es 65, el código de
Explanation / Answer
This code will help you in determining ASCII value of the character #include int main(){ char c; printf("Enter a character: "); scanf("%c",&c); /* Takes a character from user */ printf("ASCII value of %c = %d",c,c); return 0; }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.