45
The 68000's Instruction Set
Application:
Used to set bits in the SR (i.e., the S, T, and interrupt mask bits).
For example,
ORI
#$8000,SR
sets bit 15 of the SR (i.e., the trace
bit).
Condition codes:
X N Z V C
* * * * *
X is set if bit 4 of data = 1; unchanged otherwise
N is set if bit 3 of data = 1; unchanged otherwise
Z is set if bit 2 of data = 1; unchanged otherwise
V is set if bit 1 of data = 1; unchanged otherwise
C is set if bit 0 of data = 1; unchanged otherwise
PEA
Push effective address
Operation:
[SP]
←
[SP] - 4; [M([SP])]
←
<ea>
Syntax:
PEA <ea>
Attributes:
Size = longword
Description:
The longword effective address specified by the instruction is
computed and pushed onto the stack. The difference between
PEA
and
LEA
is that
LEA
calculates an effective address and puts it
in an address register, while
PEA
calculates an effective address
in the same way but pushes it on the stack.
Application:
PEA
calculates an effective address to be used later in address
register indirect addressing. In particular, it facilitates the writing
of position independent code. For example,
PEA
(TABLE,PC
)
calculates the address of
TABLE
with respect to the PC and pushes
it on the stack. This address can be read by a procedure and then
used to access the data to which it points. Consider the example:
PEA Wednesday Push the parameter address on the stack
BSR Subroutine Call the procedure
LEA (4,SP),SP Remove space occupied by the parameter
.
Subroutine
MOVEA.L (4,SP),A0 A0 points to parameter under return address
MOVE.W (A0),D2 Access the actual parameter Wednesday
.
RTS
Condition codes:
X N Z V C
- - - - -
Содержание 68000
Страница 1: ...Motorola 68000 s Instruction Set ...
Страница 2: ......