PSP - Assembler inline ( __asm__ ) within C

Discussion in 'Sony Programming and Development' started by euchloedtj, Jul 22, 2010.

  1. euchloedtj

    euchloedtj Member

    Joined:
    Mar 20, 2010
    Messages:
    21
    Likes Received:
    0
    Hello, I am a new user of this forum and developper from PSP. Nice to meet this forum.

    I have to use an asm inline within C using a register passed as a parameter. The idea is using a different register depending on some conditions, so I pass the name of the register wich I want to use .I have followed GCC manual to do it but always get the same result. This is what I want to do (Example):

    register int* REG __asm__ ("t0");

    __asm__ ("li %0, 0xFF\n" : "=r" (REG) : :);



    As far as the manual is concerned it should be:

    $t0 <-- 0xFF

    However when I am debugging always do:

    $a0 <-- 0xFF

    How could I use an asm inline code passing the register what I want to use in that moment correctly? Does anyone could give me some help?

    Kind Regards.
    Diego Torres.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page