User`s guide

Inline Assembly Language and Intrinsics
Intrinsic Functions
183Targeting MC56F83xx/DSP5685x Controllers
__mod_setint16( 0, getrandomint(), 0 );
__mod_error
Set up a modulo error variable. This function registers a static integer address to hold
the error results from any of the modulo buffer API calls. The function returns 0 if it is
successful, 1 otherwise. The argument must be the address of a static, global integer
variable. This variable holds the result of calling each of the previously defined API
functions. This allows the user to monitor the status of the error variable and take
action if the error variable is non-zero. Typically, the user would use __mod_error
during development and remove it once debugging is complete. __mod_error
generates no code, although the error variable may occupy a word of memory. A non-
zero value in the error variable indicates a misuse of the one of the API functions.
Once the error variable is set it is reset when __mod_stop is called. The error variable
contains the error number of the last error. A successful call to an API function will
not reset the error variable; only __mod_stop will reset the error variable.
Prototype
int __mod_error( int * <static_object_addr>);
Example
Register the error number variable
static int myerrno;
assert( __mod_error(&myerrno) == 0 ) ;
Modulo Buffer Examples
Listing 7.11 and Listing 7.12.are two modulo buffer examples.
Listing 7.11 Modulo Buffer Example 1
#pragma define_section DATA_INT_MODULO ".data_int_modulo"
/* Place the buffer object in a unique section so the it can be aligned
properly in the linker control file. */