
80C196KB USER’S GUIDE
LONG-INDEXED REFERENCES
This addressing mode is like the short-indexed mode
except that a
16-bit
field is taken from the instruction
and added to the WORD variable to form the address
of the operand. No sign extension is necessary. An in-
struction can contain only one long-indexed reference
and the remaining operand(s) must be register-direct
references.
Examples
AND
AX,BX,TABLE
[
CX
]
; AX:
4
BX AND MEM WORD(TABLE
0
CX)
ST
AX,TABLE
[
BX
]
; MEM WORD(TABLE
0
BX):
4
AX
ADDB AL,BL,LOOKUP
[
CX
]
; AL:
4
BL
0
MEM BYTE(LOOKUP
0
CX)
ZERO REGISTER ADDRESSING
The first two bytes in the register file are fixed at zero
by the 80C196KB hardware. In addition to providing a
fixed source of the constant zero for calculations and
comparisons, this register can be used as the WORD
variable in a long-indexed reference. This combination
of register selection and address mode allows any loca-
tion in memory to be addressed directly.
Examples
ADD
AX,1234
[
0
]
; AX:
4
AX
0
MEM WORD(1234)
POP
5678
[
0
]
; MEM WORD(5678):
4
MEM WORD(SP)
;
SP:
4
SP
0
2
STACK POINTER REGISTER ADDRESSING
The system stack pointer in the 80C196KB is accessed
as register 18H of the internal register file. In addition
to providing for convenient manipulation of the stack
pointer, this also facilitates the accessing of operands in
the stack. The top of the stack, for example, can be
accessed by using the stack pointer as the WORD vari-
able in an indirect reference. In a similar fashion, the
stack pointer can be used in the short-indexed mode to
access data within the stack.
Examples
PUSH
[
SP
]
; DUPLICATE TOP OF STACK
LD
AX,2
[
SP
]
; AX:
4
NEXT TO TOP
ASSEMBLY LANGUAGE ADDRESSING MODES
The MCS-96 assembly language simplifies the choice of
addressing modes to be used in several respects:
Direct Addressing.
The assembly language will choose
between register-direct addressing and long-indexed
with the ZERO register depending on where the oper-
and is in memory. The user can simply refer to an oper-
and by its symbolic name: if the operand is in the regis-
ter file, a register-direct reference will be used, if the
operand is elsewhere in memory, a long-indexed refer-
ence will be generated.
Indexed Addressing.
The assembly language will
choose between short and long indexing depending on
the value of the index expression. If the value can be
expressed in eight bits then short indexing will be used,
if it cannot be expressed in eight bits then long indexing
will be used.
These features of the assembly language simplify the
programming task and should be used wherever possi-
ble.
3.3 Program Status Word
The program status word (PSW) is a collection of Boo-
lean flags which retain information concerning the state
of the user’s program. There are two bytes in the PSW;
the actual status word and the low byte of the interrupt
mask. Figure 3-1 shows the status bits of the PSW. The
PSW can be saved in the system stack with a single
operation (PUSHF) and restored in a like manner
(POPF). Only the interrupt section of the PSW can be
accessed directly. There is no SFR for the PSW status
bits.
12
数控原理与维修
http://www.agreenleaf.cn
Содержание 80C196KB Series
Страница 1: ...November 1990 80C196KB User s Guide Order Number 270651 003 http www agreenleaf cn...
Страница 59: ...80C196KB USER S GUIDE Figure 11 7 Ideal A D Characteristic 270651 37 55 http www agreenleaf cn...
Страница 60: ...80C196KB USER S GUIDE Figure 11 8 Actual and Ideal Characteristics 270651 38 56 http www agreenleaf cn...
Страница 61: ...80C196KB USER S GUIDE Figure 11 9 Terminal Based Characteristic 270651 39 57 http www agreenleaf cn...
Страница 70: ...80C196KB USER S GUIDE Figure 13 5 Reset Sequence 80C196KB Reset Sequence 270651 45 66 http www agreenleaf cn...
Страница 83: ...80C196KB USER S GUIDE 270651 80 Figure 15 14 AC Timing Diagrams 79 http www agreenleaf cn...
Страница 84: ...80C196KB USER S GUIDE 270651 81 270651 84 Figure 15 14 AC Timing Diagrams Continued 80 http www agreenleaf cn...