Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

$LFB1024 = . main: addiu $sp,$sp,48 sw $31,44($sp) sw $fp,40($sp) move $fp,$sp lui $2,%hi($LC0) addiu $5,$2,%lo($LC0) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop lui $2,%hi($LC1)

$LFB1024 = . main: addiu $sp,$sp,48 sw $31,44($sp) sw $fp,40($sp) move $fp,$sp lui $2,%hi($LC0) addiu $5,$2,%lo($LC0) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

lui $2,%hi($LC1) addiu $5,$2,%lo($LC1)1 lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

lui $2,%hi($LC2) addiu $5,$2,%lo($LC2) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

lui $2,%hi($LC3) addiu $5,$2,%lo($LC3) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

lui $2,%hi($LC4) addiu $5,$2,%lo($LC4) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

lui $2,%hi($LC5) addiu $5,$2,%lo($LC5) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

addiu $2,$fp,36 move $5,$2 lui $2,%hi(_ZSt3cin) addiu $4,$2,%lo(_ZSt3cin) jal _ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_ nop

lb $2,36($fp) nop addiu $2,$2,48 sltu $3,$2,5 beq $3,$0,$L2 nop

sll $3,$2,2 lui $2,%hi($L4) addiu $2,$2,%lo($L4) addu $2,$3,$2 lw $2,0($2) nop j $2 nop

.word $L3 .word $L5 .word $L6 .word $L7 .word $L8 lui $2,%hi($LC6) addiu $5,$2,%lo($LC6) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

addiu $2,$fp,28 move $5,$2 lui $2,%hi(_ZSt3cin) addiu $4,$2,%lo(_ZSt3cin) jal _ZNSirsERi nop

move $3,$2 addiu $2,$fp,32 move $5,$2 move $4,$3 jal _ZNSirsERi nop

lw $3,28($fp) lw $2,32($fp) nop addu $2,$3,$2 sw $2,24($fp) lui $2,%hi($LC7) addiu $5,$2,%lo($LC7) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

lw $5,24($fp) move $4,$2 jal _ZNSolsEi nop

b $L2 nop

lui $2,%hi($LC6) addiu $5,$2,%lo($LC6) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

addiu $2,$fp,28 move $5,$2 lui $2,%hi(_ZSt3cin) addiu $4,$2,%lo(_ZSt3cin) jal _ZNSirsERi nop

move $3,$2 addiu $2,$fp,32 move $5,$2 move $4,$3 jal _ZNSirsERi nop

lw $3,28($fp) lw $2,32($fp) nop subu $2,$3,$2 sw $2,24($fp) lui $2,%hi($LC7) addiu $5,$2,%lo($LC7) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

lw $5,24($fp) move $4,$2 jal _ZNSolsEi nop

b $L2 nop

lui $2,%hi($LC6) addiu $5,$2,%lo($LC6) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

addiu $2,$fp,28 move $5,$2 lui $2,%hi(_ZSt3cin) addiu $4,$2,%lo(_ZSt3cin) jal _ZNSirsERi nop

move $3,$2 addiu $2,$fp,32 move $5,$2 move $4,$3 jal _ZNSirsERi nop

lw $3,28($fp) lw $2,32($fp) nop mult $3,$2 mflo $2 sw $2,24($fp) lui $2,%hi($LC7) addiu $5,$2,%lo($LC7) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

lw $5,24($fp) move $4,$2 jal _ZNSolsEi nop

b $L2 nop

lui $2,%hi($LC6) addiu $5,$2,%lo($LC6) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

addiu $2,$fp,28 move $5,$2 lui $2,%hi(_ZSt3cin) addiu $4,$2,%lo(_ZSt3cin) jal _ZNSirsERi nop

move $3,$2 addiu $2,$fp,32 move $5,$2 move $4,$3 jal _ZNSirsERi nop

lw $3,28($fp) lw $2,32($fp) nop bne $2,$0,1f div $0,$3,$2 break 7 1: mfhi $2 mflo $2 sw $2,24($fp) lui $2,%hi($LC7) addiu $5,$2,%lo($LC7) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

