0% found this document useful (0 votes)
45 views

Programming Languages: Assembly Language High-Level Language

The document discusses programming languages at different levels of abstraction. Machine language uses binary code and is difficult for humans to read and modify. Assembly language uses mnemonic codes to make programming easier. High-level languages like C++ and Python use English-like syntax that is easy for humans to read and write. The document then provides examples of code in machine language, assembly language, and a high-level language to add two numbers.

Uploaded by

Huy Ứng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Programming Languages: Assembly Language High-Level Language

The document discusses programming languages at different levels of abstraction. Machine language uses binary code and is difficult for humans to read and modify. Assembly language uses mnemonic codes to make programming easier. High-level languages like C++ and Python use English-like syntax that is easy for humans to read and write. The document then provides examples of code in machine language, assembly language, and a high-level language to add two numbers.

Uploaded by

Huy Ứng
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 24

Programming Languages

Machine Language Assembly Language High-Level Language

Machine language is a set of primitive instructions built


into every computer. The instructions are in the form of
binary code, so you have to enter binary codes for various
instructions. Program with native machine language is a
tedious process. Moreover the programs are highly difficult
to read and modify. For example, to add two numbers, you
might write an instruction in binary like this:
 
1101101010011010

1
Programming Languages
Machine Language Assembly Language High-Level Language

Assembly languages were developed to make programming easy.


Since the computer cannot understand assembly language, however,
a program called assembler is used to convert assembly language
programs into machine code. For example, to add two numbers, you
might write an instruction in assembly code like this:
ADDF3 R1, R2, R3

2
Programming Languages
Machine Language Assembly Language High-Level Language

The high-level languages are English-like and easy to learn


and program. For example, the following is a high-level
language statement (C, C++, Java, Python) that computes
the area of a circle with radius 5:
area = 5 * 5 * 3.1415;

3
Popular High-Level Languages
Language Description

Ada Named for Ada Lovelace, who worked on mechanical general-purpose computers. The Ada
language was developed for the Department of Defense and is used mainly in defense projects.
BASIC Beginner’s All-purpose Symbolic Instruction Code. It was designed to be learned and used easily
by beginners.
C Developed at Bell Laboratories. C combines the power of an assembly language with the ease of
use and portability of a high-level language.
C++ C++ is an object-oriented language, based on C.
C# Pronounced “C Sharp.” It is a hybrid of Java and C++ and was developed by Microsoft.
COBOL COmmon Business Oriented Language. Used for business applications.
FORTRAN FORmula TRANslation. Popular for scientific and mathematical applications.
Java Developed by Sun Microsystems, now part of Oracle. It is widely used for developing platform-
independent Internet applications.
Pascal Named for Blaise Pascal, who pioneered calculating machines in the seventeenth century. It is a
simple, structured, general-purpose language primarily for teaching programming.
Python A simple general-purpose scripting language good for writing short programs.
Visual Visual Basic was developed by Microsoft and it enables the programmers to rapidly develop
Basic graphical user interfaces.

4
Interpreting/Compiling Source Code

A program written in a high-level language is called a source


program or source code. Because a computer cannot
understand a source program, a source program must be
translated into machine code for execution. The translation can
be done using another programming tool called an interpreter
or a compiler.

5
Interpreting Source Code
An interpreter reads one statement from the source code,
translates it to the machine code or virtual machine code, and
then executes it right away, as shown in the following figure.
Note that a statement from the source code may be translated
into several machine instructions.

6
Compiling Source Code

A compiler translates the entire source code into a machine-


code file, and the machine-code file is then executed, as
shown in the following figure.

7
Operating Systems

The operating system (OS) is a


program that manages and
controls a computer’s activities.
The popular operating systems
for general-purpose computers
are Microsoft Windows, Mac
OS, and Linux. Application
programs, such as a Web
browser or a word processor,
cannot run unless an operating
system is installed and running
on the computer.
8
Why Java?

The answer is that Java enables users to develop and deploy


applications on the Internet for servers, desktop computers, and
small hand-held devices. The future of computing is being
profoundly influenced by the Internet, and Java promises to
remain a big part of that future. Java is the Internet programming
language.

Java is a general purpose programming language.


Java is the Internet programming language.

9
Java, Web, and Beyond
 Java can be used to develop standalone
applications.
 Java can be used to develop applications running
from a browser.
 Java can also be used to develop applications for
hand-held devices.
 Java can be used to develop applications for Web
servers.

10
Java’s History

 James Gosling and Sun Microsystems


 Oak
 Java, May 20, 1995, Sun World
 HotJava
 The first Java-enabled Web browser
 Early History Website:

http://www.java.com/en/javahistory/index.jsp

11
Companion
Website
Characteristics of Java
 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted
 Java Is Robust
 Java Is Secure
 Java Is Architecture-Neutral
 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
www.cs.armstrong.edu/liang/JavaCharacteristics.pdf
12
Companion
Website
Characteristics of Java

 Java Is Simple Java is partially modeled on C++, but greatly


 Java Is Object-Oriented simplified and improved. Some people refer to
