summaryrefslogtreecommitdiff
path: root/src/arch/raw.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-10-29 11:37:13 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-10-29 11:37:13 (GMT)
commit38e455ebbbbf90ddbf552f95a1dfb3c544907587 (patch)
treec6e2a4763baef01c87dd0954116fb2c457e10c23 /src/arch/raw.c
parent8c71b36d401b2473342daddcb9b7eb4b83ba3295 (diff)
Reduced once again the size of the main instruction structure.
Diffstat (limited to 'src/arch/raw.c')
-rw-r--r--src/arch/raw.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/arch/raw.c b/src/arch/raw.c
index 356f809..25e1fb5 100644
--- a/src/arch/raw.c
+++ b/src/arch/raw.c
@@ -74,12 +74,12 @@ static void g_raw_instruction_finalize(GRawInstruction *);
/* Indique l'encodage d'une instruction de façon détaillée. */
static const char *g_raw_instruction_get_encoding(const GRawInstruction *);
+/* Fournit le nom humain de l'instruction manipulée. */
+static const char *g_raw_instruction_get_keyword(const GRawInstruction *, AsmSyntax);
+
/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
static GBufferLine *g_raw_instruction_print(GRawInstruction *, GCodeBuffer *, MemoryDataSize, const GBinContent *, AsmSyntax);
-/* Reconstruit le cache complet d'une désignation d'instruction. */
-static void g_raw_instruction_build_keyword(const GRawInstruction *, AsmSyntax);
-
/* ---------------------------------------------------------------------------------- */
@@ -116,8 +116,8 @@ static void g_raw_instruction_class_init(GRawInstructionClass *klass)
instr = G_ARCH_INSTRUCTION_CLASS(klass);
instr->get_encoding = (get_instruction_encoding_fc)g_raw_instruction_get_encoding;
+ instr->get_keyword = (get_instruction_keyword_fc)g_raw_instruction_get_keyword;
instr->print = (print_instruction_fc)g_raw_instruction_print;
- instr->build_key = (build_instruction_keyword_fc)g_raw_instruction_build_keyword;
}
@@ -409,6 +409,39 @@ static const char *g_raw_instruction_get_encoding(const GRawInstruction *instr)
}
+
+/******************************************************************************
+* *
+* Paramètres : instr = instruction d'assemblage à consulter. *
+* 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_raw_instruction_get_keyword(const GRawInstruction *instr, AsmSyntax syntax)
+{
+ GArchOperand *operand; /* Octet décodé à afficher */
+ MemoryDataSize size; /* Taille de valeur associée */
+
+ static char *defines[] = { "dn", "db", "dw", "dd", "dq" };
+
+ operand = g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 0);
+
+ if (G_IS_TARGET_OPERAND(operand))
+ size = g_target_operand_get_size(G_TARGET_OPERAND(operand));
+ else
+ size = g_imm_operand_get_size(G_IMM_OPERAND(operand));
+
+ return defines[MDS_RANGE(size)];
+
+}
+
+
/******************************************************************************
* *
* Paramètres : instr = instruction d'assemblage à représenter. *
@@ -546,39 +579,6 @@ static GBufferLine *g_raw_instruction_print(GRawInstruction *instr, GCodeBuffer
/******************************************************************************
* *
-* Paramètres : instr = instruction à traiter. *
-* format = format du binaire manipulé. *
-* syntax = type de représentation demandée. *
-* *
-* Description : Reconstruit le cache complet d'une désignation d'instruction.*
-* *
-* Retour : Mot clef de bas niveau. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_raw_instruction_build_keyword(const GRawInstruction *instr, AsmSyntax syntax)
-{
- GArchOperand *operand; /* Octet décodé à afficher */
- MemoryDataSize size; /* Taille de valeur associée */
-
- static char *defines[] = { "dn", "db", "dw", "dd", "dq" };
-
- operand = g_arch_instruction_get_operand(G_ARCH_INSTRUCTION(instr), 0);
-
- if (G_IS_TARGET_OPERAND(operand))
- size = g_target_operand_get_size(G_TARGET_OPERAND(operand));
- else
- size = g_imm_operand_get_size(G_IMM_OPERAND(operand));
-
- G_ARCH_INSTRUCTION(instr)->cached_keyword = strdup(defines[MDS_RANGE(size)]);
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : instr = instruction à traiter. *
* is_padding = nouveau statut à associer au contenu. *
* *