# MPW and Assembly Language Programming for the Macintosh — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1)

## Transcribed source material

Machine transcriptions and image descriptions; uncertain copy may be marked [illegible]. Verify against the linked originals. Historical rights remain with the original owners.

These are transcribed excerpts, not the full publications. Open the originals for remaining pages.

### Image 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-65eca88a908ef5045137db523641598f97f330e7277d0b71d63f0f59e18fc0e9)

Transcribed text:

HAYDEN Macintosh Library BOOKS
48409
MPW and Assembly Language Programming
For the Macintosh®
Scott Kronick

Image description: A book cover with a blue-to-purple gradient, a framed illustration of a red 3D letter M beneath a gray arch with a red staircase and checkered floor, and a yellow wavy line across the sides.

Reading notes: The number 48409 at top right is small and its meaning is uncertain. The author name is spaced letter by letter across the bottom and is read as Scott Kronick.

Printed product names: Macintosh

Languages: English

[Original Image 1](https://www.vintageapple.net/files/9044c60518df74f09d24db7ca8de00c5ded50aca548563df9de555312eeac857/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6.png)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-aea4cf32756b801ce577b7fbb920a6d71e59c0f60ce5e9d269f9d4c9ca372c23)

Transcribed text:

HAYDEN Macintosh Library BOOKS
48409
MPW and Assembly Language Programming
For the Macintosh®
Scott Kronick

Image description: A blue-to-purple book cover with a large white title, a framed illustration of a red 3D letter M beneath an arch with columns and a staircase on a checkered floor, and a wavy orange line across the sides.

Reading notes: The series name 'Macintosh Library' is in stylized orange script and was read as such; the exact script letterforms may be approximate. The numeral 48409 is small and placed near the top right; read as printed.

Printed product names: Macintosh

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-3a95524b77b34dd874ef1072d5c44a4b0d4fc5df2f718da9c94d006a2544bb44)

MPW® and Asselllbly Language Progralllllling For the Macintosh®

Transcribed text:

MPW® and Asselllbly
Language
Progralllllling
For the Macintosh®
Scott   Kronick
HOWARD   W.   SAMS   &.COMPANY
A Division of   Macmillan.   Inc.
4300   West   62nd   Street
Indianapolis, Indiana 46268   USA

Reading notes: Title line 'Asselllbly' appears to contain an extraneous repeated 'l' and may be a scanning or OCR error for 'Assembly'. Title line 'Progralllllling' appears to contain repeated 'l' characters and may be a scanning or OCR error for 'Programming'. Supplied copy has irregular word spacing in the title, author name, and address lines, so exact spacing may not match the original. Transcript is intentionally empty because the exact extracted text is preserved separately; other fields were filled only from the supplied copy. No prices or dates appear in the supplied copy, so those fields are empty. The publisher line '&.COMPANY' is spelled as supplied and may have a punctuation or spacing variant.

Printed product names: MPW®

Languages: English

[Original PDF page 2](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-3e9b1396a77106bdcd5202c1b2f7b860eef10109cf524e1ac3af387aad0c7706)

HAYDEN BOOKS

Transcribed text:

#f
HAYDEN   BOOKS
/11-·~~t.~-/
The Macintosh Library provides the most
current, hands-on information for optimal use
of the Macintosh computer. With each new
title   we bring you up-to-date information
from outstanding and accomplished
Macintosh Authors.
Advanced Macintosh Pascal™
Paul Goodman
No.   046570,   $19.95
How to Write Macintosh™
Software
Scott Knaster
No.   046564,   $27.95
MacAccess: Information in
Motion
Gengle and Smith
No.   046567,   $21.95
Macintosh™ Multiplan®
Lasselle and Ramsay
No.   046555,   $16.95
Personal Publishing with the
Macintosh™ (Featuring
PageMaker   Version   2.0)
Second Edition
Terry M.   Ulick
No.   048406,   $19.95
Basic Microsoft® BASIC for the
Macintosh TM
Coan and Coan
No.   046558,   $19.95
MPW and Assembly Language
Programming
Scott Kronick
No.   048409,   $24.95
Introduction to Macintosh™
Pascal
Jonathon Simonoff
No.   046562,   $19.95
The Macintosh Advisor™
Harriman and Calica
No.   046569,   $18.95
Object-Oriented Programming
for the Macintosh™
Kurt J. Schmucker
No.   046565,   $34.95
Programming the   68000
Rosenzweig and Harrison
No.   046310,   $24.95
The Excel Advanced User's
Guide
Richard Loggins
No.   046626,   $19.95
dBASE Mac Programmer's
Reference Guide
Edward   C.   Jones
No.   048416,   $19.95
Macintosh Revealed
Volumes   One   and Two
Second Edition
Stephen Chernicoff
Nos.   048400,   048401,   $24.95 each
For the retailer nearest   you,   or to order directly from the publisher,
call   800-428-SAMS.   In Indiana, Alaska, and Hawaii call 317-298-5699.

