home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_10 / DEVELOP.LZH / DSP / SAMPLES / SAMPLE.PC < prev    next >
Text File  |  1993-06-16  |  996b  |  36 lines

  1. /* Sample program for working with the DSP                       */
  2. /*                                                               */
  3. /* Adapted to Pure C (Turbo C), W.F. Kilwinger, june '92         */
  4.  
  5. #include "tos.h"
  6. #include "stdio.h"
  7. #include "dspbind.h"
  8.  
  9. long ptemp;
  10. long xavail,yavail;
  11. long size;
  12. void main(void)
  13. {
  14.    int ret;
  15.    long *buffer;
  16.  
  17.    Dsp_Available(&xavail,&yavail);
  18.    printf("Dsp_Avail call made\n");
  19.    printf("X available = %ld\n",xavail);
  20.    printf("Y available = %ld\n",yavail);
  21.    ret = Dsp_Reserve(100L,100L);
  22.    printf("Reserving 100L X and 100L Y memory\n");
  23.    printf("Return from Dsp_Reserve = %d\n",ret);
  24.    buffer = Malloc(1000L);
  25.    size = Dsp_LodToBinary("test1.lod",buffer); 
  26.    printf("Calling Dsp_LodToBinary\n");
  27.    printf("Program size is %ld\n",size);
  28.    
  29.    Dsp_ExecProg(buffer,size,1);
  30.    Dsp_DoBlock(0L,0L,&ptemp,1L);
  31.    ptemp = (ptemp >> 8);
  32.    printf("Program return value = %lX. \n",ptemp);   
  33.    Bconin(2);
  34. }
  35.  
  36.