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

 

 KOM #2

Go down 
2 posters
AuthorMessage
Emu




Posts : 21
Points : 29
Reputation : 0
Join date : 2010-10-04

KOM #2 Empty
PostSubject: KOM #2   KOM #2 I_icon_minitimeTue Oct 05, 2010 3:29 pm

What is the result at address 0x00000000?

Lui t0, $0880
Addi t1, zero, $4
Addi t2, zero, $8
Xor t2, t1, t2
Mult t2, t1
Mflo t2
Addi t3, zero, $10
Madd t1, t2, t3, t2
Mflo t1
addiu t1, t1, $12
sw t1, $0(t0)
jr ra
nop



Last edited by Emu on Tue Oct 05, 2010 3:39 pm; edited 1 time in total
Back to top Go down
-LeetGamer-
Admin



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

KOM #2 Empty
PostSubject: Re: KOM #2   KOM #2 I_icon_minitimeTue Oct 05, 2010 3:38 pm

Lui t0, $0880 // t0 = 0x08800000
Addi t1, zero, $4 // t1 = 0x4
Addi t2, zero, $8 // t2 = 0x8
Xor t2, t1, t2 // t2 = 0xC
/*
0100
1000
----
1100 = 0xC
*/
Mult t2, t1 // $LO = 0x30
Mflo t2 // t2 = $LO
Addi t3, zero, $10 // t3 = 0x10
Madd t1, t2, t3, t2 // t1 = (t3 * t2) + t2
// t1 = 0x330
Mflo t1 // t1 = $LO
addiu t1, t1, $12 // t1 = 0x42
sw t1, $0(t0) // store
jr ra // jr ra
nop // nop

My answer: 0x42
Back to top Go down
Emu




Posts : 21
Points : 29
Reputation : 0
Join date : 2010-10-04

KOM #2 Empty
PostSubject: Re: KOM #2   KOM #2 I_icon_minitimeTue Oct 05, 2010 4:02 pm

Correct! We may have to make this harder next time Very Happy
Back to top Go down
Sponsored content





KOM #2 Empty
PostSubject: Re: KOM #2   KOM #2 I_icon_minitime

Back to top Go down
 
KOM #2
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
PSP Coding :: PSP Section :: Coding Contests :: Official KOM-
Jump to: