home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / PC_V11_B.LZH / DEMO_PC / TESTIO.C < prev    next >
C/C++ Source or Header  |  1992-07-16  |  934b  |  46 lines

  1. #include "osbind.h"
  2. #include "f:\dspspar\rev21\tsr\dspbind.h"
  3.  
  4. int dummy;
  5. long outl;
  6. int  outi;
  7. char outc;
  8.  
  9. long i;
  10. int  j;
  11. char k;
  12. long buffer;
  13. main()
  14. {
  15.    buffer = Malloc(5000L);
  16.    printf(" This program sends 5 numbers from 10 - 18 to the DSP to be\n");
  17.    printf(" divided in half.  Expected output = 5,6,7,8,9\n\n");
  18.  
  19.    Dsp_LoadProg("divby2.lod",3,buffer);
  20.    
  21.    printf("Send/receive unpacked longs\n");
  22.    for(i = 10; i < 20;i+=2)
  23.    {
  24.      Dsp_BlkUnpacked(&i,1L,&outl,1L);
  25.      printf("output = %D\n",outl);
  26.    }
  27.    Bconin(2);
  28.  
  29.    printf("Send/receive unpacked signed words\n");
  30.    for(j = 10; j < 20;j+=2)
  31.    {
  32.      Dsp_BlkWords(&j,1L,&outi,1L);
  33.      printf("output = %d\n",outi);
  34.    }
  35.    Bconin(2);
  36.  
  37.    printf("Send/receive unpacked unsigned chars\n");
  38.    for(k = 10; k < 20;k+=2)
  39.    {
  40.      Dsp_BlkBytes(&k,1L,&outc,1L);
  41.      printf("output = %d\n",outc);
  42.    }
  43.    Bconin(2);
  44.  
  45. }
  46.