newlabel(fb_shift((int)$2));
}
| program CODE1
- { emit1((char)$2); LISTLINE(0);}
+ { emit1((int)$2); LISTLINE(0);}
| program CODE2
- { emit2((short)$2); LISTLINE(0);}
+ { emit2((int)$2); LISTLINE(0);}
| program CODE4
{ emit4((long)$2); LISTLINE(0);}
| program operation ';'
| program operation '\n'
{ lineno++; LISTLINE(1); RELODONE;}
| program '#' NUMBER STRING '\n'
- { lineno++; LISTLINE(1); RELODONE;}
+ { lineno = $3;
+ if (modulename) strncpy(modulename, &stringbuf[1], 63);
+ LISTLINE(1); RELODONE;
+ }
| program error '\n'
{ serror("syntax error"); yyerrok;
lineno++; LISTLINE(1); RELODONE;
newmodule(s)
char *s;
{
+ static char nmbuf[64];
+
switchsect(S_UND);
- modulename = s;
+ if (s && s != modulename) {
+ strncpy(nmbuf, s, 63);
+ modulename = nmbuf;
+ }
+ else modulename = s;
lineno = 1;
#ifdef NEEDED
/*
if (store(ip, (valu_t) DOTVAL) == 0)
return;
#ifdef THREE_PASS
- assert(pass != PASS_2 || (oldval -= ip->i_valu) == DOTGAIN);
+ assert(pass != PASS_2 || oldval - ip->i_valu == DOTGAIN);
#endif
}
/* ---------- output ---------- */
emit1(arg)
-char arg;
{
#ifdef LISTING
if (listeoln) {
}
emit2(arg)
-short arg;
+int arg;
{
#ifdef BYTES_REVERSED
- emit1((char)(arg>>8)); emit1((char)arg);
+ emit1((arg>>8)); emit1(arg);
#else
- emit1((char)arg); emit1((char)(arg>>8));
+ emit1(arg); emit1((arg>>8));
#endif
}
long arg;
{
#ifdef WORDS_REVERSED
- emit2((short)(arg>>16)); emit2((short)(arg));
+ emit2((arg>>16)); emit2((arg));
#else
- emit2((short)(arg)); emit2((short)(arg>>16));
+ emit2((arg)); emit2((arg>>16));
#endif
}
{
switch (n) {
case 1:
- emit1((char)val); break;
+ emit1((int)val); break;
case 2:
- emit2((short)val); break;
+ emit2((int)val); break;
case 4:
emit4((long)val); break;
default: