int main(int argc, char *argv[]) { if(ProcessArgs(argc,argv)!=kNoArgError) { Usage(0); exit(0); } strcpy(gPrevLine,""); // init the previous line. strcpy(srcDigs,""); if(gRelocInfo==kTrue) { // need to prime the relocator. GetNextCmpAddr(); } while(!feof(gSrcFile)) { // while not at end of file fscanf(gSrcFile,"%s",gSrcLine); if(gRelocInfo==kFalse) fscanf(gRelocFile,"%s",gCmpLine); //printf("%s %s",gSrcLine,gCmpLine); if(!AddrCheck(gSrcLine)) { // good line addr. printf("Line in range %d!",line); CatCheckSum(); //fprintf(gDstFile,"%s\n",gPrevLine); gSrcLine[strlen(gSrcLine)-2]='\0'; // truncate. } else { // we need to process the line. ProcessALine(gSrcLine); strcpy(gSrcLine,gOutputLine); } strcpy(gPrevLine,gSrcLine); // update the previous line. printf("prev= %s\n",gPrevLine); line++; } FlushLines(); fclose(gDstFile); fclose(gRelocFile); fclose(gSrcFile); }
int HaveSegmentChange (unsigned Addr) /* Return true if the segment change attribute is set for the given address */ { /* Check the given address */ AddrCheck (Addr); /* Return the attribute */ return (AttrTab[Addr] & atSegmentChange) != 0; }
attr_t GetLabelAttr (unsigned Addr) /* Return the label attribute for the given address */ { /* Check the given address */ AddrCheck (Addr); /* Return the attribute */ return (AttrTab[Addr] & atLabelMask); }
attr_t GetStyleAttr (unsigned Addr) /* Return the style attribute for the given address */ { /* Check the given address */ AddrCheck (Addr); /* Return the attribute */ return (AttrTab[Addr] & atStyleMask); }
attr_t GetAttr (unsigned Addr) /* Return the attribute for the given address */ { /* Check the given address */ AddrCheck (Addr); /* Return the attribute */ return AttrTab[Addr]; }
void MarkAddr (unsigned Addr, attr_t Attr) /* Mark an address with an attribute */ { /* Check the given address */ AddrCheck (Addr); /* We must not have more than one style bit */ if (Attr & atStyleMask) { if (AttrTab[Addr] & atStyleMask) { Error ("Duplicate style for address %04X", Addr); } } /* Set the style */ AttrTab[Addr] |= Attr; }