[net.micro.mac] Programing the Macintosh in Assembly Language

chuq@sun.uucp (Chuq Von Rospach) (11/27/85)

Sybex has another Macintosh book out. This one is "Programing the Macintosh in
Assembly Language" by James W. Coffron (Sybex, $24.95, 779). This is a very
large book aimed at the experienced programmer who is learning to use the
Macintosh. 

This book is a good book, but it could have been a lot better. The first part
of the book is an introduction to the basic concepts of assembly language.
The rest of the book seems oriented towards an experienced programmer, so they
might as well have left this out. If you expect to learn about programming
from this book, you're going to be confused and intimidated.

After that is a description of each instruction, addressing modes, and all the
obligatory information on the 68000 processor. I've got a big gripe about this
because it was taken word for word from a generic 68000 book. They didn't even
bother to convert their debugger examples out of CPM-68K debugger to macsbug,
although they do explain how to use Macsbug. 

That is the first 250 pages. After that you actually see some Macintosh code.
Coffron has done one thing which I think is quite laudable. Rather that try to
write a full fledged Mac application from the start, he has put together a set
of Macros and a run time system. This means that you can type it all in (or
send away for the disk) and have most of the work done for you initially. This
lets you start simple and put together the pieces as you learn them. his first
program, for instance, is the obligatory "hello world" and unlike a lot of
Macintosh programs doesn't fail the readability test:

    INCLUDE MACLIB.ASM
    PROGRAM HELLO
    PRINT 	'Hello, world'
    QUIT
    ENDPROGRAM

That's all you need to build a window, print a string, and get back to the
finder. If you're planning on doing assembly language programming, this book
is probably worth the price just to get the run time system and save you a lot
of hassle building your own. Coffron then goes through the standard assembly
language concepts (binary to hex, reading keyboard input, and file I/O (well
done). His chapter on "Advanced Concepts" however, is ludicrous. His sort is a
bubble sort, and most of the concepts (linked lists, file records) are
concepts only -- no code. The only useful parts of the chapter are his
discussions of macros, conditional assembly, and some short examples of
linking assembler to other languages (specifically basic, Mac C, and Lisa
Pascal). 

After that he gets back to business with chapters on the Macintosh programming
environment and Exception processing. The final chapter is the run time
library. There isn't a lot of explanation of the code -- it looks more like a
reference manual than a tutorial. When you're through, you have an application
called Macdoodle, which is sort of a poor person's macpaint (it does implement
things like scroll bars on the paint window and supports TextEdit as well,
so it could be a good starting point).

This is a good but very frustrating book because it could have been much
better with a little work. Taking the extra time to convert the debugger
output to Macsbug would have been a help, since you can't reproduce
their examples. They should have either decided on the tutorial approach and
exlained their concepts and code more thoroughly or thrown out all the
beginner stuff and saved a few trees. 

The book is not a standalone book. If you're going to be working with it, keep
a copy of IM handy for reference (or some other book, such as the new Sybex
book on C). There are a lot of wasted pages, so they could have made it a
standalone reference if they had bothered.

It was written using MDS, so it is most useful for MDS or consulair
programmers. If you're going to do a lot of assembler programming, the book
gives you a good step forward with the run-time system, but don't expect it to
teach you the system, expect it to allow you to teach yourself.

-- 
:From catacombs of Castle Tarot:        Chuq Von Rospach 
sun!chuq@decwrl.DEC.COM                 {hplabs,ihnp4,nsc,pyramid}!sun!chuq

Let us now take the sacred oath. As of now, he is no longer an elephant!

tomj@chinet.UUCP (Tom) (12/08/85)

	I agree with Chuq that the run-time library source is a laudable 
idea, and is probabably the best part of _Programming the Mac in Assembly
Language_.  In other areas, however, the book is of mixed value.  For
example, in the section on addressing modes, the text often disagrees with 
the diagrams, making it difficult to determine exactly what is going on.
It also ignores many of the details needed in dealing with the Toolbox.  Chuq's
advice to keep a copy of _Inside Macintosh_ around is on the mark.
	In general, this book seems to be the result of a compromise between
teaching Assembly Language programming on the 68000, and working with the
Mac, and perhaps a failed compromise at that.
 	Also, my copy of the book lists Steve Williams as the author.
 
	Tom Johnston
 
_____
Tom Johnston
...ihnp4!chinet!tomj