From 0cbcc44c13cd488636cbc3b1176e22d50985925e Mon Sep 17 00:00:00 2001 From: Leonardo Chieppe Date: Sat, 25 Apr 2020 15:21:50 -0300 Subject: [PATCH] multiplicacao e divisao falta tratar os inputs na multiplicacao e trocar a divisao de inteiro para float --- main.asm | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/main.asm b/main.asm index 1cae359..9b877fe 100644 --- a/main.asm +++ b/main.asm @@ -117,7 +117,7 @@ exec_soma: j print_result -soma: +soma: #soma dois valores add $v0, $a0, $a1 jr $ra @@ -127,12 +127,34 @@ exec_subtr: j print_result -subtr: +subtr: #subtrai 2 valores sub $v0, $a0, $a1 jr $ra -#TODO - outras opções +exec_multi: + jal multi + + j print_result + +multi: #multiplica 2 valores de 16bits + mult $a0, $a1 + mflo $v0 + + jr $ra + + +exec_divi: + jal divi + + j print_result + +divi: #divide 2 valores de 16bits + div $a0, $a1 + mflo $v0 + + jr $ra + print_result: #impressão do resultado de uma função