- /* asexpr.c */
+/* asexpr.c */
/*
* (C) Copyright 1989-1995
term(esp);
while (ctype[c = getnb()] & BINOP) {
/*
- * Handle binary operators + - * / & | % ^ << >>
+ * Handle binary operators + - * / & | % ^ << >> [
*/
if ((p = oprio(c)) <= n)
break;
abscheck(esp);
esp->e_addr >>= re.e_addr;
break;
+ case '[':
+ /* MB added [ for bit access in bdata */
+ abscheck(&re);
+ if (getnb() != ']')
+ qerr();
+
+ /* if the left is a relative address then */
+ if (esp->e_base.e_ap) {
+ esp->e_addr |= (re.e_addr | 0x80) << 8;
+ break;
+ }
+ else if ((esp->e_addr & 0x87) == 0x80) {
+ esp->e_addr |= re.e_addr;
+ break;
+ }
default:
qerr();
esp->e_mode = sp->s_type;
esp->e_addr = sp->s_addr;
esp->e_base.e_ap = sp->s_area;
+ /* MB: abused bit 15 of s_addr to indicate bit-addressable bytes */
+ if ((sp->s_addr & 0x8000) && sp->s_area &&
+ (!strcmp(sp->s_area->a_id, "BSEG_BYTES") || !strcmp(sp->s_area->a_id, "BIT_BANK"))) {
+ esp->e_rlcf |= R_BIT | R_BYT2;
+ }
}
return;
}
int
oprio(register int c)
{
+ if (c == '[')
+ return (12);
if (c == '*' || c == '/' || c == '%')
return (10);
if (c == '+' || c == '-')