The various steps involved in conversion of a program written in C to a corresponding binary file. Machine language is illustrated in the figure above:
- An integrated development environment provides a text editor for creating and saving the source file. The source file is saved with .c extension Most of the high level languages support modular programming approach and hence multiple source files can be included.
- Translation of high level source code to an object file is done using a cross-compiler. It should be noted that each high level language for same target processor are different.
- Different libraries used in the project must also be included.
- The linker/locator is another software utility responsible for linking the various object modules in a multi-module project and assigning absolute address to each module.
- Object to hex file converter converts the assembly language gauge to machine understandable language. Hex file is the representation of the machine code and the hex file is dumped into the code memory of the processor/controller.
Type |
Storage size |
Value range |
char |
1 byte |
-128 to 127 or 0 to 255 |
unsigned char |
1 byte |
0 to 255 |
signed char |
1 byte |
-128 to 127 |
int |
2 bytes |
-32,768 to 32,767 |
unsigned int |
2 bytes |
0 to 65,535 |
short int |
1 byte |
-128 to +127 |
unsigned short int |
1 byte |
0 to 255 |
long,int |
4 bytes |
-2,147,483,648 to 2,147,483,647 |
unsigned long int |
4 bytes |
0 to 4,294,967,295 |