Discuss the development of new homebrew software, tools and libraries.
Moderators: cheriff , TyRaNiD
ne0h
Posts: 386 Joined: Thu Feb 21, 2008 2:15 am
Post
by ne0h » Sat Jan 10, 2009 1:35 am
I'm getting some errors with this:
Code: Select all
.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:
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
Last edited by
ne0h on Sun Jan 11, 2009 2:50 am, edited 1 time in total.
hlide
Posts: 739 Joined: Sun Sep 10, 2006 2:31 am
Post
by hlide » Sat Jan 10, 2009 2:19 am
no wonder... just have a look on a MIPS assembly instructions manual : there are something wrong in :
I'm letting you to guess what is wrong as an exercise.
ne0h
Posts: 386 Joined: Thu Feb 21, 2008 2:15 am
Post
by ne0h » Sat Jan 10, 2009 3:09 am
mmm,
this will load a word on a2 at address (a3 + a1), what's wrong?
hlide
Posts: 739 Joined: Sun Sep 10, 2006 2:31 am
Post
by hlide » Sat Jan 10, 2009 6:33 am
such an instruction doesn't exist...
NoEffex
Posts: 106 Joined: Thu Nov 27, 2008 6:48 am
Post
by NoEffex » Sat Jan 10, 2009 9:47 am
addu $t9, $a3, $a1
lw $a2, 0x0000($t9)
Last edited by
NoEffex on Tue Jan 13, 2009 8:41 am, edited 2 times in total.
Programming with:
Geany + Latest PSPSDK from svn
ne0h
Posts: 386 Joined: Thu Feb 21, 2008 2:15 am
Post
by ne0h » Sun Jan 11, 2009 1:54 am
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
ne0h
Posts: 386 Joined: Thu Feb 21, 2008 2:15 am
Post
by ne0h » Sun Jan 11, 2009 2:50 am
Ok, I've understand, thanks