forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[SOLVED] [MIPS] undefined reference $a3

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
ne0h



Joined: 21 Feb 2008
Posts: 386

PostPosted: Sat Jan 10, 2009 1:35 am    Post subject: [SOLVED] [MIPS] undefined reference $a3 Reply with quote

I'm getting some errors with this:
Code:

.globl _start
.set noreorder
.ent _start

set_k1:
    li      $k1, 0

loop:
    nop
    j   loop
    nop

check_mem:
    addi    $a3, $a3, 1
    lw      $a2, $a3($a1)
    beq     $a2, $a0, check_mem
    nop

check_saved:
    lw      $a2, $a3($a1)
    beq     $a2, $a0, loop
    nop
    break

_start:
    li      $a0, 0x00000000
    li      $a1, 0x88000000
    li      $a3, -1

    j       check_mem
    nop

    sw      $a0, $a3($a1)
   
    j       check_saved
    nop
   
   

   

.set reorder
.end _start

Sorry, I'm trying to learn mips...
The error log:
Quote:
main.o: In function `check_mem':
: undefined reference to `$a3'
main.o: In function `check_mem':
: undefined reference to `$a3'
main.o: In function `check_saved':
: undefined reference to `$a3'
main.o: In function `check_saved':
: undefined reference to `$a3'
main.o: In function `_start':
: undefined reference to `$a3'
main.o:: more undefined references to `$a3' follow
make: *** [build_asm] Error 1

_________________
Get Xplora!


Last edited by ne0h on Sun Jan 11, 2009 2:50 am; edited 1 time in total
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Sat Jan 10, 2009 2:19 am    Post subject: Reply with quote

no wonder... just have a look on a MIPS assembly instructions manual : there are something wrong in :
Code:
lw      $a2, $a3($a1)

Code:
sw      $a0, $a3($a1)

I'm letting you to guess what is wrong as an exercise.
Back to top
View user's profile Send private message
ne0h



Joined: 21 Feb 2008
Posts: 386

PostPosted: Sat Jan 10, 2009 3:09 am    Post subject: Reply with quote

mmm,
Code:
lw      $a2, $a3($a1)

this will load a word on a2 at address (a3 + a1), what's wrong?
_________________
Get Xplora!
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Sat Jan 10, 2009 6:33 am    Post subject: Reply with quote

such an instruction doesn't exist...
Back to top
View user's profile Send private message
NoEffex



Joined: 27 Nov 2008
Posts: 108

PostPosted: Sat Jan 10, 2009 9:47 am    Post subject: Reply with quote

addu $t9, $a3, $a1
lw $a2, 0x0000($t9)
_________________
Programming with:
Geany + Latest PSPSDK from svn


Last edited by NoEffex on Tue Jan 13, 2009 8:41 am; edited 2 times in total
Back to top
View user's profile Send private message
ne0h



Joined: 21 Feb 2008
Posts: 386

PostPosted: Sun Jan 11, 2009 1:54 am    Post subject: Reply with quote

I can't figure out where is my problem!
if is possible I want to know why I cannot do what I've done...
Thanks
_________________
Get Xplora!
Back to top
View user's profile Send private message
ab5000



Joined: 06 May 2008
Posts: 74

PostPosted: Sun Jan 11, 2009 2:42 am    Post subject: Reply with quote

ne0h wrote:
mmm,
Code:
lw      $a2, $a3($a1)

this will load a word on a2 at address (a3 + a1), what's wrong?


take a look there: http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html
Back to top
View user's profile Send private message
ne0h



Joined: 21 Feb 2008
Posts: 386

PostPosted: Sun Jan 11, 2009 2:50 am    Post subject: Reply with quote

Ok, I've understand, thanks
_________________
Get Xplora!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group