Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.

Similar presentations


Presentation on theme: "Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory."— Presentation transcript:

1 Chapter 2 Parts of a Computer System

2 2.1 PC Hardware: Memory

3 80x86 Memory Collection of “slots” each of which holds one byte (8 bits) Each slot identified by an address –32-bit systems use 32-bit addresses –64-bit systems use 64-bit addresses

4 Memory Units 1Kb = 2 10 = 1,024 (about a thousand), 1Mb = 2 20 = 1,048,576 (about a million) 1Gb = 2 30 = 1,073,741,824 (about a billion)

5 2.1 PC Hardware: The CPU

6 CPU’s Function Fetch instruction from memory Decode instruction Execute instruction Store results

7 80x86 Registers Internal to CPU – rapidly accessed Used in arithmetic and other operations 64-bit CPUs have larger and more registers

8 General Registers, 32-bit CPUs EAX, EBX, ECX, EDX, each 32 bits long The low-order 16 bits can be referenced by AX, BX, CX and DX, respectively The low-order 8 bits can be referenced by AL, BL, CL and DL, respectively Bits 8-15 can be referenced by AH, BH, CH and CH, respectively EAX is called the accumulator and sometimes has special instruction formats associated with it

9 Index Registers ESI, 32-bit source index used for –Source address in string moves –Array index –General purposes EDI, 32-bit destination index used for –Address of destination in string moves –Array index –General purposes

10 Stack Pointer, Base Pointer and Segment Registers ESP, 32-bit stack pointer –Holds address of top of stack EBP, 32-bit base pointer –Used in procedure calls to hold address of reference point in the stack Segment Registers used in segmented memory model –CS, DS, ES, FS, SS, GS –Each 16 bits long holding a segment selector –Managed by the operating system with flat memory model programming

11 Other Registers EIP, 32-bit instruction pointer –Holds address of next instruction to be fetched for execution EFLAGS, 32-bit –Collection of flags, or status bits –Records information about many operations Carry Flag (CF) is bit 0 Zero Flag (ZF) is bit 6 Sign Flag (SF) is bit 7 Overflow Flag (OF) is bit 11

12 Registers in 64-bit CPUs RAX, RBX, RCX, RDX, RSI, RDI, RSP, RBP, RIP, RFLAGS extend the 32-bit registers –Low-order 32 bits of RAX can be referenced by EAX; similarly for other registers R8 – R15 are new 64-bit general-use registers –Low-order 32-bits of R8 can be referenced by R8D –Low-order 16 bits by R8W; 8 bits by R8B

13 2.3 PC Hardware: I/O Devices

14 Input/Output At the hardware level, I/O ports are used –64K port addresses Since the instructions that access ports are unavailable in ordinary application programming, I/O is typically done by calls to operating system routines

15 2.4 PC Software

16 Operating System Manages program execution Provides access to I/O devices Provide user interface –Command line interface (e.g., DOS) –Graphical user interface (e.g., Windows)

17 Text Editors Used to create source programs or data files Notepad comes with Windows Word processors add extra formatting information –not normally used for creating assembly language source files

18 Language Translators Interpreters translate each high-level language source code line every time it is needed for execution Compilers translate HLL source code to object code that is almost ready for the CPU to execute Assemblers translate assembly language – a low level language – to object code

19 Linker Object code files produced by a compiler or assembler are not quite ready for execution A linker combines object code files and prepares them to be loaded into memory for execution

20 Debugger Allows the programmer to control execution of a program –Step through instructions one at a time –Stop at a preset breakpoint Lets you look at memory or register contents –Helps find programming errors –Helps understand how the computer works

21 Integrated Development Environment Single interface provides access to text editor, compiler or assembler, linker and debugger Microsoft Visual Studio is an IDE


Download ppt "Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory."

Similar presentations


Ads by Google