CHAP - I Microprocessor
CHAP - I Microprocessor
CPU contains
An address counter or instruction pointer register which holds the
address of the next instruction or data item to be fetched from
memory,
The execution unit (EU) of the 8086 tells the BIU where to fetch
instructions or data from, decodes instructions and executes
instruction. The EU contains control circuitry which directs
internal operations.
• A decoder in the EU translates instructions
fetched from memory into a series of actions which the EU carries
out.
• The EU is has a 16-bit ALU which can add, subtract, AND, OR,
XOR, increment, decrement, complement or shift binary
numbers.
• The EU is decoding an instruction or executing an instruction
which does not require use of the buses.
The Queue: The BIU fetches up to 6 instruction bytes for the
following instructions.
• The BIU stores these pre fetched bytes in first-in-first-out
register set called a queue.
• When the EU is ready for its next instruction it simply reads the
instruction byte(s) for the instruction from the queue in the BIU.
• This is much faster than sending out an address to the system
memory and waiting for memory to send back the next
instruction byte or bytes.
• Except in the case of JMP and CALL instructions, where the
queue must be dumped and then reloaded starting from a new
address, this pre fetch-and-queue scheme greatly speeds up
processing.
• Fetching the next instruction while the current instruction
executes is called pipelining.
Word Read
• Each of 1 MB memory address of 8086 represents a byte wide
location.16-bit words will be stored in two consecutive memory
locations.
• If first byte of the data is stored at an even address, 8086 can
read the entire word in one operation.
• For example if the 16 bit data is stored at even address 00520H
is 9634H
MOV BX, [00520H]
• 8086 reads the first byte and stores the data in BL and reads
the 2nd byte and stores the data in BH
BL= (00520H) i.e. BL=34H
BH= (00521H) i.e. BH=96H
• If the first byte of the data is stored at an odd address, 8086
needs two operations to read the 16 bit data.
For example if the 16 bit data is stored at even address 00521H
is 3897H
MOV BX, [00521H]
• In first operation, 8086 reads the 16 bit data from the 00520H
location and stores the data of 00521H location in register BL
and discards the data of 00520H location.
• In 2nd operation, 8086 reads the 16 bit data from the 00522H
location and stores the data of 00522H location in register BH
and discards the data of 00523H location.
BL= (00521H) i.e. BL=97H
BH= (00522H) BH=38H
Byte Read:
MOV BH, [Addr]
For Even Address:
Ex: MOV BH, [00520H]
• 8086 reads the first byte from 00520 location and stores the data
in BH and reads the 2nd byte from the 00521H location and
ignores it
BH =[ 00520H]
SEGMENT REGISTER 0H
ADDER
CS IP Instruction address
SS SP or BP Stack address
Table Shows Default 32-bit segment and offset combinations.
an 8- or 32-bit number