22.09.2015 Views

of Microprocessors

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MICROPROCESSORS 169<br />

Instruction Set<br />

The 68000 instruction set is best described as simple and straightforward.<br />

Although there are only 56 distinct instruction types (just a few more<br />

than the 6502), there are thousands <strong>of</strong> variations when one takes into account<br />

the addressing modes and other instruction "modifiers." The instruction set<br />

is claimed to be highly "orthogonal" or "symmetrical," which in the limit<br />

means that any instruction could use any addressing mode for both source<br />

and destination operands. Since actual achievement <strong>of</strong> this ideal would<br />

require a very large number <strong>of</strong> bits in the operation code and lead to many<br />

nonsense instructions, most 68000 insrructions have some kind <strong>of</strong>addressing<br />

mode restrictions. Occasionally, these are severe, for instance, the program<br />

counter relative mode can never be used to address a destination.<br />

Besides one or two addressing mode specifications, most instructions<br />

have a size modifier that specifies the length <strong>of</strong> the operands (Table 5-4). The<br />

available sizes are byte (8 bits), word (16 bits), and long word (32 bits). Some<br />

instructions may have an implied size or may operate only on words or long<br />

words. When either a data or an address register is used as a source operand,<br />

the size modifier specifies how much <strong>of</strong> the lower part <strong>of</strong> the register to read.<br />

When a data register is used as a destination, only the lower part is changed.<br />

All 32 bits <strong>of</strong> an address register, however, receive the sign-extended result <strong>of</strong><br />

any instruction using it as a destination.<br />

One reason for so few instruction types for such a powerful processor is<br />

the presence <strong>of</strong> a generalized "Move" instruction. This instruction can use<br />

any addressing mode or register for the source and almost any addressing<br />

mode for the destination. So important is Move that nearly one-quarter <strong>of</strong> the<br />

possible combinations <strong>of</strong> the 16 operation code bits are used by it. With<br />

appropriate addressing modes, Move replaces the myriad loads, stores,<br />

pushes, pops, etc., <strong>of</strong> other instruction sets. One <strong>of</strong> the variations <strong>of</strong> Move<br />

uses what is known as a "quick immediate" source operand. In a single 16-bit<br />

instruction word, any value between - 128 and + 127 can be loaded into any<br />

data register. A "move multiple registers" instruction can move any combination<br />

<strong>of</strong> the general registers to or from any memory location using any <strong>of</strong> the<br />

memory-addressing modes. The combination <strong>of</strong> registers desired is specified<br />

using a one-word bit map where each bit corresponds to a register. This<br />

instruction really makes saving and restoring registers in subroutines easy,<br />

and it executes at full bus-limited speed.<br />

Add and subtract binary arithmetic can be performed on 8-, 16-, and<br />

32-bit quantities. Not only can a register be the recipient <strong>of</strong> the result, but a<br />

register can be added to memory with the result stored in memory. There is<br />

no provision in the 68000 for pairing up data registers to hold 64-bit<br />

operands or results so multiply is restricted to 16 X 16 and divide to 32/16.<br />

Both signed and unsigned binary arithmetic is possible as well as binarycoded-decimal<br />

add and subtract. "Add quick" and "subtract quick" allow any<br />

register or memory location to be incremented or decremented by 1 to 8 with

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!