From cf119a9a257d0885c86920f0cd6945cbbf4134fa Mon Sep 17 00:00:00 2001 From: pfaure Date: Thu, 24 Jun 2021 09:43:08 +0200 Subject: [PATCH] Fix bug STOREA --- Lex_Yacc/as.y | 2 +- Tables/tables.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lex_Yacc/as.y b/Lex_Yacc/as.y index 9a890d6..6935364 100644 --- a/Lex_Yacc/as.y +++ b/Lex_Yacc/as.y @@ -48,7 +48,7 @@ Instruction : tLOADI tNB tNB {add_instruction(LOADI, $2, $3, 0);}; // STOREI R R Instruction : tSTOREI tNB tNB {add_instruction(STOREI, $2, $3, 0);}; // STOREA @ R -Instruction : tSTOREA tNB tNB {add_instruction(STORE, $2, $3, 0);}; +Instruction : tSTOREA tNB tNB {add_instruction(STOREA, $2, $3, 0);}; // JMP Ins Instruction : tJMP tNB {add_instruction(JMP, $2, 0, 0);}; diff --git a/Tables/tables.c b/Tables/tables.c index 0d040ae..78a0ae8 100644 --- a/Tables/tables.c +++ b/Tables/tables.c @@ -68,6 +68,8 @@ int Z = 0; int check_adresse(int adresse) { if (adresse >= TAILLE_MEMOIRE || adresse < 0) { printf("\033[31;01m ERROR : \033[00m Segmentation fault de %d avec eip = %d et ebp = %d\n", adresse, eip, ebp); + print(); + print_reg(); exit(2); } return adresse; @@ -238,8 +240,6 @@ void execute() { } else if (programme[eip].instruction == STOP) { if (programme[eip].param1 == 0) { continuer = 0; - print(); - print_reg(); } } eip = (eip + 1) % TAILLE_BUFFER_INSTRUCTIONS;