Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a complete MIPS program to toggle the case of all alphabetic characters in

ID: 3886928 • Letter: W

Question

Write a complete MIPS program to toggle the case of all alphabetic characters in a C-string held in RAM in your program. Declare the string with a reasonable value (a 5 or 6 word sentence with spaces and punctuation) and print it before and after toggling the case of all alphabetic characters in the string. Do not add notes to the top of the program, but you may comment individual lines. The upper-case characters are 32 less than their corresponding lower-case characters. (less than 40 lines of code)

Explanation / Answer

//for mips specific use this code..

//for mips, use this code..


.file 1 "" .section .mdebug.abi32 .previous .nan legacy .module fp=32 .module nooddspreg .abicalls .section .rodata.str1.4,"aMS",@progbits,1 .align 2 $LC0: .ascii "Input a string" .section .text.startup,"ax",@progbits .align 2 .globl main .set nomips16 .set nomicromips .ent main .type main, @function main: .frame $sp,1032,$31 # vars= 1000, regs= 2/0, args= 16, gp= 8 .mask 0x80010000,-4 .fmask 0x00000000,0 .set noreorder .cpload $25 .set nomacro lw $4,%got($LC0)($28) addiu $sp,$sp,-1032 lw $25,%call16(puts)($28) .cprestore 16 sw $31,1028($sp) movz $31,$31,$0 sw $16,1024($sp) .reloc 1f,R_MIPS_JALR,puts 1: jalr $25 addiu $4,$4,%lo($LC0) lw $28,16($sp) addiu $16,$sp,24 lw $25,%call16(gets)($28) nop .reloc 1f,R_MIPS_JALR,gets 1: jalr $25 move $4,$16 lw $28,16($sp) move $3,$16 $L2: lb $2,0($3) nop beq $2,$0,$L9 andi $2,$2,0x00ff addiu $4,$2,-65 sltu $4,$4,26 beq $4,$0,$L3 addiu $4,$2,-97 b $L7 addiu $2,$2,32 $L3: sltu $4,$4,26 beq $4,$0,$L4 addiu $2,$2,-32 $L7: sb $2,0($3) $L4: b $L2 addiu $3,$3,1 $L9: lw $25,%call16(puts)($28) nop .reloc 1f,R_MIPS_JALR,puts 1: jalr $25 move $4,$16 lw $31,1028($sp) lw $16,1024($sp) move $2,$0 j $31 addiu $sp,$sp,1032 .set macro .set reorder .end main .size main, .-main .ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609"

//nd for simple

-------------------------------------------------------------------------------------------------------------------

//and for assembly purpose,use this code..

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote