1: #ifndef lint
   2: static char *rcsid =
   3:    "$Header: fixmask.c,v 1.2 83/04/10 21:34:40 sklower Exp $";
   4: #endif
   5: 
   6: /*					-[Sat Jan 29 12:42:54 1983 by jkf]-
   7:  * 	fixmask.c				$Locker:  $
   8:  * complete program to change register save masks on the vax
   9:  *
  10:  * (c) copyright 1982, Regents of the University of California
  11:  */
  12: 
  13: 
  14: #include <stdio.h>
  15: char mybuf[BUFSIZ];
  16: extern unsigned short mask[];
  17: main(){
  18:     register savesize = 0; char *cp;
  19:     while(fgets(mybuf,BUFSIZ,stdin)!=NULL) {
  20:         if(*mybuf=='#') {
  21:             if(strcmpn(mybuf,"#save	",6)==0){
  22:                 savesize = mybuf[6]-'0';
  23:             } else if (strcmpn(mybuf,"#protect	",9)==0){
  24:                 savesize = '0'-1-mybuf[9];
  25:             }
  26:         }
  27:         if(savesize && strcmpn(mybuf,"	.set	L",7)==0) {
  28:             for(cp=mybuf;*cp++!=',';);
  29:             sprintf(cp,"0x%X\n",mask[savesize + 10]);
  30:             savesize = 0;
  31:         }
  32:         fputs(mybuf,stdout);
  33:     }
  34: }
  35: unsigned short mask[] = {
  36:     0,0,0,0xfc0,0xfc0,0xfc0,0xec0,0xcc0,0x8c0,0x0c0,0,
  37:     0x800,0xc00,0xe00,0xf00,0xf80,0xfc0,0,0,0,0};

Defined functions

main defined in line 17; used 4 times

Defined variables

mask declared in line 16; defined in line 35; used 2 times
mybuf defined in line 15; used 9 times
rcsid defined in line 2; never used
Last modified: 1985-08-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 581
Valid CSS Valid XHTML 1.0 Strict