This commit is contained in:
2021-12-17 14:15:33 +01:00
parent 109ea267a9
commit 3e28397cfc
3 changed files with 14 additions and 12 deletions

View File

@@ -33,14 +33,15 @@ void execute_instruction(union mars_instruction instruction, int player, struct
}
}
case DJZ:
/* */
case CMP:
/* Compare deux valeurs dans la mémoire */
case DAT:
/* Instruction qui rapporte des données */
default:
break;
}
printf("Position après exécution: %d\n", position[player]);
}
@@ -48,7 +49,7 @@ int main(int argc, char* argv[]){
srand(time(NULL)); /* Initialise le pseudo aléatoire pour tout le programme */
struct adresse memoire[TAILLE_MEM]; // Initialisation de la mémoire 0->7999
int position[2] = {0,0}; /* Position des joueurs */
int position[2] = {0,10}; /* Position des joueurs */
if (argc < 3){
printf("Vous n'avez pas rentrez assez d'arguments \n");
@@ -80,13 +81,12 @@ int main(int argc, char* argv[]){
fclose(fichier2);
union mars_instruction to_do;
to_do.instruct.codeOp = 1;
to_do.instruct.ArgA = 7909;
to_do.instruct.codeOp = 0;
to_do.instruct.ArgA = 753;
to_do.instruct.ArgB = 100;
to_do.instruct.modeAddrA = 1;
to_do.instruct.modeAddrB = 2;
printf("Valeur instruction: %lld\n", to_do.instructLL);
execute_instruction(to_do, 1, memoire, position);
return EXIT_SUCCESS;
}