Author: red (05-036.026.popsite.net)
Date: 01-11-2002 00:28
Welcome aboard the DSP,
To get started, grab a DSP assembler from http://www.dhs.nu/files_code.jsp
I highly recommend QASM, also known as Quick DSP assembler. It doesn't come with an editor, but you can use it from Devpak 3.1 quite effectively! By installing QASM as a TOOL in Devpac-3 it can be called whenever you want, allowing the creation of both 68030 code and 56001 code from the same work environment. I used Devpac56001 when I first started and can say that it is slow and difficult to use (I never could figure out the macros). It is not worth using, though it does have a debugger which I use to test bits of code from time to time.
There are some DSP tutorials still up on the net, however, they (in my opinion) are no substitute for the manuals produced by Motorola (The DSP 56001 manual may still be up as a PDF file at Motorola's site)
For tutorials try:
http://tomas.nocrew.org/DSP/DSP-main.html
http://www.lysator.liu.se/~noring/DSP.html
anyone out there know of any better pages??
The big stumbling block I found when I first attempted writing DSP code was: how to load the .LOD (dsp object file) into the DSP, and how to communicate with the host (the 68030) once the code is executing.
QASM will generate a .LOD file. Then you can call the XBIOS to load it into the DSP.
For example (in Devpac):
Pea Buffer ;32K buffer for .LOD file
clr.w -(sp) ;ability=0
Pea LOD_filename ;.LOD file name
move.w #108,-(sp)
trap #14
lea 12(sp),sp
Buffer ds.w $4000
LOD_filename dc.b "mydsplod.lod",0
even
here's some more info on the call:
Opcode #108
status = Dsp_LoadProg(file, ability, buffer)
char *file;
int ability;
int status;
char *buffer;
Dsp_LoadProg loads (from disk) and executes a DSP LOD file. The file is in the ASCII LOD format. File should point to the name of the program file to be loaded into the DSP. The ability number can be set to any number, but should be set to the number given by the Dsp_RequestUniqueAbility call. Buffer should point to a block of memory where the loader can place the DSP code it generates (32k byte is usually enough). A 0 return value indicates a successful launch. A return value of -1 indicates an error occured
There are some host communication examples on one of the sites I listed above. Its important to use the host interface to send data periodically to the 68030 so that you can tell if your DSP code is working correctly. For example if you have code to multiply two numbers:
move X:numberA,x0
move X:numberB,x1
mpy x0,x1,a
move a,X:result
you may want to send the result down the host interface just so you can check the result. This is, of course, and simple example of DSP code, when it gets more complex, you will be thankfull for any information the DSP can send you so you can check that the code is running properly.
Not many people are coding on the DSP lately. I hope the info. i've provided will act as an encouragment for yourself, and anyone else, who wants to tap the Full potential of the weird and wonderfull atari Falcon!
-redspecter
|