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.

tab_instruc.h 646B

12345678910111213141516171819202122232425262728
  1. #ifndef TAB_INST_H
  2. #define TAB_INST_H
  3. #define MAXTAILLE 1024
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include <stdio.h>
  7. enum opcode_t {ADD,MUL,SOU,DIV,COP,AFC,AFCA,COPA,JMP,JMF,INF,SUP,EQU,PRI,READ,WR,CALL,RET,COPR};
  8. struct operation_t {
  9. enum opcode_t opcode;
  10. int arg1;
  11. int arg2;
  12. int arg3;
  13. };
  14. //Ajoute une opération dans la table (à la fin)
  15. void add_operation(enum opcode_t opcode, int arg1, int arg2, int arg3);
  16. //Renvoi le prochain slot disponible
  17. int get_current_index();
  18. //Permet de patcher les Jump (pas de Van Halen)
  19. void patch(int index, int arg);
  20. //Ecrit la table des intructions dans un fichier ASM
  21. void create_asm();
  22. #endif