11.07.2015 Views

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

Encyclopedia of Computer Science and Technology

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

asynchronous JavaScript <strong>and</strong> XML 29In this assembly language example, the “define byte” (.db) directive is used to assign one memory byte to each <strong>of</strong> the symbolic names (variables)firstnum, secondnum, <strong>and</strong> total. The two mov comm<strong>and</strong>s then load 2 <strong>and</strong> 3 into firstnum <strong>and</strong> secondnum, respectively. Firstnum isthen loaded into the processor’s accumulator (a), <strong>and</strong> secondnum is then added to it. Finally, the sum is moved into the memory locationlabeled total.allowing the programmer to use more human-friendlynames for instructions <strong>and</strong> data variables. The programthat translates between symbolic language <strong>and</strong> machinelanguage is the assembler.With a symbolic assembler, the programmer can givenames to data locations. Thus, instead <strong>of</strong> saying (<strong>and</strong> havingto remember) that the quantity Total will be in location&H100, the program can simply define a two-byte chunk <strong>of</strong>memory <strong>and</strong> call it Total:Total DBThe assembler will take care <strong>of</strong> assigning a physical memorylocation <strong>and</strong>, when instructed, retrieving or storing thedata in it.Most assemblers also have macro capability. This meansthat the programmer can write a set <strong>of</strong> instructions (a procedure)<strong>and</strong> give it a name. Whenever that name is used inthe program, the assembler will replace it with the actualcode for the procedure <strong>and</strong> plug in whatever variables arespecified as oper<strong>and</strong>s (see macro).ApplicationsIn the mainframe world <strong>of</strong> the 1950s, the development <strong>of</strong>assembly languages represented an important first steptoward symbolic programming; higher-level languages suchas FORTRAN <strong>and</strong> COBOL were developed so that programmerscould express instructions in language that was morelike mathematics <strong>and</strong> English respectively. High-level languages<strong>of</strong>fered greater ease <strong>of</strong> programming <strong>and</strong> sourcecode that was easier to underst<strong>and</strong> (<strong>and</strong> thus to maintain).Gradually, assembly language was reserved for systems programming<strong>and</strong> other situations where efficiency or the needto access some particular hardware capability required theexact specification <strong>of</strong> processing (see systems programming<strong>and</strong> device driver).During the 1970s <strong>and</strong> early 1980s, the same evolutiontook place in microcomputing. The first microcomputerstypically had only a small amount <strong>of</strong> memory (perhaps8–64K), not enough to compile significant programs in ahigh-level language (with the partial exception <strong>of</strong> some versions<strong>of</strong> BASIC). Applications such as graphics <strong>and</strong> games inparticular were written in assembly language for speed. Asavailable memory soared into the hundreds <strong>of</strong> kilobytes <strong>and</strong>then megabytes, however, high level languages such as C<strong>and</strong> C++ became practicable, <strong>and</strong> assembly language beganto be relegated to systems programming, including devicedrivers <strong>and</strong> other programs that had to interact directlywith the hardware.While many people learning programming today receivelittle or no exposure to assembly language, some underst<strong>and</strong>ing<strong>of</strong> this detailed level <strong>of</strong> programming is still usefulbecause it illustrates fundamentals <strong>of</strong> computer architecture<strong>and</strong> operation.Further ReadingAbel, Peter. IBM PC Assembly Language <strong>and</strong> Programming. 5th ed.Upper Saddle River, N.J.: Prentice Hall, 2001.Duntemann, Jeff. Assembly Language Step by Step: Programmingwith DOS <strong>and</strong> Linux. 2nd ed. New York: Wiley, 2000.Miller, Karen. An Assembly Language Introduction to <strong>Computer</strong>Architecture Using the Intel Pentium. New York: Oxford UniversityPress, 1999.asynchronous JavaScript <strong>and</strong> XML See ajax.

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

Saved successfully!

Ooh no, something went wrong!