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 173<br />

and is set the same as Carryon arithmetic instructions but is not affected by<br />

moves. The Extend bit is used instead <strong>of</strong> carry by the multiple-precision<br />

instructions Add Extended and Subtract Extended. Conditional branch<br />

instructions have a 4-bit field that is coded for useful combinations <strong>of</strong> the<br />

condition codes. For example, the "greater than" jump condition is<br />

determined by a complex logical combination <strong>of</strong> the Negative, Zero, and<br />

Overflow bits such that it works even after comparing two signed numbers<br />

that were large enough to cause overflow when subtracted in the comparison<br />

process. Explicit branch conditions are available for all seven possible<br />

relations between two operands, both signed and unsigned, plus an always<br />

true and an always false condition to make a total <strong>of</strong> 16. The conditional<br />

branch instruction itself can test for a condition and jump up to 126 bytes<br />

away in a one-word instruction. A two-word format can jump up to 32K<br />

bytes away while an unconditional jump instruction can use any addressing<br />

mode to jump anywhere.<br />

Other unusual or specialized instructions include test any bit by bit<br />

number in either a register or memory and optionally set, clear, or flip it.<br />

The bit number itself can either be specified in the instruction or in a data<br />

register. Check is a single word instruction that simultaneously compares a<br />

data register with zero and a value specified using any addressing mode. If<br />

the register content is out <strong>of</strong> bounds, an interrupt is generated. This<br />

instruction can be liberally sprinkled in sensitive code without significantly<br />

increasing its space or time requirements. Another time-saver is the<br />

Decrement and Branch instruction. As usual, it will decrement the content<br />

<strong>of</strong> a register and simultaneously branch if the result is not yet negative.<br />

However, it also tests a specified branch condition and will not branch if it is<br />

met. Thus, there are two possible exits from a loop constructed using this<br />

instruction. Link and Unlink instructions are used to conveniently reserve<br />

space on the stack when a subroutine is entered and then freeing it upon<br />

return. Load-Effective Address simply performs an addressing mode calculation<br />

and puts the result into a specified address register or it can be pushed<br />

onto the stack.<br />

Speed<br />

Computing the exact execution time <strong>of</strong> a particular 68000 instruction<br />

is difficult because the effect <strong>of</strong> each addressing mode for both the source and<br />

destination operands as well as the size specification must be considered. In<br />

general, however, all <strong>of</strong> the simple instructions require time equal to the sum<br />

<strong>of</strong> their memory cycles plus perhaps two to four more clock cycles for internal<br />

computation. Shifts require two clock cycles per position shifted. Multiply<br />

requires approximately 70 clocks, whereas divide needs 150, which translates<br />

into 9 and 19 /-Lsec, respectively, at 8 MHz. Interrupt response takes about 44<br />

clocks, which, when added to the longest possible instruction (a divide),

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

Saved successfully!

Ooh no, something went wrong!