Computer Architecture CST 250 Microprocessor Registers Prepared by
Computer Architecture CST 250 Microprocessor Registers Prepared by: Omar Hirzallah
Contents l General Purpose Registers l Index Registers l Segment Registers l Special Registers l Programming Languages
The Registers in CPU Processor uses a very high speed small in size memory device during data processing which are called registers C. P. U Registers General Purpose Registers Index Registers Segment Registers • Accumulator • Stack Pointer • Code Segment • Base Pointer • Data Segment • Count • Source Index • Stack Segment • Data • Destination Index • Extra Segment Special Registers • Instructions Pointer • Flags Register
General Purpose Registers: Accumulator (AH, AL, AX, EAX): It accumulates the results from mathematical calculations and can be used for data movement. AH 8 bits, AL 8 bits, AX 16 bits, EAX 32 bits Base (BH, BL, BX, EBX): It points to memory locations and it can be used for data movement and arithmetic. (Points to data in the Data Segment) BH 8 bits, BL 8 bits, BX 16 bits, EBX 32 bits Count (CH, CL, CX, ECX): This counter is used typically for loops. It can be automatically incremented or decremented. CH 8 bits, CL 8 bits, CX 16 bits, ECX 32 bits Data (DH, DL, DX, EDX): It is used in calculations. It is also used significantly for multiply / divide operation. DH 8 bits, DL 8 bits, DX 16 bits, EDX 32 bits
C. P. U Registers
INDEX REGISTERS: Stack Pointer (SP, ESP): It points to the location of the stack (points to the end of the stack). SP 16 bits, ESP 32 bits Base Pointer (BP, EBP): It is also used to point inside the stack. It is used to access the sub routine data. BP 16 bits, EBP 32 bits Source Index (SI, ESI): It is used for string operations (points to the source). SI 16 bits, ESI 32 bits Destination Index Register (DI, EDI): It is used for string operations (points to the destination). DI 16 bits, EDI 32 bits
SEGMENT REGISTERS (ALL 16 bits) l Code Segment (CS): It points to the memory area where program's instructions are stored. l Data Segment (DS): It points to the memory area where program's data is stored. l Stack Segment (SS): It points to the memory area where stack is stored. l Extra Segment (ES): It can be used to point to additional data segments, if necessary.
SPECIAL REGISTERS: l Instruction Pointer (IP, EIP): It points to the next instruction that the processor is going to execute. (also called program counter) l Flags Register (Flag, Eflag): It contains individual bits set by different operations. l CF Carry l OF Overflow l ZF Zero l SF Sign
Programming Languages: There are basically two types of programming languages: 1. High Level Languages (Pascal, Basic, Cobol, C, Fortran etc. ) 2. Low Level Languages (Assembly) Each processor has a set of assembly instructions called “Instruction Set”. CISC stands for Complex Instructions Set Computers RISC stands for Reduced Instructions Set Computers Assembly Language Assembler Machine Language
- Slides: 9