68000.pdf

(822 KB) Pobierz
The 68000's Instruction Set
W e have included this appendix to save you the task of having to turn to secondary
material when writing 68000 assembly language programs. Since most
programmers are not interested in the encoding of instructions, details of
instruction encoding have been omitted (i.e., the actual op-code bit patterns).
Applications of some of the instructions have been provided to demonstrate how
they can be used in practice.
Instructions are listed by mnemonic in alphabetical order. The information
provided about each instruction is: its assembler syntax, its attributes (i.e., whether
it takes a byte, word, or longword operand), its description in words, the effect its
execution has on the condition codes, and the addressing modes it may take. The
effect of an instruction on the CCR is specified by the following codes:
U The state of the bit is undefined (i.e., its value cannot be predicted)
- The bit remains unchanged by the execution of the instruction
* The bit is set or cleared according to the outcome of the instruction.
Unless an addressing mode is implicit (e.g., NOP , RESET , RTS , etc.), the legal
source and destination addressing modes are specified by their assembly language
syntax. The following notation is used to describe the 68000's instruction set.
Data and address register direct.
Dn, An
Address register indirect.
(An)
Address register indirect with post-incrementing or pre-
decrementing.
(An)+, -(An)
Address register indirect with displacement, and address
register indirect with indexing and a displacement.
(d,An), (d,An,Xi)
Absolute addressing with a 16-bit or a 32-bit address.
ABS.W, ABS.L
Program counter relative addressing with a 16-bit offset,
or with an 8-bit offset plus the contents of an index
register.
(d,PC), (d,PC,Xi)
An immediate value (i.e., literal) which may be 16 or 32
bits, depending on the instruction.
imm
1
930890739.541.png
2
The 68000's Instruction Set
Two notations are employed for address register indirect addressing. The
notation originally used to indicate address register indirect addressing has been
superseded. However, the Teesside 68000 simulator supports only the older form.
Old notation
Current notation
d(An), d(An,Xi)
(d,An), (d,An,Xi)
d(PC), d(PC,Xi)
(d,PC), (d,PC,Xi)
ABCD
Add decimal with extend
Operation:
[destination] 10 ¬ [source] 10 + [destination] 10 + [X]
Syntax:
ABCD Dy,Dx
ABCD -(Ay),-(Ax)
Attributes:
Size = byte
Description:
Add the source operand to the destination operand along with
the extend bit, and store the result in the destination location.
The addition is performed using BCD arithmetic. The only legal
addressing modes are data register direct and memory to memory
with address register indirect using pre-decrementing.
Application:
The ABCD instruction is used in chain arithmetic to add together
strings of BCD digits. Consider the addition of two nine-digit
numbers. Note that the strings are stored so that the least-
significant digit is at the high address.
LEA Number1,A0
A0 points at first string
LEA Number2,A1
A1 points at second string
MOVE #8,D0
Nine digits to add
MOVE #$04,CCR
Clear X-bit and Z-bit of the CCR
LOOP
ABCD -(A0),-(A1)
Add a pair of digits
DBRA D0,LOOP
Repeat until 9 digits added
Condition codes: X N Z V C
* U * U *
The Z-bit is cleared if the result is non-zero, and left unchanged
otherwise. The Z-bit is normally set by the programmer before
the BCD operation, and can be used to test for zero after a chain
of multiple-precision operations. The C-bit is set if a decimal
carry is generated.
The 68000's Instruction Set
3
ADD
Add binary
Operation:
[destination] ¬ [source] + [destination]
Syntax:
ADD <ea>,Dn
ADD Dn,<ea>
Attributes:
Size = byte, word, longword
Description:
Add the source operand to the destination operand and store the
result in the destination location.
Condition codes: X N Z V C
* * * * *
Source operand addressing modes
Destination operand addressing modes
ADDA
Add address
Operation:
[destination] ¬ [source] + [destination]
Syntax:
ADDA <ea>,An
Attributes:
Size = word, longword
Description:
Add the source operand to the destination address register and
store the result in the destination address register. The source is
sign-extended before it is added to the destination. For example,
if we execute ADDA.W D3,A4 where A4 = 00000100 16 and D3.W =
8002 16 , the contents of D3 are sign-extended to FFFF8002 16 and
added to 00000100 16 to give FFFF8102 16 , which is stored in A4.
930890739.552.png 930890739.563.png 930890739.574.png 930890739.001.png 930890739.012.png 930890739.023.png 930890739.034.png 930890739.045.png 930890739.056.png 930890739.067.png 930890739.078.png 930890739.089.png 930890739.100.png 930890739.111.png 930890739.122.png 930890739.133.png 930890739.144.png 930890739.155.png 930890739.166.png 930890739.177.png 930890739.188.png 930890739.199.png 930890739.210.png 930890739.221.png 930890739.232.png 930890739.243.png 930890739.254.png 930890739.265.png 930890739.276.png 930890739.287.png 930890739.298.png 930890739.309.png 930890739.320.png 930890739.331.png 930890739.342.png 930890739.353.png 930890739.364.png 930890739.375.png 930890739.386.png 930890739.397.png 930890739.408.png 930890739.419.png 930890739.430.png 930890739.441.png 930890739.452.png 930890739.463.png 930890739.474.png 930890739.485.png 930890739.496.png 930890739.507.png 930890739.518.png 930890739.529.png 930890739.540.png 930890739.542.png 930890739.543.png 930890739.544.png 930890739.545.png 930890739.546.png 930890739.547.png 930890739.548.png 930890739.549.png 930890739.550.png 930890739.551.png 930890739.553.png 930890739.554.png 930890739.555.png 930890739.556.png 930890739.557.png 930890739.558.png 930890739.559.png 930890739.560.png 930890739.561.png 930890739.562.png 930890739.564.png 930890739.565.png 930890739.566.png 930890739.567.png 930890739.568.png 930890739.569.png 930890739.570.png 930890739.571.png 930890739.572.png 930890739.573.png 930890739.575.png 930890739.576.png 930890739.577.png 930890739.578.png 930890739.579.png 930890739.580.png 930890739.581.png 930890739.582.png 930890739.583.png 930890739.584.png 930890739.002.png 930890739.003.png 930890739.004.png 930890739.005.png 930890739.006.png 930890739.007.png 930890739.008.png 930890739.009.png 930890739.010.png 930890739.011.png 930890739.013.png 930890739.014.png 930890739.015.png 930890739.016.png 930890739.017.png 930890739.018.png 930890739.019.png 930890739.020.png 930890739.021.png 930890739.022.png 930890739.024.png 930890739.025.png 930890739.026.png 930890739.027.png 930890739.028.png 930890739.029.png 930890739.030.png 930890739.031.png 930890739.032.png 930890739.033.png 930890739.035.png 930890739.036.png 930890739.037.png 930890739.038.png 930890739.039.png 930890739.040.png 930890739.041.png 930890739.042.png 930890739.043.png 930890739.044.png 930890739.046.png 930890739.047.png 930890739.048.png 930890739.049.png 930890739.050.png 930890739.051.png 930890739.052.png 930890739.053.png 930890739.054.png 930890739.055.png 930890739.057.png 930890739.058.png 930890739.059.png 930890739.060.png 930890739.061.png 930890739.062.png 930890739.063.png 930890739.064.png 930890739.065.png 930890739.066.png 930890739.068.png 930890739.069.png 930890739.070.png 930890739.071.png 930890739.072.png 930890739.073.png 930890739.074.png 930890739.075.png 930890739.076.png 930890739.077.png 930890739.079.png 930890739.080.png 930890739.081.png 930890739.082.png 930890739.083.png 930890739.084.png 930890739.085.png 930890739.086.png 930890739.087.png 930890739.088.png 930890739.090.png 930890739.091.png 930890739.092.png 930890739.093.png 930890739.094.png 930890739.095.png 930890739.096.png 930890739.097.png 930890739.098.png 930890739.099.png 930890739.101.png 930890739.102.png 930890739.103.png 930890739.104.png 930890739.105.png 930890739.106.png 930890739.107.png 930890739.108.png 930890739.109.png 930890739.110.png 930890739.112.png 930890739.113.png 930890739.114.png 930890739.115.png 930890739.116.png 930890739.117.png 930890739.118.png 930890739.119.png 930890739.120.png 930890739.121.png 930890739.123.png 930890739.124.png 930890739.125.png 930890739.126.png 930890739.127.png 930890739.128.png 930890739.129.png 930890739.130.png 930890739.131.png 930890739.132.png 930890739.134.png 930890739.135.png 930890739.136.png 930890739.137.png 930890739.138.png 930890739.139.png 930890739.140.png 930890739.141.png 930890739.142.png 930890739.143.png 930890739.145.png 930890739.146.png 930890739.147.png 930890739.148.png 930890739.149.png 930890739.150.png 930890739.151.png 930890739.152.png 930890739.153.png 930890739.154.png
4
The 68000's Instruction Set
Application:
To add to the contents of an address register and not update the
CCR. Note that ADDA.W D0,A0 is the same as LEA (A0,D0.W),A0 .
Condition codes: X N Z V C
- - - - -
An ADDA operation does not affect the state of the CCR.
Source operand addressing modes
ADDI
Add immediate
Operation:
[destination] ¬ <literal> + [destination]
Syntax:
ADDI #<data>,<ea>
Attributes:
Size = byte, word, longword
Description:
Add immediate data to the destination operand. Store the result
in the destination operand. ADDI can be used to add a literal
directly to a memory location. For example, ADDI.W #$1234,$2000
has the effect [M(2000 16 )] ¬ [M(2000 16 )] + 1234 16 .
Condition codes: X N Z V C
* * * * *
Destination operand addressing modes
ADDQ
Add quick
Operation:
[destination] ¬ <literal> + [destination]
Syntax:
ADDQ #<data>,<ea>
930890739.156.png 930890739.157.png 930890739.158.png 930890739.159.png 930890739.160.png 930890739.161.png 930890739.162.png 930890739.163.png 930890739.164.png 930890739.165.png 930890739.167.png 930890739.168.png 930890739.169.png 930890739.170.png 930890739.171.png 930890739.172.png 930890739.173.png 930890739.174.png 930890739.175.png 930890739.176.png 930890739.178.png 930890739.179.png 930890739.180.png 930890739.181.png 930890739.182.png 930890739.183.png 930890739.184.png 930890739.185.png 930890739.186.png 930890739.187.png 930890739.189.png 930890739.190.png 930890739.191.png 930890739.192.png 930890739.193.png 930890739.194.png 930890739.195.png 930890739.196.png 930890739.197.png 930890739.198.png 930890739.200.png 930890739.201.png 930890739.202.png 930890739.203.png 930890739.204.png 930890739.205.png 930890739.206.png 930890739.207.png 930890739.208.png 930890739.209.png 930890739.211.png 930890739.212.png 930890739.213.png 930890739.214.png 930890739.215.png 930890739.216.png 930890739.217.png 930890739.218.png 930890739.219.png 930890739.220.png 930890739.222.png 930890739.223.png 930890739.224.png 930890739.225.png 930890739.226.png 930890739.227.png 930890739.228.png 930890739.229.png 930890739.230.png 930890739.231.png 930890739.233.png 930890739.234.png 930890739.235.png 930890739.236.png 930890739.237.png 930890739.238.png 930890739.239.png 930890739.240.png 930890739.241.png 930890739.242.png 930890739.244.png 930890739.245.png 930890739.246.png 930890739.247.png 930890739.248.png 930890739.249.png 930890739.250.png 930890739.251.png 930890739.252.png 930890739.253.png 930890739.255.png 930890739.256.png 930890739.257.png 930890739.258.png 930890739.259.png 930890739.260.png 930890739.261.png 930890739.262.png 930890739.263.png 930890739.264.png 930890739.266.png 930890739.267.png 930890739.268.png 930890739.269.png 930890739.270.png 930890739.271.png 930890739.272.png 930890739.273.png 930890739.274.png 930890739.275.png 930890739.277.png 930890739.278.png 930890739.279.png 930890739.280.png 930890739.281.png 930890739.282.png 930890739.283.png 930890739.284.png 930890739.285.png 930890739.286.png 930890739.288.png 930890739.289.png 930890739.290.png 930890739.291.png 930890739.292.png 930890739.293.png 930890739.294.png 930890739.295.png 930890739.296.png 930890739.297.png 930890739.299.png 930890739.300.png 930890739.301.png 930890739.302.png 930890739.303.png 930890739.304.png 930890739.305.png 930890739.306.png 930890739.307.png 930890739.308.png 930890739.310.png 930890739.311.png 930890739.312.png 930890739.313.png 930890739.314.png 930890739.315.png 930890739.316.png 930890739.317.png 930890739.318.png 930890739.319.png 930890739.321.png 930890739.322.png 930890739.323.png 930890739.324.png 930890739.325.png 930890739.326.png 930890739.327.png 930890739.328.png 930890739.329.png 930890739.330.png 930890739.332.png 930890739.333.png 930890739.334.png 930890739.335.png 930890739.336.png 930890739.337.png 930890739.338.png 930890739.339.png 930890739.340.png 930890739.341.png 930890739.343.png 930890739.344.png 930890739.345.png 930890739.346.png 930890739.347.png 930890739.348.png 930890739.349.png 930890739.350.png 930890739.351.png 930890739.352.png 930890739.354.png 930890739.355.png 930890739.356.png 930890739.357.png 930890739.358.png 930890739.359.png 930890739.360.png 930890739.361.png 930890739.362.png 930890739.363.png 930890739.365.png 930890739.366.png 930890739.367.png 930890739.368.png 930890739.369.png 930890739.370.png 930890739.371.png 930890739.372.png 930890739.373.png 930890739.374.png 930890739.376.png 930890739.377.png 930890739.378.png 930890739.379.png 930890739.380.png 930890739.381.png 930890739.382.png 930890739.383.png 930890739.384.png 930890739.385.png 930890739.387.png 930890739.388.png 930890739.389.png 930890739.390.png 930890739.391.png 930890739.392.png 930890739.393.png 930890739.394.png 930890739.395.png 930890739.396.png 930890739.398.png 930890739.399.png 930890739.400.png 930890739.401.png 930890739.402.png 930890739.403.png 930890739.404.png 930890739.405.png 930890739.406.png 930890739.407.png 930890739.409.png 930890739.410.png 930890739.411.png
The 68000's Instruction Set
5
Sample syntax:
ADDQ #6,D3
Attributes:
Size = byte, word, longword
Description:
Add the immediate data to the contents of the destination operand.
The immediate data must be in the range 1 to 8. Word and
longword operations on address registers do not affect condition
codes. Note that a word operation on an address register affects
all bits of the register.
Application:
ADDQ is used to add a small constant to the operand at the effective
address. Some assemblers permit you to write ADD and then choose
ADDQ automatically if the constant is in the range 1 to 8.
Condition codes: Z N Z V C
* * * * *
Note that the CCR is not updated if the destination operand is an
address register.
Destination operand addressing modes
ADDX
Add extended
Operation:
[destination] ¬ [source] + [destination] + [X]
Syntax:
ADDX Dy,Dx
ADDX -(Ay),-(Ax)
Attributes:
Size = byte, word, longword
Description:
Add the source operand to the destination operand along with
the extend bit, and store the result in the destination location.
The only legal addressing modes are data register direct and
memory to memory with address register indirect using pre-
decrementing.
Application:
The ADDX instruction is used in chain arithmetic to add together
strings of bytes (words or longwords). Consider the addition of
930890739.412.png 930890739.413.png 930890739.414.png 930890739.415.png 930890739.416.png 930890739.417.png 930890739.418.png 930890739.420.png 930890739.421.png 930890739.422.png 930890739.423.png 930890739.424.png 930890739.425.png 930890739.426.png 930890739.427.png 930890739.428.png 930890739.429.png 930890739.431.png 930890739.432.png 930890739.433.png 930890739.434.png 930890739.435.png 930890739.436.png 930890739.437.png 930890739.438.png 930890739.439.png 930890739.440.png 930890739.442.png 930890739.443.png 930890739.444.png 930890739.445.png 930890739.446.png 930890739.447.png 930890739.448.png 930890739.449.png 930890739.450.png 930890739.451.png 930890739.453.png 930890739.454.png 930890739.455.png 930890739.456.png 930890739.457.png 930890739.458.png 930890739.459.png 930890739.460.png 930890739.461.png 930890739.462.png 930890739.464.png 930890739.465.png 930890739.466.png 930890739.467.png 930890739.468.png 930890739.469.png 930890739.470.png 930890739.471.png 930890739.472.png 930890739.473.png 930890739.475.png 930890739.476.png 930890739.477.png 930890739.478.png 930890739.479.png 930890739.480.png 930890739.481.png 930890739.482.png 930890739.483.png 930890739.484.png 930890739.486.png 930890739.487.png 930890739.488.png 930890739.489.png 930890739.490.png 930890739.491.png 930890739.492.png 930890739.493.png 930890739.494.png 930890739.495.png 930890739.497.png 930890739.498.png 930890739.499.png 930890739.500.png 930890739.501.png 930890739.502.png 930890739.503.png 930890739.504.png 930890739.505.png 930890739.506.png 930890739.508.png 930890739.509.png 930890739.510.png 930890739.511.png 930890739.512.png 930890739.513.png 930890739.514.png 930890739.515.png 930890739.516.png 930890739.517.png 930890739.519.png 930890739.520.png 930890739.521.png 930890739.522.png 930890739.523.png 930890739.524.png 930890739.525.png 930890739.526.png 930890739.527.png 930890739.528.png 930890739.530.png 930890739.531.png 930890739.532.png 930890739.533.png 930890739.534.png 930890739.535.png 930890739.536.png 930890739.537.png 930890739.538.png 930890739.539.png
Zgłoś jeśli naruszono regulamin