![Digital Equipment Alpha 21164PC Скачать руководство пользователя страница 328](http://html.mh-extra.com/html/digital-equipment/alpha-21164pc/alpha-21164pc_hardware-reference-manual_2498508328.webp)
C–4
Serial Icache Load Predecode Values
29 September 1997 – Subject To Change
if (argc>1)
strcpy(filename,argv[1]);
if (argc>2)
strcpy(ofilename,argv[2]);
if (argc>3)
strcpy(hfilename,argv[3]);
if (NULL == (infile = fopen(filename,"rb")))
{
printf("input file open error: %s\n", filename);
exit(0);
}
if (NULL == (outfile = fopen(ofilename, "wb")))
{
printf("binary output file open error: %s\n", ofilename);
exit(0);
}
if (NULL == (hexfile = fopen(hfilename, "w")))
{
printf("hex output file open error: %s\n", hfilename);
exit(0);
}
fprintf(hexfile,":020000020000FC\n"); /* extended segment addr record */
tparity = eparity(tag) ^ eparity(tphysical) ^ eparity(asn);
tvalids = 15;
instatus = 0;
instr_count = 0;
/* there are 1024 full 32 byte records (MAX_INSTR instructions) */
for (lines_written = 0; lines_written < 1024; lines_+)
{
build_vector(instr, outvector, &instatus, &instr_count); /* build the vector */
fwrite(&outvector[0],1,DATA_BYTES_PER_REC,outfile); /* print it to a
binary file */
fprintf(hexfile,":19%04X00",offset); /* print it to the hex
file */
chksum = (offset & 0xff) + (offset >> 8) + 0x19;
for (j=0; j<DATA_BYTES_PER_REC; j++)
{
charptr = ((char*) &outvector[0]) + j;
fprintf(hexfile,"%02X", (0xff& *charptr));
= *charptr;
}
= DATA_BYTES_PER_REC;
fprintf(hexfile,"%02X\n", (-chksum) & 0xff);
}
if (instatus == 0) /* there’s more data in the file to read, oops... */
{
while (instatus == 0){