1. What Is an Assembly Language?
An assembly language is a type of low-level programming language that is intended to communicate directly with a computer's hardware. Unlike machine language, which consists of binary and hexadecimal characters, assembly languages are designed to be readable by humans.
Low-level programming languages such as assembly language are a necessary bridge between the underlying hardware of a computer and the higher- level programming languages - such as Python or JavaScript-in which modern software programs are written.
1. An assembly language is a type of programming language that translates high-level languages into machine language.
2. It is a necessary bridge between software programs and their underlying hardware platforms.
3. Today, assemble languages are rarely written directly, although they are still used in some niche applications such as when performance requirements are particularly high.
2. What is pre-processor in embedded system?
The C pre-processor is a macro processor that is used automatically by the C compiler to transform your program before actual compilation (Pre-processor directives are executed before compilation.). It is called a macro processor because it allows you to define macros, which are brief abbreviations for longer constructs. A macro is a segment of code which is replaced by the value of macro. Macro is defined by #define directive.
Pre-processing directives are lines in your program that start with #. The # is followed by an identifier that is the directive name. For example, #define is the directive that defines a macro. Whitespace is also allowed before and after the #.
The # and the directive name cannot come from a macro expansion. For example, if foo is defined as a macro expanding to define, that does not make #foo a valid pre-processing directive.
List of pre-processor directives:
1. #include
2. #define
3. #undef
4. #ifdef
5. #ifndef
6. #if
7. #else
8. #elif
9. #endif
10. #error
11. #pragma
3. What are the C program elements in embedded.
(i) Header file:
1. A file with extension.h
2. It contains C function declarations and macro definitions to be shared between several source files.
3. There are two types of header files: files that programmer writes and files that come with compiler.
4. It is a simple practice in C or C++ programs to keep all constants, macros, system wide global variables and functions prototype in header file and include that header file whenever it is required.
5. Example:
#include <stdio.h>
Here
#include. Preprocessor directive to call header file <stdio.h>
(ii) Macros:
1. It is a collection of codes that is defined in C program by a name.
2. It differs from function in sense that once a macro is defined by a name, the compiler will put the corresponding codes for it at every place where that macro name appears.
3. Advantages of using macro are that the speed of execution of program increases. There is a decrease in the length of the program. Also there is a decrease in errors caused by repetitive coding.
3. What are the features of embedded C++?
It is a dialect of the c++ programming language for embedded systems. It was defined by an industry group led by major japanese CPU manufacturers. Embedded Cis Procedure Oriented Programming and Embedded C++ is Object Oriented Programmimg(OOP). C++ is an object oriented programming language which encapsulates multiple datatype in one user-defined data type which is called class.
In many embedded system designs today, programmers can leverage all the features of C++ such as classes, templates, exception handling, and class inheritance that have proven so useful for mainstream computer applications. Some of these C++ features, however, bloat the compiled code significantly increasing memory requirements while reducing execution speed. A new C++ dialect called Embedded C++ (EC++) has been developed by an industry standards committee to address the limitations of C++ in some embedded applications where memory is limited and 32-bit processors are prevalent. EC++ proposes to maintain the most valuable C++ concepts while eliminating those most responsible for boosting memory requirements and reducing efficiency. Ideally, designers will be able to choose whether to use EC++, C++, or a hybrid of the two to match specific application
Post a Comment
0 Comments