No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gen_assembleur.h 1019B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef GEN_ASSEMBLEUR_H
  2. #define GEN_ASSEMBLEUR_H
  3. #define INSTRUCTION_TABLE_SIZE 1000
  4. #include "table_symboles.h"
  5. enum operation{ADD, SOU, MUL, DIV, CPY, AFC, RET, JMPF};
  6. typedef struct instruction{
  7. enum operation operation;
  8. int reg1;
  9. int reg2;
  10. int reg3;
  11. }instruction;
  12. //table des instructions
  13. typedef struct instructions_array{
  14. instruction array[INSTRUCTION_TABLE_SIZE];
  15. int index;
  16. } instructions_array;
  17. void gen_arithmetique(instructions_array * array, enum operation op, int arg1, int arg2);
  18. int gen_var(Table_Symboles * table, instructions_array * array, char * varName);
  19. int gen_entier(Table_Symboles * table, instructions_array * array, int entier);
  20. int gen_return(Table_Symboles * table, instructions_array * array, int adr);
  21. int gen_jmpf(Table_Symboles * table, instructions_array * array, int cond);
  22. void update_jump(instructions_array * array, int if_value, int adr_jmp);
  23. //renvoie l'index (ou valeur?) de la premiere @ dispo
  24. int new_temp(Table_Symboles * table);
  25. #endif