ProgrammingModel of 8086 DataRegisters:          15                           8              7                              0AXBXCXDX                AH AL BH BL CH CL Dh DL        ·        Four 16-bit general purpose registersused to store operands and results.·        Each can be accessed as a whole (AX,BX, CX & DX)or the upper and lower bytes can be accessed separately (AL, AH, BL, CL, CH, DL& DH).·        AX is an implied operand for somearithmetic operations.

·        BX may be used as a base register in addresscalculations.·        CX is an implied counter for certaininstructions.·        DX is sometimes used to hold the addressof I/O instructions.  SegmentRegisters:            15                                            0                   CS                   SS                   DS                    ES    ·        Usedto calculate physical memory addresses.·        CS(Code Segment) is used in combination with IP to access the executing programinstructions.

Best services for writing your paper according to Trustpilot

Premium Partner
From $18.00 per page
4,8 / 5
4,80
Writers Experience
4,80
Delivery
4,90
Support
4,70
Price
Recommended Service
From $13.90 per page
4,6 / 5
4,70
Writers Experience
4,70
Delivery
4,60
Support
4,60
Price
From $20.00 per page
4,5 / 5
4,80
Writers Experience
4,50
Delivery
4,40
Support
4,10
Price
* All Partners were chosen among 50+ writing services by our Customer Satisfaction Team

·        SS(Stack Segment) is used in combination with SP to access the executing programStack.·        DS(Data Segment) and ES (Extra Segment) are used to access the executing programdata.PhysicalAddress.  ·        TheSegment, Pointer and other addressing registers are only 16 bits wide. On theother hand, the address put on the bus by the 8086 (called Physical Address) is20-bits. So, where do the missing 4-bits come from?             16bit Effective Address or Offset                                                                   +            16bit Segment Address                                                        =                    20bits Physical Address             Example:(CS) = 123A, (IP) = 341BTherefore,next instruction fetched at:    341BOffset +123A0 Segment Address=157BBPhysical Address  ProgramStatus Word (PSW).

 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 OF DF IFTF SF ZF AF PF CF The 8086 PSW contains 16 bits: 9 Flags & 7 not used. •Flags are divided into conditional and control. • Conditional Flagsreflect the result of the previous operation       involving the ALU • ControlFlags control the execution of special functions or instructions. • SF (Sign Flag) is equal to the mostsignificant bit (MSB) of the result (2’s complement numbers has a “1” as MSB). • ZF (ZeroFlag) is ‘1’ if the result is zero.• PF (ParityFlag) is ‘1’ if the low order 8-bits of the result contain an even number of’1s’. • CF (Carry Flag) is ‘1’ if anaddition causes a carryout or a subtraction causes a borrow.

X86 AssemblyLanguage Programming for the PC 23 • AF(Auxiliary Flag) is ‘1’ if an addition causes a carry-out or a subtractioncauses a borrow in/by bit 3. This flag is used exclusively for BCD arithmetic.• OF (Overflow Flag) is set if the result is out of range.

• DF (DirectionFlag) is used by string manipulation instructions. If ‘1’ auto-increment;otherwise, autodecrement. • IF (Interrupt Flag) if set, maskable interrupts arerecognized. • TF (Trap Flag) if set, a “trap” is executed after eachinstruction (control is transferred to a subroutine after each instruction).