Reading notes: Some prices shown as $19.95 are followed by product numbers; the 'each' price for Macintosh Revealed applies per volume.

Printed product names: MacAccess: Information in Motion · Basic Microsoft BASIC for the Macintosh · MPW and Assembly Language Programming · Programming the 68000 · The Excel Advanced User's Guide · dBASE Mac Programmer's Reference Guide · Macintosh Revealed Volumes One and Two

Printed prices: $19.95 · $27.95 · $21.95 · $16.95 · $24.95 · $18.95 · $34.95

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-740f1f3e33fca5592b42c819e7684b489a655b994f0b8aa81a9acad1522fbf30)

MPW® and Assembly Language Programming For the Macintosh®

Transcribed text:

MPW® and Assembly
Language Programming
For the Macintosh®
The Macintosh Programmer's Workshop
for Assembly, Pascal, and C
(with Emphasis   on   Assembly)

Printed product names: MPW · Macintosh · The Macintosh Programmer's Workshop

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-4b1085519265323d6af4f534acb4aac87ab6f6d45ac5d061fc43fd0acd1f1d50)

Transcribed text:

©1987   by   Scott   Kronick
FIRST   EDITION
FIRST   PRINTING-1987
All rights reserved. No part of this book shall be reproduced, stored in
a retrieval system, or transmitted by any means, electronic,
mechanical, photocopying, recording, or otherwise, without written
permission from the publisher. No patent liability is assumed with
respect to the use of the information contained herein. While every
precaution has been taken in the preparation of this book, the
publisher assumes no responsibility for errors or omissions. Neither is
any liability assumed for damages resulting from the use of the
information contained herein.
International   Standard   Book Number:   0-672-48409-9
Library of Congress Catalog Card Number: 87-61779
Acquisitions Editor: Greg   Michael
Manuscript Editor:   Susan   Pink Bussiere, Techright
Designer:   T. R. Emrick
Cover Art:   Celeste Design
Compositor:   Shepard   Poorman   Communications, Indianapolis
Printed in the   United   States of America
Trademark Acknowledgments
All terms mentioned in this book that are known to be trademarks or
service marks are listed below. In addition, terms suspected of being
trademarks or service marks have been appropriately capitalized.
Howard W.   Sams   &.   Co. cannot attest to the accuracy of this
information.   Use   of a term in this book should not be regarded as
affecting the validity of any trademark or service mark.
Apple and ImageWriter are registered marks of Apple Computer, Inc.
Mac and MacApp are trademarks of Apple Computer, Inc.
Macintosh, Macintosh Plus, and Macintosh Programmer's Workshop
are trademarks of Macintosh Laboratory, Inc., licensed by Apple
Computer, Inc.

Reading notes: Copyright and printing dates appear as 1987 and the Library of Congress number 87-61779 is listed as a catalog number rather than a date. No primary headline is printed in the supplied copy; the opening lines are copyright and front-matter text. Trademark list reads in reading order from front matter and may not reflect a single headline layout.

Printed product names: Apple · ImageWriter · Mac · MacApp · Macintosh · Macintosh Plus · Macintosh Programmer's Workshop

Printed dates: 1987 · 87-61779

Languages: English

[Original PDF page 5](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-acc22e005afabddb457b747a2c7cedb1c3d202ca96aed04d5c8fbaa7e740a081)

Transcribed text:

=   I   ...   I   < > +
§a   "'.00   i   /!,.   «
»   +   ! 0   -   *   &
f....,   #   A
$
'*
To order a disk   containing all the example programs used in this book
(plus additional fear and loathing sidetracks and Mac surprises) use the order
form in the back of the book.
I wrote this book without any help   from anyone, and if you
believe that, my friends and I have some mosquito-free land in the Everglades
we'd like to sell you.
Martha Lynch, Andy Hertzfeld, Michael Cermak, Sandi   Pottberg,   David
Rand, Susan Barker, Doug Greene, Allen Cecil, Fred Huxham, Raines
Cohen, Steve Costa, John Heckendom, Kathy Ewing, and the   BMUG   crowd.
The book is dedicated to my mother, Ruth, and father, Mason.

