home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Vectronix 2
/
VECTRONIX2.iso
/
FILES_10
/
DEVELOP.LZH
/
DSP
/
SAMPLES
/
SAMPLE.PC
< prev
next >
Wrap
Text File
|
1993-06-16
|
996b
|
36 lines
/* Sample program for working with the DSP */
/* */
/* Adapted to Pure C (Turbo C), W.F. Kilwinger, june '92 */
#include "tos.h"
#include "stdio.h"
#include "dspbind.h"
long ptemp;
long xavail,yavail;
long size;
void main(void)
{
int ret;
long *buffer;
Dsp_Available(&xavail,&yavail);
printf("Dsp_Avail call made\n");
printf("X available = %ld\n",xavail);
printf("Y available = %ld\n",yavail);
ret = Dsp_Reserve(100L,100L);
printf("Reserving 100L X and 100L Y memory\n");
printf("Return from Dsp_Reserve = %d\n",ret);
buffer = Malloc(1000L);
size = Dsp_LodToBinary("test1.lod",buffer);
printf("Calling Dsp_LodToBinary\n");
printf("Program size is %ld\n",size);
Dsp_ExecProg(buffer,size,1);
Dsp_DoBlock(0L,0L,&ptemp,1L);
ptemp = (ptemp >> 8);
printf("Program return value = %lX. \n",ptemp);
Bconin(2);
}