Hardware Reference
In-Depth Information
window shows the contents of the processor, consisting of the current values of the
segment registers, CS , DS , SS , and ES , the arithmetic registers, AH , AL , AX , and oth-
ers.
The middle window in the top row contains the stack, an area of memory used
for temporary values.
The right-hand window in the top row contains a fragment of the assembly lan-
guage program, with the arrow showing which instruction is currently being
executed. As the program runs, the current instruction changes and the arrow
moves to point to it. The strength of the tracer is that by hitting the return key
(labeled Enter on PC keyboards), one instruction is executed and all the windows
are updated, making it possible to run the program in slow motion.
Below the left window is a window that contains the subroutine call stack, here
empty. Below it are commands to the tracer itself. To the right of these two win-
dows is a window for input, output, and error messages.
Below these windows is a window that shows a portion of memory. These
windows will be discussed in more detail later, but the basic idea should be clear:
the tracer shows the source program, the machine registers, and quite a bit of infor-
mation about the state of the program being executed. As each instruction is
executed the information is updated, allowing the user to see in great detail what
the program is doing.
C.2 THE 8088 PROCESSOR
Every processor, including the 8088, has an internal state, where it keeps cer-
tain crucial information. For this purpose, the processor has a set of registers
where this information can be stored and processed. Probably the most important
of these is the PC ( program counter ), which contains the memory location, that is,
the address , of the next instruction to be executed. This register is also called IP
( Instruction Pointer ). This instruction is located in a part of the main memory,
called the code segment . The main memory on the 8088 may be up to slightly
more the 1 MB in size, but the current code segment is only 64 KB. The CS regis-
ter in Fig. C-1 tells where the 64-KB code segment begins within the 1-MB mem-
ory. A new code segment can be activated by simply changing the value of the CS
register. Similarly, there is also a 64-KB data segment, which tells where the data
begins. In Fig. C-1 its origin is given by the DS register, which can also be
changed as needed to access data outside the current data segment. The CS and DS
registers are needed because the 8088 has 16-bit registers, so they cannot directly
hold the 20-bit addresses needed to reference the entire 1-MB memory.
This is
why the code and data segment registers were introduced.
The other registers contain data or pointers to data in the main memory. In
assembly language programs, these registers can be directly accessed. Apart from
 
 
Search WWH ::




Custom Search