Constant value is understandable as non changeable value like PI=3.141592... value in math. Usually you use constants in your programs, but don't realize that they are constants. For instance:
x=x+3; The number 3 is a constant which will be compiled directly in addition operation. Constants can be character or string. Like in function printf(“Hello World\n”); “Hello World” is a string constant which is placed in program memory and will never changes.
It is usually recommended to declare constants by using identifier with reserved word const:
What are variables in C language. Variables are simple keywords which are defined by the values. Values can be changed. Variables are like a boxes with some size where values like apples can be put in. So variables can be various forms and sizes so called variable types.
Variable type is defined by a reserved word which indicates the type and size of variable identifier:
unsigned char my_char;
long int all_my_numbers;
int number;
Why do we need variables? The basic answer is that memory is limited and compiler needs to know much space to reserve for each variable. So the programmer needs to specify the variable type and its size by using one of reserved words from the table:
C language is function based programming language. C program itself is a function. Usually parameters to C function are passed as arguments. Function consists of a name followed by the parentheses enclosing arguments or an empty pair of parentheses if there are not arguments required. If there are several arguments, they are separated by commas.
The mandatory part in C program is main function. This function must be included in every program because this is a first function which is run after execution of program.
ASM is a specific language as it is a low level programming language. It is mnemonics to a mashine codes. It takes tons of time to develop embedded programs in ASM language. Now even 8 bit microcontrollers are more capable as they were earlier. The program memories are going up to megabyte(s). Programs becoming more complex, functionality grows up. This is one reason to use higher level programming languages like C.
If using C language you do not have to go into details how processor works. You don't have to think about hardware logic. It is better to leave this work to C compiler which may help you to avoid bugs in silicon level.