04-01-2013, 11:38 AM
EMBEDDED PROGRAM AND SOFTWARE DEVELOPMENT PROCESS
EMBEDDED PROGRAM.pptx (Size: 645.36 KB / Downloads: 21)
Queues
Queue is an ADT data structure similar to stack, except that the first item to be inserted is the first one to be removed.
This mechanism is called First-In-First-Out (FIFO).
Placing an item in a queue is called “insertion”, which is done at the end of the queue called “rear”.
Removing an item from a queue is called “deletion”, which is done at the other end of the queue called “front”.
Some of the applications are : printer queue, keystroke queue, etc.
What is a stack?
Stores a set of elements in a particular order
Stack principle: LAST IN FIRST OUT
= LIFO
It means: the last element inserted is the first one to be removed
Example:
Stack Applications
Real life
Pile of books
Plate trays
More applications related to computer science
Program execution stack (read more from your text)
Evaluating expressions
Array-based Stack Implementation
Allocate an array of some size (pre-defined)
Maximum N elements in stack
Bottom stack element stored at element 0
last index in the array is the top
Increment top when one element is pushed, decrement after pop
Embedded programming in c++
Object oriented program language.
The codes C++ class RTCSWT.
Same name in Inherited class – Method overloading
Methods have same name and number – Method overriding
C++ operations execute in constant, measurable time
Reason for the need of Inline Function
Normally, a function call transfers the control from the calling program to the function and after the execution of the program returns the control back to the calling program after the function call.
These concepts of function save program space and memory space and are used because the function is stored only in one place and is only executed when it is called.
Inline Assembly
The most common methods for using assembly code fragments in a C programming project is to use a technique called inline assembly.
Inline assembly is invoked in different compilers in different ways. Also, the assembly language syntax used in the inline assembly depends entirely on the assembly engine used by the C compiler.
Microsoft C++, for instance, only accepts inline assembly commands in MASM syntax, while GNU GCC only accepts inline assembly in GAS syntax (also known as AT&T syntax).