Presentation is loading. Please wait.

Presentation is loading. Please wait.

Recitation Material of Quiz 1 June 11, 2013. Problem 1.

Similar presentations


Presentation on theme: "Recitation Material of Quiz 1 June 11, 2013. Problem 1."— Presentation transcript:

1 Recitation Material of Quiz 1 June 11, 2013

2 Problem 1

3 551718 ten / 2ten = 275859ten Step 0

4 551718 ten / 2ten = 275859ten Step 1: 5/2=2 remainder=1

5 551718 ten / 2ten = 275859ten Step 2: remainder 1*10 = 10 10+5 = 15/2 = 7 new_remainder = 1

6 551718 ten / 2ten = 275859ten Step 3: remainder 1*10 = 10 10+1 = 11/2 = 5 new_remainder = 1

7 551718 ten / 2ten = 275859ten Step 4: remainder 1*10 = 10 10+7 = 17/2 = 8 new_remainder = 1

8 551718 ten / 2ten = 275859ten Step 5: remainder 1*10 = 10 10+1 = 17/2 = 5 new_remainder = 1

9 551718 ten / 2ten = 275859ten Step 6: remainder 1*10 = 10 10+8 = 18/2 = 9 new_remainder = 0

10 Problem2

11

12 B A C D E F OUT 1 1 1

13 Problem 3

14 B = A = then = =B’s ones-complement (since B+ =, and B+ +1= + = ) So, – B = + – And thus A-B = A + + – = + + – = – =

15 Problem 4

16 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe20 0x0040001 8

17 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

18 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

19 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

20 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

21 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

22 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

23 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

24 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

25 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

26 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

27 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

28 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

29 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8

30 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe14 0x0040001 8 0x0040007c

31 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe14 0x0040001 8 0x0040007c

32 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe14 0x0040001 8 0x0040007c

33 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe14 0x0040001 8 0x0040007c 0x0000000 3

34 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe14 0x0040001 8 0x0040007c 0x0000000 3

35 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3

36 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0

37 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0

38 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0

39 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2

40 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2

41 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2

42 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0

43 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0

44 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0

45 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1

46 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1

47 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffdfc 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1

48 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffdfc 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

49 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffdfc 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

50 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffdfc 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

51 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffdfc 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

52 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

53 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

54 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

55 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

56 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe04 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

57 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

58 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

59 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

60 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

61 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe0c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

62 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe14 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

63 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe14 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

64 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe14 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

65 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe14 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

66 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

67 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

68 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

69 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

70 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

71 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

72 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

73 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

74 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

75 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

76 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe1c 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

77 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe20 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

78 [00400024] 23bdfff8 addi $sp, $sp, -8 [00400028] afbf0000 sw $ra, 0($sp) [0040002c] 34020001 ori $v0, $0, 1 ; 16: li $v0, 1 # 0! = 1 [00400030] 10800006 beq $a0, $0, 24 [zero-0x00400030] [00400034] afa40004 sw $a0, 4($sp) [0040003c] 0c100009 jal 0x00400024 [factorial] [00400040] 8fa40004 lw $a0, 4($sp) [00400044] 70821002 mul $v0, $a0, $v0 [00400048] 8fbf0000 lw $ra, 0($sp) [0040004c] 23bd0008 addi $sp, $sp, 8 [00400050] 03e00008 jr $ra [00400054] 23bdfffc addi $sp, $sp, -4 [main: Entry] [00400058] afbf0000 sw $ra, 0($sp) [0040005c] 3c011001 lui $at, 4097 [prompt] ; 39: la $a0, prompt [00400060] 34240000 ori $a0, $at, 0 [prompt] [00400064] 34020004 ori $v0, $0, 4 ; 40: li $v0, 4 [00400068] 0000000c syscall [0040006c] 34020005 ori $v0, $0, 5 ; 43: li $v0, 5 [00400070] 0000000c syscall [00400074] 00022021 addu $a0, $0, $v0 [00400078] 0c100009 jal 0x00400024 [factorial]; [0040007c] 00022021 addu $a0, $0, $v0 [00400080] 34020001 ori $a0, $0, 1 ; 50: li $v0, 1 [00400084] 0000000c syscall [00400088] 3c011001 lui $at, 4097 [endl] ; 53: la $a0, endl [0040008c] 3424001f ori $a0, $1, 31 [endl] [00400090] 34020004 ori $v0, $0, 4 ; 54: li $v0, 4 [00400094] 0000000c syscall [00400098] 34020000 ori $at, $0, 0 ; 57: li $v0, 0 # Return zero. [0040009c] 8fbf0000 lw $ra, 0($sp) [004000a0] 23bd0004 addi $sp, $sp, 4 [004000a4] 03e00008 jr $ra ; 61: jr $ra $sp 0x7ffffe20 0x0040001 8 0x0040007c 0x0000000 3 0x0040004 0 0x0000000 2 0x0040004 0 0x0000000 1 0x0040004 0

79 Problem 5

80 .data prompt:.asciiz”Give radius r:”.text main: la $a0, prompt li $v0, 4 syscall li $v0, 5 syscall li $t3, 3 mult $t3, $v0 mflo $t3 mult $t3, $v0 mflo $a0 li $v0, 1 syscall


Download ppt "Recitation Material of Quiz 1 June 11, 2013. Problem 1."

Similar presentations


Ads by Google