summaryrefslogtreecommitdiff
path: root/src/arch/immediate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/immediate.c')
-rw-r--r--src/arch/immediate.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/arch/immediate.c b/src/arch/immediate.c
index f8c2474..3bc4712 100644
--- a/src/arch/immediate.c
+++ b/src/arch/immediate.c
@@ -466,3 +466,46 @@ static char *g_imm_operand_get_text(const GImmOperand *operand, const exe_format
return result;
}
+
+
+/******************************************************************************
+* *
+* Paramètres : operand = opérande à traiter. *
+* addr = valeur résultante. [OUT] *
+* *
+* Description : Convertit une valeur immédiate en adresse de type vmpa_t. *
+* *
+* Retour : Bilan de l'opération. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+bool g_imm_operand_to_vmpa_t(const GImmOperand *operand, vmpa_t *addr)
+{
+ bool result; /* Bilan à renvoyer */
+
+ result = true;
+
+ switch (operand->size)
+ {
+ case AOS_8_BITS_UNSIGNED:
+ *addr = operand->unsigned_imm.val8;
+ break;
+ case AOS_16_BITS_UNSIGNED:
+ *addr = operand->unsigned_imm.val16;
+ break;
+ case AOS_32_BITS_UNSIGNED:
+ *addr = operand->unsigned_imm.val32;
+ break;
+ case AOS_64_BITS_UNSIGNED:
+ *addr = operand->unsigned_imm.val64;
+ break;
+ default:
+ result = false;
+ break;
+ }
+
+ return result;
+
+}