Académique Documents
Professionnel Documents
Culture Documents
16 bit microprocessor
16 bit data bus 20 bit address bus 1 Mega byte memory
8086 Architecture
CPU- divided into 2 units 1. BIU 2. EU Work divided among two units Speed Processing
BIU
Circuit for physical address calculation Pre decoding instruction byte queue (6 bytes long) Establish communication with external devices and peripherals
EU
Contains the register set of 8086 16 bit ALU 16 bit flag register Decoding unit which decodes the opcode byte queue issued from instruction byte queue. Timing and control unit Pass results to BIU to be stored in memory
8086 Architecture
Memory Segmentation
1 Mega byte memory is divided into 16 logical segments Each segment 64K bytes in size There are four segments 1. Code segment 2. Data segment 3. Stack segment 4. Extra segment CS-executable program DS, ES-data SS - stack
Physical Address
20 bit physical address is calculated from 2 parts 1.Segment address 2. offset Segment registers-16 bit base address Pointers/Index registers offset CS,DS,SS,ES contain address for code, data and stack segments
Memory
Memory 8 bits Reads 16 bits from odd addressed byte and even addressed byte (512 KB) If a word begins at even address it is fetch in single fetch cycle If a word begins in odd address it is fetch in two cycles
O-Overflow flag-Set if overflow occurs S- Sign Flag- Set if result of computation is negative Z- Zero Flag- Result of computation is zero
Pipelined Architecture
Overlapped fetch and execution cycles Instruction pipelining-Fetched instruction is executed internally, external bus used to fetch next instruction Increases the speed of processor Slow memory parts can be used without affecting overall performance 8086-Implemented using two functional blocksEU and BIU
Addressing Modes
Way by which operand is specified Addressing mode Data related addressing mode Branch related addressing mode General Instruction format Opcode operand
Arithmetic Instruction
This instructions affect the conditional flags ADD-Add ADD AX,0100H ADC-Add with carry ADC AX,BX INC-Increment specified byte/word by one INC [BX] DEC-Decrement DEC [5000H] CY not affected
Arithmetic Instruction
SUB-Subtract SUB [5000H], 0100 SBB-Subtract with borrow SBB AX,BX CMP-Compare two specified bytes/words CMP BX,0100H AAA-ASCII Adjust after addition AAS- ASCII adjust after subtraction AAM-ASCII adjust after multiplication AAD-ASCII adjust after division
Arithmetic Instruction
DAA-Decimal Adjust Accumulator DAS-Decimal Adjust after Subtraction NEG-Negate Form 2s compliment of destination MUL-Unsigned multiplication MUL BH (AX) (AL) (BH) MUL CX (DX)(AX) (CX) (AX) IMUL-Signed Multiplication IMUL BH
Arithmetic Instruction
CBW-Convert signed byte to word Byte in AL. Result in AX CWD-Convert signed word to double word. Double word in DX and AX. DIV- Unsigned Division Dividend in AX and divisor specified using any addressing mode except immediate. Result AL(quotient) AH (remainder) DX and AX in case of double word IDIV-signed division.
Logical Instruction
AND-Bit by bit AND AND AX,0005H OR-Logical OR OR AX,BX NOT- Logical Invert NOT [5000H] XOR Logical Exclusive OR XOR AX, [5000H] TEST Logical Compare Instruction TEST AX,BX
Logical Instruction
SHL/SAL-Shift Logical/Arithmetic Left through CY. Count specified by CL SHR/SAR-Shift Logical/Arithmetic Right through CY. Count specified by CL ROR-Rotate right without carry ROL-Rotate left without carry RCR-Rotate right through carry RCL-Rotate left through carry
String Instruction
REP-Repeat Instruction Prefix The instruction is repeated till CX becomes zero REPE/REPZ-Repeat if equal, Repeat if zero REPNE/REPNZ-Repeat if not eqaul and repeat if not zero MOVSB/MOVSW-Moves a string of bytes/words pointed by DS:SI to memory location pointed by ES:DI. Index registers automatically updated depending on DF. Can be used with REP prefix.
String Instruction
CMPS- Compare string byte/word DS:SI and ES:DI point to two strings. The result of comparison on the flags. REP prefix can be used to repeat process. SCAS-Scan string byte/word Scans a string of bytes or words for an operand byte or word specified in AL/AX. String pointed by ES:DI. When a match is found ZF set.
String Instruction
LODS- Load String byte/word Loads AL/AX register by the content of a string pointed by DS:SI. STOS-Store string byte/word Stores the AL/AX register contents to a location in the string pointed by ES:DI.
Assembler Directives
Directives indicate how an operand section of a program is to be processed by the assembler. DB- Define byte; Reserve bytes of memory locations DW- Define word; Reserve words of memory locations DD-Define double word; Reserve 2 words DQ- Define quad word; Reserve 4 words DT- Define ten bytes; Reserve 10 bytes
Assembler Directives
ASSUME-Assume logical segment name END-End of program ENDP-End of procedure ENDS- End of segment EQU-Assign a label with a value EXTRN- External and Public Indicates that the names, procedures and labels declared after this directive have already been declared in some other modules.
Assembler Directives
FAR- defines a far pointer NEAR-defines a near pointer MACRO-Designates the start of a macro sequence OFFSET- Specifies an Offset address ORG-Sets the origin within a segment PROC- starts procedure PTR-designates a pointer SEGMENT-starts a segment
Assembler Directive
STRUC- defines the start of a data structure Structure name STRUC Sequence of DB,DW and DD directives Structure name ENDS RECORD-This is for defining a bit pattern within a byte or word Record Name RECORD field spec, field spec Field spec-Field name : length= preassignment Pattern RECORD opcode:5,mode:3,opr1:4=8,opr2:4=4;
Assembler Directive
WORD- Indicates word sized EXIT-return to DOS SMALL- only one data segment be used with one code segment EVEN- Forces the address of next byte to be even 00 01 DUP-Duplication operator 02 ARRAY1 DB 2DUP(0,1,2,?) 00 ARRAY1 01
02 -
Macro
A macro is a group of instruction that perform one task Similar to procedure Procedure accessed via CALL instruction
In macro all instructions defined in the macro are inserted at then point of usage
Interrupts
Interrupts are external signals which interrupt the normal execution of a program 8086 interrupts can come from three sources NMI or INTR-Hardware Interrupt INT N Software Interrupt Interrupt due to an error condition from execution of a instruction
Interrupts
4 bytes required to hold the CS and IP values of each interrupt service procedures. The interrupt vector table holds the address of 256 interrupt procedures. Lowest 5 interrupts are dedicated interrupts Divide by zero Single step NMI Breakpoint Interrupt Overflow Interrupt
Interrupts
Interrupts 5 to 31 are reserved for future expansion Interrupts 32 to 255 are available for user Software interrupt- Type 0 through Type 255 INTR- external signal to interrupt execution of program Priority-Divide error, INT N, INTO-Highest NMI INTR Single step-Lowest
Minimum Mode
Minimum Mode
Minimum Mode
The address must be latched since it is available only during the first part of the bus cycle. To signal that the address is ready to be latched a 1 is put on pin 25, the address latch enable (ALE) pin. Typically, the latching is accomplished using Intel 8282s. Because 8282 is an 8-bit latch, two of them are needed for 16-bit address and three are needed if a full 20-bit address is used.
Minimum Mode
Minimum Mode
The Intel IC device for implementing the transceiver (driver/receiver) block shown is the 8286 transceiver device. The 8286 contains 16 tristate elements, eight receivers and eight drivers. Therefore, two 8286 is needed to service all of the data lines for an 8086 system.
The third component, other than the processor, that is needed in this mode is an 8284A clock generator.
Minimum Mode
Maximum Mode
A processor is in maximum mode when its MN / /MX pin is grounded. The main difference between minimum and maximum mode configurations is the need for additional circuitry to translate the control signals. It is normally implemented with an Intel 8288 bus controller.
Maximum Mode
Maximum Mode
Maximum Mode
Multiprocessor Configuration
Multiprocessing System-A system which includes two or more components that can execute instructions simultaneously Advantages improves overall cost/system performance processors can be combined to fit the needs of application unnecessary expense due to a centralized system can be avoided
Multiprocessor Configuration
provides room for further expansion since tasks are divided, debugging is easy Maximum mode of 8086 supports multiprocessing 3 basic configurations are configurations are possible Closely coupled configuration Loosely coupled configuration Coprocessor configuration
Coprocessor Configuration
Same as closely coupled configuration but the supporting processor is dependant and must interact directly with CPU
Handle integer, decimal, and real types of data, with lengths ranging from 2 to 10 bytes.
The instruction set supports addition, subtraction, multiplication and division, square root, exponentiation, taking the tangent and so on.