0
1.3kviews
State the features of C-programming useful in Embedded system.
1 Answer
0
4views

High level language coding of source files in C has great advantage and therefore most programming is in high-level language. Basic features are as follows-

1. High-level program development cycle is short even for complex systems because

  • Use of routines
  • Standard library functions
  • Modular programming approach
  • Object-oriented design approach/ top-down design

a) A function defines

  • Method of operation
  • Sets of statements and commands that are run when function is called.

b) Library functions are readily available to programmer. The codes for them are not defined by the programmer. Example: squareroot(), delay(), wait(). Therefore, it saves programmer’s time for coding.

c) Modular programming approach

  • Reusable software components.
  • Components are built by set of function.
  • Example: IC has several circuits integrated into one, similarly module may call several functions and library functions.
  • It has only one calling method and one return point.

d) Top-down design: In this method main program is first designed, then its modules, sub-modules and finally the functions.

2. High-level program facilities data type declarations:

a) This provides ease of programming.

Example: There are 4 types of integers i.e. int, unsigned int, short and long. Therefore, to deal with only positive values declare a variable as unsigned int. Similarly to manipulate text and strings, the date type is char. For arithmetical calculations we use signed integer (32 bits) int.

b) Each data type is an abstraction for the methods, which are permitted for using, manipulating, representing and defining a set of permissible operations on data.

3. High-level program facilitates ‘type-checking’ therefore making program less prone to errors. Example, type-checking does not permit subtraction, multiplication and division on char data types.

4. High-level program facilitates use of control structures (while, do-while, break and for) and conditional statements (if, if-else, else-if and switch-case) to specify the program flow by simple statements.

5. High-level program language has portability of non-processor specific codes. When network changes, ISR module of drivers change, initialization and program-locator modules change and initial boot-up record changes. C is a language between low (assembly) and high-level languages.

Please log in to add an answer.