language

some fools attempt at an interpreted language
Log | Files | Refs | README

is.h (1213B)


      1 /*
      2  `is` holds the instruction set specification.
      3 
      4  Anything having to do with getting information about a given instruction will
      5  be handled by this file.
      6 */
      7 
      8 #ifndef IS_H
      9 #define IS_H
     10 
     11 #include "ins_mdata.h"
     12 #include "fh.h"
     13 #include "bc.h"
     14 
     15 // This array is populated by inc/ins_mdata.h
     16 byte_t INS_MDATA[0x100];
     17 
     18 // This array is populated by inc/ins_adata.h
     19 byte_t INS_ADATA[0x100];
     20 
     21 /* Takes an opcode, fills metadata about that opcode (given that it exists) in
     22  * the `bc_cont` structure
     23  *  byte_t   - opcode
     24  *  bc_cont* - Bytecode instruction
     25  */
     26 void get_opcode_mdata(byte_t, bc_cont*);
     27 
     28 /* Fills in metadata in @param byte_t.
     29  * byte_t - un-expanded metadata
     30  * int*   - is number of params          [0]
     31  * int*   - int[3] detailing param types [1]
     32  *
     33  * For example, given a byte 11011011, it would break down into the following:
     34  * @param[1] = 3,
     35  * @param[2] = { 01, 10, 11 }
     36  */
     37 void unencode(byte_t, int*, int*);
     38 
     39 /* Sets up INS_MDATA datastructure to quickly queue for data.
     40  *  Instruction arguement type metadata
     41  */
     42 void init_mdata(void);
     43 
     44 /* Sets up INS_ADATA datastructure to quickly queue for data.
     45  *  Instruction arguement abstract-type metadata
     46  */
     47 void init_adata(void);
     48 
     49 #endif // IS_H