12345678910111213141516171819202122232425262728293031323334353637383940 |
- #ifndef GEN_ASSEMBLEUR_H
- #define GEN_ASSEMBLEUR_H
-
- #define INSTRUCTION_TABLE_SIZE 1000
-
- #include "table_symboles.h"
-
- enum operation{ADD, SOU, MUL, DIV, CPY, AFC, RET, JMPF};
-
- typedef struct instruction{
- enum operation operation;
- int reg1;
- int reg2;
- int reg3;
- }instruction;
-
- //table des instructions
- typedef struct instructions_array{
- instruction array[INSTRUCTION_TABLE_SIZE];
- int index;
- } instructions_array;
-
-
-
- void gen_arithmetique(instructions_array * array, enum operation op, int arg1, int arg2);
-
- int gen_var(Table_Symboles * table, instructions_array * array, char * varName);
-
- int gen_entier(Table_Symboles * table, instructions_array * array, int entier);
-
- int gen_return(Table_Symboles * table, instructions_array * array, int adr);
-
- int gen_jmpf(Table_Symboles * table, instructions_array * array, int cond);
-
- void update_jump(instructions_array * array, int if_value, int adr_jmp);
-
- //renvoie l'index (ou valeur?) de la premiere @ dispo
- int new_temp(Table_Symboles * table);
-
- #endif
|