Matriz Inversa em Assembly
Por: biiatoth • 10/11/2016 • Trabalho acadêmico • 768 Palavras (4 Páginas) • 543 Visualizações
.data
var:
Line1: .float 2.0, 3.0, 5.0
Line2: .float 1.0, 1.0, 5.0
Line3: .float 0.0, 6.0, 4.0
.text
main:
la $s0, Line1
la $s1, Line2
la $s2, Line3
lwc1 $f1, 0($s0)
lwc1 $f2, 4($s1)
lwc1 $f3, 8($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4,36($s2)
lwc1 $f10,36($s2)
lwc1 $f1, 4($s0)
lwc1 $f2, 8($s1)
lwc1 $f3, 0($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4,40($s2)
lwc1 $f11,40($s2)
lwc1 $f1, 8($s0)
lwc1 $f2, 0($s1)
lwc1 $f3, 4($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4, 44($s2)
lwc1 $f5, 44($s2)
lwc1 $f1, 8($s0)
lwc1 $f2, 4($s1)
lwc1 $f3, 0($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4,48($s2)
lwc1 $f6,48($s2)
lwc1 $f1, 0($s0)
lwc1 $f2, 8($s1)
lwc1 $f3, 4($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4,52($s2)
lwc1 $f7,52($s2)
lwc1 $f1, 4($s0)
.data
var:
Line1: .float 3.0, 4.0, 1.0
Line2: .float 9.0, 0.0, 7.0
Line3: .float 2.0, 1.0, 6.0
enter:
.asciiz "\n"
.text
main:
la $s0, Line1
la $s1, Line2
la $s2, Line3
lwc1 $f1, 0($s0)
lwc1 $f2, 4($s1)
lwc1 $f3, 8($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4,36($s2)
lwc1 $f0,36($s2)
lwc1 $f1, 4($s0)
lwc1 $f2, 8($s1)
lwc1 $f3, 0($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4,40($s2)
lwc1 $f5,40($s2)
lwc1 $f1, 8($s0)
lwc1 $f2, 0($s1)
lwc1 $f3, 4($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4,44($s2)
lwc1 $f6,44($s2)
lwc1 $f1, 8($s0)
lwc1 $f2, 4($s1)
lwc1 $f3, 0($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4,48($s2)
lwc1 $f7,48($s2)
lwc1 $f1, 0($s0)
lwc1 $f2, 8($s1)
lwc1 $f3, 4($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4,52($s2)
lwc1 $f8,52($s2)
lwc1 $f1, 4($s0)
lwc1 $f2, 0($s1)
lwc1 $f3, 8($s2)
mul.s $f4, $f1, $f2
mul.s $f4, $f4, $f3
swc1 $f4,56($s2)
lwc1 $f9,56($s2)
add.s $f10,$f0,$f5
add.s $f10,$f10,$f6
add.s $f11,$f7,$f8
add.s $f11,$f11,$f9
sub.s $f11,$f10,$f11
swc1 $f11, 80($s2)
lwc1 $f12, 80($s2)
li $v0,2
syscall
li $v0, 4
la $a0, enter
syscall
capi:
#(0) 2.0, 5.0, 1.0
#(4)
...