Sunteți pe pagina 1din 7

Programming languages

Nihar Ranjan Roy

Computer Programming languages


Machine language:
Sometimes referred to as machine code or object code, machine language is a collection of binary digits or bits that the computer reads and interprets. Machine language is the only language a computer is capable of understanding. It is a low-level programming language used to interface with computer hardware. Assembly language uses structured commands as substitutions for numbers allowing humans to read the code more easily than looking at binary. Although easier to read than binary, assembly language is still a complex language and often substituted for a higher language such as C.

Assembly language

Nihar Ranjan Roy

Computer Programming languages


High level languages
Usually machine-independent, sophisticated programming language that uses familiar English (or any human language) like syntax. In a HLL, each statement can represent several assembly language instructions that perform complex computing operations. It allows programmers to concentrate on application development without bothering with the underlying machine architecture.

Nihar Ranjan Roy

Generations of programming languages


first generation: machine language second generation: assembly language third generation: high-level programming languages, such as C,C++, and Java. Fourth generation (1970s-1990) (abbreviated 4GL) is a programming language or programming environment designed with a specific purpose in mind, such as the development of commercial business software. Example Visual Dataflex,Panther,Xbase++ e.t.c. fifth generation: languages used for artificial intelligence and neural networks.
Nihar Ranjan Roy 4

Assembler
MOV AX,5000H ; Initialize DATA SEGMENT MOV DS,AX ; to 5000H MOV AX,[1000H] ; take lower 16-bit of NUM1 in AX MOV BX,[2000H] ; take lower 16-bit of NUM2 in BX ADD AX,BX ; AX = AX + BX MOV [3000H],AX ; Store lower 16-bit result at NUM3 MOV AX,[1002H] ; take higher 16-bit of NUM1 in AX MOV BX,[2002H] ; take higher 16-bit of NUM2 in BX ADC AX,BX ; AX = AX + BX + CF (add with carry) MOV [3002H],AX ; Store higher 16-bit result at NUM3 HLT ; Halt 8086

A program which converts assembly language into machine code. This is a 8086 Assembly Language Program to add two 32-bit signed & unsigned number.

Assembly language are architecture dependent and have different set of instruction for different architecture

Nihar Ranjan Roy

Compiler
/* addition of 2 nos in c*/ #include<stdio.h> void main() { int i,j,k; puts(please enter two nos); scanf(%d%d,&i,&j); k=i+j; printf(sum=%d,k); } A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code). The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language . A program that translates from a low level language to a higher level one is a decompiler. A program that translates between high-level languages is usually called a language translator, source to source translator, or language converter.

Nihar Ranjan Roy

Interpreter
An interpreter converts high level language into machine level language like a compiler but A compiler converts whole source coded into machine language and then executes where as an interpreter does this line by line. A compiler compiles only once and then the file can be executed any number of times where as interpreter does these conversion again and again.

Nihar Ranjan Roy

S-ar putea să vă placă și