diff --git a/1/FH/assignments/Actividad_MipsEnsemblador/codigo.asm b/1/FH/assignments/Actividad_MipsEnsemblador/codigo.asm new file mode 100644 index 0000000..baa15ea --- /dev/null +++ b/1/FH/assignments/Actividad_MipsEnsemblador/codigo.asm @@ -0,0 +1,21 @@ +.data +theArray: + .space 160 + +.text +main: + li $t6, 1 # Sets t6 to 1 + li $t7, 4 # Sets t7 to 4 + sw $t6, theArray($0) # Sets the first term to 1 + sw $t6, theArray($t7) # Sets the second term to 1 + li $t0, 8 # Sets t0 to 8 +loop: + addi $t3, $t0, -8 + addi $t4, $t0, -4 + lw $t1, theArray($t3) # Gets the last + lw $t2, theArray($t4) # two elements + mul $t5, $t1, $t2 # Adds them together... + sw $t5, theArray($t0) # ...and stores the result + addi $t0, $t0, 4 # Moves to next "element" of theArray + blt $t0, 160, loop # If not past the end of theArray, repeat + jr $ra \ No newline at end of file diff --git a/1/FH/assignments/t1-ej13.txt b/1/FH/assignments/t1-ej13.txt new file mode 100644 index 0000000..d9ad7c0 --- /dev/null +++ b/1/FH/assignments/t1-ej13.txt @@ -0,0 +1,51 @@ +1) +Operaciones: +c = a{9} + b{2} = 11 +d = c{11} - a{9} = 2 +a = a{9} / 3 = 3 +b = b{2} * b{2} = 4 + +Resultados: +a = 3 +b = 4 +c = 11 +d = 2 + +2) +Operaciones: +d = 0 +b = b{45} * d{0} = 0 +a = a{16} / 4 = 4 +d = c{24} / a{15} = 2 + +Resultados: +a = 4 +b = 0 +c = 24 +d = 2 + +3) +d = c{0} * a{26} = 0 +si d{0} = 0 + goto ins4 +d = b{45} * a{26} # saltada +ins4: d = c{0} * b{45} = 0 + +a = 26 +b = 45 +c = 0 +d = 0 + +4) +si a > 4 + goto ins5 + +a = a + 1 +b = b + a +goto ins1 +ins5: b = b * b + +a = 5 +b = 256 +c = 9546351681 +d = 123487890