The Processor

 

The Strategy:

    We are saying I have Pentium III processor and Pentium IV processor and so on...., but actually what is a processor?  A Processor is an hardware which executes the given software instructions and interacts various other components such as Memory and I/O devices. 

The Architecture:

   

    The processor is partitioned into two logical units: an execution unit (EU) and a bus interface unit (BIU), as illustrated in the figure.  The role of the EU is to execute instructions, whereas the BIU delivers instructions and data to the EU.  The EU contains an arithmetic and logic unit (ALU), a control unit (CU), and a number of registers.  These features provide for execution of instructions and arithmetic and logical operations.

    The most important function of the BIU is to manage the bus control unit., segment registers, and instruction queue.  The BIU controls the buses that transfer data to the EU, to memory, and to external Input/Output (I/O) devices, whereas the segment registers control memory addressing.

    Another function of the BIU is to provide access to instructions.  Since the instructions for a program that is executing are in memory, the BIU must access instructions from memory and place them in an instruction queue.  Because this queue is from 4 to 32 bytes in size, depending on the processor, the BIU is able to look ahead and prefetch instructions so that there is always a queue of instructions ready to execute. 

    The EU and BIU work in parallel, with the BIU keeping one step ahead.  The EU notifies the BIU when it needs access to data in memory or an I/O device.  Also, the EU requests machine instructions from the BIU instructions queue.  The top instruction is the currently executable one, and while the EU is occupied executing an instructions, the BIU fetches another instruction from memory.  This fetching overlaps with exection and speeds up processing.

    Processors up through the 80486 have what is known as single pipeline, which restricts them to completing one instructions before stating the next.  The Pentium and later processors have a dual pipeline structure that enable it to run many operations in parallel.

Registers:

    Registers are memory for the CPU.  The CPU execute instructions by fetching the values in these registers.  When the CPU access a value in the register it is significantly than to access a value at a RAM memory address.  The 8086\8088\80188\80186\80286 have 16 bit registers. and 80386 and above has 32 bit registers.  Another functions of registers in memory addressing.  When an information is to be accessed at a particular memory address, that address is stored in one of the registers, and the instruction is excuted.

    AX,BX,CX,DX are the general-purpose registers. They can address one-word or two bytes portions.  The leftmost byte is the "high" portion and the rightmost byte is the "low" portion.  For example, the CX register consists of a CH(high) and a CL(low) portion, and you can reference any portion by its name.  Now remember that in the previous topic we have used the following C program.

#include "stdio.h"
#include "dos.h"

union REGS i,o;
void main()
{
	i.h.ah = 0;
	int86(22,&i,&o);
	printf("%d",o.h.ah);
}

    In dos.h the structure REGS is defined as

union REGS {
	union WORDREGS x;
	union BYTEREGS h;
}

union WORDREGS{
	int ax,bx,cx,dx;
}

union BYTEREGS{
	char ah,al,bh,bl,ch,cl,dh,dl;
}

    The explanation is simple.  ax,bx,cx,dx integers in the union REGS correspond to the general purpose registers AX,BX,CX,DX. Note that integers are one word or two bytes in size as that of registers.  Further we know that each registers can be considered as high byte (first 8 bits) and low byte (next 8 bits). For AX registers, we have AH,AL and soon.  Also in the union register, ah,al are one byte elements (as they are declared as char).  The DOS interrupt 22 need the service number 0 loaded in the AH registers (What ever interrupt it is , the service number should be loaded in AH register only).  Hence we are doing this: i.h.ah = 0.  In fact this is too correct: i.x.ax = 0.

 

(For more information : Learn "IBM PC ASSEMBLY LANGUAGE AND PROGRAMMING" by 'Peter Abel')

Doubts & Corrections? Inform Me!