microprocessor 8086 and microcontoller

22
Presentation No.1 Computer Organization And Assembly Language Names ID’s Saad Tanvir 14005065-083 Maria Ahmad 14005065-045 Submitted to : Sir Talal

Upload: saad-tanvir

Post on 23-Feb-2017

74 views

Category:

Engineering


4 download

TRANSCRIPT

Page 1: Microprocessor 8086 and Microcontoller

Presentation No.1Computer Organization

And Assembly Language

Names ID’s Saad Tanvir 14005065-083 Maria Ahmad 14005065-045

Submitted to: Sir Talal

Page 2: Microprocessor 8086 and Microcontoller

Difference Between

MicroprocessorAnd

Microcontroller

Page 3: Microprocessor 8086 and Microcontoller

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

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

It is not capable for handling the Boolean function.

Very few number of bits handling instructions.

Examples:- INTEL 8086, INTEL Pentium series

Page 4: Microprocessor 8086 and Microcontoller

MicrocontrollerA microcontroller is a computer present in a single integrated circuit which is dedicated to perform one task and execute one specific application. 

CPU, RAM, ROM, I/O and timer are all on the same chip.

It is capable for Boolean functions.

Many bits handling instructions.

Examples:- INTEL 8051, 89960,PIC16F877

Page 5: Microprocessor 8086 and Microcontoller

Types of Registers in 8086

There are four types of r86egisters used in 8086:

•General Purpose Registers•Segment Registers•Special Purpose Registers•Flag Registers

Page 6: Microprocessor 8086 and Microcontoller

General Purpose RegistersAX 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 7: Microprocessor 8086 and Microcontoller

General Purpose RegistersBX The Base Address Register:(Divided into BH / BL)•It is used to contain I/O port address for I/O instruction.

CX The Counter Register: (Divided into CH / CL):•Iterative code segments using the LOOP instruction•Repetitive operations on strings with the REP command•Count (in CL) of bits to shift and rotate 

Page 8: Microprocessor 8086 and Microcontoller

General Purpose RegistersDX The Data Register: (Divided into DH / DL):•DX and AX concatenated into 32-bit register for some Multiplication and Division operations•Specifying ports in some Input and Out operations

SI Source Index Register:•Used for Pointer addressing of data•Used as source in some string processing instructions•Offset address relative to DS

 

Page 9: Microprocessor 8086 and Microcontoller

General Purpose RegistersDI Destination Index Register:•Used for Pointer addressing of data•Used as destination in some string processing instructions•Offset Address relative to ES BP Base Pointer:•Primarily used to access parameters passed via Stack•Offset address relative to SS 

 

Page 10: Microprocessor 8086 and Microcontoller

General Purpose RegistersSP Stack Pointer:A stack pointer is a small register that stores the address of the last program request in a stack. A stack is a specialized buffer which stores data from the top down. As new requests come in, they "push down" the older ones. 

 

Page 11: Microprocessor 8086 and Microcontoller

Segment RegistersThere are four types of Segment Registers:•CS (Code Segment)- Points at the segment containing the current program•DS (Data Segment)-Points at the segment where the variables are defined•ES(Extra Segment)-Extra Segment register, it’s up to the coder to define its usage•SS(Stack Segment)-Points at the segment containing the stack

Page 12: Microprocessor 8086 and Microcontoller

Special Purpose Registers

IP- The Instruction PointerIt points next instruction to be executedOffset address relative to CS

Page 13: Microprocessor 8086 and Microcontoller

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 14: Microprocessor 8086 and Microcontoller

Flag RegistersCarry 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. 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 15: Microprocessor 8086 and Microcontoller

Flag RegistersAuxiliary 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. 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 16: Microprocessor 8086 and Microcontoller

Flag RegistersSign 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. Interrupt Enable Flag (IF):-When this flag is set to 1 CPU reacts to interrupts from external devices.

Page 17: Microprocessor 8086 and Microcontoller

Flag RegistersSign 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. Interrupt Enable Flag (IF):-When this flag is set to 1 CPU reacts to interrupts from external devices.

Page 18: Microprocessor 8086 and Microcontoller

Flag RegistersDirection 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 19: Microprocessor 8086 and Microcontoller

Flag RegistersOverflow 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 127The difference of two negative operands is less than -128Example:When you add bytes 100 + 50 (result is not in range -128...127).

Page 20: Microprocessor 8086 and Microcontoller

Flag Register Examples  1101 0111 1011 1001

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

Page 21: Microprocessor 8086 and Microcontoller

Flag Register Examples 0101 0110 0111 1110

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

Page 22: Microprocessor 8086 and Microcontoller

Thank You