Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Lecture 2 High Level vs Low Level Languages

Lecture 2 High Level vs Low Level Languages



|Views: 14,832|Likes:
Published by api-3739389

More info:

Published by: api-3739389 on Oct 15, 2008
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





 Prepared by: Khurram Tanvir 
CS203 HO#2
Kingdom of Saudi Arabia
 دا ا ا 
Royal Commission at Yanbu
 ا ا 
University College – Yanbu
 ا ا-
Department of ACS & AIT
Yanbu Al-Sinaiyah
 ا  
Semester 2007-08
1. Programming Languages
Languages are used to communicate between different entities. Computer languagemakes it possible to talk to the computers and ask the computer to perform specificwork. Computer language produces programs which are executed by CPU, and thenCPU instructs all the other parts of computers to perform work accordingly. Computersonly understand programs in their own machine language. Machine language is thelanguage of 0’s and 1’s. It is difficult to write program in machine language so what is thesolution to this dilemma? The answer is in what are called high-level languages i.e.Computer programming languages that look like natural language.
2. High-Level Languages (HLL)
HLLs are programming languages that look like natural language text. Their advantagesare:1. They make programming easier and more abstract, i.e. the programmer does notneed to come up with the detailed machine instructions2. HLL programs are machine independent. They can run on different hardwareplatforms (i.e. different computers with different instruction sets):To run a HLL program on a specific machine, it has to be translated to its machinelanguage. This is done through the use of a compiler. A Compiler is a program thattranslates a HLL program to a machine language program of a specific platform. TheMachine language program produced by the compiler is usually referred to as theexecutable program. Hence by using the appropriate compiler we can execute our HLLprograms on any platform.
 Prepared by: Khurram Tanvir 
CS203 HO#2
2.1 Mapping Between HLL and Machine Language
Translating HLL programs to machine language programs is not a one-to-one mapping.A HLL instruction (usually called a statement) will be translated to one or more machinelanguage instructions. The number of mapped machine instructions depends on theefficiency of the compiler in producing optimized machine language programs from theHLL programs. A machine language program produced by a compiler or an assembler.Usually, machine language programs produced by compilers are not efficient (i.e. theycontain many unnecessary instructions that increase processing and slow downexecution).
3. Assembly language
Assembly language is the most basic programming language available for anyprocessor. With assembly language, a programmer works only with operationsimplemented directly on the physical CPU. Assembly language lacks high-levelconveniences such as variables and functions, and it is not portable between variousfamilies of processors. Nevertheless, assembly language is the most powerful computer programming language available, and it gives programmers the insight required to writeeffective code in high-level languages.Machine code for displaying $ sign on lower right corner of screen.10111000, 00000000, 10111000, 10001110, 11011000, 11000110, 00000110,10011110, 00001111, 00100100, 11001101, 00011111The program above, written in assembly language, looks like this:MOV AX, 47104MOV DS, AXMOV [3998], 36INT 32
 Prepared by: Khurram Tanvir 
CS203 HO#2
When an assembler reads this sample program, it converts each line of code into oneCPU-level instruction.
3.1 Advantages of learning Assembly language
1. Very useful for making efficient and fast running programs.2. Very useful for making small programs for embedded system applications.3. Easy to access hardware in assembly language4. Writing compact code.
4. The Compiler
Compiler is a program that translates the high level programs to machine code either directly or via assembler.

Activity (28)

You've already reviewed this. Edit your review.
Lakshan Silva added this note
Fine material (y)
Lakshan Silva liked this
Jia Yi Chew liked this
1 thousand reads
1 hundred reads
Ryan Rev Barley liked this
Sanjay Kumar Sharma added this note
very nice
Ryan Rev Barley liked this
Dipendra Khadka liked this

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->