} else if (cpid == 0) {
close(pipefd[0]);
dup2(pipefd[1], STDOUT_FILENO);
- printf("[%d] Hey Jude\n", getpid());
- //execl("/bin/ls", "ls", (char*)NULL);
+ execl("/bin/ls", "ls", (char*)NULL);
close(pipefd[1]);
exit(EXIT_SUCCESS);
} else {
.data
-msg_addition: .asciiz "Valeur attendue 97, obtenue"
-msg_soustraction: .asciiz "Valeur attendue 63, obtenue"
-msg_multiplication: .asciiz "Valeur attendue 6111, obtenue"
-msg_division: .asciiz "Valeur attendue , obtenue"
+msg_addition: .asciiz "Valeur attendue 97, obtenue "
+msg_soustraction: .asciiz "Valeur attendue 63, obtenue "
+msg_multiplication: .asciiz "Valeur attendue 6111, obtenue "
+msg_division_quotient: .asciiz "Valeur quotient attendue 1, obtenue "
+msg_division_reste: .asciiz "Valeur reste attendue 29, obtenue "
+saut_de_ligne: .asciiz "\n"
.text
la $t1,34
la $t2,63
la $a0,msg_addition
li $v0,4
syscall
+add $a0,$t3,$zero
+li $v0,1
+syscall
+la $a0,saut_de_ligne
+li $v0,4
+syscall
sub $t4,$t3,$t1
+la $a0,msg_soustraction
+li $v0,4
+syscall
+add $a0,$t4,$zero
+li $v0,1
+syscall
+la $a0,saut_de_ligne
+li $v0,4
+syscall
mult $t3,$t4
mflo $t5
+la $a0,msg_multiplication
+li $v0,4
+syscall
+add $a0,$t5,$zero
+li $v0,1
+syscall
+la $a0,saut_de_ligne
+li $v0,4
+syscall
div $t2,$t1
mflo $t6
mfhi $t7
-
-
-
-
+la $a0,msg_division_quotient
+li $v0,4
+syscall
+add $a0,$t6,$zero
+li $v0,1
+syscall
+la $a0,saut_de_ligne
+li $v0,4
+syscall
+la $a0,msg_division_reste
+li $v0,4
+syscall
+add $a0,$t7,$zero
+li $v0,1
+syscall
la $v0,10
-syscall
\ No newline at end of file
+syscall