X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=sect.c;h=3b2ed99dfb24590ed620dc4b183f4d7382db6a52;hp=e010ff24696f5629e6f6ebaa623ba44573192109;hb=f3c7d186a15b89c39e360b9cc89545a0d24bd6a4;hpb=cfd001aea60f54e49d9beae0f941c513f45c202b diff --git a/sect.c b/sect.c index e010ff2..3b2ed99 100644 --- a/sect.c +++ b/sect.c @@ -282,7 +282,7 @@ int chcheck(uint32_t amt) // // Arrange for a fixup on a location // -int AddFixup(uint16_t attr, uint32_t loc, TOKEN * fexpr) +int AddFixup(uint16_t attr, uint32_t loc, TOKENPTR fexpr) { uint32_t i = MIN_FIXUP_MEM; uint16_t len = 0; @@ -291,7 +291,7 @@ int AddFixup(uint16_t attr, uint32_t loc, TOKEN * fexpr) // Compute length of expression (could be faster); determine if it's the // single-symbol case; no expression if it's just a mark. (? is this true?) - if ((*fexpr == SYMBOL) && (fexpr[2] == ENDEXPR)) + if ((*fexpr.u32 == SYMBOL) && (fexpr.u32[2] == ENDEXPR)) { // Just a single symbol, possibly followed by a DWORD i += sizeof(SYM *); @@ -306,11 +306,13 @@ int AddFixup(uint16_t attr, uint32_t loc, TOKEN * fexpr) attr |= FU_EXPR; // Count the # of tokens in the expression - for(len=0; fexpr[len]!=ENDEXPR; len++) + for(len=0; fexpr.u32[len]!=ENDEXPR; len++) { - // Add one to len for 2X tokens - if (fexpr[len] == CONST || fexpr[len] == SYMBOL) + // Add one to len for 2X tokens, two for 3X tokens + if (fexpr.u32[len] == SYMBOL) len++; + else if (fexpr.u32[len] == CONST) + len += 2; } // Add 1 for ENDEXPR @@ -360,11 +362,11 @@ int AddFixup(uint16_t attr, uint32_t loc, TOKEN * fexpr) *fchptr.wp++ = len; while (len--) - *fchptr.lp++ = *fexpr++; + *fchptr.lp++ = *fexpr.u32++; } else { - *fchptr.sy++ = symbolPtr[fexpr[1]]; + *fchptr.sy++ = symbolPtr[fexpr.u32[1]]; // SCPCD: Correct bit mask for attr (else other FU_xxx will match) // NYAN ! @@ -388,7 +390,7 @@ int AddFixup(uint16_t attr, uint32_t loc, TOKEN * fexpr) int ResolveFixups(int sno) { PTR fup; // Current fixup - uint32_t eval; // Expression value + uint64_t eval; // Expression value SYM * sy; // (Temp) pointer to a symbol uint16_t i; // (Temp) word int reg2; @@ -462,7 +464,7 @@ int ResolveFixups(int sno) { i = *fup.wp++; - if (evexpr(fup.tk, &eval, &eattr, &esym) != OK) + if (evexpr((TOKENPTR)fup.tk, &eval, &eattr, &esym) != OK) { fup.lp += i; continue;