User`s guide

Inline Assembly Language and Intrinsics
Intrinsic Functions
179Targeting MC56F83xx/DSP5685x Controllers
__mod_setint16
__mod_error
__mod_init
Initialize a modulo buffer pointer with arbitrary data using the address specified by the
<addr_expr>. This function expects a byte address. <addr_expr> is an arbitrary C
expression which normally evaluates the address at the beginning of the modulo
buffer, although it may be any legal buffer address. The <mod_desc> evaluates to a
compile time constant of either 0 or 1, represented by the modulo pointers R0 or R1,
respectively. The <mod_sz> is a compile time integer constant representing the size of
the modulo buffer in bytes. The <data_sz> is a compile time integer constant
representing the size of data being stored in the buffer in bytes. <data_sz> is usually
derived from the sizeof() operator.
The __mod_init function may be called independently for each modulo pointer
register.
If __mod_error has not been previously called, no record of __mod_init errors are
saved.
If __mod_error has been previously called, __mod_init may set one of the error
condition in the static memory location defined by __mod_error. (See __mod_error
description for a complete list of error conditions).
Prototype
void __mod_init (
int <mod_desc>,
void * <addr_expr>,
int <mod_sz>,
int <data_sz> );
Example
Initialize a modulo buffer pointer with a buffer size of 3 and where each element is a
structure: