User`s manual

12 digi.com Introduction to Dynamic C
2.2 Dynamic C Enhancements and Differences
Dynamic C differs from a traditional C programming system running on a PC or under UNIX. The reason?
To better help customers write the most reliable embedded control software possible. It is not possible to
use standard C in an embedded environment without making adaptations. Standard C makes many
assumptions that do not apply to embedded systems. For example, standard C implicitly assumes that an
operating system is present and that a program starts with a clean slate, whereas embedded systems may
have battery-backed memory and may retain data through power cycles. Rabbit has extended the C lan-
guage in a number of areas.
2.2.1 Dynamic C Enhancements
Many enhancements have been added to Dynamic C. Some of these are listed below.
Function Chaining, a concept unique to Dynamic C, allows special segments of code to be embedded
within one or more functions. When a named function chain executes, all the segments belonging to
that chain execute. Function chains allow software to perform initialization, data recovery, or other
kinds of tasks on request.
Costatements allow cooperative, parallel processes to be simulated in a single program.
Cofunctions allow cooperative processes to be simulated in a single program.
Slice Statements allow preemptive processes in a single program.
Dynamic C supports embedded assembly code and stand-alone assembly code.
Dynamic C has keywords that help protect data shared between different contexts (shared) or stored in
battery-backed memory (protected).
Dynamic C has a set of features that allow the programmer to make the fullest use of xmem (extended
memory). The compiler supports a 1 MB physical address space.
Normally, Dynamic C takes care of memory management, but there are instances where the program-
mer will want to take control of it. Dynamic C has keywords and directives to help put code in the
proper place, such as: root, xmem, and #memmap.
See Chapter 9 for further details on memory management.