diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2008-11-16 23:16:47 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2008-11-16 23:16:47 (GMT) |
commit | 3d6e959ad3e56681ba39bd8f0a003b8a1aff132c (patch) | |
tree | 9a8c7608f60d05c8b968f443567fc77825fff8ff /src/arch/operand.h | |
parent | 12b4201890b4b2eefffaa6615b4b3076253dff6f (diff) |
Took care of signed immediate values as well as unsigned ones.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@42 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/operand.h')
-rw-r--r-- | src/arch/operand.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/arch/operand.h b/src/arch/operand.h index 0a00d9f..fab1344 100644 --- a/src/arch/operand.h +++ b/src/arch/operand.h @@ -36,14 +36,25 @@ typedef enum _AsmOperandSize { AOS_UNDEFINED, /* Taille non définie */ - 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 */ + AOS_8_BITS_UNSIGNED, /* Opérande sur 8 bits n.-s. */ + AOS_16_BITS_UNSIGNED, /* Opérande sur 16 bits n.-s. */ + AOS_32_BITS_UNSIGNED, /* Opérande sur 32 bits n.-s. */ + AOS_64_BITS_UNSIGNED, /* Opérande sur 64 bits n.-s. */ + + AOS_8_BITS_SIGNED, /* Opérande sur 8 bits signés */ + AOS_16_BITS_SIGNED, /* Opérande sur 16 bits signés */ + AOS_32_BITS_SIGNED, /* Opérande sur 32 bits signés */ + AOS_64_BITS_SIGNED /* Opérande sur 64 bits signés */ } AsmOperandSize; +#define AOS_8_BITS AOS_8_BITS_UNSIGNED +#define AOS_16_BITS AOS_16_BITS_UNSIGNED +#define AOS_32_BITS AOS_32_BITS_UNSIGNED +#define AOS_64_BITS AOS_64_BITS_UNSIGNED + + /* Définition générique d'une opérande */ typedef struct _asm_operand asm_operand; @@ -67,6 +78,9 @@ void print_db_operand(const asm_operand *, char *, size_t, AsmSyntax); /* Lit une valeur (signée ou non) sur x bits. */ bool read_imm_value(AsmOperandSize, const uint8_t *, off_t *, off_t, ...); +/* Indique le signe d'une valeur immédiate. */ +bool is_imm_operand_negative(const asm_operand *); + /* 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); |