Reading notes: Garbled OCR-like symbols at the start of the text make the opening lines unreliable. Reading order of the acknowledgments and dedication lines is uncertain.

Languages: English

[Original PDF page 6](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-046956cf13daf23d359a4e915f5b6365cb23dabbb839461241b949f0ced9c4eb)

Transcribed text:

PART   ONE
Chapter 1
Chapter   .2
Chapter 3
Chapter 4
Chapter   5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
PART   TWO
Chapter   10
Chapter 11
Chapter   1.2
Chapter 13
Contents
Read Me First   ix
The Macintosh Programmer's Workshop   1
I Bought the Disks, Now What?   3
What Are the Fundamental File Commands?   13
Can   You   Show Me a   Program   in Assembly?   .23
Now How About   Pascal   and C?   31
What's the Story with Startup and Files in General?   43
Can   You   Give Me a Perspective on the Entire Command Language?   53
How Do   You   Do Resources?   63
Who   Uses   Make and the Structured Commands   71
Arn I Debugging   Yet?   85
Up   Bit Creek: The Assembly Tutorial
Slots: All the Bits That Fit
See Dick and Jane Grimace: First Lines of Assembly Code
The ABC's of Blocks of Code
Back to the Slot That Got   You   Here
vii
93
95
101
109
117

Reading notes: Table of contents page numbers and some chapter numbers are misread or garbled, such as 'Chapter .2', 'Chapter 1.2', and 'Chapter 13' with uncertain spacing. Reading order of the front matter and the appendix entries is mixed together and uncertain.

Printed product names: Macintosh

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-e0d690bbf0c2ff787dac485f566951f3913e7f942b120f5cf4ca38bacbeea1b3)

Transcribed text:

Chapter 14
Chapter   15
Chapter 16
Chapter 17
Chapter 18
Chapter 19
Chapter   20
Chapter   21
Chapter   22
Chapter   23
PART THREE
Chapter24
Chapter25
viii   Contents
Fourplay: From Head to Tue with Lots of Time for the Middle
The Addresses of   Screen   Stars
Check the   Status   of the   Stack,   Captain
Macintosh Programmers Do   It   in Windows
Quickdraw Goes Inside the Window
The Mouse Makes CorneredCoin Complete
Momentous Events
Structured Programming with Blocks
The Key to Boarding the Keyboard
Menus: The Literature of Giants
The   MPW   and Assembly Dictionaries
The   MPW   Shell   Command Language
The   68000   Instruction   Set   with Directives and Tuolbox Traps
Index
125
133
141
151
161
171
181
189
197
207
219
225
277
331

Reading notes: Table of contents extracted without visible headline; some chapter entries have irregular spacing and possible OCR spacing artifacts such as 'Tue' and 'Tuolbox' that may be misreadings. Chapter 24 and 25 entries lack spacing consistent with other entries.

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-14715bdc332df81e8ba410577dd26836a49c346dec1f4f0edb3ad9c0f56b30a6)

Transcribed text:

Read Me First
Here you will find answers to the following questions:
•   Exactly who is this book intended for?
•   How is this book different from the manuals?
•   Why is the emphasis on assembly language?
•   Exactly   "'.'hat   will I learn?
You   have in your hands a starter's book using the Macintosh   Program   -
mer's Workshop   (MPW).
That's right-starter's: Programmers who wish to begin using MPW and
programmers who wish to begin using assembly language.
You   might have heard that   MPW   is a sophisticated, professional   pro-
gramming environment intended for the   serious   developer. That's like saying
educational TV is intended only for the serious thinker. Don't be snookered
by pretentious programmers. The elegance of   MPW   benefits learners as
well as developers.
The three sections within this text are designed to
•   Provide   show-me-how demonstrations of the extensive   MPW   command
language for assembly,   Pascal,   and C programming.   Programs   in each of
the languages are built from the ground up. Later chapters introduce
additional   MPW   features   along with explanations of resources and
debugging.
•   Provide   a line-by-line, byte-by-byte instruction of Macintosh assembly
ix

Reading notes: Line break in product name 'Program-mer's Workshop' may be a hyphenation artifact Garbled characters in '"'.'hat' near 'Exactly what will I learn?'

