diff options
Diffstat (limited to 'src/arch/operand.h')
-rw-r--r-- | src/arch/operand.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/arch/operand.h b/src/arch/operand.h index 81c9a53..1b5b33f 100644 --- a/src/arch/operand.h +++ b/src/arch/operand.h @@ -27,17 +27,46 @@ #include <stdbool.h> #include <stdint.h> +#include <sys/types.h> +/* Taille des données intégrées */ +typedef enum _AsmOperandSize +{ + AOS_8_BITS, /* Opérande sur 8 bits */ + AOS_16_BITS, /* Opérande sur 16 bits */ + AOS_32_BITS, /* Opérande sur 32 bits */ + AOS_64_BITS /* Opérande sur 64 bits */ + +} AsmOperandSize; + + /* Définition générique d'une opérande */ typedef struct _asm_operand asm_operand; +/* Différentes formes de représentation humaine */ +typedef enum _AsmSyntax +{ + ASX_INTEL, /* Syntaxe Intel */ + ASX_ATT /* Syntaxte AT&T */ + +} AsmSyntax; + + /* Crée une opérande pour l'instruction 'db'. */ bool fill_db_operand(asm_operand *, uint8_t); +/* Traduit une opérande de type 'db' en texte. */ +void print_db_operand(const asm_operand *, char *, size_t, AsmSyntax); + +/* Crée une opérande contenant une valeur sur x bits. */ +bool fill_imm_operand(asm_operand *, AsmOperandSize, const uint8_t *, off_t *, off_t); + +/* Traduit une opérande de valeur immédiate en texte. */ +void print_imm_operand(const asm_operand *, char *, size_t, AsmSyntax); |