Hardware Reference
In-Depth Information
The flag register or condition code register is actually a set of single-bit reg-
isters. Some of the bits are set by arithmetic instructions and relate to the result, as
follows:
Z - result is zero
S - result is negative (sign bit)
V - result generated an overflow
C - result generated a carry
A - Auxilary carry (out of bit 3)
P - parity of the result
Other bits in this register control operation of certain aspects of the processor. The
I bit enables interrupts. The T bit enables tracing mode, which is used for debug-
ging. Finally, the D bit controls the direction of the string operations. Not all 16
bits of this flag register are used; the unused ones are hardwired to zero.
There are four registers in the segment register group . Recall that the stack,
the data and the instruction codes all reside in main memory, but usually in differ-
ent parts of it. The segment registers govern these different parts of the memory,
which are called segments . These registers are called CS for the code segment
register, DS for the data segment register, SS for the stack segment register, and ES
for the extra segment register. Most of the time, their values are not changed. In
practice, the data segment and stack segment use the same piece of memory, with
the data being at the bottom of the segment and the stack being at the top. More
about these registers will be explained in Sec. C.3.1.
C.3 MEMORY AND ADDRESSING
The 8088 has a somewhat ungainly memory organization due to its combina-
tion of a 1-MB memory and 16-bit registers. With a 1-MB memory, it takes 20 bits
to represent a memory address. Consequently, it is impossible to store a pointer to
memory in any of the 16-bit registers. To get around this problem, memory is
organized as segments, each of them 64 KB, so an address within a segment can be
represented in 16 bits. We will now go into the 8088 memory architecture in more
detail.
C.3.1 Memory Organization and Segments
The memory of the 8088, which consists simply of an array of addressable 8-
bit bytes, is used for the storage of instructions as well as for the storage of data
and for the stack. In order to separate the parts of the memory which are used for
 
 
 
Search WWH ::




Custom Search