Created
April 1, 2009 04:23
-
-
Save yewreeka/88549 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| findblob: | |
| la $t3, image # address of image | |
| or $t0, $zero, $zero # i = 0 | |
| mult $a1, $a2 | |
| mflo $t1 # max = w * h | |
| loop: beq $t0, $t1, exit | |
| sll $t2, $t0, 2 # mult by 4 | |
| add $t2, $t2, $t3 # t3 = i + address | |
| lw $t4, 0($t2) | |
| andi $t5, $t4, 65535 | |
| srl $t4, $t4, 16 | |
| beq $a0, $t4, found | |
| beq $a0, $t5, found | |
| addi $t0, $t0, 1 # i++ | |
| j loop | |
| found: add $v0, $t2, $zero | |
| exit: jr $ra |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment