4. 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
5. • 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
9. • 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
10. • BX - the base address register (divided into BH /
BL).
CX - the count register (divided into CH / CL):
1. Iterative code segments using the LOOP instruction
2. Repetitive operations on strings with the REP command
3. Count (in CL) of bits to shift and rotate
11. DX - the data register (divided into DH /
DL):
1. DX:AX concatenated into 32-bit
register for some MUL and DIV
operations
2. Specifying ports in some IN and OUT
operations
12. 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
13. 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
14. BP - base pointer:
1. Primarily used to access parameters
passed via the stack
2. Offset address relative to SS
15. SP - stack pointer:
1. Always points to top item on the stack
2. Offset address relative to SS
3. Always points to word (byte at even
address)
4. An empty stack will had SP = FFFEh
16. THERE ARE FOUR TYPES OF SEGMENT
REGISTERS:
•Code SegmentCS
•Data SegmentDS
•Extra SegmentES
•Stack SegmentSS
17. • 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.
18. • IP - the instruction pointer:
1. Always points to next instruction to be executed
2. Offset address relative to CS
• IP register always works together with CS segment
register and it points to currently executing
instruction
19. • 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
20. •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.
21. • 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.
22. •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.
23. •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.
24. • 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.
25. •Interrupt Enable Flag (IF):-
•When this flag is set to 1 CPU reacts
to interrupts from external devices.
26. • 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.
27. • 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).