2023-04-14 16:55:57 +02:00
|
|
|
#ifndef _INSTRUCTION_TABLE_H_
|
|
|
|
#define _INSTRUCTION_TABLE_H_
|
|
|
|
|
|
|
|
#include "../header/shash/shash.h"
|
|
|
|
#include <sys/types.h>
|
2023-09-30 14:10:43 +02:00
|
|
|
#include <stdint.h>
|
2023-04-14 16:55:57 +02:00
|
|
|
|
2023-04-15 23:16:35 +02:00
|
|
|
#define MAX_INSTRUCTION_COUNT 16
|
|
|
|
|
|
|
|
// Create a hashtable that contains informations about the instructions.
|
2023-04-14 16:55:57 +02:00
|
|
|
shash_hashtable_t create_instruction_information_hastable(void);
|
|
|
|
|
2023-04-15 23:16:35 +02:00
|
|
|
// Destroy the information table
|
2023-04-15 23:19:17 +02:00
|
|
|
void destroy_instruction_information_hashtable(shash_hashtable_t *instruction_information_table);
|
2023-04-15 23:16:35 +02:00
|
|
|
|
2023-04-14 16:55:57 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
unsigned int requires_adress;
|
|
|
|
unsigned int supports_adress_label;
|
2023-09-30 14:10:43 +02:00
|
|
|
uint8_t opcode;
|
2023-04-14 16:55:57 +02:00
|
|
|
} instruction_information_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char *name;
|
2023-04-15 23:16:35 +02:00
|
|
|
unsigned int name_length;
|
2023-04-14 16:55:57 +02:00
|
|
|
unsigned int requires_adress;
|
|
|
|
unsigned int supports_adress_label;
|
2023-09-30 14:10:43 +02:00
|
|
|
uint8_t opcode;
|
2023-04-14 16:55:57 +02:00
|
|
|
} instruction_information_config_t;
|
|
|
|
|
|
|
|
#endif
|