Information Technology Reference
In-Depth Information
Figure 2.4 The stack push and pop operations
incremented to indicate to location 1024. In the stack pop operation, the SP is first
decremented to become 1021. The value stored at this location (DD in this case) is
retrieved (popped out) and stored in the shown register.
Different operations can be performed using the stack structure. Consider, for
example, an instruction such as ADD (SP)
,(SP). The instruction adds the contents
of the stack location pointed to by the SP to those pointed to by the SP
þ
1 and stores
the result on the stack in the location pointed to by the current value of the SP.
Figure 2.5 illustrates such an addition operation. Table 2.1 summarizes the instruc-
tion classification discussed above.
The different ways in which operands can be addressed are called the addressing
modes. Addressing modes differ in the way the address information of operands is
specified. The simplest addressing mode is to include the operand itself in the
instruction, that is, no address information is needed. This is called immediate
addressing. A more involved addressing mode is to compute the address of the
operand by adding a constant value to the content of a register. This is called indexed
addressing. Between these two addressing modes there exist a number of other
addressing modes including absolute addressing, direct addressing, and indirect
addressing. A number of different addressing modes are explained below.
þ
- 52
1000
- 13
1000
SP
SP
39
1050
1001
1002
39
1050
1001
1002
Figure 2.5 Addition using the stack
Search WWH ::




Custom Search