# Rabbit Semiconductor

Rabbit Semiconductor is an American company which designs and sells the Rabbit family of microcontrollers and microcontroller modules. For development, it provides Dynamic C, a non-standard dialect of C with proprietary structures for multitasking.
Rabbit Semiconductor was purchased in 2006 by Digi International for $49 million. Before the purchase, Rabbit Semiconductor was a division of Z-World, Inc. Z-World developed and manufactured embedded controller products as well as embedded software development environments.

## Microcontroller architecture

The Rabbit processor family shares many features with the Zilog Z80/Z180 processors. For example, the registers of a Rabbit 2000/3000 processor are almost the same as the registers of a Z80/Z180 processor. The Rabbit 4000 processor expands to include the use of 32-bit registers. The instruction set of Rabbit processors also closely resembles the instruction set of the Z80/Z180 family. While the opcodes of many instructions are the same between the Rabbit 2000/3000 processors and Z80/Z180 processors, the two families of processors are not binary compatible. As with the Z80/Z180 family, the Rabbit processors are CISC processors.
The Rabbit processor family has unique features. For example, the Z80/Z180 family disables interrupts once an interrupt is serviced by an interrupt service routine. However, the Rabbit processors permit interrupts to interrupt service routines according to priorities (a total of 4).
Rabbit Semiconductor claims that the instruction set of Rabbit processors is optimized for C code.

## Dynamic C

Perhaps the most notable feature of the Rabbit microcontroller is its development environment. Dynamic C, a product of Rabbit Semiconductor, has additions, deletions and inconsistencies compared to the ANSI-C standard.
The Dynamic C IDE comes with extensive open-source libraries and sample code released under the MPL license or ISC license.

### Note

    (Reference: Porting a Program to Dynamic C-Rabbit Semiconductor)
   Dynamic C follows the ISO/ANSI C standard when feasible and desirable. Because the standard does not take into account the special needs of embedded systems, it is necessary to depart from the standard in some areas and desirable in others. The standard does not take into account important embedded systems issues such as read only memory and embedded assembly language. For this reason, practical compilers intended for embedded systems do not completely comply with the standard, but use it as a guide.
As an example of an addition, Dynamic C has a chaining mechanism to chain fragments of code from different subroutines to an arbitrary number of chains. This extension permits the use of not only initialized variables, but any arbitrary code to execute before a program starts execution in the main function.
As an example of a deletion, as of version 10.23 Dynamic C does not support block scope variables or bit fields. The development toolchain does not include a separate preprocessor and linker, which may complicate the process of porting existing programs to the compiler. As of version 10.64 block scope for variables is supported.
As an example of an inconsistency, Dynamic C implicitly treats all initialized global variables as if they were declared with the const qualifier. Furthermore, all const variables reside in flash memory. Earlier versions of Dynamic C did not check the use of the const keyword in parameters—it was possible to pass a const variable as a parameter to a function that did not expect it, potentially leading to attempts to write to flash memory. As of the latest version of Dynamic C, the compiler will produce an error when the user attempts to modify a const variable directly, and will produce a warning if the user discards the const qualifier when passing a parameter to a function.

### Multitasking constructs

One noteworthy feature of Dynamic C is its inclusion of language constructs to simplify multitasking. These constructs, the costate statement and the slice statement, implement a form of cooperative and preemptive multitasking, respectively. As an example, consider the following program which flashes two LEDs with different frequencies:
When this code is run, the first costatement will be executed, and the first LED will turn on. The costatement will then yield to the second statement while it waits for 100 milliseconds. The second costatement will execute in a similar manner. While both costatements are waiting for their time to elapse, the while loop will busy-wait, but this waiting time could potentially be used to perform other tasks. For more information, see the Dynamic C User's Manual.