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.

MICROPROCESSORS 155<br />

1 million bytes/sec is available for dynamic memory refresh, DMA displays,<br />

and other uses without any effect on the microprocessor at all. Most other<br />

microprocessors would be stopped cold using conventional DMA techniques<br />

at this speed. Even another 6502 may be connected to the same bus with<br />

oppositely phased clocking (external clock operation would be required) for a<br />

dual-processor system. Clearly, then, the 6502 bus is actually one <strong>of</strong>the most<br />

flexible available.<br />

Interrupts<br />

Interrupts on the 6502 at first seem somewhat limited but on closer<br />

examination are seen to be extremely flexible. Two priority levels <strong>of</strong> interrupt<br />

are built in, the standard maskable (can be disabled by program instructions)<br />

interrupt and a nonmaskable interrupt, which has a higher priority. The<br />

maskable interrupt request line into the 6502 is level sensitive and will<br />

continue to interrupt the CPU as long as it is enabled and active. Unwanted<br />

multiple interrupts are prevented, however, because the CPU disables them<br />

after the interrupt sequence until the program enables them again. The<br />

nonmaskable interrupt is edge sensitive. Whenever the logic level at this<br />

input goes from high to low, the nonmaskable interrupt sequence is<br />

unconditionally executed. These two different interrupt actions are very<br />

useful in logic replacement applications and in fact avoid a serious problem 4<br />

the 8080 has in general-purpose applications.<br />

The interrupt sequence itself consists <strong>of</strong> executing a "jump to subroutine<br />

indirect" through dedicated addresses in high memory. These addresses<br />

are called vectors and are FFFC-FFFD (hexadecimal notation) for maskable<br />

and FFFE and FFFF for nonmaskable interrupts. Any number <strong>of</strong> vectored<br />

interrupt levels may be implemented for each interrupt type by having<br />

the interrupting device respond to read cycles at those addresses with the<br />

address <strong>of</strong> the service routine.<br />

Registers<br />

The 6502 has possibly fewer bits <strong>of</strong> on-chip registers than any other<br />

microprocessor. Besides the program counter, there is an 8-bit accumulator<br />

and two 8-bit index regIsters. The stack pointer is also 8 bits and the stack is<br />

thus limited to 256 bytes and is always in Page 1. The status register has the<br />

usual negative, carry, and zero flags but also has overflow, interrupt disable,<br />

and decimal mode flags. When the decimal mode flag is on, the arithmetic<br />

instructions assume two-digit BCD data. As we will see later, what is<br />

lacking in register count is made up double in memory-addressing flexibility.<br />

4 If an 8080 program gets caught in a loop with the interrupt disabled, it is impossible<br />

to interrupt the program and return to the monitor. Reset is the only way our, which<br />

destroys the program counter and other registers, making straightforward isolation <strong>of</strong><br />

the loop impossible.

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

Saved successfully!

Ooh no, something went wrong!