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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

166 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

as floating-point math. For now, the subroutine that services the emulator<br />

instructions can decode and "execute" them in s<strong>of</strong>tware. Beyond these, there<br />

are 16 more trap instructions, each with its own interrupt vector. The traps<br />

are typically used to call operating system routines (as many as 16) without<br />

the user program needing to know where in memory the routines are stored.<br />

Finally, there is a trace interrupt that is generated after evety instruction<br />

execution ifthe trace bit is on in the status register. This feature makes it very<br />

easy to implement s<strong>of</strong>tware tracing <strong>of</strong> program execution.<br />

There are eight separate interrupt priority levels in the 68000. The<br />

highest are internally generated and external hardware error indications that<br />

cannot be disabled. The other seven levels are normal I/O-type interrupts. A<br />

3-bit level number in the status register determines which levels are allowed<br />

to generate interrupts. When this register contains seven, all I/O interrupts<br />

except Level 7 are inhibited. When it contains lower numbers, lower level<br />

interrupts are allowed. A zero level number allows all interrupts. When an<br />

interrupt is recognized, the current level number in the status register is<br />

changed to match the level number being serviced, thus inhibiting further<br />

interrupts on that or a lower level. Higher-priority interrupts, however, can<br />

still interrupt the lower-priority service routine, thus providing a true<br />

multilevel nested operation.<br />

I/O interrupt hardware can be either simple or complex. For a simple<br />

system, the 68000 can be instructed to generate a vector number based on<br />

the priority level being serviced, thus providing up to seven possible<br />

interrupt sources. This autovector mode is activated by driving the VPA signal<br />

during interrupt acknowledge bus cycles. Using this approach does not<br />

preclude having multiple interrupt sources on each level, but then the level<br />

service routine would have to poll devices on its level to determine which was<br />

interrupting. With more complex hardware, each interrupting device can<br />

drive a unique 8-bit vector number onto the data bus during interrupt<br />

acknowledge bus cycles. This would provide for direct, automatic entry into<br />

each device's service subroutine with no polling or status testing necessary.<br />

Registers<br />

Whereas the 6502 <strong>of</strong>fers a spartan set <strong>of</strong> four working registers but very<br />

flexible memory addressing to compensate, the 68000 <strong>of</strong>fers the most<br />

registers coupled with the most useful addressing modes. There are in fact<br />

eight data registers and eight address registers, each <strong>of</strong>which is a full 32 bits in<br />

length. All eight <strong>of</strong> the data registers (DO-D7) and seven <strong>of</strong> the address<br />

registers (AO-A6) can be used however the program sees fit. Address Register<br />

7 is normally reserved as a stack pointer, since the interrupt, subroutine<br />

linkage, and privilege hardware assume that. There are, in fact, two A7<br />

registers, one for Supervisor Mode and one for User Mode. The present<br />

privilege mode selects which one is active. Actually, any <strong>of</strong> the address

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

Saved successfully!

Ooh no, something went wrong!