DOC PREVIEW
CMU CS 15213 - Lecture

This preview shows page 1-2-3-4 out of 11 pages.

Save
View full document
Premium Document
Do you want full access? Go Premium and unlock all 11 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

IA32 Processors 15 213 Totally Dominate Computer Market The course that gives CMU its Zip Machine Level Programming I Introduction Sept 10 2002 Topics n n Evolutionary Design n Starting in 1978 with 8086 n Added more features as time goes on n Still support old features although obsolete Complex Instruction Set Computer CISC Assembly Programmer s Execution Model n l But only small subset encountered with Linux programs Accessing Information l Registers n Hard to match performance of Reduced Instruction Set Computers RISC n But Intel has done just that l Memory n Arithmetic operations X86 Evolution Programmer s View 8086 Transistors 1978 29K n Limited to 1MB address space DOS only gives you 640K 1982 134K n Added elaborate but not very useful addressing scheme n Basis for IBM PC AT and Windows n 1985 X86 Evolution Programmer s View Name 16 bit processor Basis for IBM PC DOS 386 3 Date n 80286 15 213 F 02 2 class05 ppt Name Many different instructions with many different formats Date Transistors 486 1989 1 9M Pentium 1993 3 1M Pentium MMX 1997 4 5M n Added special collection of instructions for operating on 64bit vectors of 1 2 or 4 byte integer data PentiumPro 275K Extended to 32 bits Added flat addressing n Capable of running Unix n Linux gcc uses no instructions introduced in later models 15 213 F 02 4 1995 6 5M n Added conditional move instructions n Big change in underlying microarchitecture 15 213 F 02 X86 Evolution Programmer s View Name Pentium III Date Transistors 1999 8 2M Advanced Micro Devices AMD n n Added streaming SIMD instructions for operating on 128 bit vectors of 1 2 or 4 byte integer or floating point data n Our fish machines Pentium 4 n 2001 Historically l AMD has followed just behind Intel l A little bit slower a lot cheaper n Recently l Recruited top circuit designers from Digital Equipment Corp l Exploited fact that Intel distracted by IA64 42M l Now are close competitors to Intel Added 8 byte formats and 144 new instructions for streaming SIMD mode 15 213 F 02 5 X86 Evolution Clones Clones n Developing own extension to 64 bits 15 213 F 02 6 New Species IA64 Transmeta n X86 Evolution Clones Clones Name Date Transistors Itanium 2001 10M Recent start up l Employer of Linus Torvalds n Radically different approach to implementation l Translates x86 code into Very Long Instruction Word VLIW code l High degree of parallelism n Shooting for low power market n Extends to IA64 a 64 bit architecture n Radically new instruction set designed for high performance n Will be able to run existing IA32 programs l On board x86 engine n Joint project with Hewlett Packard Itanium 2 n 7 15 213 F 02 8 2002 221M Big performance boost 15 213 F 02 Assembly Programmer s View CPU Memory Addresses Registers E I P Data Condition Codes Turning C into into Object Object Code Code n Code in files p1 c p2 c n Compile with command gcc O p1 c p2 c o p Object Code Program Data OS Data l Use optimizations O l Put resulting binary in file p Instructions text C program p1 c p2 c Compiler gcc S Stack Programmer Visible State n EIP text Asm program p1 s p2 s Program Counter Assembler gcc or as l Address of next instruction n Register File l Heavily used program data n Condition Codes l Store status information about most recent arithmetic operation 9 l Used for conditional branching n Memory binary l Byte addressable array Compiling Into Assembly Assembly C Code int sum int x int y int t x y return t Static libraries a Linker gcc or ld l Code user data some OS data l Includes stack used to support procedures 15 213 F 02 Object program p1 o p2 o binary Executable program p 15 213 F 02 10 Assembly Characteristics Generated Assembly Minimal Data Types n sum pushl ebp movl esp ebp movl 12 ebp eax addl 8 ebp eax movl ebp esp popl ebp ret Integer data of 1 2 or 4 bytes l Data values l Addresses untyped pointers n Floating point data of 4 8 or 10 bytes n No aggregate types such as arrays or structures l Just contiguously allocated bytes in memory Primitive Operations Obtain with command gcc O S code c n Perform arithmetic function on register or memory data n Transfer data between memory and register l Load data from memory into register Produces file code s l Store register data into memory n Transfer control l Unconditional jumps to from procedures l Conditional branches 11 15 213 F 02 12 15 213 F 02 Object Code Code for sum Machine Instruction Instruction Example Example Assembler n Translates s into o 0x401040 sum n Binary encoding of each instruction 0x55 Total of 13 0x89 n Nearly complete image of executable bytes 0xe5 code Each 0x8b instruction 1 n Missing linkages between code in 0x45 2 or 3 bytes different files 0x0c Starts at 0x03 address Linker 0x45 0x401040 0x08 n Resolves references between files 0x89 n Combines with static run time 0xec libraries 0x5d l E g code for malloc printf 0xc3 n C Code int t x y Some libraries are dynamically linked l Linking occurs when program begins n Assembly n addl 8 ebp eax l Same instruction whether signed or unsigned n 0x401046 03 45 08 Disassembled Object ebp esp ebp 0xc ebp eax 0x8 ebp eax ebp esp ebp 0x0 esi esi objdump d p n Useful tool for examining object code n Analyzes bit pattern of series of instructions n Produces approximate rendition of assembly code Can be run on either a out complete executable or o file n 15 213 F 02 Alternate Disassembly Disassembler 15 3 byte instruction Stored at address 0x401046 14 Disassembled push mov mov add mov pop ret lea Register eax Memory M ebp 8 Register eax Return function value in eax Object Code n Disassembling Object Object Code Code 00401040 sum 0 55 1 89 e5 3 8b 45 0c 6 03 45 08 9 89 ec b 5d c c3 d 8d 76 00 Operands x y t n 15 213 F 02 Add 2 4 byte integers l Long words in GCC parlance Similar to expression x y execution 13 Add two signed integers 0x401040 0x55 0x89 0xe5 0x8b 0x45 0x0c 0x03 0x45 0x08 0x89 0xec 0x5d 0xc3 0x401040 0x401041 0x401043 0x401046 0x401049 0x40104b 0x40104c 0x40104d sum sum 1 sum 3 sum 6 sum 9 sum 11 sum 12 sum 13 push mov mov add mov pop ret lea ebp esp ebp 0xc ebp eax 0x8 ebp eax ebp esp ebp 0x0 esi esi Within gdb Debugger gdb p disassemble sum Disassemble procedure x 13b sum n 15 213 F 02 n 16 Examine the 13 bytes starting at sum 15 213 F 02 What Can be Disassembled Disassembled Moving Data Data eax edx objdump d WINWORD EXE WINWORD EXE Moving Data file format pei i386 No symbols in WINWORD EXE …


