4 Computer-Programming-CS101
4 Computer-Programming-CS101
Fall 2015
Instructors:
Dr. Fawad Hussain, Dr. Rashad Jilani, Engr.
Ahmad Sohaib, Engr. Zawar Hussain, Engr.
Usman Raza & Dr. Ahmar Rashid.
Faculty of Computer Science and
Engineering
GIK Institute of Engineering Sciences and
Technology
Computer
Programming
Computer Programming
Computer
Low-level languages
High-level languages
Programming Language
Categorization
3GL, 4GL
2GL
1st Generation
Language [1GL]
HIGH-LEVEL
LANGUAGES
ASSEMBLY
LANGUAGE
MACHINE LANGUAGE
HARDWARE
LOW-LEVEL
LANGUAGES
Machine Language /
Machine Code
Machine Language /
Machine Code
Example
Add the registers 1 and 2. Place the result in
register 6.
[ op | rs | rt | rd | shamt | funct ]
0
1
2
6
0
32
decimal
000000 00001 00010 00110 00000 100000
binary
Assembly Language
Allows
Assembly Language
Example 1
Add 10 to the variable MARKS
ADD MARKS, 10
Example 2
Transfer the value 10 to the AL register
MOV AL, 10
High-level languages
C/C++, JAVA, BASIC and etc.
Example 1
Add 10 to the variable MARKS
MARKS = MARKS + 10;
Example 2
Assign the value 10 to the variable A, value 20 to variable B,
add them and store the results in variable C
A = 10;
B = 20;
C = A + B;
Next
Now