Here is the code:
.file 1 ""
.section .mdebug.abi32
.previous
.nan legacy
.module fp=32
.module nooddspreg
.abicalls
.rdata
.align 2
$LC1:
.ascii "There are two roots : %f,%f\012\000"
.align 2
$LC2:
.ascii "There is one root : %f\012\000"
.align 2
$LC3:
.ascii "There are two complex roots : %f +/- %f\012\000"
.text
.align 2
.globl roots_of
.set nomips16
.set nomicromips
.ent roots_of
.type roots_of, @function
roots_of:
.frame $fp,72,$31 # vars= 24, regs= 2/2, args= 24, gp= 8
.mask 0xc0000000,-12
.fmask 0x00300000,-8
.set noreorder
.cpload $25
.set nomacro
addiu $sp,$sp,-72
sw $31,60($sp)
sw $fp,56($sp)
swc1 $f20,68($sp)
swc1 $f21,64($sp)
movz $31,$31,$0
move $fp,$sp
.cprestore 24
swc1 $f12,72($fp)
swc1 $f14,76($fp)
sw $6,80($fp)
lwc1 $f2,76($fp)
lwc1 $f0,76($fp)
nop
mul.s $f2,$f2,$f0
lwc1 $f4,72($fp)
lw $2,%got($LC0)($28)
nop
lwc1 $f0,%lo($LC0)($2)
nop
mul.s $f4,$f4,$f0
lwc1 $f0,80($fp)
nop
mul.s $f0,$f4,$f0
sub.s $f0,$f2,$f0
swc1 $f0,32($fp)
lwc1 $f0,32($fp)
mtc1 $0,$f2
nop
c.lt.s $f2,$f0
nop
bc1f $L7
nop
lw $3,76($fp)
li $2,-2147483648 # 0xffffffff80000000
xor $2,$3,$2
mtc1 $2,$f0
nop
cvt.d.s $f20,$f0
lwc1 $f0,32($fp)
nop
cvt.d.s $f0,$f0
mov.d $f12,$f0
lw $2,%call16(sqrt)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,sqrt
1: jalr $25
nop
lw $28,24($fp)
add.d $f2,$f20,$f0
lwc1 $f0,72($fp)
nop
add.s $f0,$f0,$f0
cvt.d.s $f0,$f0
div.d $f0,$f2,$f0
cvt.s.d $f0,$f0
swc1 $f0,36($fp)
lw $3,76($fp)
li $2,-2147483648 # 0xffffffff80000000
xor $2,$3,$2
mtc1 $2,$f0
nop
cvt.d.s $f20,$f0
lwc1 $f0,32($fp)
nop
cvt.d.s $f0,$f0
mov.d $f12,$f0
lw $2,%call16(sqrt)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,sqrt
1: jalr $25
nop
lw $28,24($fp)
sub.d $f2,$f20,$f0
lwc1 $f0,72($fp)
nop
add.s $f0,$f0,$f0
cvt.d.s $f0,$f0
div.d $f0,$f2,$f0
cvt.s.d $f0,$f0
swc1 $f0,40($fp)
lwc1 $f0,36($fp)
nop
cvt.d.s $f2,$f0
lwc1 $f0,40($fp)
nop
cvt.d.s $f0,$f0
swc1 $f0,20($sp)
swc1 $f1,16($sp)
mfc1 $7,$f2
mfc1 $6,$f3
lw $2,%got($LC1)($28)
nop
addiu $4,$2,%lo($LC1)
lw $2,%call16(printf)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,printf
1: jalr $25
nop
lw $28,24($fp)
b $L8
nop
$L7:
lwc1 $f0,32($fp)
mtc1 $0,$f2
nop
c.eq.s $f0,$f2
nop
bc1f $L5
nop
lw $3,76($fp)
li $2,-2147483648 # 0xffffffff80000000
xor $2,$3,$2
mtc1 $2,$f0
nop
cvt.d.s $f20,$f0
lwc1 $f0,32($fp)
nop
cvt.d.s $f0,$f0
mov.d $f12,$f0
lw $2,%call16(sqrt)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,sqrt
1: jalr $25
nop
lw $28,24($fp)
add.d $f2,$f20,$f0
lwc1 $f0,72($fp)
nop
add.s $f0,$f0,$f0
cvt.d.s $f0,$f0
div.d $f0,$f2,$f0
cvt.s.d $f0,$f0
swc1 $f0,36($fp)
lwc1 $f0,36($fp)
nop
cvt.d.s $f0,$f0
mfc1 $7,$f0
mfc1 $6,$f1
lw $2,%got($LC2)($28)
nop
addiu $4,$2,%lo($LC2)
lw $2,%call16(printf)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,printf
1: jalr $25
nop
lw $28,24($fp)
b $L8
nop
$L5:
lw $3,76($fp)
li $2,-2147483648 # 0xffffffff80000000
xor $2,$3,$2
lwc1 $f0,72($fp)
nop
add.s $f0,$f0,$f0
mtc1 $2,$f2
nop
div.s $f0,$f2,$f0
swc1 $f0,44($fp)
lw $3,32($fp)
li $2,-2147483648 # 0xffffffff80000000
xor $2,$3,$2
mtc1 $2,$f0
nop
cvt.d.s $f0,$f0
mov.d $f12,$f0
lw $2,%call16(sqrt)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,sqrt
1: jalr $25
nop
lw $28,24($fp)
mov.d $f2,$f0
lwc1 $f0,72($fp)
nop
add.s $f0,$f0,$f0
cvt.d.s $f0,$f0
div.d $f0,$f2,$f0
cvt.s.d $f0,$f0
swc1 $f0,48($fp)
lwc1 $f0,44($fp)
nop
cvt.d.s $f2,$f0
lwc1 $f0,48($fp)
nop
cvt.d.s $f0,$f0
swc1 $f0,20($sp)
swc1 $f1,16($sp)
mfc1 $7,$f2
mfc1 $6,$f3
lw $2,%got($LC3)($28)
nop
addiu $4,$2,%lo($LC3)
lw $2,%call16(printf)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,printf
1: jalr $25
nop
lw $28,24($fp)
$L8:
nop
move $sp,$fp
lw $31,60($sp)
lw $fp,56($sp)
lwc1 $f20,68($sp)
nop
lwc1 $f21,64($sp)
addiu $sp,$sp,72
j $31
nop
.set macro
.set reorder
.end roots_of
.size roots_of, .-roots_of
.rdata
.align 2
$LC4:
.ascii "Quadratic Solver\000"
.align 2
$LC5:
.ascii "a: \000"
.align 2
$LC6:
.ascii "%f\000"
.align 2
$LC7:
.ascii "b: \000"
.align 2
$LC8:
.ascii "c: \000"
.text
.align 2
.globl main
.set nomips16
.set nomicromips
.ent main
.type main, @function
main:
.frame $fp,48,$31 # vars= 16, regs= 2/0, args= 16, gp= 8
.mask 0xc0000000,-4
.fmask 0x00000000,0
.set noreorder
.cpload $25
.set nomacro
addiu $sp,$sp,-48
sw $31,44($sp)
sw $fp,40($sp)
move $fp,$sp
.cprestore 16
movz $31,$31,$0
lw $2,%got($LC4)($28)
nop
addiu $4,$2,%lo($LC4)
lw $2,%call16(puts)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,puts
1: jalr $25
nop
lw $28,16($fp)
nop
lw $2,%got($LC5)($28)
nop
addiu $4,$2,%lo($LC5)
lw $2,%call16(printf)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,printf
1: jalr $25
nop
lw $28,16($fp)
addiu $2,$fp,24
move $5,$2
lw $2,%got($LC6)($28)
nop
addiu $4,$2,%lo($LC6)
lw $2,%call16(__isoc99_scanf)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,__isoc99_scanf
1: jalr $25
nop
lw $28,16($fp)
nop
lw $2,%got($LC7)($28)
nop
addiu $4,$2,%lo($LC7)
lw $2,%call16(printf)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,printf
1: jalr $25
nop
lw $28,16($fp)
addiu $2,$fp,28
move $5,$2
lw $2,%got($LC6)($28)
nop
addiu $4,$2,%lo($LC6)
lw $2,%call16(__isoc99_scanf)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,__isoc99_scanf
1: jalr $25
nop
lw $28,16($fp)
nop
lw $2,%got($LC8)($28)
nop
addiu $4,$2,%lo($LC8)
lw $2,%call16(printf)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,printf
1: jalr $25
nop
lw $28,16($fp)
addiu $2,$fp,32
move $5,$2
lw $2,%got($LC6)($28)
nop
addiu $4,$2,%lo($LC6)
lw $2,%call16(__isoc99_scanf)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,__isoc99_scanf
1: jalr $25
nop
lw $28,16($fp)
lwc1 $f0,24($fp)
lwc1 $f2,28($fp)
lwc1 $f4,32($fp)
nop
mfc1 $6,$f4
mov.s $f14,$f2
mov.s $f12,$f0
lw $2,%got(roots_of)($28)
nop
move $25,$2
.reloc 1f,R_MIPS_JALR,roots_of
1: jalr $25
nop
lw $28,16($fp)
move $2,$0
move $sp,$fp
lw $31,44($sp)
lw $fp,40($sp)
addiu $sp,$sp,48
j $31
nop
.set macro
.set reorder
.end main
.size main, .-main
.rdata
.align 2
Here are the errors i receive in MIPS:
Error in C:\Users\***\Desktop\School Stuffs\***\Quadratic solver.asm line 5 column 14: .module fp=32
Invalid language element: fp=32
Error in C:\Users\***\Desktop\School Stuffs\***\Quadratic solver.asm line 24 column 22: .type roots_of, @function
Invalid language element: @function
Error in C:\Users\***\Desktop\School Stuffs\***\Quadratic solver.asm line 289 column 18: .type main, @function
Invalid language element: @function
Assemble: operation completed with errors.
Im trying to make a quadratic solver that excepts multiple inputs and uses special phrases but i keep get these errors. I cant find any reason as to why the errors pop up. Any help would be great!