diff --git a/source/compiler/sc2.c b/source/compiler/sc2.c index 02a256f5..5887a86d 100644 --- a/source/compiler/sc2.c +++ b/source/compiler/sc2.c @@ -1224,6 +1224,13 @@ static int command(void) assert((sym->ident & iFUNCTN)!=0 || (sym->ident & iREFFUNC)!=0); stgwrite(sym->name); } else { + if (strcmp(name, "sysreq.c")==0) { + assert((sym->ident & iFUNCTN)!=0 && (sym->usage & uNATIVE)!=0); + if (sc_status==statWRITE && (sym->usage & uREAD)==0 && sym->addr>=0) { + /* reserve a SYSREQ id if called for the first time */ + sym->addr=ntv_funcid++; + } /* if */ + } outval(sym->addr,FALSE); } /* if */ /* mark symbol as "used", unknown whether for read or write */