music
OSdata.com: assembly language 

OSdata.com

Assembly Language

introduction

summary

    This web page examines assembly languages in a general manner. Specific examples of addressing modes and instructions from various processors are used to illustrate the general nature of assembly language.

Now building a

free computer programming text book project

If you like the idea of this project,
then please donate some money.

more information on donating

Google

Now building a For those with high speed connections, the very large single file summary is still on line.

free
downloadable
computer
programming
text book
HTML
or
table of
contents

work in
progress

general

    Unlike the other programming languages catalogued here, assembly language is not a single language, but rather a group of languages. Each processor family (and sometimes individual processors within a processor family) has its own assembly language.

    In contrast to high level languages, data structures and program structures in assembly language are created by directly implementing them on the underlying hardware. So, instead of catalogueing the data structures and program structures that can be built (in assembly language you can build any structures you so desire, including new structures nobody else has ever created), we will compare and contrast the hardware capabilities of various processor families.

    This web page does not attempt to teach how to program in assembly language. Because of the close relationship between assembly languages and the underlying hardware, this web page will discuss hardware implementation as well as software.

    If you aren’t fairly familiar with how computers work, you should probably first read basics of computer hardware or this page won’t make any sense at all.

history

    history: The oldest non-machine language, allowing for a more human readable method of writing programs than writing in binary bit patterns (or even hexadecimal patterns).

comparison of assembly and high level languages

    Assembly languages are close to a one to one correspondence between symbolic instructions and executable machine codes. Assembly languages also include directives to the assembler, directives to the linker, directives for organizing data space, and macros. Macros can be used to combine several assembly language instructions into a high level language-like construct (as well as other purposes). There are cases where a symbolic instruction is translated into more than one machine instruction. But in general, symbolic assembly language instructions correspond to individual executable machine instructions.

    High level languages are abstract. Typically a single high level instruction is translated into several (sometimes dozens or in rare cases even hundreds) executable machine language instructions. Some early high level languages had a close correspondence between high level instructions and machine language instructions. For example, most of the early COBOL instructions translated into a very obvious and small set of machine instructions. The trend over time has been for high level languages to increease in abstraction. Modern object oriented programming languages are highly abstract (although, interestingly, some key object oriented programming constructs do translate into a very compact set of machine instructions).

    Assembly language is much harder to program than high level languages. The programmer must pay attention to far more detail and must have an intimate knowledge of the processor in use. But high quality hand crafted assembly language programs can run much faster and use much less memory and other resources than a similar program written in a high level language. Speed increases of two to 20 times faster are fairly common, and increases of hundreds of times faster are occassionally possible. Assembly language programming also gives direct access to key machine features essential for implementing certain kinds of low level routines, such as an operating system kernel or microkernel, device drivers, and machine control.

    High level programming languages are much easier for less skilled programmers to work in and for semi-technical managers to supervise. And high level languages allow faster development times than work in assembly language, even with highly skilled programmers. Development time increases of 10 to 100 times faster are fairly common. Programs written in high level languages (especially object oriented programming languages) are much easier and less expensive to maintain than similar programs written in assembly language (and for a successful software project, the vast majority of the work and expense is in maintenance, not initial development).

    For information on how to interface high level languages and assembly languages, see assembly/high level language interface

availability

    availability: Assemblers are available for just about every processor ever made. Native assemblers produce object code on the same hardware that the object code will run on. Cross assemblers produce object code on different hardware that the object code will run on.

