PSP Coding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

PSP Coding


 
HomeLatest imagesSearchRegisterLog in

 

 Code help

Go down 
2 posters
AuthorMessage
DragonZero




Posts : 13
Points : 34
Reputation : 0
Join date : 2010-09-29

Code help Empty
PostSubject: Code help   Code help I_icon_minitimeSun 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 ?
Back to top Go down
-LeetGamer-
Admin



Posts : 247
Points : 397
Reputation : 4
Join date : 2010-09-29
Age : 30

Code help Empty
PostSubject: Re: Code help   Code help I_icon_minitimeSun 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
Back to top Go down
 
Code help
Back to top 
Page 1 of 1
 Similar topics
-
» How Would I Sub and De Sub A Code?
» [HELP] How to Sub DMA code?
» Mohh2 Killstreak Code
» How to Write a two code Subroutine!
» How Joker A Code [ Big Guide ]

Permissions in this forum:You cannot reply to topics in this forum
PSP Coding :: PSP Section :: PSP Chat :: PSP Coding Help-
Jump to: