Semester : SEMESTER 6
Subject : Embedded System
Year : 2018
Term : MARCH
Scheme : 2015 Full Time
Course Code : EC 308
Page:31
Ox2FA: Byte at IER; 0x2FB: Byte at LCR;
Ox2FC: Byte at MCR;
Ox2FD: Byte at LSR; 0x2FE: Byte at MSR
Ox2FF: Byte Dummy Character
* Example- structure 510
* Eight characters- Seven for thebytes in BR/THR/DLATCHLByte,IER, IR, LCR, MCR,
LSR,
Use of functions
(i) Passing the Values (elements):
The values are copied into the arguments of the functions. When the function is executed in
this way, it does not change a variable’s value at the function, which calls new function.
(ii) Passing the References
When an argument value to a function passes through a pointer, the called function can
change this value. On returning from this function, the new value may be available in the
calling program or another function called by this function.
Use of Reentrant Function
* Reentrant function- A function usable by the several tasks and routines synchronously (at
the same time). This is because all the values of its argument are retrievable from the stack.
Three conditions for a function called as reentrant function
1. All the arguments pass the values and none of the argument is a pointer (address) whenever
a calling function calls that function.
2. When an operation is not atomic, that function should not operate on any variable, which
is declared outside the function or which an interrupt service routine uses or which is a
global variable but passed by reference and not passed by value as an argument into the
function. [The value of such a variable or variables, which is not local, does not save on
the stack when there is call to another program.]
3. That function does not call any other function that is not itself Reentrant.
Data Structures: Arrays
* Array: A structure with a series of data items sequentially placed in memory
(i) Each element accessible by an identifier name (which points to the array) and an index, i
(which define offset from the first element)