summaryrefslogtreecommitdiff
path: root/src/arch/x86/operand.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/operand.c')
-rw-r--r--src/arch/x86/operand.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/arch/x86/operand.c b/src/arch/x86/operand.c
index 84d4038..4b8eef8 100644
--- a/src/arch/x86/operand.c
+++ b/src/arch/x86/operand.c
@@ -130,6 +130,7 @@ asm_x86_operand *create_new_x86_operand(void)
* *
* Paramètres : data = donnée à analyser. *
* is_reg32 = indique si le registre est un registre 32 bits. *
+* base = valeur du premier registre. *
* *
* Description : Crée une opérande renvoyant vers un registre 16 ou 32 bits. *
* *
@@ -139,17 +140,17 @@ asm_x86_operand *create_new_x86_operand(void)
* *
******************************************************************************/
-asm_x86_operand *x86_create_reg1632_operand(uint8_t data, bool is_reg32)
+asm_x86_operand *x86_create_reg1632_operand(uint8_t data, bool is_reg32, uint8_t base)
{
asm_x86_operand *result; /* Registre à retourner */
X8616bRegister reg16; /* Registre 16 bits */
X8632bRegister reg32; /* Registre 32 bits */
if (is_reg32)
- switch (data - 0xb8)
+ switch (data - base)
{
case 0 ... 7:
- reg32 = (X8632bRegister)(data - 0xb8);
+ reg32 = (X8632bRegister)(data - base);
break;
default:
return NULL;
@@ -157,10 +158,10 @@ asm_x86_operand *x86_create_reg1632_operand(uint8_t data, bool is_reg32)
}
else
- switch (data - 0xb0)
+ switch (data - base)
{
case 0 ... 7:
- reg16 = (X8616bRegister)(data - 0xb0);
+ reg16 = (X8616bRegister)(data - base);
break;
default:
return NULL;