User`s manual

Dynamic C Users Manual digi.com 331
If programs are executing on the target controller with the debugging instructions present, but without
Dynamic C attached, the call to the function that handles RST 28H instructions in the vector table will be
replaced by a simple ret instruction for Rabbit 2000 based targets. For Rabbit 3000 based targets, the RST
28H instruction is treated as a NOP by the processor when in debug mode. The target controller will work,
but its performance will not be as good as when the nodebug keyword is used.
If the nodebug option is used for the main() function, the program will begin to execute as soon as it fin-
ishes compiling (as long as the program is not compiling to a file).
Use the directive #nodebug anywhere within the program to enable nodebug for all statements follow-
ing the directive. The #debug directive has the opposite effect.
Assembly code blocks are nodebug by default, even when they occur inside C functions that are marked
debug, therefore using the nodebug keyword with the #asm directive is usually unnecessary.
17.2.2 In-line I/O
The built-in I/O functions (WrPortI(), RdPortI(), BitWrPortI() and BitRdPortI()) can be
generated as efficient in-line code instead of function calls. All arguments must be constant. A normal
function call is generated if the I/O function is called with any non-constant arguments. To enable in-line
code generation for the built-in I/O functions check the option “Inline builtin I/O functions” in the Com-
piler dialog, which is accessible by clicking the Compiler tab in the Project Options dialog.
17.3 Run-time Storage of Data
Data that will never change in a program can be put in flash by initializing it in the declarations. The com-
piler will put this data in flash. See the description of the const, xdata, and xstring keywords for
more information.
If data must be stored at run-time and persist between power cycles, there are several ways to do this using
Dynamic C functions:
User Block - Recommended method for storing non-file data. Factory-stored calibration constants live
in the User block for boards with analog I/O. Space here is limited to as small as (8K-
sizeof(SysIDBlock)) bytes, or less if there are calibration constants. For specific information
about the User block on your board, open the sample programs userblock_info.c and/or
idblock_report.c. The latter program will print, among other things, the location of the
User block.
Flash File System - The file system is best for storing data that must be organized into files, or data
that won’t fit in the User block. It is best used on a second flash chip. It is not possible to use a second
flash for both extra program code that doesn’t fit into the first flash, and the file system. The macro
USE_2NDFLASH_CODE must be uncommented in the BIOS to allow programs to grow into the sec-
ond flash; this precludes the use of the file system.
WriteFlash2 - This function is provided for writing arbitrary amounts of data directly to arbitrary
addresses in the second flash.