

Assemblers, Compilers, Linkers and LibrariansĪssemblers or (C-) Compilers translate the human readable source code into “hex code” that represents the machine instructions (op codes). For that reason a microcontroller’s firmware in machine readable form is also called Hex-Code and the file that stores that code Hex-File. Instead of writing opcodes in bits, they are commonly represented as hexadecimal numbers, whereby one hex number represents 4 bits within a byte, so it takes two hex numbers to represent 8 bits or 1 byte. A microcontroller’s instruction set is represented by “op codes.” Op codes are a unique sequence of bits (“0” and “1”) that are decoded by the controller’s instruction decode logic and then executed. Next the source code needs to be translated into instructions the microcontroller can actually execute. The penalty for more portable code and faster program development is a larger code size (20%…40% compared to assembler). A higher level language like C is for the most part independent of a microcontroller’s specific architecture, but still requires some controller specific extensions of the standard language to be able to control all of a chip’s peripherals and functionality.

Programming in assembler involves learning a microcontroller’s specific instruction set (assembler mnemonics), but results in the most compact and fastest code.

This source code is written with a standard ASCII text editor and saved as an ASCII text file. Software Code for a microcontroller is written in a programming language of choice (often Assembler or C).
