Search This Blog

Friday, June 8, 2012

Instruction Set - Preference of C over Assembly

Well we all know what instruction set is. An instruction set is a group of instructions a machine “understands“ to execute. So cutting to the chase, ATmega 16 has 131 different instruction. For the most efficient and fast execution of a given microcontroller, assembly language should be used. Assembly language is written to efficiently interact with a specific microcontroller’s resident hardware. One needs to learn assembly language instruction specific to the device to be effecient with programming the device in a assembly language program. But the only problem the program is not transferrable to other devices.

So we program in C, to increase the portability of program to similar architectural devices. Like to a whole AVR line devices we can use the same program written for ATmega16. When a C program is compiled during the software development process, the program is first converted to assembly language and then to the machine code for the specific microcontroller. We must emphasize that programming in C is not better than assembly language or vice versa. Both approaches have their inherent advantages and disadvantages. That we all know of.(assuming).

No comments:

Post a Comment