Appendix B

Source Code for PIPE.EXE

#include <stdio.h>
#include <conio.h>
#include <time.h>
#include <dos.h>

#define OUT_PORT 0x378
#define HIGH 0x02
#define LOW  0x00

main()
{
     FILE *input;
     int i,data=0;
     unsigned long int c=0,d,count;
     char b,masked_b;

     input = fopen("test.dat","r");
     printf("file opened...\n");
     while ((b = getc(input)) != EOF) {
          count++;
          if (!(count%100000)) printf("kbytes: %d",count/1000);
          for (i = 1; i < 8; i++) {
               masked_b = b;
               masked_b &= 0x01;
               outp(OUT_PORT,masked_b);
               masked_b |= 0x02;
               for(d=1; d<3;d++);                 /* used for timing of bitrate */
               outp(OUT_PORT,masked_b);
               masked_b &= 0x05;
               for(d=1; d<3; d++);                /* used for timing of bitrate */
               outp(OUT_PORT,masked_b);
               for(d=1; d<3; d++);                /* used for timing of bitrate */
               b >>= 1;
          }
     }
     fclose(input);
     exit(0);
}


[Back to Table of Contents]
[Back to MPEG Audio Decoder Module page]
Last Modified on Thursday, April 25, 1996
Copyright©1996, All Rights Reserved.
Kire Filipovski, Mike Schwnakl