Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In MIPS 4.5. Could you also show the steps, please? la $a0, prompt Your Turn jal PromptInt move $30, $v0 seg $t0, $30, -1 Calculate

In MIPS 4.5. Could you also show the steps, please?

image text in transcribed

la $a0, prompt Your Turn jal PromptInt move $30, $v0 seg $t0, $30, -1 Calculate the Branch Amounts and assemble the instructions into Machine Code for the statements on lines 9, 14, 17 and 27 bnez $t0, EndLoop la $a0, result Note: On 27, don't forget sign extension. Address Code Basic 0x00400000 Ox3c011001 lui $1, 0x00001001 4: Ox00400004 0x34240000 ori $4, $1, 0x00000000 0x00400008 Ox0c10002ajal 0x004000a8 5: 0x00400000 Ox00028021 addu $16, $0, $2 6: 0x00400010 0x2001ffff addi $1,$0, 0xffffffff 0x00400014 0x02014023 subu $8,$16, $1 Ox00400018 0x34010001 ori $1,$0, 0x00000001 0x0040001c 0x0101402b sltu $8,$8,$1 Ox00400020 bne $8, 90, 9: Ox00400024 0x3c011001 lui $1, 0x00001001 10: 0x00400028 0x3424001d ori $4, $1, 0x0000001d 0x0040002C 0x00102821 addu $5, $0, $16 11: 0x00400030 Ox0c100024 jal 0x00400090 12: 0x00400034 0x2a080064 3lti $8,$16, 0x00000064 13: 0x00400038 beg $8,$0, 14: 0x004000300x3c011001lui $1, 0x00001001 15: 0x00400040 Ox34240041 ori $4, $1, 0x00000041 0x00400044 0x0c100030 jal 0x00400000 16: Ox00400048 bgez $0, 17: Ox0040004c Ox3c011001 lui $1, 0x00001001 19: 0x00400050 Ox3424002b ori $4, $1, 0x0000002b 0x00400054 Ox0c100030 jal 0x00400000 20: 0x00400058 0x3c011001 lui $1, 0x00001001 22: 0x004000500x3424005a ori $4, $1, 0x0000005a 0x00400060 0x0c100030 jal 0x00400000 23: 0x00400064 0x3c011001 lui $1, 0x00001001 24: 0x00400068 Ox34240000 ori $4, $1, 0x00000000 0x0040006C 0x0c10002ajal 0x004000a3 25: 0x00400070 Ox00028021 addu $16, $0, $2 Ox00400074 bgez $0, 27: 0x00400078 Ox0c100033 jal 0x004000cc 29: move Sal, $30 jal Printint slti $t0, $30, 100 beqz $t0, BigNumber la $ao, little jal PrintString b EndIf la $a0, big jal PrintString la $a0, tryAgain jal PrintString la $a0 prompt 26: jal PromptInt move $30, $v0 b BeginLoop jal Exit la $a0, prompt Your Turn jal PromptInt move $30, $v0 seg $t0, $30, -1 Calculate the Branch Amounts and assemble the instructions into Machine Code for the statements on lines 9, 14, 17 and 27 bnez $t0, EndLoop la $a0, result Note: On 27, don't forget sign extension. Address Code Basic 0x00400000 Ox3c011001 lui $1, 0x00001001 4: Ox00400004 0x34240000 ori $4, $1, 0x00000000 0x00400008 Ox0c10002ajal 0x004000a8 5: 0x00400000 Ox00028021 addu $16, $0, $2 6: 0x00400010 0x2001ffff addi $1,$0, 0xffffffff 0x00400014 0x02014023 subu $8,$16, $1 Ox00400018 0x34010001 ori $1,$0, 0x00000001 0x0040001c 0x0101402b sltu $8,$8,$1 Ox00400020 bne $8, 90, 9: Ox00400024 0x3c011001 lui $1, 0x00001001 10: 0x00400028 0x3424001d ori $4, $1, 0x0000001d 0x0040002C 0x00102821 addu $5, $0, $16 11: 0x00400030 Ox0c100024 jal 0x00400090 12: 0x00400034 0x2a080064 3lti $8,$16, 0x00000064 13: 0x00400038 beg $8,$0, 14: 0x004000300x3c011001lui $1, 0x00001001 15: 0x00400040 Ox34240041 ori $4, $1, 0x00000041 0x00400044 0x0c100030 jal 0x00400000 16: Ox00400048 bgez $0, 17: Ox0040004c Ox3c011001 lui $1, 0x00001001 19: 0x00400050 Ox3424002b ori $4, $1, 0x0000002b 0x00400054 Ox0c100030 jal 0x00400000 20: 0x00400058 0x3c011001 lui $1, 0x00001001 22: 0x004000500x3424005a ori $4, $1, 0x0000005a 0x00400060 0x0c100030 jal 0x00400000 23: 0x00400064 0x3c011001 lui $1, 0x00001001 24: 0x00400068 Ox34240000 ori $4, $1, 0x00000000 0x0040006C 0x0c10002ajal 0x004000a3 25: 0x00400070 Ox00028021 addu $16, $0, $2 Ox00400074 bgez $0, 27: 0x00400078 Ox0c100033 jal 0x004000cc 29: move Sal, $30 jal Printint slti $t0, $30, 100 beqz $t0, BigNumber la $ao, little jal PrintString b EndIf la $a0, big jal PrintString la $a0, tryAgain jal PrintString la $a0 prompt 26: jal PromptInt move $30, $v0 b BeginLoop jal Exit

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

Fundamentals Of International Financial Accounting And Reporting

Authors: Roger Hussey

1st Edition

9814280232, 9789814280235

More Books

Students also viewed these Accounting questions

Question

How are the elements of a borderLayout organized?

Answered: 1 week ago