From 0fa10f44a95ba4e12958abcb15430d7c5ebf3cf1 Mon Sep 17 00:00:00 2001 From: gallois Date: Thu, 29 Apr 2021 11:31:50 +0200 Subject: [PATCH] interpreteur.l et instructions.h --- Interpreteur/src/instructions.h | 4 ++++ Interpreteur/src/interpreter.l | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Interpreteur/src/instructions.h b/Interpreteur/src/instructions.h index 88be5d2..ed45fe3 100644 --- a/Interpreteur/src/instructions.h +++ b/Interpreteur/src/instructions.h @@ -16,6 +16,9 @@ #define AFCA 13 #define WR 14 #define READ 15 +#define RET 16 +#define CALL 17 +#define COPR 18 #define MAX_INSTRUCTIONS_SIZE 256 #define MAX_MEMORY_SIZE 256 @@ -24,6 +27,7 @@ void asm_init(); void asm_add_3(char ins, int arg1, int arg2, int arg3); void asm_add_2(char ins, int arg1, int arg2); void asm_add_1(char ins, int arg1); +void asm_add_0(char ins); void asm_run(); #endif // #ifndef __INSTRUCTIONS_H__ diff --git a/Interpreteur/src/interpreter.l b/Interpreteur/src/interpreter.l index 2829679..0800272 100755 --- a/Interpreteur/src/interpreter.l +++ b/Interpreteur/src/interpreter.l @@ -21,6 +21,9 @@ PRI {return tPRI;} AFCA {return tAFCA;} WR {return tWR;} READ {return tREAD;} +RET {return tRET;} +CALL {return tCALL;} +COPR {return tCOPR;} -?[0-9]+ { yylval.nb = atoi(yytext);