Quick question about syscall

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
Ladon0081
Posts: 1
Joined: Thu Mar 03, 2005 2:53 pm

Quick question about syscall

Post 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?
Guest

Post 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.
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post 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.
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Guest

Post 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 ;)
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

Aah, sorry, it's me who just didn't read his question completely ^_^
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Post Reply