structure

    format: free form or column (depends on the assembly langauge)

    nature: procedural language with one to one correspondence between language mnemonics and executable machine instructions.

    “Assembler languages occupy a unique place in the computing world. Since most assmebler-language statements are symbolic of individual machine-language instructions, the assembler-language programmer has the full power of the computer at his disposal in a way that users of other languages do not. Because of the direct relationship between assembler language and machine language, assembler language is used when high efficiency of programs is needed, and especially in areas of application that are so new and amorphous that existing program-oriented languages are ill-suited for describing the procedures to be followed.” —Assembler Language Programming by George W. Struble, page viib1

    “Perhaps the most glaring difference among the three types of languages [high level, assembly, and machine] is that as we move from high-level languages to lower levels, the code gets harder to read (with understanding). The major advantages of high-level languages are that they are easy to read and are machine independent. The instructions are written in a combination of English and ordinary mathematical notation, and programs can be run with minor, if any, changes on different computers.” —VAX-11 Assembly Language Programming by Sara Baase, page 1b2

    “The second most visible difference among the different types of languages is that several lines of assembly language are needed to encode one line of a high-level language program.” —VAX-11 Assembly Language Programming by Sara Baase, page 2b2

    “There are a number of situations in which it is very desirable to use assembler language routines to do part of a job, and use some higher-level language for other parts. It makes sense to use higher-level languages such as Fortran, COBOL, or PL/I for parts of procedures for which they are well-suited, and supplement with assembler language routines for those parts of procedures for which the higher-level language is awkward or inefficient.” —Assembler Language Programming by George W. Struble, page 427b1

    “If one has a choice between assembly language and a high-level language, why choose assembly language? The fact that the amount of programming done in assembly language is quite small compared to the amount done in high-level languages indicates that one generally doesn’t choose assembly language. However, there are situations where it may not be convenient, efficient, or possible to write programs in hihg-level languages. … Programs to control and communicate with peripheral devices (input and output devices) are usually written in assembly language because they use special instructions that are not available in high-level languages, and they must be very efficient. Some systems programs are written in assembly language for similar reasons. In general, since high-level languages are designed without the features of a particular machine in mind and a compiler must do its job in a standardized way to accomodate all valid programs, there are situations where to take advantage of special features of a machine, to program some details that are inaccessible from a high-level language, or perhaps to increase the efficiency of a program, one may reasonably choose to write in assembly language.” —VAX-11 Assembly Language Programming by Sara Baase, page 3-4b2

    “In situations where programming in a high-level language is not appropriate, it is clear that assembly language is to be preferred to machine language. Assembly language has a number of advantages over machine code aside from the obvious increase in readability. One is that the use of symbolic names for data and instruction labels frees the programmer from computing and recomputing the memory locations whenever a change is made in a program. Another is that assembly languages generally have a feature, called macros, that frees the [programmer] from having to repeat similar sections of code used in several places in a program. Assemblers fo many bookkeeping and other tasks for the user. Often compilers translate into assembly language rather than machine code.” —VAX-11 Assembly Language Programming by Sara Baase, page 3b2

kinds of processors

    Processors can broadly be divided into the categories of: CISC, RISC, hybrid, and special purpose.

    Complex Instruction Set Computers (CISC) have a large instruction set, with hardware support for a wide variety of operations. In scientific, engineering, and mathematical operations with hand coded assembly language (and some business applications with hand coded assembly language), CISC processors usually perform the most work in the shortest time.

    Reduced Instruction Set Computers (RISC) have a small, compact instruction set. In most business applications and in programs created by compilers from high level language source, RISC processors usually perform the most work in the shortest time.

    Hybrid processors are some combination of CISC and RISC approaches, attempting to balance the advantages of each approach.

    Special purpose processors are optimized to perform specific functions. Digital signal processors, graphics chips, and various kinds of co-processors are the most common kinds of special purpose processors.

executable instructions

    There are four general classes of machine instructions. Some instructions may have characteristics of more than one major group. The four general classes of machine instructions are: computation, data transfer, sequencing, and environment control.

    Executable instructions can be divided into several broad categories of related operations:

Now building a

further reading: books:

If you want your book reviewed, please send a copy to: Milo, POB 1361, Tustin, CA 92781, USA.

Price listings are for courtesy purposes only and may be changed by the referenced businesses at any time without notice.

further reading: books: general

    Structured Computer Organization, 4th edition; by Andrew S. Tanenbaum; Prentice Hall; October 1998; ISBN 0130959901; Paperback; 669 pages; $95.00; used by CS 308-273A (Principles of Assembly Languages) at McGill University School of Computer Science


    Computers: An Introduction to Hardware and Software Design; by Larry L. Wear, James R. Pinkert (Contributor), William G. Lane (Contributor); McGraw-Hill Higher Education; February 1991; ISBN 0070686742; Hardcover; 544 pages; $98.60; used by CS 308-273A (Principles of Assembly Languages) at McGill University School of Computer Science

further reading: books: Motorola 680x0

68000 Family Assembly Language/Book and Disk (PWS Series in Engineering); by Alan Clements, B.Sc.; PWS Pub Co; August 1994; ISBN 0534932754; Hardcover; 720 pages; $98.95; used by CS 308-273A (Principles of Assembly Languages) at McGill University School of Computer Science


    Assembly Language and Systems Programming for the M68000 Family, 2nd edition; by William Ford, William Topp; Jones & Bartlett Pub; November 1996; ISBN 0763703575; Hardcover; 890 pages; $78.95; used by CIS 260 (Honors: Machine Organization and Microcomputers) at University of Delaware Department of Department of Computer & Information Sciences

    Macintosh Assembly System, version 2.0; by William Ford, William Topp; Jones & Bartlett Pub; January 1992; ISBN 0763705950; Textbook Binding; $37.50; used by CIS 260 (Honors: Machine Organization and Microcomputers) at University of Delaware Department of Department of Computer & Information Sciences

