From 2317325a463b1cd52ee0a9444ec1a70064d4531c Mon Sep 17 00:00:00 2001 From: Pixel <> Date: Sun, 15 Apr 2001 17:36:16 +0000 Subject: Bug fixe --- lib/assembler.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/assembler.c b/lib/assembler.c index 8bceaec..b472ce1 100644 --- a/lib/assembler.c +++ b/lib/assembler.c @@ -1354,7 +1354,7 @@ static void evaluate_pattern(_TableauVariable * it, expression_t * e) m = m->left; if (m->string) { if (m->type) { - if (strcmp(m->name, "I") || strcmp(m->string, "O")) { + if (strcmp(m->name, "I") || strcmp(m->string, "O") || strcmp(m->string, "o")) { exception(1, _("Unknow constant type in the meta language")); } tv = 0; @@ -1596,7 +1596,7 @@ void asm_eol(void) exception(1, _("Unmatched instruction")); } - /* Operation crutiale: nous avons l'instruction qui correspond le mieux à notre + /* Operation cruciale: nous avons l'instruction qui correspond le mieux à notre expression, on va tenter de l'évaluer */ Initialise(&it); @@ -1623,6 +1623,37 @@ void asm_eol(void) CreerElement(instr->names[i], e_current)); } break; + case 'O': + if (instr->etypes) { + if (!strcmp(instr->names[i], "I")) { + if (e_current->e_subtype == E_VALUE) { + pushdword(e_current->avalue, 0); + } else { + pushdword(0, e_current); + } + } else { + exception(1, + _ + ("Unknow constant type in the meta language")); + } + } + break; + case 'o': + if (instr->etypes) { + if (!strcmp(instr->names[i], "I")) { + if (e_current->e_subtype == E_VALUE) { + exception(1, _("Can't have a direct value for a relative offset")); + } else { + pi = pushdword(0, e_current); + } + pi->Encoded -= pi->offset; + } else { + exception(1, + _ + ("Unknow constant type in the meta language")); + } + } + break; case 'P': t = (expression_t *) Emalloc(sizeof(expression_t)); t->e_type = t->e_subtype = E_VALUE; -- cgit v1.2.3