summaryrefslogtreecommitdiff
path: root/src/arch/operand.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2008-07-27 19:38:15 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2008-07-27 19:38:15 (GMT)
commit1bf9c5ebe8bb3326e10491974cd43b221e2a56a1 (patch)
tree01a745a798661478eb7a6e02c0a0831bb1b4950c /src/arch/operand.h
parentdbf4d1f93e54251568854bff0ebc9c84f60857f6 (diff)
Supported new x86 opcodes (nop and mov).
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@7 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/operand.h')
-rw-r--r--src/arch/operand.h29
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);