summaryrefslogtreecommitdiff
path: root/src/arch/arm/instruction.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-10-06 20:52:21 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-10-06 20:52:21 (GMT)
commit1d5f7f28f92251dc4d3bff8d87b3e3052ab9cab2 (patch)
tree1ad4346a8cbcd8379850f68d04cb8757371c05e1 /src/arch/arm/instruction.c
parentada6b756efd6ca109f6c46aa4d3eb11c17ad6b84 (diff)
Got prepared to disassemble some ARMv7 instructions.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@409 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/arm/instruction.c')
-rw-r--r--src/arch/arm/instruction.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/arch/arm/instruction.c b/src/arch/arm/instruction.c
index 5ea3926..c315bae 100644
--- a/src/arch/arm/instruction.c
+++ b/src/arch/arm/instruction.c
@@ -40,6 +40,9 @@ static void g_arm_instruction_dispose(GArmInstruction *);
/* Procède à la libération totale de la mémoire. */
static void g_arm_instruction_finalize(GArmInstruction *);
+/* Fournit le nom humain de l'instruction manipulée. */
+static const char *g_arm_instruction_get_keyword(const GArmInstruction *, AsmSyntax);
+
/* Indique le type défini pour une représentation d'une instruction ARM. */
@@ -61,12 +64,16 @@ G_DEFINE_TYPE(GArmInstruction, g_arm_instruction, G_TYPE_ARM_INSTRUCTION);
static void g_arm_instruction_class_init(GArmInstructionClass *klass)
{
GObjectClass *object_class; /* Autre version de la classe */
+ GArchInstructionClass *instr; /* Encore une autre vision... */
object_class = G_OBJECT_CLASS(klass);
+ instr = G_ARCH_INSTRUCTION_CLASS(klass);
object_class->dispose = (GObjectFinalizeFunc/* ! */)g_arm_instruction_dispose;
object_class->finalize = (GObjectFinalizeFunc)g_arm_instruction_finalize;
+ instr->get_key = (get_instruction_keyword_fc)g_arm_instruction_get_keyword;
+
}
@@ -128,6 +135,26 @@ static void g_arm_instruction_finalize(GArmInstruction *instr)
/******************************************************************************
* *
+* Paramètres : instr = instruction à traiter. *
+* syntax = type de représentation demandée. *
+* *
+* Description : Fournit le nom humain de l'instruction manipulée. *
+* *
+* Retour : Mot clef de bas niveau. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static const char *g_arm_instruction_get_keyword(const GArmInstruction *instr, AsmSyntax syntax)
+{
+ return instr->keyword;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : instr = instruction ARM à mettre à jour. *
* cond = condition d'exécution de l'instruction. *
* *
@@ -139,7 +166,7 @@ static void g_arm_instruction_finalize(GArmInstruction *instr)
* *
******************************************************************************/
-void g_armv7_instruction_set_cond(GArmInstruction *instr, ArmCondCode cond)
+void g_arm_instruction_set_cond(GArmInstruction *instr, ArmCondCode cond)
{
instr->cond = cond;
@@ -158,7 +185,7 @@ void g_armv7_instruction_set_cond(GArmInstruction *instr, ArmCondCode cond)
* *
******************************************************************************/
-ArmCondCode g_armv7_instruction_get_cond(const GArmInstruction *instr)
+ArmCondCode g_arm_instruction_get_cond(const GArmInstruction *instr)
{
return instr->cond;