View Full Document

CMU CS 15213 - Lecture

Documents in this Course
lecture

lecture

14 pages

lecture

lecture

46 pages

Caches

Caches

9 pages

lecture

lecture

39 pages

Lecture

Lecture

36 pages

Lecture

Lecture

45 pages

Lecture

Lecture

56 pages

lecture

lecture

11 pages

lecture

lecture

9 pages

Lecture

Lecture

36 pages

Lecture

Lecture

37 pages

Exam

Exam

16 pages

Lecture

Lecture

10 pages

Lecture

Lecture

43 pages

Lecture

Lecture

8 pages

Lecture

Lecture

8 pages

Lecture

Lecture

36 pages

Lecture

Lecture

43 pages

Lecture

Lecture

12 pages

Lecture

Lecture

37 pages

Lecture

Lecture

6 pages

Lecture

Lecture

40 pages

coding

coding

2 pages

Exam

Exam

17 pages

Exam

Exam

14 pages

Lecture

Lecture

29 pages

Lecture

Lecture

34 pages

Exam

Exam

11 pages

Lecture

Lecture

9 pages

Lecture

Lecture

37 pages

Lecture

Lecture

36 pages

lecture

lecture

46 pages

Lecture

Lecture

33 pages

Lecture

Lecture

57 pages

Lecture

Lecture

32 pages

Lecture

Lecture

46 pages

Lecture

Lecture

40 pages

Lecture

Lecture

11 pages

Lecture

Lecture

6 pages

Lecture

Lecture

43 pages

Lecture

Lecture

12 pages

Lecture

Lecture

18 pages

Exam

Exam

10 pages

Lecture

Lecture

45 pages

Lecture

Lecture

37 pages

Exam

Exam

24 pages

class09

class09

21 pages

class22

class22

37 pages

class20

class20

30 pages

class27

class27

33 pages

class25

class25

21 pages

class04

class04

31 pages

Lecture

Lecture

59 pages

class01a

class01a

14 pages

class12

class12

45 pages

class29

class29

33 pages

Lecture

Lecture

39 pages

Lecture

Lecture

6 pages

class03

class03

34 pages

lecture

lecture

42 pages

Lecture

Lecture

40 pages

Lecture

Lecture

47 pages

Exam

Exam

19 pages

R06-B

R06-B

25 pages

class17

class17

37 pages

class25

class25

31 pages

Lecture

Lecture

15 pages

final-f06

final-f06

17 pages

Lecture

Lecture

9 pages

lecture

lecture

9 pages

Exam

Exam

15 pages

Lecture

Lecture

22 pages

class11

class11

45 pages

lecture

lecture

50 pages