lw $5,24($fp) move $4,$2 jal _ZNSolsEi nop

b $L2 nop

move $4,$0 jal exit nop

lui $2,%hi($LC8) addiu $5,$2,%lo($LC8) lui $2,%hi(_ZSt4cout) addiu $4,$2,%lo(_ZSt4cout) jal _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc nop

move $2,$0 move $sp,$fp lw $31,44($sp) lw $fp,40($sp) addiu $sp,$sp,48 j $31 nop

$LFB1028 = . _Z41__static_initialization_and_destruction_0ii: addiu $sp,$sp,32 sw $31,28($sp) sw $fp,24($sp) move $fp,$sp sw $4,32($fp) sw $5,36($fp) lw $3,32($fp) li $2,1 # 0x1 bne $3,$2,$L12 nop lw $3,36($fp) li $2,65535 # 0xffff bne $3,$2,$L12 nop

lui $2,%hi(_ZStL8__ioinit) addiu $4,$2,%lo(_ZStL8__ioinit) jal _ZNSt8ios_base4InitC1Ev nop

lui $2,%hi(__dso_handle) addiu $6,$2,%lo(__dso_handle) lui $2,%hi(_ZStL8__ioinit) addiu $5,$2,%lo(_ZStL8__ioinit) lui $2,%hi(_ZNSt8ios_base4InitD1Ev) addiu $4,$2,%lo(_ZNSt8ios_base4InitD1Ev) jal __cxa_atexit nop

nop move $sp,$fp lw $31,28($sp) lw $fp,24($sp) addiu $sp,$sp,32 j $31 nop

$LFB1029 = . _GLOBAL__sub_I_main: addiu $sp,$sp,32 sw $31,28($sp) sw $fp,24($sp) move $fp,$sp li $5,65535 # 0xffff li $4,1 # 0x1 jal _Z41__static_initialization_and_destruction_0ii nop

move $sp,$fp lw $31,28($sp) lw $fp,24($sp) addiu $sp,$sp,32 j $31 nop

image text in transcribed

image text in transcribed

image text in transcribed

I run the program using MIPS (QTSPIM)

PLEASE HELP ME FIX THIS ERROR FOR ABOVE CODING

