X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tools%2Ftranslate.c;h=3d3014c46a15f11a5d753c3a4a7c0b1f510cd5fa;hb=27ebfaed5dcb3fa037438d8a13404c6b957c6c11;hp=cb036c14207179cf48cf34a1e28453e2e08b227a;hpb=b0d802b2ddecf36d2c76a7647e16c80cb55c5bb2;p=ia32rtools.git diff --git a/tools/translate.c b/tools/translate.c index cb036c1..3d3014c 100644 --- a/tools/translate.c +++ b/tools/translate.c @@ -625,8 +625,10 @@ static int parse_operand(struct parsed_opr *opr, if (wordc_in == 2) { if (IS(words[w], "offset")) { opr->type = OPT_OFFSET; + opr->lmod = OPLM_DWORD; strcpy(opr->name, words[w + 1]); - return wordc; + pp = proto_parse(g_fhdr, opr->name, 1); + goto do_label; } if (IS(words[w], "(offset")) { p = strchr(words[w + 1], ')'); @@ -3476,6 +3478,25 @@ tailcall: } } } + else if (po->op == OP_MOV && po->operand[0].pp != NULL + && po->operand[1].pp != NULL) + { + // = offset + if ((po->operand[1].pp->is_func || po->operand[1].pp->is_fptr) + && !IS_START(po->operand[1].name, "off_")) + { + if (!po->operand[0].pp->is_fptr) + ferr(po, "%s not declared as fptr when it should be\n", + po->operand[0].name); + if (pp_cmp_func(po->operand[0].pp, po->operand[1].pp)) { + pp_print(buf1, sizeof(buf1), po->operand[0].pp); + pp_print(buf2, sizeof(buf2), po->operand[1].pp); + fnote(po, "var: %s\n", buf1); + fnote(po, "func: %s\n", buf2); + ferr(po, "^ mismatch\n"); + } + } + } else if (po->op == OP_RET && !IS(g_func_pp->ret_type.name, "void")) regmask |= 1 << xAX; else if (po->op == OP_DIV || po->op == OP_IDIV) {