EVAL FINAL ESAYYYYYYY
This commit is contained in:
@@ -510,7 +510,7 @@ void parcours_opExp(n_exp *n)
|
||||
sprintf(tmp, "$t%d", iRegistre3);
|
||||
depile(tmp);
|
||||
|
||||
sprintf(tmp,"or $t%d, $t%d, $t%d",iRegistre, iRegistre2, iRegistre3);
|
||||
sprintf(tmp,"or $t%d, $zero, $t%d",iRegistre, iRegistre3);
|
||||
printMips(tmp);
|
||||
|
||||
sprintf(tmp,"j %s",empile);
|
||||
@@ -523,31 +523,36 @@ void parcours_opExp(n_exp *n)
|
||||
sprintf(tmp,"%s : ", empile);
|
||||
printMips(tmp);
|
||||
} else if(n->u.opExp_.op == et) {
|
||||
char empile[256];
|
||||
char fin[256];
|
||||
char faux[256];
|
||||
new_tag(empile);
|
||||
new_tag(fin);
|
||||
new_tag(faux);
|
||||
|
||||
parcours_exp(n->u.opExp_.op1);
|
||||
sprintf(tmp, "$t%d", iRegistre2);
|
||||
depile(tmp);
|
||||
//sprintf(tmp,"li $t%d, 1",iRegistre);
|
||||
//printMips(tmp);
|
||||
|
||||
sprintf(tmp,"beq $zero, $t%d, %s",iRegistre2,faux);
|
||||
printMips(tmp);
|
||||
|
||||
|
||||
sprintf(tmp, "$t%d", iRegistre2);
|
||||
empile(tmp);
|
||||
|
||||
parcours_exp(n->u.opExp_.op2);
|
||||
sprintf(tmp, "$t%d", iRegistre3);
|
||||
depile(tmp);
|
||||
sprintf(tmp,"beq $zero, $t%d, %s",iRegistre3,faux);
|
||||
|
||||
sprintf(tmp, "$t%d", iRegistre2);
|
||||
depile(tmp);
|
||||
|
||||
sprintf(tmp,"beq $zero, $t%d, %s", iRegistre3, faux);
|
||||
printMips(tmp);
|
||||
|
||||
|
||||
//--
|
||||
sprintf(tmp,"and $t%d, $t%d, $t%d",iRegistre, iRegistre2, iRegistre3);
|
||||
printMips(tmp);
|
||||
//--
|
||||
|
||||
sprintf(tmp,"j %s", empile);
|
||||
sprintf(tmp,"j %s", fin);
|
||||
printMips(tmp);
|
||||
|
||||
sprintf(tmp," %s :",faux);
|
||||
@@ -555,23 +560,46 @@ void parcours_opExp(n_exp *n)
|
||||
sprintf(tmp,"li $t%d 0",iRegistre);
|
||||
printMips(tmp);
|
||||
|
||||
sprintf(tmp ," %s :",empile);
|
||||
sprintf(tmp ," %s :",fin);
|
||||
|
||||
printMips(tmp);
|
||||
|
||||
} else if(n->u.opExp_.op == non) {
|
||||
parcours_exp(n->u.opExp_.op1);
|
||||
char fin[256];
|
||||
new_tag(fin);
|
||||
|
||||
sprintf(tmp, "$t%d", iRegistre3);
|
||||
depile(tmp);
|
||||
sprintf(tmp,"li $t%d 1",iRegistre);
|
||||
|
||||
sprintf(tmp,"not $t%d $t%d",iRegistre,iRegistre3);
|
||||
printMips(tmp);
|
||||
sprintf(tmp,"beq $t%d, $zero %s",iRegistre3,fin);
|
||||
} else if(n->u.opExp_.op == cond) {
|
||||
char tmp[256];
|
||||
char faux[256];
|
||||
char empile[256];
|
||||
new_tag(faux);
|
||||
new_tag(empile);
|
||||
|
||||
parcours_exp(n->u.opExp_.op1);
|
||||
|
||||
sprintf(tmp, "$t%d", iRegistre2);
|
||||
depile(tmp);
|
||||
sprintf(tmp,"beq $t%d, $zero %s",iRegistre2, faux);
|
||||
printMips(tmp);
|
||||
sprintf(tmp,"li $t%d 0",iRegistre);
|
||||
|
||||
parcours_exp(n->u.opExp_.op2);
|
||||
|
||||
sprintf(tmp, "$t%d", iRegistre);
|
||||
depile(tmp);
|
||||
sprintf(tmp,"j %s", empile);
|
||||
printMips(tmp);
|
||||
sprintf(tmp, "%s :",fin);
|
||||
|
||||
sprintf(tmp, "%s :", faux);
|
||||
printMips(tmp);
|
||||
parcours_exp(n->u.opExp_.op3);
|
||||
sprintf(tmp, "$t%d", iRegistre);
|
||||
depile(tmp);
|
||||
|
||||
sprintf(tmp, "%s :", empile);
|
||||
printMips(tmp);
|
||||
}
|
||||
sprintf(tmp, "$t%d", iRegistre);
|
||||
|
||||
Reference in New Issue
Block a user