You are on page 1of 9

Presentation

Subject : Advanced Microprocessor

TOPIC:- Inline function and inline assembly


Department =Ec A1
Enrollment. No. =160130111015

Guided by :- Prof. Suhas Patel


INLINE FUNCTION

DEFINITION :

In C++, the functions that are not actually called


rather their code is expanded in line at the point of
each invocation such functions are called inline
functions
WHY IT IS NEEDED?
• Some important points about
inline function

• Inline functions are enhancement feature to


increase the execution time of a program.
• By using it we can eliminate the cost of calls
to small functions.
• Inline keywords sends a request not a
command to the compiler.
Inline assembler
 In computer programming an inline assembler is a
feature of some compilers that allows low level code
written in assembly language to embedded within a
program that has been compiled from a high level
language such as C.

 It is just a set of assembly instructions written as inline


functions.
CONDITIONS AND LIMITATIONS

 Function should not have any return statement.


 Function length should be short.
 It increases the executable size due to code expansion.
 It increases the executable size, which may cause
thrashing in memory.
Simple example :-

Void main ()

C=add(5,3) call

}
Int add (int x, int y) definition

Here the definition is inlined when the function


calls. It is a request so compiler can also ignore
it.

You might also like