summaryrefslogtreecommitdiff
path: root/src/arch/raw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/raw.c')
-rw-r--r--src/arch/raw.c45
1 files changed, 19 insertions, 26 deletions
diff --git a/src/arch/raw.c b/src/arch/raw.c
index 61a37e0..d0348c9 100644
--- a/src/arch/raw.c
+++ b/src/arch/raw.c
@@ -78,7 +78,7 @@ static const char *g_raw_instruction_get_encoding(const GRawInstruction *);
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);
+static void g_raw_instruction_print(GRawInstruction *, GBufferLine *, size_t, size_t);
@@ -444,11 +444,11 @@ static const char *g_raw_instruction_get_keyword(const GRawInstruction *instr, A
/******************************************************************************
* *
-* Paramètres : instr = instruction d'assemblage à représenter. *
-* buffer = espace où placer ledit contenu. *
+* Paramètres : instr = instruction d'assemblage à représenter. *
+* buffer = espace où placer ledit contenu. *
* msize = taille idéale des positions et adresses; *
* content = contenu binaire global à venir lire. *
-* syntax = type de représentation demandée. *
+* syntax = type de représentation demandée. *
* *
* Description : Ajoute à un tampon GLib le contenu de l'instance spécifiée. *
* *
@@ -458,9 +458,8 @@ static const char *g_raw_instruction_get_keyword(const GRawInstruction *instr, A
* *
******************************************************************************/
-static GBufferLine *g_raw_instruction_print(GRawInstruction *instr, GCodeBuffer *buffer, MemoryDataSize msize, const GBinContent *content, AsmSyntax syntax)
+static void g_raw_instruction_print(GRawInstruction *instr, GBufferLine *line, size_t index, size_t repeat)
{
- GBufferLine *result; /* Ligne de destination */
GArchInstruction *base; /* Autre version de l'instance */
const char *key; /* Mot clef principal */
size_t klen; /* Taille de ce mot clef */
@@ -474,25 +473,21 @@ static GBufferLine *g_raw_instruction_print(GRawInstruction *instr, GCodeBuffer
base = G_ARCH_INSTRUCTION(instr);
if (!instr->is_padding && !instr->is_string)
- result = G_ARCH_INSTRUCTION_CLASS(g_raw_instruction_parent_class)->print(base, buffer, msize, content, syntax);
+ G_ARCH_INSTRUCTION_CLASS(g_raw_instruction_parent_class)->print(base, line, index, repeat);
else
{
- result = g_code_buffer_prepare_new_line(buffer, &base->range);
-
- g_buffer_line_add_flag(result, BLF_HAS_CODE);
-
- g_buffer_line_fill_mrange(result, msize/* TODO ! */, msize);
+ g_buffer_line_fill_vmpa(line, get_mrange_addr(&base->range), MDS_32_BITS_UNSIGNED, MDS_32_BITS_UNSIGNED);
/* Instruction proprement dite */
- key = g_arch_instruction_get_keyword(base, syntax);
+ key = g_arch_instruction_get_keyword(base, 0/*, syntax*/);
klen = strlen(key);
- g_buffer_line_append_text(result, BLC_ASSEMBLY_HEAD, key, klen, RTT_INSTRUCTION, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY_HEAD, key, klen, RTT_INSTRUCTION, NULL);
if (instr->is_padding)
- g_buffer_line_append_text(result, BLC_ASSEMBLY, "...", 3, RTT_RAW, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY, "...", 3, RTT_RAW, NULL);
else /*if (instr->is_string)*/
{
@@ -516,15 +511,15 @@ static GBufferLine *g_raw_instruction_print(GRawInstruction *instr, GCodeBuffer
{
if (!first)
{
- g_buffer_line_append_text(result, BLC_ASSEMBLY, ",", 1, RTT_PUNCT, NULL);
- g_buffer_line_append_text(result, BLC_ASSEMBLY, " ", 1, RTT_RAW, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY, ",", 1, RTT_PUNCT, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY, " ", 1, RTT_RAW, NULL);
}
else
first = false;
string[iter++] = '"';
- g_buffer_line_append_text(result, BLC_ASSEMBLY, string, iter, RTT_STRING, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY, string, iter, RTT_STRING, NULL);
iter = 1;
@@ -534,13 +529,13 @@ static GBufferLine *g_raw_instruction_print(GRawInstruction *instr, GCodeBuffer
if (!first)
{
- g_buffer_line_append_text(result, BLC_ASSEMBLY, ",", 1, RTT_PUNCT, NULL);
- g_buffer_line_append_text(result, BLC_ASSEMBLY, " ", 1, RTT_RAW, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY, ",", 1, RTT_PUNCT, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY, " ", 1, RTT_RAW, NULL);
}
else
first = false;
- g_arch_operand_print(base->operands[i], result, syntax);
+ g_arch_operand_print(base->operands[i], line, 0/*, syntax*/);
}
@@ -554,15 +549,15 @@ static GBufferLine *g_raw_instruction_print(GRawInstruction *instr, GCodeBuffer
{
if (!first)
{
- g_buffer_line_append_text(result, BLC_ASSEMBLY, ",", 1, RTT_PUNCT, NULL);
- g_buffer_line_append_text(result, BLC_ASSEMBLY, " ", 1, RTT_RAW, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY, ",", 1, RTT_PUNCT, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY, " ", 1, RTT_RAW, NULL);
}
else
first = false;
string[iter++] = '"';
- g_buffer_line_append_text(result, BLC_ASSEMBLY, string, iter, RTT_STRING, NULL);
+ g_buffer_line_append_text(line, BLC_ASSEMBLY, string, iter, RTT_STRING, NULL);
}
@@ -572,8 +567,6 @@ static GBufferLine *g_raw_instruction_print(GRawInstruction *instr, GCodeBuffer
}
- return result;
-
}