further reading: books: Motorola 68300

    The Motorola Mc68332 Microcontroller: Product Design, Assembly Language Programming, and Interfacing; by Thomas L. Harman; Prentice Hall; March 1991; ISBN 0136031277; Paperback; 512 pages; $41.25; used by EE 380 (Introduction to Microprocessors) at University of Alberta Department of Electrical and Computer Engineering

further reading: books: IBM System 360/370

    Assembler Language Programming The IBM System/360 and 370; 2nd edition; by George W. Struble (University of Oregon); Addison-Wesley Publishing Company; 1975, 1969; ISBN 0-201-07322-6; hardcover; 477 pages; special order

further reading: books: DEC VAX

    VAX-11 Assembly Language Programming; by Sara Baase (San Diego State University); Prentice-Hall, Inc.; 1983; ISBN 0-13-940957-2; hardcover; 407 pages; special order

In Association with Amazon.com

If you want your book reviewed, please send a copy to: Milo, POB 1361, Tustin, CA 92781, USA.

related software

Price listings are for courtesy purposes only and may be changed by the referenced businesses at any time without notice.

We are working on providing a second source.

     Metrowerks CodeWarrior Discover Programming for Mac 5.0; C, C++, Java, and Pascal; PowerMac; $49.95


further reading: web sites

further reading: web sites: general

ProgramFiles.com — Programming — Assembly Language: a collection of assemblers, cross-assemblers, editors, debuggers, simulators, disassemblers, inspectors, shells, and other programs for assembly languages: 68000, 8085, MC68HC11, 80x86, 8748, and 8749

further reading: web sites: Motorola 680x0

Meet the 68000: Jack Powell’s May 1985 Digital Antic article introducing the 68000 as used in the Atari ST computers; although dated, still a valid introduction and overview of the 68000 processor

glossary of terms, symbols, and expressions: A. Clements’ gloassary of 68000 terms, symbols, and expressions

assembly language presentation: A. Clements’ presentation of the basics of 68000 assembly language programming with a simple programming example

Microprocessor Systems 1 (3D1) Notes: Michael Brady’s class notes on the basics of microprocessor systems using the 68000 as an example

Motorola M680x0 Macro Preprocessor: an SDSU student’s macro preprocessor for 680x0 assembly language

68000 Assembly Language Glossary: a UCI student’s guide to Motorola 680x0 terminology

further reading: web sites: other

Shopping for assembly language programming products; just a list of books

Now building a free music player coding example

    Programming example: I am making heavily documented and explained open source PHP/MySQL code for a method to play music for free — almost any song, no subscription fees, no download costs, no advertisements, all completely legal. This is done by building a front-end to YouTube (which checks the copyright permissions for you).

    View music player in action: www.musicinpublic.com/.

    Create your own copy from the original source code/ (presented for learning programming). Includes how to run this from your own computer if you don’t have a web site.


OSdata.com is used in more than 300 colleges and universities around the world

Read details here.

Some or all of the material on this web page appears in the
free downloadable college text book on computer programming.


return to table of contents
free downloadable college text book

view text book
HTML file

Because I no longer have the computer and software to make PDFs, the book is available as an HTML file, which you can convert into a PDF.


    A web site on dozens of operating systems simply can’t be maintained by one person. This is a cooperative effort. If you spot an error in fact, grammar, syntax, or spelling, or a broken link, or have additional information, commentary, or constructive criticism, please e-mail Milo. If you have any extra copies of docs, manuals, or other materials that can assist in accuracy and completeness, please send them to Milo, PO Box 1361, Tustin, CA, USA, 92781.

    Click here for our privacy policy.

Now building a For those with high speed connections, the very large single file summary is still on line.


previous page next page
previous page next page

home page

two levels up

special topics

one level up

peer level

free computer programming text book project

Building a free downloadable text book on computer programming for university, college, community college, and high school classes in computer programming.

If you like the idea of this project,
then please donate some money.

send donations to:
Milo
PO Box 1361
Tustin, California 92781

Supporting the entire project:

    If you have a business or organization that can support the entire cost of this project, please contact Pr Ntr Kmt (my church)

more information on donating

Some or all of the material on this web page appears in the
free downloadable college text book on computer programming.


I do the news as an unpaid volunteer for KOCI 101.5 FM, Newport Beach/Costa Mesa (also available on the web)


Google

Made with Macintosh

    This web site handcrafted on Macintosh computers using Tom Bender’s Tex-Edit Plus and served using FreeBSD .

Viewable With Any Browser


    Names and logos of various OSs are trademarks of their respective owners.

    Copyright © 2000, 2001, 2002, 2004 Milo

    Created: February 14, 2001 (from asm.htm)

    Last Updated: March 31, 2004


return to table of contents
free downloadable college text book

previous page next page
previous page next page