#ifndef INSTR_H_INCLUDED
#define INSTR_H_INCLUDED

#include <map>
#include <vector>
#include <string>
#include "map.h"

#include "parameters.h"


using namespace std;


class instruction;

class instruction{

friend class src_file;

    private :
        instr_type type;
        int code;
        int instr_code; // instruction under the form of int code
        int exn;
        string name;
        int arg[3];
        string s_arg;
        int line;
        int nb_int_arg;
    public :
        instruction(string name_, int cline, table_instr *table);

        void print();
        void verif(table_label *labels,vector<instruction> *vect,vector<instruction>::iterator *it, bool verbose);
   //Debuging     void printc() {print(); cout  << code << "\t:" << arg[0] << "\t:"  << arg[1] << "\t:"  << arg[2] << "\t:" << instr_code << endl<< endl<< endl;};
        void printc() { cout << instr_code << endl;};
        void error(string msg);
        bool execute(int registers[18],vector<instruction>::iterator *it,vector<instruction>::iterator begin, int ram[SIZE_RAM], unsigned short inputs[NB_IO], unsigned short output[NB_IO], bool watch);
};

#endif // INSTR_H_INCLUDED