QtSpim File Simulator Registers Text Segment Data Segment Window Help Int Regs [16] Data Text Regs Int Regs [16] 6 X Data PC = 0 EPC 0 Cause = 0 BadvAddr = 0 Status = 3000ff10 45520 HI LO = 0 = 0 726 Error C Kernel data segment [90000000] .. [90010000] (900000001 78452020 74706563 206e6f69 63682000 Exception [90000010) 72727563 61206465 6920646e 72 6f6e67 curred and ignor [90000020] 000a 6465 495b2020 7265746e 74707572 e d.. [Interrupt [900000301 2000205d 4c545b20 20005d42 40545b20 ] (TIB). [ TL TOD0000401 [90000040] 20005442 20005042 20005d42 64415b20 B1. ) [ TLB 1. [Ad 1000cc [90000050) 73657264 72652073 20726872 69206e69 dress error in i Ano [900000601 61742164 2f74736e ZEEGERA 2002 1000020 FR200000 [90000070] 5b202000 726 10000.0 402022 [90000080] 692072 657 000000001 2010 [90000090] 20646142 747 spim: (parser) Unknown character on line 3 of file [900000a01 72646461 5d7 C:/Users/USER/Documents/COA.TEST1.asm ad [900000bol 74616420 646 addiu Ssp, Ssp,48 10000 0 zod 455b2020 [90000000] 726 000000 Easter 2003 [90000000] 5d6c6c61 202 Bacca 200 [90000000] 50746e69 202 000 concen OK Abort [90000000] 692064 757 2000 1 5b202000 746-TCT [90000100) Ez a (90000110) 66726576 50776f6c 20200020 6172545b ver flow] [ Tra Food [900001201 00205d7056202000 616f6c46 676e6974 p] [ Floating [90000130] 696f7020 205d746e 20000000 6f435b20 point] [co [90000140] 636f7270 005d3220 20000000 444d5b20 . proc 2] [MD --- [90000150] 005d584d 575b2020 68637461 20200050 MX1 0001 . 101 [Watch] (90000160] 63614d5b 656e6968 65686320 005d6b63 [ Machine . check) (90000170] 00000000 5b202000 68636143 00005065 . . [cache] [90000180] 90000024 90000033 9000003b 90000043 $ 3 w w " [90000190] 9000004b 90000071 9000008d 900000aa K a w waa [900001a0] 900000c0 900000d6 900000e6 90000100 [90000100) 90000101 90000lla 90000124 90000125 2010 (90000100) 90000139 9000013a 9000013b 90000148 9 (90000100] 90000149 9000014a 9000014b 90000154 I K [900001e0] 9000015e 90000170 90000171 90000172 P a [90000110] 90000173 90000174 90000175 9000017 (90000200]..[9000ffff] 00000000 TIJU UIZ . T . RO [30] = 0 R1 [at] = 0 R2 [VO] = 0 R3 [vi] = 0 R4 [ab] = 1 1. R5 [al] = 7ffff900 R6 [a2] = 7ffff908 R7 [a3] = 0 40 R8 [to] = 0 R9 [ti] = 0 R10 [t2] = 0 R11 [t3] = 0 0 R12 [t4] = 0 R13 [t5] = 0 DLA ito na R14 [t6] = 0 R15 [t7] = 0 R16 [80] = 0 R17 [31] = 0 De La R18 [s2] = 0 R19 [83] = 0 non - R20 [84] = 0 ] R21 [85] = 0 R22 [86] = 0 R23 [87] = 0 R24 [t8] = 0 R25 [t9] = 0 R26 ini = 0 . . . . A . S t Do jal Ox00000000 [main] ; 188: jal main 00 nop ; i89: non Da ori $2 Error Dc syscal spim: (parser) Label is defined for the second time on line 2 of file i C:/Users/USER/Documents/COA.TEST1.asm 21 addu $ main: DO lui $1 t 20 00 sw $2, lui $1 OK Abort 04 DO 82 sw $4, 516 ($1) mfco $26, $13 srl $4, $26, 2 ; 95: mfco Sko $13 # Cause register ; 96: srl Sao SKO 2# Extract ExcCode Field andi CA CA 21 az od oor 60004 addiu $6, $5, 4 41080 sll $2, $4, 2 23021 addu $6, $6, $2 00000 jal 0x00000000 [main] 00000 nop 2000a ori $2,$0, 10 0000c syscall Error ; 185: addiu a2 $al 4 # envp ; 186: sll Svo Sao 2 ; 187: addu $a2 Sa 2 Svo ; 188: jal main ; 189: ; 191: li $v0 10 i 10821 addu $2 19000 lui $1 spim: (parser) syntax error on line 4 of file C:/Users/USER/Documents/COA. TESTI.asm OK Abort 20200 19000 sw $2, lui $1 40204 a 6800 a 2082 4001f 20004 49000 0000c sw $4, 516 ($1) mfco $26, $13 srl $4, $26, 2 andi $4, $4, 31 ori $2, $0, 4 lui $4, -28672 __m1_] syscall ; 95: mfco Sko $13 # Cause register ; 96: sri Sao Sko 2 # Extract ExcCode Field ; 97: andi Sa0 Sa0 0xif ; 101: li $v0 4 # syscall 4 (print_str) ; 102: l $30 m1 : 103: syscall

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistical And Scientific Database Management International Working Conference Ssdbm Rome Italy June 21 23 1988 Proceedings Lncs 339

Authors: Maurizio Rafanelli ,John C. Klensin ,Per Svensson

1st Edition

354050575X, 978-3540505754

More Books

Students also viewed these Databases questions