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

I need help with MIPS Assembly Language and the MARS program development environ

ID: 3793407 • Letter: I

Question

I need help with MIPS Assembly Language and the MARS program development environment.

Demonstrate how to implement loops in MIPS.

The program should read from memory the contents of an array containing a number of characters, followed by a period (‘.’).

Your program should create a second character array which is identical to the first, except that the case of every alphabetical letter has been changed:

for example, given the input string “Ab()Cd1234EfGh#.”

your program would create the string “aB()cD1234eFgH#.” and store it in a buffer.

Test the program using input strings of different lengths. The program may assume that the input string will always contain a single period, which will always be the last character.

Explanation / Answer

.file 1 "" .section .mdebug.abi32 .previous .gnu_attribute 4, 1 .abicalls .rdata .align 2 $LC0: .ascii "Input a string" .text .align 2 .globl main $LFB0 = . .set nomips16 .ent main .type main, @function main: .frame $fp,1040,$31 # vars= 1008, regs= 2/0, args= 16, gp= 8 .mask 0xc0000000,-4 .fmask 0x00000000,0 .set noreorder .cpload $25 .set nomacro addiu $sp,$sp,-1040 $LCFI0: sw $31,1036($sp) $LCFI1: sw $fp,1032($sp) movz $31,$31,$0 $LCFI2: move $fp,$sp $LCFI3: .cprestore 16 sw $0,28($fp) lw $2,%got($LC0)($28) nop addiu $4,$2,%lo($LC0) lw $2,%call16(puts)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) addiu $2,$fp,32 move $4,$2 lw $2,%call16(gets)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) b $L2 nop $L5: lw $2,28($fp) addiu $3,$fp,24 addu $2,$3,$2 lbu $2,8($2) nop sb $2,24($fp) lb $2,24($fp) nop slt $2,$2,65 bne $2,$0,$L3 nop lb $2,24($fp) nop slt $2,$2,91 beq $2,$0,$L3 nop lw $2,28($fp) lw $3,28($fp) addiu $4,$fp,24 addu $3,$4,$3 lb $3,8($3) nop andi $3,$3,0x00ff addiu $3,$3,32 andi $3,$3,0x00ff sll $3,$3,24 sra $3,$3,24 addiu $4,$fp,24 addu $2,$4,$2 sb $3,8($2) b $L4 nop $L3: lb $2,24($fp) nop slt $2,$2,97 bne $2,$0,$L4 nop lb $2,24($fp) nop slt $2,$2,123 beq $2,$0,$L4 nop lw $2,28($fp) lw $3,28($fp) addiu $4,$fp,24 addu $3,$4,$3 lb $3,8($3) nop andi $3,$3,0x00ff addiu $3,$3,-32 andi $3,$3,0x00ff sll $3,$3,24 sra $3,$3,24 addiu $4,$fp,24 addu $2,$4,$2 sb $3,8($2) $L4: lw $2,28($fp) nop addiu $2,$2,1 sw $2,28($fp) $L2: lw $2,28($fp) addiu $3,$fp,24 addu $2,$3,$2 lb $2,8($2) nop sltu $2,$0,$2 andi $2,$2,0x00ff bne $2,$0,$L5 nop addiu $2,$fp,32 move $4,$2 lw $2,%call16(puts)($28) nop move $25,$2 jalr $25 nop lw $28,16($fp) move $2,$0 move $sp,$fp lw $31,1036($sp) lw $fp,1032($sp) addiu $sp,$sp,1040 j $31 nop .set macro .set reorder .end main $LFE0: .size main, .-main .section .eh_frame,"aw",@progbits $Lframe1: .4byte $LECIE1-$LSCIE1 $LSCIE1: .4byte 0x0 .byte 0x1 .globl __gxx_personality_v0 .ascii "zP" .uleb128 0x1 .sleb128 -4 .byte 0x1f .uleb128 0x5 .byte 0x0 .4byte __gxx_personality_v0 .byte 0xc .uleb128 0x1d .uleb128 0x0 .align 2 $LECIE1: $LSFDE1: .4byte $LEFDE1-$LASFDE1 $LASFDE1: .4byte $LASFDE1-$Lframe1 .4byte $LFB0 .4byte $LFE0-$LFB0 .uleb128 0x0 .byte 0x4 .4byte $LCFI0-$LFB0 .byte 0xe .uleb128 0x410 .byte 0x4 .4byte $LCFI2-$LCFI0 .byte 0x11 .uleb128 0x1e .sleb128 2 .byte 0x11 .uleb128 0x1f .sleb128 1 .byte 0x4 .4byte $LCFI3-$LCFI2 .byte 0xd .uleb128 0x1e .align 2 $LEFDE1:

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