programming languages first generation languages (machine language) we actually have to do a few...

11
Programming Languages First Generation Languages (Machine Language) We Actually have to do a few things. First we have to find the operating code, or op code (by number) to move the data (let’s assume the command is number 28) Of course, we have know the identifying number for each of the registers (assume R1 = 12; R2 = 13) Finally, we have to find the op code for addition (Assume it is 37). The code I enter might be: 28 2 12; 28 3 13; 37 12 13 13; (Well, Kind of – It’s a little more involved) A brief overview of software evolution

Upload: melvin-fowler

Post on 30-Dec-2015

216 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

Programming Languages

First Generation Languages (Machine Language) We Actually have to do a few things.

First we have to find the operating code, or op code (by number) to move the data (let’s assume the command is number 28)

Of course, we have know the identifying number for each of the registers (assume R1 = 12; R2 = 13)

Finally, we have to find the op code for addition (Assume it is 37).

The code I enter might be:28 2 12;28 3 13;37 12 13 13;

(Well, Kind of – It’s a little more involved)

A brief overview of software evolution

Page 2: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

Programming Languages

First Generation Languages (Machine Language)

Let’s not forget that the computer is just a series of light-switches (binary). Therefore we need to convert our decimal values to binary:

2 = 000000000000010 (on 16-bits)3 = 000000000000011 (on 16-bits)12 = 00001100 (on 8-bits)13 = 00001101 (on 8-bits)28 = 00011100 (on 8-bits)37 = 00100101 (on 8-bits)

Therefore, We would enter the commands:

00011100 000000000000010 00001100;00011100 000000000000011 00001101;00100101 00001100 00001101 00001101;

MITS Altair

Page 3: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

Programming Languages

Second Generation Languages (Assembly – c1948)

The advancement over machine level languages was that it was mnemonic (assisting or intended to assist the memory)

We did not need to know the specific register addresses

We did not need to know the op codesFor the previous example, the code we enter might be:

MOV 2 R1;MOV 3 R2;ADD R1 R2 R2;

An Assembler would then transfer the commands into a machine level language

Page 4: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

Programming Languages

Third Generation Languages (mid - late 1950’s)

The advancement over assembly level languages was that programmers did not need to know either the op codes nor the registers used • Specific locations in RAM were referred to by a user

defined name• The compiler or interpreter, as well as the operating

system, kept track of the specific locations

• For the previous example, the code we enter might be:

X = 2 + 3 (FORTRAN)

The code would then be rewritten as either an assembly language code or directly to a machine level language

Page 5: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

Programming Languages

Third Generation Languages (mid – late1950’s) In the above example ‘X’ is a specific location in

RAM, although we don’t have to know where it is

• It is usually referred to as a variable

• Although it can be a constant

• Meaning that we can change the contents of the location as we wish

• Meaning that once we set its value, it can not be changed

Either way, the address is assigned by the operating system at run time and managed by the compiled program (i.e., the machine-level program)

Page 6: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

Programming Languages

Comparison of COBOL and FORTRAN (Hello World)

COBOL (COmmon Business-Oriented Language)

• 001 IDENTIFICATION DIVISION.• 002 PROGRAM-ID. 'HELLO'.• 003 ENVIRONMENT DIVISION.• 004 CONFIGURATION SECTION.• 005 SOURCE-COMPUTER. IBM-360.• 006 OBJECT-COMPUTER. IBM-360.• 0065 SPECIAL-NAMES.• 0066 CONSOLE IS CNSL.• 007 DATA DIVISION.• 008 WORKING-STORAGE SECTION.• 009 77 HELLO-CONST PIC X(12) VALUE 'HELLO, WORLD'.• 075 PROCEDURE DIVISION.• 090 000-DISPLAY.• 100 DISPLAY HELLO-CONST UPON CNSL.• 110 STOP RUN.

• Intended to process large amounts of data as a batch

• Edsger Dijkstra, winner of the Turing Award remarked that "The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offense."

Page 7: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

Programming Languages

Comparison of COBOL and FORTRAN (Hello World)

FORTRAN (FORmula TRANslation)

PROGRAM MAIN PRINT *, 'HELLO WORLD' STOP END

• Intended as a ‘Scientific Language’

• It is one of the most popular languages in the area of high-performance computing and is the language used for programs that benchmark and rank the world's fastest supercomputers.

Page 8: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

An Overview of the C/C++ Programming Languages

Page 9: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

Overview of the C Programming Language

• Developed in 1978 at Bell Labs by Kernighan & Ritchie after A & B failed

• Associated with UNIX • Developed on UNIX Systems • UNIX and its software are written in c• Intended as general purpose Language• Basically a primitive language: 34 (28 original) Key words:

auto break case char const continue

default do double else enum extern

float for gotoifintlong

register

return short

while signed

sizeof static struct switch typedef

union unsigned void volatile

new

release

Page 10: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

• Developed by  Bjarne Sroustrup  at Bell Labs during 1983-1985.

and and_eq asm bitand bitor catch class const_cast continue

default delete dynamic_cast explicit export falsefriendinlinemutable

namespace not not_eq operator or or_eq private protected public

reinterpret_cast template this throw true

• C++ is an extension of C. • Prior to 1983, Stroustrup added features to C

and formed what he called "C with Classes". • In 1983 the use of classes and object-oriented features with the

power and efficiency of C. The term C++ was first used in 1983.

• Additional C++ Reserved Words

try typeid typename using

virtual wchar_t xor xor_eq

40 Additional; 74 Total

Overview of the C++ Programming Language

Page 11: Programming Languages  First Generation Languages (Machine Language)  We Actually have to do a few things. First we have to find the operating code,

Overview of the C++ Programming Language

Computer languages rooted in C:

“Many later languages have borrowed directly or indirectly from C, including D, Go, Rust, Java, JavaScript, Limbo, LPC, C#, Objective-C, Perl, PHP, Python, Verilog (hardware description language),[4]and Unix's C shell. These languages have drawn many of theircontrol structures and other basic features from C. Most of them (with Python being the most dramatic exception) are also verysyntactically similar to C in general, and they tend to combine the recognizable expression and statement syntax of C with underlying type systems, data models, and semantics that can be radically different. C++ and Objective-C started as compilers that generated C code; C++ is currently nearly a superset of C,[10] while Objective-C is a strict superset of C.[11]”

http://en.wikipedia.org/wiki/C_(programming_language)