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

registers can be used as a stack pointer with equal ease, a valuable feature for<br />

many high-level languages.<br />

Data registers act essentially like accumulators and all are equivalent;<br />

none have dedicated functions. All <strong>of</strong> the standard arithmetic operations<br />

including shifts and multiply/divide operate on data registers. Some <strong>of</strong> the<br />

addressing modes can use values in the data registers as <strong>of</strong>fsets and indices.<br />

Since data registers are 32 bits long, they are <strong>of</strong>ten called upon to hold<br />

shorter 8- and 16-bit values. In general, when a shorter value is loaded into<br />

or created in a data register, it is put at the lower (rightmost) end and the<br />

remainder <strong>of</strong> the register is not changed. This action can lead to program bugs<br />

but is very useful when needed.<br />

Address registers most closely resemble the index registers <strong>of</strong> classic<br />

computers. Limited arithmetic such as add/subtract, compare, and increment/decrement<br />

can be performed but not shifts or logical operations.<br />

Address registers always contain 32-bit values; if a word value is loaded or<br />

generated, it is sign extended to 32 bits. Byte-sized operations are not allowed<br />

on address registers.<br />

Addressing Modes<br />

Historically, as small computers became more sophisticated, the<br />

greatest improvement was in the variety <strong>of</strong> memory-addressing modes<br />

available. For example, the Digital Equipment PDP-ll became the most<br />

popular minicomputer largely because <strong>of</strong> its many and varied addressing<br />

modes. Likewise, the 6502, Motorola 6809, and 68000 have reached the<br />

heads <strong>of</strong> their respective classes because <strong>of</strong> flexible memory addressing.<br />

Addressing modes are important because, when manipulating common<br />

data structures, the availability <strong>of</strong> a single instruction with an appropriate<br />

addressing mode can replace several time- and space-consuming address<br />

calculation instructions. This is doubly important in music synthesis<br />

applications, which typically manipulate large, moderately complex data<br />

structures. A particularly strong point <strong>of</strong> the 68000 is that these addressing<br />

modes work for data arrays as large as the addressing range, i.e., up to 16M<br />

bytes. Other processors using segmented memory, such as the 8086 series,<br />

may have nearly as many addressing modes as the 68000, but they are useless<br />

when array sizes exceed 64K bytes. In fact, a considerable amount <strong>of</strong> segment<br />

register swapping is usually necessary when the total size <strong>of</strong> all arrays exceeds<br />

128K bytes.<br />

Table 5-3 is a summary description <strong>of</strong> the addressing modes <strong>of</strong>fered by<br />

the 68000. Keep in mind that, whenever an address register or a data register<br />

participates in an address mode calculation, the full 32 bits (or optionally 16<br />

bits) <strong>of</strong> the register is used. Also, the result <strong>of</strong> an addresss calculation is<br />

always a 32-bit integer <strong>of</strong> which the lower 24 are sent out to the address bus<br />

on the 68000. The 68020, with its 4G-byte addressing range, merely sends<br />

out all 32-bits <strong>of</strong> the result; the addressing modes still work the same way.

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

Saved successfully!

Ooh no, something went wrong!