Linking

Linking

37 pages

Lecture

Lecture

64 pages

Integers

Integers

40 pages

Exam

Exam

11 pages

Lecture

Lecture

37 pages

Lecture

Lecture

44 pages

Lecture

Lecture

37 pages

Lecture

Lecture

9 pages

Lecture

Lecture

37 pages

Lecture

Lecture

45 pages

Final

Final

25 pages

lecture

lecture

9 pages

Lecture

Lecture

30 pages

Lecture

Lecture

16 pages

Final

Final

17 pages

Lecture

Lecture

8 pages

Exam

Exam

11 pages

Lecture

Lecture

47 pages

Lecture

Lecture

9 pages

lecture

lecture

39 pages

Exam

Exam

11 pages

lecture

lecture

41 pages

lecture

lecture

37 pages

Lecture

Lecture

59 pages

Lecture

Lecture

45 pages

Exam 1

Exam 1

18 pages

Lecture

Lecture

41 pages

Lecture

Lecture

32 pages

Lecture

Lecture

30 pages

Lecture

Lecture

9 pages

Lecture

Lecture

9 pages

Lecture

Lecture

15 pages

Lecture

Lecture

11 pages

Lecture

Lecture

9 pages

Lecture

Lecture

34 pages

Lecture

Lecture

40 pages

Lecture

Lecture

4 pages

Lecture

Lecture

46 pages

Lecture

Lecture

8 pages

Lecture

Lecture

65 pages

Lecture

Lecture

38 pages

Lecture

Lecture

35 pages

Lecture

Lecture

8 pages

Lecture

Lecture

34 pages

Lecture

Lecture

8 pages

Exam

Exam

13 pages

Lecture

Lecture

43 pages

Lecture

Lecture

9 pages

Lecture

Lecture

12 pages

Lecture

Lecture

9 pages

Lecture

Lecture

34 pages

Lecture

Lecture

43 pages

Lecture

Lecture

7 pages

Lecture

Lecture

45 pages

Lecture

Lecture

24 pages

Lecture

Lecture

47 pages

Lecture

Lecture

12 pages

Lecture

Lecture

20 pages

Lecture

Lecture

9 pages

Exam

Exam

11 pages

Lecture

Lecture

52 pages

Lecture

Lecture

20 pages

Exam

Exam

11 pages

Lecture

Lecture

35 pages

Lecture

Lecture

47 pages

Lecture

Lecture

18 pages

Lecture

Lecture

30 pages

Lecture

Lecture

59 pages

Lecture

Lecture

37 pages

Lecture

Lecture

22 pages

Lecture

Lecture

35 pages

Exam

Exam

23 pages

Lecture

Lecture

9 pages

Lecture

Lecture

22 pages

class12

class12

32 pages

Lecture

Lecture

8 pages

Lecture

Lecture

39 pages

Lecture

Lecture

44 pages

Lecture

Lecture

38 pages

Lecture

Lecture

69 pages

Lecture

Lecture

41 pages

Lecture

Lecture

12 pages

Lecture

Lecture

52 pages

Lecture

Lecture

59 pages

Lecture

Lecture

39 pages

Lecture

Lecture

83 pages

Lecture

Lecture

59 pages

class01b

class01b

17 pages

Exam

Exam

21 pages

class07

class07

47 pages

Odyssey

Odyssey

18 pages

multicore

multicore

66 pages

Lecture

Lecture

6 pages

lecture

lecture

41 pages

lecture

lecture

55 pages

lecture

lecture

52 pages

lecture

lecture

33 pages

lecture

lecture

46 pages

lecture

lecture

55 pages

lecture

lecture

17 pages

lecture

lecture

49 pages

Exam

Exam

17 pages

lecture

lecture

56 pages

Exam 2

Exam 2

16 pages

Exam 2

Exam 2

16 pages

Notes

Notes

37 pages

Lecture

Lecture

40 pages

Lecture

Lecture

36 pages

Lecture

Lecture

43 pages

Lecture

Lecture

25 pages

Exam

Exam

13 pages

Lecture

Lecture

32 pages

Lecture

Lecture

12 pages

Lecture

Lecture

58 pages

Lecture

Lecture

29 pages

Lecture

Lecture

59 pages

Lecture

Lecture

41 pages

Lecture

Lecture

50 pages

Exam

Exam

17 pages

Lecture

Lecture

29 pages

Lecture

Lecture

44 pages

Lecture

Lecture

41 pages

Lecture

Lecture

52 pages

Lecture

Lecture

40 pages

Lecture

Lecture

33 pages

lecture

lecture

10 pages

Lecture

Lecture

27 pages

Lecture

Lecture

29 pages

Lecture

Lecture

39 pages

Lecture

Lecture

9 pages

Lecture

Lecture

29 pages

