Question: Have the following code and when ran in MARS 4.5 I get the following errors, could you help solve these problems within my code? A




Have the following code and when ran in MARS 4.5 I get the following errors, could you help solve these problems within my code? A lot of them are repetitive mistakes.
$LCO: .ascii "Enter a positive integer: 1000" $LCI: .ascii "%d\000" $LC2: ascii "Error: Not a positive number. 1000 $LC3: ascii "&d is banned! \0121000" $LC4: .ascii "d is safe\012\000" isBanned (int): addiu $sp,$sp,-40 SW $31,36($sp) SW $fp, 32($sp) move $fp,$sp SW $4,40($fp) SW $0,28($fp) SW $0,24($fp) $16: $3,24($fp) $2,40($fp) $2, $3, $2 $2,$0, $L7 lw lw nop slt beq nop lui addiu jal nop addiu move $2,hi($LCO) $4, $2,%20($LCO) printf lui $2, $fp, 28 $5, $2 $2,%hi($LC1) $4, $2,% lo($LC1) scanf addiu jal nop LW $2,28($fp) nop $2, $L3 bgtz nop lui $2,hi($LC2) $4, $2,%lo ($LC2) puts addiu jal nop b nop $L4 $L3: # Oxc $3,28($fp) $2,12 $2,$0,1f $0, $3, $2 7 $2 $2,$0, $L5 w li bne div break mfhi bne nop lw nop move lui addiu jal nop b nop $2,28($fp) $5, $2 $2,Shi($LC3) $4, $2,lo($LC3) printf $L4 $15: $2,28($fp) lw nop move lui addiu jal nop $5, $2 $2,Shi($LC4) $4, $2,%lo($LC4) printf $14: $2,24($fp) lw nop addiu SW $2, $2,1 $2,24($fp) $16 b nop $4, $2,%lo ($LC2) puts addiu jal nop b nop $L4 $L3: # Oxc $3,28($fp) $2,12 $2,$0,1f $0, $3, $2 7 $2 $2,$0, $L5 w li bne div break mfhi bne nop lw nop move lui addiu jal nop b nop $2,28($fp) $5, $2 $2,Shi($LC3) $4, $2,lo($LC3) printf $L4 $15: $2,28($fp) lw nop move lui addiu jal nop $5, $2 $2,Shi($LC4) $4, $2,%lo($LC4) printf $14: $2,24($fp) lw nop addiu SW $2, $2,1 $2,24($fp) $16 b nop SW lw $2,24($fp) nop addiu $2, $2,1 $2,24($fp) b $L6 nop 3L7: nop move $sp,$fp lw $31,36($sp) lw $fp, 32($sp) addiu $sp,$sp,40 j $31 nop $LC5: ascii "Enter the number of inputs: 1000" main: addiu $sp,$sp, -40 SW $31,36($sp) SW $fp, 32($sp) move $fp,$sp SW $0,24($fp) lui $2,%hi($LC5) addiu $4, $2,%lo($LC5) jal printf nop addiu $2, $fp, 24 move $5, $2 lui $2,%hi($LC1) addiu $4, $2,% lo($LC1) jal scanf nop lw $2,24($fp) nop move $4, $2 jal isBanned (int) nop move $2,$0 move $sp,$fp lw $31,36($sp) lw $fp, 32($sp) addiu $sp,$sp,40 j $31 nop Error in /Users/codylaj/Desktop/ExamPart3.asm line 2 column 1: ".asciiz" directive cannot appear in text segment Error in /Users/codylaj/Desktop/ExamPart3.asm line 4 column 1: ".asciiz" directive cannot appear in text segment Error /Users/codylaj/Desktop/ExamPart3.asm line 6 column 1: ".asciiz" directive cannot appear in text segment Error /Users/codylaj/Desktop/ExamPart3.asm line 8 column 1: ".asciiz" directive cannot appear in text segment Error /Users/codylaj/Desktop/ExamPart3.asm line 10 column 1: ".asciiz" directive cannot appear in text segment Error /Users/codylaj/Desktop/ExamPart3.asm line 12 column 1: "isBanned" is not a recognized operator Error in /Users/codylaj/Desktop/ExamPart3.asm line 30 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 31 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 36 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 37 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 44 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 45 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 55 column 23: "1f": operand is of incorrect type Error in /Users/codylaj/Desktop/ExamPart3.asm line 64 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 65 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 76 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 77 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 97 column 17: "$31": operand of incorrect type Error in /Users/codylaj/Desktop/ExamPart3.asm line 102 column 9: ".ascii" directive cannot appear in text segment Error /Users/codylaj/Desktop/ExamPart3.asm line 111 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 112 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 117 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 118 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 124 column 9: "jal": Too many or incorrectly formatted operands. Expected: jal target Error in /Users/codylaj/Desktop/ExamPart3.asm line 131 column 17: "$31": operand is of incorrect type Assemble: operation completed with errors. $LCO: .ascii "Enter a positive integer: 1000" $LCI: .ascii "%d\000" $LC2: ascii "Error: Not a positive number. 1000 $LC3: ascii "&d is banned! \0121000" $LC4: .ascii "d is safe\012\000" isBanned (int): addiu $sp,$sp,-40 SW $31,36($sp) SW $fp, 32($sp) move $fp,$sp SW $4,40($fp) SW $0,28($fp) SW $0,24($fp) $16: $3,24($fp) $2,40($fp) $2, $3, $2 $2,$0, $L7 lw lw nop slt beq nop lui addiu jal nop addiu move $2,hi($LCO) $4, $2,%20($LCO) printf lui $2, $fp, 28 $5, $2 $2,%hi($LC1) $4, $2,% lo($LC1) scanf addiu jal nop LW $2,28($fp) nop $2, $L3 bgtz nop lui $2,hi($LC2) $4, $2,%lo ($LC2) puts addiu jal nop b nop $L4 $L3: # Oxc $3,28($fp) $2,12 $2,$0,1f $0, $3, $2 7 $2 $2,$0, $L5 w li bne div break mfhi bne nop lw nop move lui addiu jal nop b nop $2,28($fp) $5, $2 $2,Shi($LC3) $4, $2,lo($LC3) printf $L4 $15: $2,28($fp) lw nop move lui addiu jal nop $5, $2 $2,Shi($LC4) $4, $2,%lo($LC4) printf $14: $2,24($fp) lw nop addiu SW $2, $2,1 $2,24($fp) $16 b nop $4, $2,%lo ($LC2) puts addiu jal nop b nop $L4 $L3: # Oxc $3,28($fp) $2,12 $2,$0,1f $0, $3, $2 7 $2 $2,$0, $L5 w li bne div break mfhi bne nop lw nop move lui addiu jal nop b nop $2,28($fp) $5, $2 $2,Shi($LC3) $4, $2,lo($LC3) printf $L4 $15: $2,28($fp) lw nop move lui addiu jal nop $5, $2 $2,Shi($LC4) $4, $2,%lo($LC4) printf $14: $2,24($fp) lw nop addiu SW $2, $2,1 $2,24($fp) $16 b nop SW lw $2,24($fp) nop addiu $2, $2,1 $2,24($fp) b $L6 nop 3L7: nop move $sp,$fp lw $31,36($sp) lw $fp, 32($sp) addiu $sp,$sp,40 j $31 nop $LC5: ascii "Enter the number of inputs: 1000" main: addiu $sp,$sp, -40 SW $31,36($sp) SW $fp, 32($sp) move $fp,$sp SW $0,24($fp) lui $2,%hi($LC5) addiu $4, $2,%lo($LC5) jal printf nop addiu $2, $fp, 24 move $5, $2 lui $2,%hi($LC1) addiu $4, $2,% lo($LC1) jal scanf nop lw $2,24($fp) nop move $4, $2 jal isBanned (int) nop move $2,$0 move $sp,$fp lw $31,36($sp) lw $fp, 32($sp) addiu $sp,$sp,40 j $31 nop Error in /Users/codylaj/Desktop/ExamPart3.asm line 2 column 1: ".asciiz" directive cannot appear in text segment Error in /Users/codylaj/Desktop/ExamPart3.asm line 4 column 1: ".asciiz" directive cannot appear in text segment Error /Users/codylaj/Desktop/ExamPart3.asm line 6 column 1: ".asciiz" directive cannot appear in text segment Error /Users/codylaj/Desktop/ExamPart3.asm line 8 column 1: ".asciiz" directive cannot appear in text segment Error /Users/codylaj/Desktop/ExamPart3.asm line 10 column 1: ".asciiz" directive cannot appear in text segment Error /Users/codylaj/Desktop/ExamPart3.asm line 12 column 1: "isBanned" is not a recognized operator Error in /Users/codylaj/Desktop/ExamPart3.asm line 30 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 31 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 36 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 37 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 44 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 45 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 55 column 23: "1f": operand is of incorrect type Error in /Users/codylaj/Desktop/ExamPart3.asm line 64 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 65 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 76 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 77 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 97 column 17: "$31": operand of incorrect type Error in /Users/codylaj/Desktop/ExamPart3.asm line 102 column 9: ".ascii" directive cannot appear in text segment Error /Users/codylaj/Desktop/ExamPart3.asm line 111 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 112 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 117 column 9: "lui": Too many or incorrectly formatted operands. Expected: lui $t1, 100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 118 column 9: "addiu": Too many or incorrectly formatted operands. Expected: addiu $t1,$t2,-100 Error in /Users/codylaj/Desktop/ExamPart3.asm line 124 column 9: "jal": Too many or incorrectly formatted operands. Expected: jal target Error in /Users/codylaj/Desktop/ExamPart3.asm line 131 column 17: "$31": operand is of incorrect type Assemble: operation completed with errors
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
