| View previous topic :: View next topic |
| Author |
Message |
ne0h
Joined: 21 Feb 2008 Posts: 386
|
Posted: Sat Jan 10, 2009 1:35 am Post subject: [SOLVED] [MIPS] undefined reference $a3 |
|
|
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 |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Sat Jan 10, 2009 2:19 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
ne0h
Joined: 21 Feb 2008 Posts: 386
|
Posted: Sat Jan 10, 2009 3:09 am Post subject: |
|
|
mmm,
this will load a word on a2 at address (a3 + a1), what's wrong? _________________ Get Xplora! |
|
| Back to top |
|
 |
hlide
Joined: 10 Sep 2006 Posts: 750
|
Posted: Sat Jan 10, 2009 6:33 am Post subject: |
|
|
| such an instruction doesn't exist... |
|
| Back to top |
|
 |
NoEffex
Joined: 27 Nov 2008 Posts: 108
|
Posted: Sat Jan 10, 2009 9:47 am Post subject: |
|
|
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 |
|
 |
ne0h
Joined: 21 Feb 2008 Posts: 386
|
Posted: Sun Jan 11, 2009 1:54 am Post subject: |
|
|
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 |
|
 |
ab5000
Joined: 06 May 2008 Posts: 74
|
|
| Back to top |
|
 |
ne0h
Joined: 21 Feb 2008 Posts: 386
|
Posted: Sun Jan 11, 2009 2:50 am Post subject: |
|
|
Ok, I've understand, thanks _________________ Get Xplora! |
|
| Back to top |
|
 |
|