Lecture

Lecture

8 pages

Lecture

Lecture

43 pages

Lecture

Lecture

43 pages

Lecture

Lecture

75 pages

Lecture

Lecture

55 pages

Exam

Exam

12 pages

Lecture

Lecture

43 pages

Lecture

Lecture

35 pages

lecture

lecture

36 pages

Exam

Exam

33 pages

lecture

lecture

56 pages

lecture

lecture

64 pages

lecture

lecture

8 pages

Exam

Exam

14 pages

Lecture

Lecture

43 pages

Lecture

Lecture

36 pages

lecture

lecture

56 pages

lecture

lecture

75 pages

lecture

lecture

36 pages

Lecture

Lecture

50 pages

Lecture

Lecture

45 pages

Lecture

Lecture

13 pages

Exam

Exam

23 pages

Lecture

Lecture

10 pages

Lecture

Lecture

48 pages

Lecture

Lecture

83 pages

lecture

lecture

57 pages

Lecture

Lecture

33 pages

Lecture

Lecture

39 pages

Lecture

Lecture

33 pages

lecture

lecture

54 pages

Lecture

Lecture

30 pages

Exam

Exam

13 pages

Lecture

Lecture

36 pages

Lecture

Lecture

40 pages

Exam

Exam

17 pages

Lecture

Lecture

9 pages

Exam

Exam

15 pages

Lecture

Lecture

44 pages

Lecture

Lecture

34 pages

Lecture

Lecture

24 pages

Lecture

Lecture

29 pages

class12

class12

43 pages

lecture

lecture

43 pages

class22

class22

22 pages

R06-B

R06-B

25 pages

class01b

class01b

19 pages

lecture

lecture

29 pages

lab1

lab1

8 pages

Caches

Caches

36 pages

lecture

lecture

55 pages

Lecture,

Lecture,

37 pages

Integers

Integers

40 pages

Linking

Linking

38 pages

lecture

lecture

45 pages

Lecture

Lecture

61 pages

Linking

Linking

33 pages

lecture

lecture

40 pages

lecture

lecture

40 pages

Lecture

Lecture

32 pages

lecture

lecture

48 pages

lecture

lecture

44 pages

Exam

Exam

11 pages

Lecture

Lecture

31 pages

Lecture

Lecture

46 pages

Lecture

Lecture

40 pages

Lecture

Lecture

40 pages

Exam

Exam

12 pages

Lecture

Lecture

42 pages

Lecture

Lecture

36 pages

Lecture

Lecture

45 pages

Lecture

Lecture

41 pages

Lecture

Lecture

13 pages

Lecture

Lecture

35 pages

Lecture

Lecture

20 pages

Final

Final

19 pages

Lecture

Lecture

33 pages

Lecture

Lecture

50 pages

Lecture

Lecture

33 pages

Lecture

Lecture

27 pages

Lecture

Lecture

6 pages

Exam

Exam

15 pages

Lecture

Lecture

24 pages

Lecture

Lecture

23 pages

Lecture

Lecture

43 pages

Lecture

Lecture

32 pages

Lecture

Lecture

52 pages

Lecture

Lecture

37 pages

Lecture

Lecture

36 pages

Lecture

Lecture

34 pages

Lecture

Lecture

40 pages

Lecture

Lecture

15 pages

lecture

lecture

21 pages

Lecture

Lecture

58 pages

Lecture

Lecture

49 pages

Lecture

Lecture

36 pages

Lecture

Lecture

11 pages

Lecture

Lecture

12 pages

Lecture

Lecture

58 pages

Lecture

Lecture

33 pages

Exam

Exam

15 pages

Lecture

Lecture

35 pages

Lecture

Lecture

10 pages

Lecture

Lecture

25 pages

Lecture

Lecture

31 pages

Lecture

Lecture

24 pages

Lecture

Lecture

34 pages

Lecture

Lecture

50 pages

lecture

lecture

35 pages

Lecture

Lecture

11 pages

Lecture

Lecture

39 pages

Lecture

Lecture

45 pages

Lecture

Lecture

41 pages

exam1-f05

exam1-f05

11 pages

Lecture

Lecture

4 pages

Lecture

Lecture

17 pages

Exam

Exam

17 pages

malloc()

malloc()

12 pages

Lecture

Lecture

57 pages

Lecture

Lecture

30 pages

Lecture

Lecture

30 pages

Lecture

Lecture

47 pages

Lecture

Lecture

33 pages

Exam

Exam

12 pages

Lecture

Lecture

43 pages

Lectures

Lectures

33 pages

Lecture

Lecture

36 pages

lecture

lecture

33 pages

Exam

Exam

14 pages

Lecture

Lecture

43 pages

Lecture

Lecture

25 pages

Load more
Download Lecture
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?