User manual
Computer Remote Control
E-16 ProMaster 2500 User Manual
Source Code of
LABEL.C Program
************************************************************************
* LABEL.C - Create Hex Label Format containing label info *
* *
* This program is written using only standard C file functions *
* and can be compiled with any C compiler. *
*************************************************************************
#include <stdio.h> /* include standard IO file */
FILE *fp; /* declare file pointer */
char lb[] = /* initialize input buffer */
" ";
.()
{
int i = 0; /* index variable */
char l, c, d, chksum; /* work and checksum variables */
fp = fopen("LABEL.HEX","w"); /* open output file */
fputs("Q001FE\n",fp); /* write header record to file */
fputs("Q20201FC\n",fp); /* write part type record to file*/
/* select 28 pin PLCC */
fputs("Q7020EEF",fp); /* write rotation record to file */
/* get label information */
l = 1; /* init length */
fputc('\n',stdout);
for (d = 0; d 4; d++){
fputs("Enter label line ",stdout);
fputc(d+49,stdout);
fputs(": ",stdout);
while ((c = getchar()) != '\n'){
lb[i++] = c; /* store character in buffer */
++l; /* inc length counter */
}
lb[i++] = 13; /* write a cr to delimit each line */
++l;
}
fputs("\nQ1",fp); /* write data record */
cput(l); /* write length */
for (i=0,chksum=l; i1; ++i){ /* write re.der data record */
cput(lb[i]); /* write character */
chksum += lb[i]; /* update checksum */
}
cput(~chksum); /* write checksum */
fputs("\nQ901FE\n",fp); /* write termination record */
fclose(fp); /* close output file */
} /* exit */
cput(a) /* write byte in ASCII format */
char a; /* input parameter */
{
char c; /* temporary character variable */
c = ((a > 4) & 15)+48; /* convert left nibble */
if (c 57) c += 7;
fputc(c,fp); /* write character */
c = (a & 15)+48; /* convert right nibble */
if (c 57) c += 7;
fputc(c,fp); /* write character */
} /* return to caller */










