📄 uiter
字号:
48c48< int projseen,firstsrc;
---> int projseen,firstsrc,cpychar;
53a54,55> if((ascptr= fopen("ASCIIFIL.$$$","wb")) == NULL){
> fprintf(stderr,"Cannot open ASCIIFIL.$$$ \n"); exit(1);}
148c150< if ((uitptr = fopen(filechar, "w")) == NULL)
---> if ((uitptr = fopen(filechar, "wb")) == NULL)
153c155< if ((outFile=fopen(filechar,"w")) == NULL)
---> if ((outFile=fopen(filechar,"wb")) == NULL)
165,168c167,170< if (((inptr = fopen(p, "r")) == NULL) &&
< ((inptr = fopen(ffnm, "r")) == NULL) &&
< ((inptr = fopen(filsnm, "r")) == NULL) &&
< ((inptr = fopen(filcapnm, "r")) == NULL))
---> if (((inptr = fopen(p, "rb")) == NULL) &&
> ((inptr = fopen(ffnm, "rb")) == NULL) &&
> ((inptr = fopen(filsnm, "rb")) == NULL) &&
> ((inptr = fopen(filcapnm, "rb")) == NULL))
175,177c177,179< if (((inptr = fopen(p, "r")) == NULL) &&
< ((inptr = fopen(filsnm, "r")) == NULL) &&
< ((inptr = fopen(filcapnm, "r")) == NULL))
---> if (((inptr = fopen(p, "rb")) == NULL) &&
> ((inptr = fopen(filsnm, "rb")) == NULL) &&
> ((inptr = fopen(filcapnm, "rb")) == NULL))
199a202,207> if ((inptr = fopen("ASCIIFIL.$$$", "rb")) == NULL)
> fatal("can't open ASCIIFIL.$$$");
> if ((uitptr = fopen(filechar, "wb")) == NULL)
> fatal("can't open %s", filechar);
> while((cpychar=getc(inptr)) != EOF) putc(cpychar,uitptr);
> fclose(inptr); fclose(uitptr);
235c243< if ((input = fopen(filechar, "r")) == NULL)
---> if ((input = fopen(filechar, "rb")) == NULL)
255,334c263< archive();
< fclose(input);
< /* continue;*/
< }
< rewind(input);
< #endif
< parse(p);
< fclose(input);
< /*break;*/
< }
< #ifndef ASLD
< if (nfile == 0) {
< input = stdin;
< parse("STDIN");
< }
< #endif
< commfinish();
< machfinish(PASS_1);
< #ifdef ASLD
< if (unresolved) {
< register int i;
<
< nerrors++;
< fflush(stdout);
< fprintf(stderr, "unresolved references:\n");
< for (i = 0; i < H_SIZE; i++) {
< ip = hashtab[H_GLOBAL+i];
< while (ip != 0) {
< if ((ip->i_type & (S_EXT|S_TYP)) == (S_EXT|S_UND))
< fprintf(stderr, "\t%s\n", ip->i_name);
< ip = ip->i_next;
< }
< }
< }
< #else
< if (unresolved)
< outhead.oh_flags |= HF_LINK;
< /*
< if (nfile == 0)
< fatal("no source file");
< */
< #endif
< }
<
< #ifdef ASLD
<
< archive() {
< register long offset;
< struct ar_hdr header;
< char getsize[AR_TOTAL];
<
< archmode++;
< offset = 2;
< for (;;) {
< if (unresolved == 0)
< break;
< fseek(input,offset,0);
< if (fread(getsize,AR_TOTAL,1,input) != 1)
< break;
< offset += AR_TOTAL;
< strncpy(header.ar_name,getsize,sizeof header.ar_name) ;
< header.ar_size= (((((long) (getsize[AR_SIZE+1]&0377))<<8)+
< ((long) (getsize[AR_SIZE ]&0377))<<8)+
< ((long) (getsize[AR_SIZE+3]&0377))<<8)+
< ((long) (getsize[AR_SIZE+2]&0377)) ;
< archsize = header.ar_size;
< if (needed()) {
< fseek(input,offset,0);
< archsize = header.ar_size;
< header.ar_name[14] = '\0';
< parse(remember(header.ar_name));
< }
< offset += header.ar_size;
< while (offset % 2)
< offset++;
< }
< archmode = 0;
< }
<
< needed()
---> char *s;
336,368c265< register c, first;
< register item_t *ip;
< register need;
<
< #ifdef LISTING
< register save;
<
< save = listflag; listflag = 0;
< #endif
< need = 0;
< peekc = -1;
< first = 1;
< for (;;) {
< c = nextchar();
< if (c == '\n') {
< first = 1;
< continue;
< }
< if (c == ' ' || c == '\t' || c == ',')
< continue;
< if (ISALPHA(c) == 0)
< break;
< if ((ip = item_search(readident(c))) == 0) {
< if (first)
< break;
< continue;
< }
< if (first) {
< if (ip == &keytab[KEYSECT]) {
< while ((c = nextchar()) != '\n')
< ;
< continue;
< }
---> static char nmbuf[STRINGMAX];
370,377c267,270< if (ip != &keytab[KEYDEFINE])
< break;
< first = 0;
< }
< if ((ip->i_type & S_TYP) == S_UND) {
< need++;
< break;
< }
---> switchsect(S_UND);
> if (s && s != modulename) {
> strncpy(nmbuf, s, STRINGMAX-1);
> modulename = nmbuf;
378a272,281> else modulename = s;
> lineno = 1;
> #ifdef NEEDED
> /*
> * problem: it shows the name of the tempfile, not any name
> * the user is familiar with. Moreover, it is not reproducable.
> */
> if ((sflag & (SYM_EXT|SYM_LOC|SYM_LAB)) && PASS_SYMB)
> newsymb(s, S_MOD, 0, (valu_t)0);
> #endif
380c283,286< listflag = save;
---> listtemp = 0;
> if (dflag & 01000)
> listtemp = listmode;
> listflag = listtemp;
382d287< return(need);
384d288< #endif /* ASLD */
386,387c290< parse(s)
< char *s;
---> setupoutput()
389,391c292,295< register i;
< register item_t *ip;
< register char *p;
---> register sect_t *sp;
> register long off;
> struct outsect outsect;
> register struct outsect *pos = &outsect;
393,437c297,298< for (p = s; *p; )
< if (*p++ == '/')
< s = p;
< #ifdef ASLD
< yylval.y_strp = s;
< putval(MODULE);
< #endif
< for (i = 0; i < FB_SIZE; i++)
< fb_ptr[FB_BACK+i] = 0;
< newmodule(s);
< peekc = -1;
< yyparse();
< /*
< * Check for undefined symbols
< */
< #ifdef ASLD
< for (i = 0; i < H_SIZE; i++) {
< while (ip = hashtab[H_LOCAL+i]) {
< /*
< * cleanup local queue
< */
< hashtab[H_LOCAL+i] = ip->i_next;
< /*
< * make undefined references extern
< */
< if ((ip->i_type & (S_VAR|S_TYP)) == S_UND)
< ip->i_type |= S_EXT;
< /*
< * relink externals in global queue
< */
< if (ip->i_type & S_EXT)
< item_insert(ip, H_GLOBAL+i);
< }
< }
< #else
< for (i = 0; i < H_SIZE; i++) {
< for (ip = hashtab[H_LOCAL+i]; ip; ip = ip->i_next) {
< if (ip->i_type & S_EXT)
< continue;
< if (ip->i_type != S_UND)
< continue;
< if (uflag == 0)
< serror("undefined symbol %s", ip->i_name);
< ip->i_type |= S_EXT;
< }
---> if (! wr_open(aoutpath)) {
> fatal("comm4 can't create %s", aoutpath);
439c300< #endif
---> wr_ohead(&outhead);
441c302< * Check for undefined numeric labels
---> * section table generation
443,447c304,314< for (i = 0; i < FB_SIZE; i++) {
< if ((ip = fb_ptr[FB_FORW+i]) == 0)
< continue;
< serror("undefined label %d", i);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -