Hardware Reference
In-Depth Information
Figure 5.2 8086 flags
Segment Registers (CS, DS, SS, and ES)
We have already briefly mentioned the function of the four Segment Registers.
Each register is associated with a separate workspace. The workspace defined
by the Code Segment Register will contain program instructions, whilst the
space defined by the Data and Extra Segments will generally contain data. In
situations where RAM is limited there is no reason why the several Segment
Registers should not have the same value (as in the case of a COM program).
The code fragment:
MOV
AX,CS
; Make Code and Data
MOV
DS,AX
; Segments the same
can be used to make the Data Segment equal to the Code Segment (note that
the instruction MOV DS,CS is not a valid 8086 instruction).
As a further example, the code fragment:
MOV
AX,vidram ; Make Data Segment point
MOV
DS,AX
; to video memory
can be used to make the Data Segment point to the start of a block of video
RAM (vidram will previously have been the subject of an equate).
Interrupt handling
By comparison with earlier 8-bit microprocessors, the 8086 provides somewhat
superior interrupt handling and uses a table of 256 4-byte pointers stored in the
Search WWH ::




Custom Search