Page 1 of 1

Quick question about syscall

Posted: Thu Mar 03, 2005 3:14 pm
by Ladon0081
OK, I new to ps2 programming and I am having some difficulty with syscall. What does syscall with v1 == 0x3C ( aka RFU060 ) do exactly, and what does it return? I notice all code loads sp with v0 after the call.

Also, I've seen the instruction ei in code but have not seen it documented. Is this some kinda pseudoinstruction?

Posted: Thu Mar 03, 2005 5:40 pm
by Guest
EI = Enable Interrupts. That should be self-explanatory.

It is a COP0 instruction and surely is documented. But if COP0 instructions are documented in a different section of the manual that would explain why you didn't see them.

Posted: Thu Mar 03, 2005 5:59 pm
by pixel
gorim ? you seem to be quite missing the points of questions from people lately :)

Anyway, I've aliased RFU060 to SetupThread lately. It should only be used in the crt0 of the software (that is, the small startup code that runs before your software)

The actual prototype is:

Code: Select all

void * SetupThread(void * gp, void * stack, s32 stack_size, void * args, void * root_func);

So, this syscall should be to set up your main thread, and, indeed, it does return the stack pointer. It shouldn't be used outside of crt0 anyway I think.

Posted: Thu Mar 03, 2005 6:14 pm
by Guest
pixel wrote:gorim ? you seem to be quite missing the points of questions from people lately :)
Really ? I answered the one part I had an immediate answer to. Did you not see it ? Here let me repeat it for you, and then perhaps you should go take another look to make sure I am not lying to you. :)
Ladon0081 wrote: Also, I've seen the instruction ei in code but have not seen it documented. Is this some kinda pseudoinstruction?
Now, if you think I am still missing a point, please by all means point it out to me more clearly ;)

Posted: Thu Mar 03, 2005 7:48 pm
by pixel
Aah, sorry, it's me who just didn't read his question completely ^_^