This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
main: | |
li $a0, 5 | |
jal fib | |
move $a0, $v0 | |
jal print_int | |
jal print_newline | |
fib: | |
addiu $sp, $sp, -12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.data | |
break: .asciiz "\n" | |
ask: .asciiz "Please enter a random 4 digit number for a seed: " | |
input: .float 4 | |
list : .word 100 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
la $a0, info # Load the start address of the array | |
lw $t0, length # Load the array length | |
sll $t0, $t0, 2 # Multiple the array length by 4 (the size of the elements) | |
add $a1, $a0, $t0 # Calculate the array end address | |
jal mergesort # Call the merge sort function | |
b sortend # We are finished sorting | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.data | |
str1: .asciiz "Enter String: " | |
#.align 2 | |
getc: .asciiz "Enter char: " | |
#.align 2 | |
ret: .asciiz "Character <ch> occurs in string <string> <n> times" | |
buffer: .space 100 #space to store our string | |
L1: .space 2 #space for our char | |
L2: .space 4 #space for our char’s frequency in string |
NewerOlder