Computer Systems

10
University of Amsterdam Computer Systems – the instruction set Arnoud Visser 1 Computer Systems The instruction set architecture

description

Computer Systems. The instruction set architecture. Intel Processors. A stable platform for last decades: 8086 (1978) 8 bits 80186 (1980) 8 or 16 bits 80286 (1982) 16 bits 80386 (1985) 32 bits (33 MHz) Pentium 4 (2001) 32 bits (3.2 GHz). Intel Architecture 32-bit. - PowerPoint PPT Presentation

Transcript of Computer Systems

Page 1: Computer Systems

University of Amsterdam

Computer Systems – the instruction set architecture Arnoud Visser 1

Computer Systems

The instruction set architecture

Page 2: Computer Systems

University of Amsterdam

Computer Systems – the instruction set architecture Arnoud Visser 2

Intel Processors

• A stable platform for last decades:– 8086 (1978) 8 bits– 80186 (1980) 8 or 16 bits– 80286 (1982) 16 bits– 80386 (1985) 32 bits (33 MHz)– Pentium 4 (2001) 32 bits (3.2 GHz)

Page 3: Computer Systems

University of Amsterdam

Computer Systems – the instruction set architecture Arnoud Visser 3

Intel Architecture 32-bit

• Each processor was designed to be backward compatible

• Co-processor is been integrated

• Extra instructions are added for vector manipulation (MMX, SSE, AVX)

• Gcc didn’t use these instructions until version 3.1 (May 2002)

Page 4: Computer Systems

University of Amsterdam

Computer Systems – the instruction set architecture Arnoud Visser 4

ALU is still the core

• Unit that performs arithmetic / logic operations on two inputs

ALU

Y

X

X + Y

0

ALU

Y

X

X - Y

1

ALU

Y

X

X & Y

2

ALU

Y

X

X ^ Y

3

A

B

A

B

A

B

A

B

Page 5: Computer Systems

University of Amsterdam

Computer Systems – the instruction set architecture Arnoud Visser 5

Basic Knowledge

• Introduced in ‘Digitale Techniek’

Page 6: Computer Systems

University of Amsterdam

Computer Systems – the instruction set architecture Arnoud Visser 6

Timing

• For an subtraction, you needed three steps (automated with an sequencer)

Page 7: Computer Systems

University of Amsterdam

Computer Systems – the instruction set architecture Arnoud Visser 7

Micro-instructions

• The ‘invoer’ is moved from memory to two registers (a,d), followed by operation subl

int subtract(int invoer1, int invoer2){ return (invoer1 - invoer2);}

_subtract:pushl %ebpmovl %esp, %ebpmovl 12(%ebp), %edxmovl 8(%ebp), %eaxsubl %edx, %eaxpopl %ebpret

Register file

ALUALU

Gcc

-S

Page 8: Computer Systems

University of Amsterdam

Computer Systems – the instruction set architecture Arnoud Visser 8

Integer Arithmetic Operations

Of the 15 operations, we concentrate on 4 (Y86)

Instruction Effect Description

addl S,D D ← D + S Add

subl S,D D ← D - S Subtract

andl S,D D ← D & S And

xorl S,D D ← D ^ S Exclusive-orIncl D D ← D + 1 Increment

Sarl k, D D ← D >> k Arithmetic right shift

Page 9: Computer Systems

University of Amsterdam

Computer Systems – the instruction set architecture Arnoud Visser 9

Conclusion

• We understand know how the simplest of subroutines is translated in micro-instructions

int subtract(int invoer1, int invoer2)

{ return (invoer1 - invoer2);}

_subtract:pushl %ebpmovl %esp, %ebpmovl 12(%ebp), %edxmovl 8(%ebp), %eaxsubl %edx, %eaxpopl %ebpret

Gcc

-S

Page 10: Computer Systems

University of Amsterdam

Computer Systems – the instruction set architecture Arnoud Visser 10

Assignment

• Practice Problem 3.6

• ‘Calculate Word Index’(see Fig. 3.3 page 203)

Instruction Effect Description

leal S,D D ← &S Load effective address