Ada: Difference between revisions

Jump to navigation Jump to search
m
Minor grammatical improvements
[unchecked revision][unchecked revision]
m (Minor grammatical improvements)
Line 1:
Ada is a strongly typed programming language that enjoys widespread useduse within the embedded systems and safety-critical software industry. It was originally developed under contract to the United States Department of Defense, as part of a project to develop a single unified language meeting the safety and reliability requirements of the department's embedded systems projects.
 
The language was first standardized in 1983, and has since undergone multiple revisions. The latest version is Ada 2012. The language itself is defined by the ISO standard [https://www.iso.org/standard/61507.html ISO/IEC 8652], and the Military standard MIL-STD-1815A. In 1991, the US Department of Defense mandated the use of Ada for all software, though exceptions to this rule were often granted. This mandate was effectively removed in 1997, as the DoD began to embrace 'commercial off the shelf' (COTS) technology. Similar requirements existed in other NATO countries for command and control systems, and Ada was the mandated or preferred language for defense-related applications in countries such as Sweden, Germany, and Canada.
Line 41:
=== Representation clauses ===
 
Ada allows for explicitly defining the in-memory representation of scalar and compound types. The following example demonstrates the definition of a record type ( equivalent to structures in C ), as well as its associated representation in memory.
 
<source lang="ada">
Line 160:
</source>
 
Contrast this with the same functionality implemented in C. Despite being shorter in length, the register cannot be altered without using bitwise operators to manipulate the individual fields. This approach is generally considered more error-prone than using a record in Ada overlaid at the register's memory-mapped address. It is possible to define a <tt>struct</tt> type in C with bit-fields for the individual elements, however the C standard does not guarantee the layout and order of the individual fields ( refer to section 6.7.2.1 paragraph 11 of the C1X standard ).
 
<source lang="c">
Line 183:
{
/** The UART control register pointer. */
volatile uint8_t *uart_control_reg = (uint8_t*)UART_CNTL_REG_ADDR;
 
// Configure the UART.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu