Hey Everyone, I am Vikram Salunke and welcome to the x86 Assembly Course.

Working with High Level Lanaguge

working with high level lanaguge

We will start with the Working with High Level Language.
The high level languages are C, C++, Java etc.
We have a Source Code file named Example.c
C Preprocessor will preprocessed that file and Example.i file will be generated.
After that C Compiler will convert that file into assembly code file and Example.s file will be generated.
After that Assembler will convert that file into Object Code file and then Example.o file will be generated.
After that Linker with the help of other object code file, and objet code libraries will convert that file into a executable file such as Example.exe

When Executing a Program

when executing c program

When you execute a program that Example.exe file is currently stored in Secondary storage such as Hard Disk Drive (HDD).
Then when you execute that program the Loader will load Runtime objects, modules and libraries and that file will be load into the Main Memory known as a RAM and the file will be allocated a process address space.

Hello World

Now we will look at the C Programming Basics
We will start with the Hello World program.
To perform exercises we need Windows XP. I have installed Windows XP on VMWare platform. You can use VMWare or VirtualBox and then install Microsoft Visual Studio 2008 Express Edition with C++.
So, we will look at the Hello World program.

hello world program

This is Hello World program. Let's look at what is happening there.
The first line is #include stdio.h
This is a preprocessor command, which tells C compiler to include stdio.h files before going to actual compilation.
After that int main(){ that means main function where program execution begins and { tells compiler that main() program's body started.
Then next statement is printf("Hello World!\n"); this function is available in C in stdio.h file which causes Hello World to be displayed on a screen.
Then next statement is return 0; } that means it is telling that to terminate main() function and return value 0.

Now we will run this program
To run this program we need to click Build -> Build Solution
As we can see we have successfully compiled the program.
Now let's run it using this play symbol. The program has been executed successfully but we didn't see any output.
Why ? Because program exited with return value 0.
So what we will do? We will place a breakpoint before main() ends.
What is a breakpoint? The breakpoint means when we click here, the program will stop executing here. So, we can see the result.
Click on play icon. After that click on this. And as we can see Hello World! has been printed on a screen.

C Programming Basics

Now let's look at some C Programming basics
[+] ; is statement terminator that means this statement has been ended and now new statement will start.
[+] /* this is comment */ means whatever we written inside this will be ignored by a complier. So this is a comment is ignored by compiler and will not be processed.
[+] C is a case-sensitive so abc is different than Abc.
[+] int,break, if ... there are some keywords in C language which we can't use as a constant or a variable.
[+] \n for new line.

Data Types

So, now let's look at the Data Types.
Data Types is used for declaring variables of functions of a different types.
Type of a variable determines how much space occupies in storage and how the bit pattern is interpreted.
Type of a function specifies the type of the function's return value
The data type we have already seen in int it is for integer - a whole number. It is generally 2 or 4 bytes

Variables

Now, let's look at the variables
What is a variable?
A variable is a name given to storage area
variable has specific type which determines the size and layout of variable's memory and set of operations that can be applied to the variable.
This is the way we can define the variable

type variable = value;

this is a example of a variable

int num1;

or we can initialised the variable using other formats such as

int num2 = 0 ;

If you want to join our in person class then please click here we are doing trainings in some upcoming InfoSec conferences.
And if you have any doubts, any questions then you can tweet me @vikramsalunke20
We are uploading daily new videos on YouTube click here to subscribe.
If you want to solve the exercises on this topic those are below. Solve the exercises and check your understandings. Thank you :)