d75p 34 – hnc computer architecture week 11 a brief history of software. © c nyssen/aberdeen...

19
D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated Prepared 25/11/03

Upload: stephen-martin-austin

Post on 27-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

D75P 34 – HNC Computer Architecture

Week 11

A Brief History Of Software.

© C Nyssen/Aberdeen College 2003All images © C Nyssen/Aberdeen College except where statedPrepared 25/11/03

Page 2: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

In the very early days of computing, all programming could only be done in binary.

Coding programs in binary was slow, complex and error-prone and is seldom undertaken nowadays.

Even very junior programmers were highly qualified mathematicians and engineers.

Photo courtesy and © US Army Archives

Page 3: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

Because computer programming was so specialised, a method had to be found to make it more accessible.

Newly-invented computer “languages” enabled the programmer to write in more user-friendly code.

Compilers had to be developed to turn this code into machine-readable binary.

How does a Pascal program run?Photograph courtesy and © Micro Instrumentation and

Telemetry Systems Corp

Page 4: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

In 1960, mathematicians at the Pentagon helped develop the COBOL programming language.

This was one of the very first “high-level” languages, which is still in common use today.

Photo© and by permission of Hewlett-Packard Ltd.

But how does a text file of source code become a running program?

Page 5: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

Programmer transfers the design into appropriate programming language

Compiler checks the code for errors

If code is correct, compiler then creates a map and an object file

The object file is then linked, i.e. converted into machine-readable binary

Program can then be run!

Page 6: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

There are many programming languages available today. These vary in complexity and how close they are to human speech.

As a general rule, the closer a language is to English, the further away it gets from the native language of the computer – binary.

As languages move further and further away from binary, the computer has to work even harder to figure out what it is supposed to do!

Page 7: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

Some popular programming languages-

-and the degree of difficulty involved for each party!

COBOL (1960) Pascal (1970)Basic (1975)Visual Basic (1983)Java (1995)C# (C-sharp) (2000)

Page 8: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

As part of Outcome 3, we will analyse some source code written in a very “low-level” language – one that is very close to machine code.

This language is often called “Assembly Language” or more commonly, just “Assembler”.

.MODEL SMALL

.STACK 200H

.CODESTART:mov ax, 0003h int 10h

mov bx, 0b800hmov es, bx

mov bx,0mov ah, 1mov es:[bx], ah

mov ax, 0100hint 21h

mov ax, 4c00hint 21h

END START

Page 9: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

Before high-level languages were developed, computers could only be programmed in binary or assembler.

Assembly code programmers are still much sought after, however, for various reasons…

US Army lady programmers at the decommissioning of ENIAC in 1955.

Photo © and courtesy US Army.

Page 10: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

                                                      

Legacy programs – many large organisations still use huge software systems originally developed in assembly code

Compilers – high level languages have to be converted to machine-code at some point, so compilers are often written in assembly code

Device drivers – assembly code provides a high degree of control over the CPU and hardware, as the programmer can manipulate registers and RAM directly.

Page 11: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

Assembly code is very, very fast compared to high level languages. It also gives a high degree of control over resources, so these can be directly diverted to the graphics and sound cards.

Games programs are often written in high-level code such as C++ or Java, with sections of assembly code embedded in, to take full advantage of hardware control. This has been written in an object language

such as C++ with chunks of 80x86 thrown in.

Page 12: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

You will sometimes see software marketed as being “For PC only”, as these usually contain Intel-derived code which will only run on a PC.

High level languages are compiler-dependent. A Pascal or Java program will run on any platform, provided there is a compatible compiler installed.

Low level languages are processor-dependent. Assembly code written to run specifically on a Pentium, will not run on a Mac or StrongARM, as all processors use their own versions of assembly code.

Page 13: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

Every model of processor has it’s own list of assembly code instructions, that it can understand and respond to. This is called its Instruction Set.

There are two main types of processors available – those with a large set of complex instructions, and those with a smaller, more compact set. These two groups are called

CISC (Complex Instruction Set)

and

RISC (Reduced Instruction Set).

Page 14: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

All Intel Pentiums, clones and derivatives use an Intel 80x86 instruction set. Apple computers are based on a Motorola 68000 processor. Both of these are CISCs.

The Acorn-3000 series, Sun Sparcs and the latest StrongARM processors all use RISC chips.

The very newest processors, e.g. the Pentium 4, now incorporate elements of both architectures, and are often called CRISC chips.

Page 15: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

Both CISC and RISC instruction sets use certain “groups” of commands –

Load or Move - moves data into a specific register

#source code#

la $t1, stringdata xor $sp, $sp, $sploop:lb $t0, ($t1)beqz $t0 sub $sp, $sp, 4sw $t0, ($sp)add $t1,$t1,1j loopend:#and continue rest of program

#data#

stringdata :asciiz "Hello_Mum"

Arithmetic - adding and subtracting

Compare works like a Pascal “if” statement

Branch or Jump - for a loop structure

Interrupt - hands back control of the processor

Page 16: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

When a program is about to be run, it first loads into RAM. The CPU then fetches each instruction in turn,

analyses and executes it.

This is called the Fetch-Execute Cycle.

Page 17: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

How Windows Loads...

The BIOS boots up and does the POST. The BIOS then locates an operating system (usually on the

C:\ drive). The OS then gets loaded from the hard drive into the RAM. The CPU then starts to execute the OS program by carrying

out each instruction in turn.

Page 18: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

Summary [1]

Programming languages can be High Level or Low Level.

High Level languages are closer to the language of the programmer.

Low Level languages are closer to the language of the processor.

Each model of processor has its own instruction set. The assembly code used depends on which model of

processor will be used to run the program.

Page 19: D75P 34 – HNC Computer Architecture Week 11 A Brief History Of Software. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except

Summary [2]

High level languages are compiler-dependent. Low level languages are processor-dependent. Processors fall into two main groups – those using a

Complex, and those using a Reduced, instruction set. Programs about to be run are loaded into RAM. The CPU then retrieves each instruction in turn,

analyses and runs it.