Teaching assembly language on the Macintosh (abstract only)

As a part of its program of abandoning the IBM System/370 mainframe computer in favor of personal computers and UNIX workstations for undergraduate instruction, the Department of Computer and Information Science at Ohio State has decided to experiment with teaching assembly language on the Apple Macintosh.Ideally, given the complexity of the MC68000 microprocessor and the Macintosh operating system, we would like to teach this course using a student assembler-interpreter similar to Macintosh Pascal. In such a system, the assembler 1) would be a simple two-pass assembler, 2) would assemble the program using the exact machine language equivalent for each assembly language operation and operand, 3) would check each operand used in the program to determine whether or not it is in the proper range, and 4) would have good assembly-time diagnostics. The interpreter 1) would provide a simple input/output interface for integers and strings, 2) would highlight the currently executing instruction on the screen in some way, 3) would allow the programmer to stop execution dynamically under control of the program, the mouse, or the keyboard, 4) would allow the programmer to examine and change the contents of registers and memory locations any time the program is stopped, and 5) would have good execution-time diagnostics.In the absence of such a student assembler-interpreter, we must make do with the assemblers actually available for the Macintosh (there are no machine language interpreters). There are at least four different assemblers which might be considered. They are 1) MDS, the Macintosh 68000 Development System assembler from Apple, 2) MPW, the Macintosh Programming Workshop assembler from Apple, 3) MacASM from Mainstay, and 4) McAssembly from Signature Software.Of the four assemblers, MDS is the logical choice because of its major advantages: 1) it is by far the most widely used, 2) it is offered by Apple in a student version at reduced cost, and 3) the Boston College Shell can be used with it. MDS does have a few disadvantages, however: 1) there is no programmer's reference manual, so that its most subtle restrictions and idiosyncrasies must be discovered by experiment, 2) it is not a simple two-pass assembler, 3) it frequently substitutes a more efficient operation or a more convenient operand form for the one chosen by the programmer, 4) it does not always flag out-of-range operands, and 5) its diagnostics are generally quite cryptic.BCS, the Boston College Shell, programmed by Professor Jerry Keough of that institution, consists of 1) a set of subroutines and macros which provide a simplified student environment, 2) a set of easy-to-use input/output routines, and 3) a primitive debugging facility. For example, the following program reads in an integer in the range -2{15}..2{15}-1 and displays it on the screen. It also stops and displays the register contents before and after displaying the integer. Include Macros Main _Write ′Enter an integer:′ _GetNum_Debug ′Before′ _Write ′The integer is:′_OutNum_Debug ′After′ _Exit EndThe advantage of BCS for teaching beginning students can readily be appreciated by anyone who has tried to do this using the regular Macintosh assembly language environment.We are in the process of developing a text which follows the recommendations for CS3 published by ACM in Curriculum '78. In this text, we first introduce the concepts of computer architecture, machine language, and assembler language, then cover the addressing modes of the MC68000. The MC68000 instruction set is introduced in the context of actually writing and executing programs, including subprograms and macros, using MDS and BCS. Finally, more advanced topics, such as interfacing with the unique features of the Macintosh operating system, are covered.Since this text presently exists only in the form of a very preliminary draft, we have chosen to supplement it with another. There are two possible choices: Programming the 68000: Macintosh Assembly Language, by Edward Rosenzweig and Harland Harrison, published by Hayden Books; and it]Programming the Macintosh in Assembly Language, by Steve Williams, published by Sybex.We have chosen the text by Rosenzweig and Harrison, as it conforms most closely to the outline given above.The Complete Book of Macintosh Assembly Language Programming by Dan Weston, published by Scott, Foresman, is also an excellent text, but is aimed at the more advanced student.The results of this experiment, scheduled to begin Winter Quarter, 1987, will be reported on at a later date.