MIPS Program: Getting some errors

I think I have some errors in my program

Page 1 of 1

0 Replies - 3021 Views - Last Post: 10 February 2009 - 07:15 PM Rate Topic: -----

#1 jingoria  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 96
  • Joined: 22-October 07

MIPS Program: Getting some errors

Posted 10 February 2009 - 07:15 PM

I am trying to write this program where,
I need to print a loop of 3's multiples and repeat that loop 15 times.

In other words I need to print this series 15 times:
3, 6, 12, 15, 18...

I am using Spim for my code. Upon runing I get some exceptions.I am totally new with this language and don't really know how to interpret this exceptions. Does this exceptions means the errors?
If so please can you look at my code and explain me how to correct my code?

Here is my code :

.data	#Variable declaration
comma: .asciiz  ", "
	 #variable x  is in $t0
	  #variable y is in $t1
	  #variable n is in $t2
	  #variable a is in $t3
	  #variable b	

.text						
.globl main	# begining of implementation section
main:

move  $t0, $zero		 # x = 3 , the first loop statement
addi $t0, $t0, 3					
move  $t2, $zero
addi $t2, $t2, 5			 # n = 1, initializes variable n
forltst:slt  $v0, $t2, 15   # $v0 = 0 if $t2 > 15
mul  $t3, $t0, $t2	   
lw $a0, 0($t3)
la  $a0, comma		   	
beq $t2, 15, exit1	  #go to exit1 if $t2 > 15



addi $t2, $t2, 1		 #increment n by 1
j forltst					 #jump to test of outer loop
exit1:



These are my exceptions I am getting.

Exception 4 [Address error iinst/data fetch] occurred and ignored
Exception 4 [Address error in inst/data fetch] occurred and ignored
Exception 4 [Address error in inst/data fetch] occurred and ignored
Exception 7 [Bad data address] occurred and ignored
Exception 4 [Address error in inst/data fetch] occurred and ignored
Exception 4 [Address error in inst/data fetch] occurred and ignored
Exception 4 [Address error in inst/data fetch] occurred and ignored
Exception 7 [Bad data address] occurred and ignored
Exception 4 [Address error in inst/data fetch] occurred and ignored
Exception 4 [Address error in inst/data fetch] occurred and ignored
Exception 4 [Address error in inst/data fetch] occurred and ignored


Thanks.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1