DragonZero
Posts : 13 Points : 34 Reputation : 0 Join date : 2010-09-29
| Subject: Code help Sun Oct 03, 2010 10:27 am | |
| I wanna make a code that take the highest number of the value's. Example:
0x00001000 0x00004000 < so it take this one 0x00001000 0x00003000 0x00001000 0x00002000
Any idea's ? | |
|
-LeetGamer- Admin
Posts : 247 Points : 397 Reputation : 4 Join date : 2010-09-29 Age : 30
| Subject: Re: Code help Sun Oct 03, 2010 10:53 am | |
| Here is an example for two values: 0x00001000 0x00004000 0x00001004 0x00003000 - Code:
-
Lui t0 $0880 Lw t1 $1000(t0) Lw t2 $1004(t0) Slt t3 t1 t2 Bne t3 0 $To "here" Nop // This is if t1 < t2 Sw t2 $0000(t0) Beq 0 0 $To jr ra // This is to go to the end and not execute the other option Nop // This is if t2 < t1 "here" Sw t1 $0000(t0) Jr ra Nop
That will post the biggest value into address 00000000 | |
|