Java as "C++--" because it is like C++ but
 Java Is Distributed
with more functionality and fewer negative
 Java Is Interpreted aspects.
 Java Is Robust
 Java Is Secure
 Java Is Architecture-Neutral
 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic

13
Companion
Website
Characteristics of Java
 Java Is Simple Java is inherently object-oriented.
 Java Is Object-Oriented Although many object-oriented languages
began strictly as procedural languages,
 Java Is Distributed Java was designed from the start to be
 Java Is Interpreted object-oriented. Object-oriented
programming (OOP) is a popular
 Java Is Robust
programming approach that is replacing
 Java Is Secure traditional procedural programming
 Java Is Architecture- techniques.

Neutral One of the central issues in software


 Java Is Portable development is how to reuse code. Object-
oriented programming provides great
 Java's Performance
flexibility, modularity, clarity, and
 Java Is Multithreaded reusability through encapsulation,
 Java Is Dynamic inheritance, and polymorphism.
14
Companion
Website

Characteristics of Java
 Java Is Simple Distributed computing involves several
 Java Is Object-Oriented computers working together on a network.
Java is designed to make distributed
 Java Is Distributed computing easy. Since networking
 Java Is Interpreted capability is inherently integrated into
Java, writing network programs is like
 Java Is Robust sending and receiving data to and from a
 Java Is Secure file.
 Java Is Architecture-
Neutral
 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
15
Companion
Website
Characteristics of Java

 Java Is Simple You need an interpreter to run Java


programs. The programs are compiled into
 Java Is Object-Oriented the Java Virtual Machine code called
 Java Is Distributed bytecode. The bytecode is machine-
independent and can run on any machine
 Java Is Interpreted that has a Java interpreter, which is part of
 Java Is Robust the Java Virtual Machine (JVM).
 Java Is Secure
 Java Is Architecture-
Neutral
 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
16
Companion
Website
Characteristics of Java
 Java Is Simple Java compilers can detect many problems
 Java Is Object-Oriented that would first show up at execution time
in other languages.
 Java Is Distributed
 Java Is Interpreted Java has eliminated certain types of error-
 Java Is Robust prone programming constructs found in
other languages.
 Java Is Secure
 Java Is Architecture- Java has a runtime exception-handling
Neutral feature to provide programming support
 Java Is Portable for robustness.
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic

17
Companion
Website
Characteristics of Java
 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted Java implements several security
mechanisms to protect your system against
 Java Is Robust
harm caused by stray programs.
 Java Is Secure
 Java Is Architecture-
Neutral
 Java Is Portable
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
18
Companion
Website
Characteristics of Java
 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted
 Java Is Robust
 Java Is Secure
Write once, run anywhere
 Java Is Architecture-
Neutral With a Java Virtual Machine (JVM),
you can write one program that will
 Java Is Portable run on any platform.
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
19
Companion
Website
Characteristics of Java
 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted
 Java Is Robust
 Java Is Secure
 Java Is Architecture-
Because Java is architecture neutral,
Neutral Java programs are portable. They can
 Java Is Portable be run on any platform without being
recompiled.
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
20
Companion
Website
Characteristics of Java
 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted
 Java Is Robust
 Java Is Secure
 Java Is Architecture-
Java’s performance Because Java is
Neutral architecture neutral, Java programs
 Java Is Portable are portable. They can be run on any
platform without being recompiled.
 Java's Performance
 Java Is Multithreaded
 Java Is Dynamic
21
Companion
Website
Characteristics of Java
 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted
 Java Is Robust
 Java Is Secure
 Java Is Architecture-
Neutral
 Java Is Portable Multithread programming is smoothly
integrated in Java, whereas in other
 Java's Performance
languages you have to call procedures
 Java Is Multithreaded specific to the operating system to enable
 Java Is Dynamic multithreading.
22
Companion
Website
Characteristics of Java
 Java Is Simple
 Java Is Object-Oriented
 Java Is Distributed
 Java Is Interpreted
 Java Is Robust
 Java Is Secure
 Java Is Architecture-
Neutral Java was designed to adapt to an evolving
 Java Is Portable environment. New code can be loaded on the
fly without recompilation. There is no need for
 Java's Performance developers to create, and for users to install,
 Java Is Multithreaded major new software versions. New features can
be incorporated transparently as needed.
 Java Is Dynamic
23
JDK Versions
 JDK 1.02 (1995)
 JDK 1.1 (1996)
 JDK 1.2 (1998)
 JDK 1.3 (2000)
 JDK 1.4 (2002)
 JDK 1.5 (2004) a. k. a. JDK 5 or Java 5
 JDK 1.6 (2006) a. k. a. JDK 6 or Java 6
 JDK 1.7 (2011) a. k. a. JDK 7 or Java 7
 JDK 1.8 (2014) a. k. a. JDK 8 or Java 8
 …
24

You might also like