summaryrefslogtreecommitdiff
path: root/src/arch/instruction.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r--src/arch/instruction.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index c2e4c7c..1bdb50e 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -52,7 +52,7 @@ static void g_arch_instruction_finalize(GArchInstruction *);
/* Ajoute à un tampon GLib le contenu de l'instance spécifiée. */
-static GBufferLine *_g_arch_instruction_print(const GArchInstruction *, GCodeBuffer *, MemoryDataSize, const GBinContent *, AsmSyntax);
+static GBufferLine *_g_arch_instruction_print(GArchInstruction *, GCodeBuffer *, MemoryDataSize, const GBinContent *, AsmSyntax);
@@ -203,15 +203,25 @@ void g_arch_instruction_set_encoding(GArchInstruction *instr, const char *encodi
* *
* Description : Etend la désignation d'un nom d'instruction. *
* *
-* Retour : - *
+* Retour : true. *
* *
* Remarques : - *
* *
******************************************************************************/
-void g_arch_instruction_append_suffix(GArchInstruction *instr, const char *suffix)
+bool g_arch_instruction_extend_keyword(GArchInstruction *instr, const char *suffix)
{
- instr->suffix = suffix;
+ instr->suffix = stradd(instr->suffix, suffix);
+
+ if (instr->cached_keyword != NULL)
+ {
+ free(instr->cached_keyword);
+ instr->cached_keyword = NULL;
+ }
+
+ /* TODO : signal ? */
+
+ return true;
}
@@ -960,11 +970,14 @@ size_t g_arch_instruction_compute_group_index(GArchInstruction **iter, GArchInst
* *
******************************************************************************/
-const char *g_arch_instruction_get_keyword(const GArchInstruction *instr, AsmSyntax syntax)
+const char *g_arch_instruction_get_keyword(GArchInstruction *instr, AsmSyntax syntax)
{
if (instr->cached_keyword == NULL)
G_ARCH_INSTRUCTION_GET_CLASS(instr)->build_key(instr, syntax);
+ if (instr->suffix != NULL)
+ instr->cached_keyword = stradd(instr->cached_keyword, instr->suffix);
+
return instr->cached_keyword;
}
@@ -1025,7 +1038,7 @@ void g_arch_instruction_set_displayed_max_length(GArchInstruction *instr, phys_t
* *
******************************************************************************/
-static GBufferLine *_g_arch_instruction_print(const GArchInstruction *instr, GCodeBuffer *buffer, MemoryDataSize msize, const GBinContent *content, AsmSyntax syntax)
+static GBufferLine *_g_arch_instruction_print(GArchInstruction *instr, GCodeBuffer *buffer, MemoryDataSize msize, const GBinContent *content, AsmSyntax syntax)
{
GBufferLine *result; /* Ligne de destination */
const char *key; /* Mot clef principal */