summaryrefslogtreecommitdiff
path: root/lib/assembler.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/assembler.c')
-rw-r--r--lib/assembler.c35
1 files changed, 33 insertions, 2 deletions
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;