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.

150 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

desired. The operating system may either load the object file into memory<br />

itself or a loader program may be used for that purpose. After loading, the<br />

user may specify the data files, if any, and execute the program. With such a<br />

setup, program size is limited only by the capacity <strong>of</strong> the diskette and the<br />

amount <strong>of</strong> memory available for the assembler's symbol table. Most <strong>of</strong> the<br />

preceding comments also apply to compiler languages such as FORTRAN or<br />

the new structured microcomputer languages such as C and Pascal.<br />

High-Level Language<br />

By far the most popular high-level language for microcomputers is<br />

BASIC. Originally developed at Dartmouth University for student use on a<br />

large time-sharing computer, it has evolved well beyond its design goals into<br />

a general-purpose programming language. Although its strengths and weaknesses<br />

in music programming will be detailed in Chapter 18, it can be said<br />

here that it is an excellent one-shot problem-solving language but not especially<br />

suited for large or complex programs. As a matter <strong>of</strong> fact, most <strong>of</strong> the<br />

waveforms and plots in this book were done using simple BASIC programs.<br />

BASIC will also be used periodically to illustrate program algorithms. One<br />

unique feature present in nearly all microcomputer BASIC is the PEEK and<br />

POKE functions. These allow a BASIC program to directly address and read<br />

or write any memory location in the microcomputer. If the system utilizes<br />

memory-mapped 1/0 2 , then BASIC programs may be written to operate any<br />

I/O device on the system!<br />

On microcomputers, BASIC is almost exclusively implemented as an<br />

interpreter and is permanently stored in read-only memory. Thus, BASIC<br />

programs exist in memory as character strings in the same form as they<br />

appear in print except for perhaps the substitution <strong>of</strong> single, normally<br />

unprintable, bytes for keywords. Part <strong>of</strong> the BASIC interpreter is a simple,<br />

line-number-oriented text editor. When the "run" command is given, the<br />

interpreter scans each program line, extracts the meaningful information<br />

from the line, acts upon it, and then goes to the next line. As a result, BASIC<br />

programs tend to run very slowly compared to the inherent capability <strong>of</strong> the<br />

microcomputer. Nevertheless, BASIC is very easy to learn and use and for any<br />

but highly repetitive calculations its speed is adequate. Most disk-based<br />

microcomputers also have a BASIC compiler available, which greatly speeds up<br />

execution at the expense <strong>of</strong> losing the interpreter's interactive program<br />

development feature.<br />

Another commonly used language on microcomputers is simply called<br />

C. It was developed at Bell Laboratories to run on PDP-ll minicomputers<br />

and has efficiency features that make it suitable fot system programming as<br />

2Memory-mapped I/O is peculiar ro the PDP-II line <strong>of</strong> minicomputers and most<br />

microprocessors. Essentially all I/O device status, control, and data registers are<br />

addressed like memory locations with all memory reference microprocessor instructions<br />

available for I/O register manipulation.

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

Saved successfully!

Ooh no, something went wrong!