What is CPU Register:-
usually measured by the no of bits they hold e.g._a "32 bit register or a ""64 bit register".
x86 architecture provide 16 basic program register:
Segment Register(CS,DS,SS,ES,FS,GS,EFLAG,EIP)
X64 ADDRESS an additional 8 general purpose register:
- The cpu usages these location to store data and instruction temporarily for pro
- cpu process , store and transfer data from one components to another with the help of register .
- The number of register variable among computers.
- it increases the performance of cpu.
- Each register receive the information , holds the temporarily and pass it on, as direct by CU
- the size of register depend on the computer architeture..
- PC(Program Counter)
- IR(Instruction register)
- MAR (Memory Address Register)
- IP(Instruction Pointer)
- SPR(Stack Pointer Register(SP)
- GPR (General Purpose Register)(A,B,C,D)
- Address and Segment Register(CS,DS,ES,SS)
- Index Register(Dl , Sl)
PC(Program counter):_
1. it holds the add of the next instruction to be fetched and executed .2. when instruction is fetched the value us automatically incremented and its points to the add of next instruction.
IR(Instruction Register):-
it holds the current instruction that is being executed.MAR Register
MAR stand for “Memory Address Register”, and its main objective is to store all memory addresses of entire data and instructions.MAR helps to make the communication with using of MDR (Memory Data Register) in between the CPU and Main Memory
MBR(Memory Buffer Register):-
FR Register
FR register stands for “Flag Register“, and this register helps to indicate the specific condition. Flag register contains the one or two bytes, and further every byte is splitted into 8 bits. And every bit delivers the flag means condition.
Few flags register are Carry flag, Parity flag, Sign flag, Zero flags, and Overflow flag.
GPR Registers
GPR stands for “General Purpose Registers“, and these are unified types of registers. These registers are capable to store the memory addresses, data values as well as floating-point values. Mostly, GPR registers are used into modern CPU and GPUs due to their best flexibility.
SPR Register
SPR stands for “Special Purpose Registers“, and they are used to hold the program state. SPR registers are enabled with PC (Program Counter) and SR (Status Register).
General Purpose Register:-
- These register are used to perform arithmetic and logical operation
- EAX, EBX, EDX, are 4 byte register AX, BX, CX and DX are 2byte AH ,AL BH,BL,CH,CL,DH and DL are 1 byte register.
AX(Accumulator Register)
it is used to asthmatic and logical operation,it holds the initial data to be operated upon and the final result for processing .
the result of arithmetic operation are returned to accumulator to transfer to the main memory through buffer.
BX(Base Register)
it is an address register that can be used for in directing addressing.
CX(counter Register)
it is used for counting purpose,it acts as counter loop ex .for(int i=10;i>0;i--)
DX(Data Register)
it is special role in division and multiplication.
Segment Register / Address Register:
size of each segment register is 2 byte.
CS(Code Segment)
it hold the base location of all executable instruction in the program .CS along with ip register fetches the next instruction.
DS(Data Register)
it is default base location for memory variable.
DS points of data in memory using Dl and SI
CPU calculate the offset variable using the values of DS.
ES(Extra Segment)
it is additional base location for memory of DS .
SS(Stack Segment):
it contains the base location of the current program stack.
- Index Register:
- index Registry are used for data movement.
- there are two type of index registers.
- SI(Source Index)
- DI(Destination Index
- DS Point to data in memory using DI (destination index) or SI(source Index) registes.
CS along with ip Register fetched the next instruction.