From 38e3212d37dc9594aa409b67da00529466a1713e Mon Sep 17 00:00:00 2001 From: Pixel <> Date: Sun, 15 Apr 2001 18:22:38 +0000 Subject: Bug fixes --- lib/assembler.c | 16 +++++++++++++--- lib/instructions.txt | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/assembler.c b/lib/assembler.c index b472ce1..25b975b 100644 --- a/lib/assembler.c +++ b/lib/assembler.c @@ -1127,7 +1127,7 @@ static void super_pattern(pattern_t * patterns, expression_t * e) return; if (!((e->op == OP_DECAL) || (e->op == OP_DIRECT))) return; - + for (patterns = patterns->next; patterns; patterns = patterns->next) { for (i = 0; i < patterns->nbr; i++) { if (!patterns->expr[i]->name) { @@ -1136,11 +1136,13 @@ static void super_pattern(pattern_t * patterns, expression_t * e) if (!patterns->expr[i]->left) { e->pattern = patterns; e->index = i; + return; } } else { if (patterns->expr[i]->left) { e->pattern = patterns; e->index = i; + return; } } } @@ -1153,11 +1155,13 @@ static void super_pattern(pattern_t * patterns, expression_t * e) && (e->child->next->e_subtype == E_VALUE))) { e->pattern = patterns; e->index = i; + return; } } else { if (e->e_subtype == E_LABEL) { e->pattern = patterns; e->index = i; + return; } } } @@ -1321,7 +1325,7 @@ static void evaluate_pattern(_TableauVariable * it, expression_t * e) if (m->string) { fprintf(stderr, "et une string associée\n"); if (m->type) { - if (!strcmp(m->name, "I")) { + if (strcmp(m->name, "I")) { exception(1, _("Unknow constant type in the meta language")); } if (e->e_subtype == E_VALUE) { @@ -1678,9 +1682,15 @@ void asm_eol(void) for (i = 0; i < instr->nbimplicit; i++) { switch(instr->itypes[i]) { case 0: /* type direct */ + fprintf(stderr, "On cherche la variable %s\n", instr->istrings[i]); t = (expression_t *) NomVarToVar(instr->istrings[i], it, &trouve); if (!trouve) { - exception(1, _("Syntax error in meta language")); + t = (expression_t *) Emalloc(sizeof(expression_t)); + t->e_type = t->e_subtype = E_VALUE; + t->avalue = 0; + t->child = t->next = NULL; + t->pattern = NULL; + fprintf(stderr, "Insertion de la variable %s, de valeur %i.\n", instr->istrings[i], t->avalue); } InsererVarDansTab(&it, CreerElement(instr->implicits[i], t)); break; diff --git a/lib/instructions.txt b/lib/instructions.txt index 494ca47..becfc21 100644 --- a/lib/instructions.txt +++ b/lib/instructions.txt @@ -67,8 +67,8 @@ I:SHR c1=.Pr,c2=.Pr,.I=.C;op=0x7;e=0x1 I:MOV c1=.Pr,rm=.Pm;op=8;e=0;c2=.Fa;c3=regop I:MOV c1=.Pr,c3=.Pr;op=8;e=0;c2=0 I:MOV c1=.Pr,.I=.C;op=8;e=1 -I:MOV c2=.Pm,rm=.Pr;op=8;e=2;c1=.Fa;c3=regop -I:MOV c2=.Pm,.I=.C;op=8;e=3;c1=.Fa;c3=regop +I:MOV rm=.Pm,c2=.Pr;op=8;e=2;c1=.Fa;c3=regop +I:MOV rm=.Pm,.I=.C;op=8;e=3;c1=.Fa;c3=regop p:MV=MOV -- cgit v1.2.3