Unable to determine why floating point comparison is giving syntax error

79 views Asked by At

Code is meant to loop, calculating fibonacci sequence based on user input(n). In PCSpim im receiving:

(parser) syntax error on line 71 of file. c.ep.d $f0, $f8

    s.d $f2, 0.0 #f0 - These two house the fibonacci f0 + f1 numbers throughout the loop
    s.d $f4, 1.1 #f1
    
    li.d $f8, 0.0 #Used respectively for when I need a zero or a one.
    li.d $f10, 1.0
    
    
    mtc1 $a0, $f0  #n is entered by the user in main, converted from integer to double here.
    cvt.d.w $f0, $f0 # f0 = n
    
    sub.d $f0, $f0, $f4 # -1 from n preemptively as I do the first calculation above.
    loop:
    add.d $f6, $f4, $f2 #$f6 = f0 + f1
    add.d $f2, $f4, $f8 # f0 = f1
    add.d $f4, $f6, $f8 # f1 = (f0 + f1) 
    sub.d $f0, $f0, $f10 # - 1 from n
    
    
    
    c.ep.d $f0, $f8 #comparing DoubleZero and n  <--- This is where the error is coming from
    
    bc1f loop #continue to loop if n is not equal to 0.


    li $v0, 3
    add.d $f12, $f10, $f6 #print the double
    syscall
    #move $v0, $f4

    jr $ra #return to main```
0

There are 0 answers