8086 microprocessor

30
BISMILLAHIR RAHMANIR RAHIM AS SALAMU ALAYKUM

Upload: mdgalib-hossain

Post on 21-Apr-2017

38 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: 8086 Microprocessor

BISMILLAHIR RAHMANIR RAHIM

AS SALAMU ALAYKUM

Page 2: 8086 Microprocessor

8086-MICROPROCESSOR

Page 3: 8086 Microprocessor

MD. GALIB HOSSAINID-1436CSE00365

Page 4: 8086 Microprocessor

P-5

Microprocessor P-7

Types of Registers in 8086 P-9

General Purpose Registers P-16

Segment Registers P-18

Special Purpose Registers P-19

Flag Registers

• sort out the details

8086

Page 5: 8086 Microprocessor

MICROPROCESSOR

• It is an integrated circuit, which contains all the functions of the Central Processing Unit (CPU).

• It is not capable for handling the Boolean function.

• It contains only CPU, RAM, ROM, I/O, timer are separately interfaced.

• Examples:-

INTEL 8086, INTEL Pentium series

Page 6: 8086 Microprocessor

INTERNAL ARCHITECTURE OF 8086

Page 7: 8086 Microprocessor

TYPES OF REGISTERS IN 8086

General Purpose Register

s

Segment Register

s

Special Purpose Register

s

Flag Register

s

Page 8: 8086 Microprocessor
Page 9: 8086 Microprocessor

GENERAL PURPOSE REGISTERS•AX The Accumulator Register: (Divided into AH / AL)• It consist of 8-bit registers AL and AH, when they combine they used as 16-bit register.•Generates shortest machine code•Arithmetic, logic and data transfer•One number must be AL or AX•Multiplication and Division• Input and Output

Page 10: 8086 Microprocessor

GENERAL PURPOSE REGISTERS

•BX - the base address register (divided into BH / BL).

CX - the count register (divided into CH / CL):

1. Iterative code segments using the LOOP instruction2. Repetitive operations on strings with the REP command3. Count (in CL) of bits to shift and rotate

Page 11: 8086 Microprocessor

DX - the data register (divided into DH / DL):

1. DX:AX concatenated into 32-bit register for some MUL and DIV operations2. Specifying ports in some IN and OUT operations

GENERAL PURPOSE REGISTERS

Page 12: 8086 Microprocessor

GENERAL PURPOSE REGISTERS

SI - source index register:1. Can be used for pointer addressing of data

2. Used as source in some string processing instructions

3. Offset address relative to DS

Page 13: 8086 Microprocessor

GENERAL PURPOSE REGISTERS

DI - destination index register:1. Can be used for pointer addressing of data

2. Used as destination in some string processing instructions

3. Offset address relative to ES

Page 14: 8086 Microprocessor

GENERAL PURPOSE REGISTERS

BP - base pointer:1. Primarily used to access parameters passed via the stack

2. Offset address relative to SS

Page 15: 8086 Microprocessor

GENERAL PURPOSE REGISTERS

SP - stack pointer:1. Always points to top item on the stack2. Offset address relative to SS3. Always points to word (byte at even address)

4. An empty stack will had SP = FFFEh

Page 16: 8086 Microprocessor

THERE ARE FOUR TYPES OF SEGMENT REGISTERS:

•Code Segment

CS•Data SegmentDS•Extra Segment

ES•Stack Segment

SS

Page 17: 8086 Microprocessor

SEGMENT REGISTERS

•CS - points at the segment containing the current program.•DS - generally points at segment where variables are defined.• ES - extra segment register, it's up to a coder to define its usage.•SS - points at the segment containing the stack.

Page 18: 8086 Microprocessor

SPECIAL PURPOSE REGISTERS

• IP - the instruction pointer:1. Always points to next instruction to be executed2. Offset address relative to CS

• IP register always works together with CS segment register and it points to currently executing instruction

Page 19: 8086 Microprocessor

FLAG REGISTERS

•Flags Register is modified automatically by CPU after mathematical operations, this allows to determine the type of the result, and to determine conditions to transfer control to other parts of the program

Page 20: 8086 Microprocessor

FLAG REGISTERS

•Carry Flag (CF):-•An addition causes this flag to be set to 1, if there is carry out of the MSB, and subtraction causes this to be set to 1 if borrow is needed.

Page 21: 8086 Microprocessor

FLAG REGISTERS

•Parity Flag (PF):-•This is set to 1 if the low-order 8 bits of the result of the previous operation contain an even number of 1s. Otherwise it is reset to 0.

Page 22: 8086 Microprocessor

FLAG REGISTERS

•Auxiliary Flag (AF):-•This flag is used executively for BCD arithmetic. It is set to 1 if there is a carry out of bit 3 during an addition and borrows by bit 3during a subtraction.

Page 23: 8086 Microprocessor

FLAG REGISTERS

•Zero Flag (ZF):-•This is set to 1 if the result of the previous operation is zero and 0 if the result of the previous operation is non-zero.

Page 24: 8086 Microprocessor

FLAG REGISTERS

•Sign Flag (SF):- •This is set to 1 when result is negative. When result is positive it is set to 0. Actually this flag take the value of the most significant bit. •Trap Flag (TF):-• It is used for on chip debugging.

Page 25: 8086 Microprocessor

FLAG REGISTERS

•Interrupt Enable Flag (IF):-•When this flag is set to 1 CPU reacts to interrupts from external devices.

Page 26: 8086 Microprocessor

FLAG REGISTERS

•Direction Flag (DF) :- •This flag is used by some instructions to process data chains, when this flag is set to 0. The processing is done forward, when this flag is set to 1 the processing is done backward.

Page 27: 8086 Microprocessor

FLAG REGISTERS

• Overflow Flag (OF):-• This is set to 1 when there is a signed overflow.• This indicates that the result is too large to fit in 8-bit

destination operand.• The sum of two positive signed operands exceeds 127• The difference of two negative operands is less than -128• Example:• When you add bytes 100 + 50 (result is not in range -

128...127).

Page 28: 8086 Microprocessor

FLAG REGISTER EXAMPLES

1101 0111 1011 1001+ 1101 0111 0111 1010

1010 1111 0011 0011• In the above example: • SF (Sign Flag) = 1• ZF (Zero Flag) = 0• PF (Parity Flag) =1• CF (Carry Flag) =1• AF (Auxiliary Flag) = 1• OF (Overflow Flag) =1

Page 29: 8086 Microprocessor

FLAG REGISTER EXAMPLES

0101 0110 0111 1110 - 0100 1110 1110 1010

0000 0111 1001 0100• In the above example:• SF (Sign Flag) = 0• ZF (Zero Flag) = 0• PF (Parity Flag) =0• CF (Carry Flag) =0• AF (Auxiliary Flag) = 0• OF (Overflow Flag) =0

Page 30: 8086 Microprocessor

THANK YOU

Allah hafiz