home *** CD-ROM | disk | FTP | other *** search
/ Between Heaven & Hell 2 / BetweenHeavenHell.cdr / 500 / 471 / rccl139 < prev    next >
Text File  |  1987-03-02  |  1KB  |  61 lines

  1. /*
  2.  * test program for the very beginnings  (brother vax1shot.c)
  3.  */
  4.  
  5. #include "../h/stdio11.h"
  6. #include "../h/fifoio.h"
  7.  
  8. #define YES     1
  9. #define NO      0
  10. #define NW      32
  11.  
  12. struct fifobuf obuf, ibuf;
  13.  
  14. struct drcdevice *dp = DRC_ADDR;
  15.  
  16. main()
  17. {
  18.     int i, code;
  19.  
  20.     setbuf(stdin,NULL);
  21.     setbuf(stdout,NULL);
  22.  
  23.     printf("\nflip switch to Micro and type <return> to begin ");
  24.     while (getchar() != '\n')
  25.         ;
  26.     printf("send to vax :\n");
  27.     for(i = 0; i < NW; ++i) {
  28.         obuf.data[i] = 0125252;
  29.         ibuf.data[i] = 0;
  30.         printf("%o ", obuf.data[i]);
  31.     }
  32.     obuf.wc = NW;
  33.  
  34.     while ((dp->drccsr & FIFO_EMPTY) == 0)
  35.         i = dp->drcbuf;
  36.  
  37.     printf("\ntype <return> to interrupt ");
  38.     while (getchar() != '\n')
  39.         ;
  40.  
  41.     code = dr11(&ibuf, &obuf);
  42.  
  43.     printf("wc = %d code %d\n", ibuf.wc, code);
  44.  
  45.     printf("got from vax :\n");
  46.     for (i = 0; i < NW; ++i) {
  47.         printf("%o ", ibuf.data[i]);
  48.     }
  49.     zexit(0);
  50. }
  51.  
  52.  
  53. zexit(n)
  54. int n;
  55. {
  56.  
  57.     dp->drccsr = 0;
  58.     printf("\nexit %d\n", n);
  59.     halt();
  60. }
  61.