Printed product names: Macintosh Program-mer's Workshop (MPW)

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-a7b1ae9d587607681a50a76db70bb87de18d8b481d1f8ae0acc7a9df20c89060)

Transcribed text:

X   Read Me First
language fundamentals that assumes no previous experience in   assem-
bly programming. Included are ten fully-explained sample programs
illustrating the   Toolbox's   mouse   events, windows,   Quickdraw, and
menus.
•   Provide   MPW   users with two complete dictionaries. The first contains
summary entries for the entire   MPW   command language. The second
contains the   68000   assembly language instruction set plus all the   direc-
tives and Toolbox traps used in the example programs.
Unlike the manuals, the instruction here is not inundated with   encyclo-
pedic chapters listing every conceivable option for every obscure feature.
The elements of   MPW   and assembly are introduced in the order in which a
starter would use them. For example, you'll create a short,   standalone
application in the third chapter.
A large section of this book is devoted to giving a clear understanding
of Macintosh assembly language. A knowledge of assembly principles offers
considerable reward even for programmers who work primarily in Pascal
or C. Assembly directly manipulates the computer's processor and memory,
illustrating programming concepts that are difficult to visualize from within
the higher-level languages like Pascal and C.
Assembly code, when well written, executes faster and uses less space
than code from higher-level languages.   MPW   provides a convenient means
of linking assembly code with Pascal and C code. Pascal and C programmers
can improve a program's performance by coding in assembly those   opera-
tions that demand speed.
Macintosh assembly is particularly accessible to all levels of   program-
mers because so much of the groundwork coding is built into the Toolbox of
the Macintosh ROM. In this text,   MPW   is illustrated with short assembly
programs that help you write assembly programs of your own and increase
your understanding of Pascal, C, and the hardware that supports all   com-
puter languages.
As long as you have the   MPW   disks and a Macintosh computer capable
of running them, you can begin developing programs.   You   have three   sec-
tions   (none of which presume you are an experienced   MPW   user or
programmer) to get you going.
Part 1. The Macintosh Programmer's Workshop
The purpose of part 1 is to get a starter up and running with program
development in assembly, Pascal, and C.   You   can
•   Explore the contents of the massive Workshop disk set, discovering
which files a starter will need immediately and which can be set aside.

Reading notes: Possible OCR spacing artifacts within words such as 'assem-bly' and 'pro-gramming' in the extracted copy

Printed product names: MPW · Toolbox · Quickdraw · Macintosh · Pascal · C · 68000

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/1#scan-5a28b14fe24231cb57e4efae0030efe732199688fbf345e2398ea0aed790a5f1)

Transcribed text:

Xi   Read Me First
•   Practice building applications in assembly,   Pascal, and C. A sample
development session in each language is presented in chapters 3 and 4.
•   Experiment with the primary tools of the Workshop   Shell,   the central
application that allows you to write, compile, and execute your pro-
grams from a single place.
•   Unveil   the potential of   MPW,   including structured commands, user-
defined menus, automated development features, and resource and
debugging tools.
Part 2.   Up   Bit Creek: The Assembly Tutorial
The purpose of part 2 is to get a starter writing and understanding assem-
bly programs by examining individual lines of code in short example pro-
grams. (You'll also be entertained by a   fear and loathing   sidetrack in every
chapter). Here, you can
•   Review assembly's use of hexadecimal numbers.
•   Witness snapshots of the processor and memory in action.
•   Uncover, bit by bit, the low-level instructions that make a computer
perform.
•   Write short assembly programs using the Macintosh Tuolbox, including
mouse events, windows, Quickdraw, and menus.
Part 3. The MPW and Assembly Dictionaries
The purpose of part 3 is to keep the   MPW   user and the starting assembly
programmer fully informed with a quick and complete reference for looking
up new vocabulary. This section contains
•   The   MPW   Shell   command language
•   The   68000   instruction set with directives and Toolbox traps

Reading notes: Possible OCR error: 'Tuolbox' appears where 'Toolbox' is likely intended. Section headings appear as body-style lines; primary heading is not explicitly marked.

Printed product names: MPW · Workshop Shell · Quickdraw · 68000

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/60218aa233a2d1615a987a4d1691f855e31bf3149029c9b38b7edc08aba47ce8/MPW_and_Assembly_Language_Programming_for_the_Macintosh_1987.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-mpw-and-assembly-language-programming-for-the-macintosh-1987-a5f2d6/2.md)
