Motorola DSP Developer's Kit | ![]() ![]() |
DSP56K Assembly or C-code
An associated assembly or C-code binary file you create is loaded into the simulator when the MEX-file is executed. It is possible to select from more than one binary at run-time, based on, for example, function input data types.
The restrictions on the DSP assembly are:
BEGIN
and END
labelsThe simulator starts execution of DSP instructions at BEGIN
and terminates when it reaches the END
address.
The name of any global variable in a C-code source file is translated to a symbol/label. This allows the MEX file to run object code independently, whether compiled from an assembly or a C-language source file.
int IN;
may be equivalent to the assembly code
org x:$0
IN
MEX-File
Use the supplied template as the basis for writing your own MEX-files. Simply add details about your particular function, as explained in the remainder of this chapter.
Use all of the standard features provided by the MATLAB API for C MEX-files, including calling any mx
and mex
routines where appropriate.
Locations in the supplied template files that must be modified for individual functions lie between
* *********** START USER CODE SECTION ***********
* *********** END USER CODE SECTION ***********
comment blocks. Code outside these blocks should remain unchanged.
Simulator Command File
You can optionally provide a DSP Simulator command file to control the execution of the simulator itself, just as you would if running the simulator outside the MATLAB environment. Ensure that each simulator command line is followed by a carriage return.
If a command file contains any load
and device
commands, these take precedence over the assembly or C binary and device type supplied within the MEX-file when the simulator object is created (see Instantiating the Simulink DSP Simulator).
![]() | What the DSP Developer's Kit Provides | MATLAB MEX-Files | ![]() |