Search The Web

Wednesday, December 28, 2011

Cissembly - where c and assembly meets I

 The world of software development has reached a stage where in merely writing the algorithm generates the code!.There are software which validates other software. But still the demand exists for low level language programing. Lot of firmwares are written using the c and assembly.
  
In my last post i have described how C++ is growing in embedded domain. But in this post i wold like to explain the combination of c and assembly language. Aim is to discuss how exactly we improve the performance by using C for fast development and assembly for fast execution.

Some of the basic thumb rules is to use assembly code to
1) Develop low level drivers which helps to improve the performance. And also helps to enjoy the specialized features the controller.

2) Use assembly code to develop software delays. We can go in the instruction execution cycle details of the data sheet to tune the timing.

3) If you want to decrease the foot print. But for that penalty is increased development time :P

4) Let the application layer in c as it is best idea for portability.

The cocktail of c and assembly language is known as Cissembly.  I love this language as I have coined this word at least!

source code structure may include in line assembly code. c might call a assembly routine or viceversa.
Data handling is a crusial thing because variable or memory access from assembly is out of the purview of the compiler. So if any overlaping occurs in data section then compiler cannot identify it.

To generate a good c and assembly language combination, developer needs to know following things
i) proper understanding of the compiler  especially the topics related to c and assembly
ii) function call conventions.

Please refer my upcoming post "Cissembly - where c and assembly meets II"



For any further information please feal free to mail at contact_ehobby@gmail.com -eguru

No comments:

Post a Comment