From 9608fc23272222a5472444514c044b736108e33d Mon Sep 17 00:00:00 2001 From: Pixel <> Date: Mon, 16 Apr 2001 19:31:22 +0000 Subject: Bleh --- lib/assembler.c | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) (limited to 'lib/assembler.c') diff --git a/lib/assembler.c b/lib/assembler.c index 4abdb62..3fda135 100644 --- a/lib/assembler.c +++ b/lib/assembler.c @@ -1812,6 +1812,40 @@ void asm_eof(FILE * f) break; } } + if (ttext->Expr->op == OP_DECAL) { + if ((ttext->Expr->child->e_subtype == E_LABEL) && (ttext->Expr->child->next->e_subtype == E_VALUE)) { + a = ttext->Expr->child->next->avalue; + nbsymbols++; + writeword(1, f2, 1); + writeword(ttext->offset, f2, 1); + writeword(strlen(ttext->Expr->child->symbol), f2, 1); + writestring(ttext->Expr->child->symbol, f2); + nbe++; + break; + } + } + if (ttext->Expr->op == OP_PLUS) { + if (((ttext->Expr->child->e_subtype == E_LABEL) && (ttext->Expr->child->next->e_subtype == E_VALUE)) || ((ttext->Expr->child->e_subtype == E_VALUE) && (ttext->Expr->child->next->e_subtype == E_LABEL))) { + if (ttext->Expr->child->e_subtype == E_LABEL) { + a = ttext->Expr->child->next->avalue; + nbsymbols++; + writeword(1, f2, 1); + writeword(ttext->offset, f2, 1); + writeword(strlen(ttext->Expr->child->symbol), f2, 1); + writestring(ttext->Expr->child->symbol, f2); + nbe++; + } else { + a = ttext->Expr->child->avalue; + nbsymbols++; + writeword(1, f2, 1); + writeword(ttext->offset, f2, 1); + writeword(strlen(ttext->Expr->child->next->symbol), f2, 1); + writestring(ttext->Expr->child->next->symbol, f2); + nbe++; + } + break; + } + } if (ttext->Expr->op != OP_FUNC_CALL) { exception(1, _("Can't evaluate expression for a direct value")); } @@ -1890,12 +1924,6 @@ void asm_eof(FILE * f) nbe++; break; case E_OPERATION: - if (tdata->Expr->op == OP_DIRECT) { - if (tdata->Expr->child->e_subtype == E_VALUE) { - a = tdata->Expr->child->avalue; - break; - } - } if (tdata->Expr->op != OP_FUNC_CALL) { exception(1, _("Can't evaluate expression for a direct value")); } -- cgit v1.2.3