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

Text Editor<br />

Much <strong>of</strong> the actual time a user spends with a microcomputer system is<br />

probably spent with the text editor program. Even if he or she is a perfect<br />

typist and never needs to actually edit, the editor is necessary to create text<br />

files for the assembler or compiler or even music interpreter. However, since<br />

people are seldom perfect typists and are never perfect programmers, the<br />

editor is also used to add, delete, change, and move program text. Most<br />

editors are limited to editing files that are small enough to fit into main<br />

memory. Thus, large programs must be broken into acceptably small<br />

segments and edited separately. Typically, a file would be read into a text<br />

buffer in memory, edited as required, and a new file would be created. The<br />

old file can then be deleted if desired. If large insertions that might cause the<br />

file to exceed available memory are anticipated, a portion <strong>of</strong> the text buffer<br />

contents may be written as one file, deleted from memory, and the remainder<br />

along with the insertion would be written as another file. The assembler or<br />

compiler can link the segments together into a single program. Having a<br />

large amount <strong>of</strong> memory available is obviously a benefit when using this type<br />

<strong>of</strong> editor.<br />

Highly sophisticated editors supplied as part <strong>of</strong> some disk-operating<br />

systems are able to handle any size file by scrolling the text through memory<br />

forward and backward in response to user commands. Insertions and deletions<br />

may be made in any order by scrolling the text on the screen to the<br />

desired point and then keying in the change. The inherent editing capability<br />

<strong>of</strong> the disk allows long files to be edited directly without creating unnecessary<br />

copies. Less advanced editors may still allow unlimited file size and<br />

insertions but can only scroll forward, thus requiring that editing be done in<br />

sequence to some extent.<br />

Assembler<br />

The purpose <strong>of</strong>an assembler is to convert program source text statements<br />

into binary machine language object code and a printed listing. Assemblers<br />

work in a variety <strong>of</strong> ways according to the size <strong>of</strong> system they were designed<br />

for and level <strong>of</strong> sophistication.<br />

Today, good assemblers work with a disk-operating system in a general<br />

way that is much more convenient than the early cassette-based ones were.<br />

Before being run, the assembler is given the name <strong>of</strong> the source file, which<br />

already exists, and the names <strong>of</strong> two new files that it will create; one to hold<br />

the object code and the other to hold the listing. The assembler then scans<br />

the source file two or three times and produces the object and listing files.<br />

Before printing the listing file, the user can quickly scan it using the editor<br />

to see ifany errors were flagged by the assembler. Assuming there were few or<br />

none, the editor can be commanded to print the listing if one is actually

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

Saved successfully!

Ooh no, something went wrong!