Modulo Addressing Error Codes

To register a static variable for error-code storage, use __mod_error(). If an error occurs, this static variable will contain one of the values the following table explains.

Table 1. Modulo Addressing Error Codes
Code Meaning
11 <mod_desc> parameter must be zero or one.
12 R0 modulo pointer is already initialized. An extraneous call to __mod_init or __mod_initint16 to initialize R0 has been made.
13 R1 modulo pointer is already initialized. An extraneous call to __mod_init or __mod_initint16 to initialize R1 has been made.
14 Modulo buffer size must be a compile time constant.
15 Modulo buffer size must be greater than one.
16 Modulo buffer size is too big.
17 Modulo buffer size for R0 and R1 must be the same.
18 Modulo buffer data types for R0 and R1 must be the same.
19 Modulo buffer has not been initialized.
20 Modulo buffer has not been started.
21 Parameter is not a compile time constant.
22 Attempt to use word pointer functions with byte pointer initialization. __mod_getint16 and __mod_setint16 were called but __mod_init was used for initialization. __mod_initint16 is required for pointer initialization.
23 Modulo increment value exceeds modulo buffer size.
24 Attempted use of R1 as a modulo pointer without initializing R0 for modulo use.

The following table lists the error codes possible for each modulo addressing intrinsic function.

Table 2. Possible Error Codes
Function Possible Error Code
__mod_init 11, 12, 13, 14, 15, 16, 17, 18, 21
__mod_stop none
__mod_getint16 11, 14, 20, 22, 24
__mod_setint16 11, 14, 20, 22, 24
__mod_start none
__mod_access 11, 19, 20, 24
__mod_update 11, 14, 20, 23, 24
__mod_initint16 11, 12, 13, 14, 15, 1 6, 17