# On Macintosh Programming Advanced Techniques 1990 — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/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-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-3819df1690ef265498327c1fa83663437c278e66a682750f11bafa5ac37668e1)

On Macintosh® Programming: Advanced Techniques

Transcribed text:

DANIEL K. ALLEN

Addison-Wesley

On Macintosh®
Programming:
Advanced
Techniques

Image description: Book cover with a red header band bearing the author name and Addison-Wesley publisher logo, over a cream background covered in a black perspective grid with bold black stacked title lettering and thin orange, red, and magenta horizontal stripes on the left.

Reading notes: The registered trademark symbol after Macintosh is small and may be approximated; the title lines are stacked with overlapping letterforms that were read as printed.

Printed product names: Macintosh

Languages: English

[Original Image 1](https://www.vintageapple.net/files/bf1dfe9fa5f31dc5bce3c2ee2504e27c72b6baf35f7b3aeee2381520e166de6b/64455e2badd4acb4b9f1ff26.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-456ad6aa4dd7b12e7e940d0c11893a5c8ad171b258588c637a37f805754fe5a6)

Transcribed text:

DANIEL K. ALLEN

Addison-Wesley

On Macintosh® Programming: Advanced Techniques

Image description: A book cover with a red band across the top holding the author name and publisher logo, over a cream background with a black perspective grid pattern and three thin colored horizontal stripes (yellow, orange-red, magenta) crossing the bold black title.

Reading notes: Title text is stylized display type; the 'Programming:' and 'Techniques' lines are overlapped by the grid lines but remain legible. The ® symbol after Macintosh is small and placed above the word; included as printed.

Printed product names: Macintosh

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-5ca05c93f55d41aee31766a7920e8acc6fb4d157e5f5c10837944677775ebb42)

Image description: A plain, entirely blank white page with no artwork, layout elements, or markings visible.

Reading notes: No visible text was found on the image, so transcript and printed fields are empty.

[Original PDF page 2](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-67023f7dae3f12164c0d275eaa8551b23b38761e8f354a8f321217c7b34362a0)

On Macintosh Programming: Advanced Techniques

Transcribed text:

On   Macintosh Programming:
Advanced Techniques
DANIEL   K. ALLEN
.....
......
Addison-Wesley   Publishing   Company,   Inc.
Reading, Massachusetts   Menlo   Park,   California   New York
Don   Mills,   Ontario   Wokingham,   England   Amsterdam   Bonn
Sydney   Singapore   Tokyo   Madrid   San   Juan

Reading notes: Publisher and location lines contain irregular spacing from extraction but are legible

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-c168a15f60208cab6ff72a5eb3d7d09b1e459b16da368b1d82d9810221c2d800)

On Macintosh programming : advanced techniques

Transcribed text:

Many of the designations used by manufacturers and sellers to
distinguish their products are claimed as trademarks. Where those
designations appear in this book and Addison-Wesley was aware of a
trademark claim, the designations have been printed in initial capital
letters (i.e., Macintosh is a registered trademark of Apple Computer,
Inc.).
Library   of   Congress   Cataloging-in-Publication   Data
Allen, Daniel K.
On   Macintosh programming : advanced techniques   I   Daniel   K.   Allen.
p.   cm.
ISBN   0-201-51737-X
1. Macintosh (Computer)--Programming.   I.   Title
QA76.8.M3A445   1990   89-39855
005.265--dc20   CIP
Copyright   ©   1990   by Daniel K. Allen
All rights reserved. No part of this publication may be reproduced,
stored in a retrieval system, or transmitted, in any form or by any
means, electronic, mechanical, photocopying, recording, or otherwise,
without the prior written permission of the publisher.   Printed   in the
United States of America.
Published   simultaneously in Canada.
This book was written, organized, indexed, and formatted by the author,
using the following tools: Apple Macintosh SE 2.5/40 with Radius
Accelerator 16, Apple LaserWriter   Plus,   Microsoft Word   4.0,   Microsoft
Excel 1.5, Apple HyperCard 1.2.2, Apple   MPW   2.0   and   3.0,   and many
of the tools presented in this book.
Sponsoring Editor: Carole McClendon
Technical Editor: Tony Meadow
Technical Reviewers:   Paul   Finlayson and Tom Taylor
Cover Design: Doliber Skeffington
Text Design: Total Concept Associates
Set in 11-point Times Roman by   Perry   Mcintosh
0-201-51737-X
ABCDEFGHIJ-AL -89
First printing, December 1989

Reading notes: OCR spacing irregular in the cataloging block (e.g., 'On   Macintosh programming') and the spelling 'Perry   Mcintosh' is preserved as printed

Printed product names: Macintosh · Apple Macintosh SE 2.5/40 · Radius Accelerator 16 · Apple LaserWriter Plus · Microsoft Word 4.0 · Microsoft Excel 1.5 · Apple HyperCard 1.2.2 · Apple MPW 2.0 · Times Roman

Printed dates: 1990 · 89-39855 · December 1989

Languages: English

[Original PDF page 4](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-bb3c8a9f98a16bcf51ac7c14f18100b59d1c59cac760e7265dfaf00e05d0d4f8)

Image description: The image is a entirely blank white page with no visible artwork, layout, or markings.

[Original PDF page 5](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-5a733743d99458cea9aeb6fd0160c88e09f5e54dedf5bedb0ce056f88fe7d6b0)

Transcribed text:

CONTENTS
Preface
INTRODUCTION
How This Book Is   Organized
Conventions
History of Macintosh
CHAPTER   1   THE   MACINTOSH   ARCHITECTURE
The Macintosh Software Architecture
The Macintosh Hardware Architecture
Memory Map
Memory Mapped   1/0
Register Saving Conventions
Parameter Passing Conventions
A5 World
Low-memory Globals
The A-trap Dispatcher
ATrap-C Tool
LoMem-C Tool
Ascii-C Tool
Conclusion
Recommended Reading
CHAPTER 2   THE   MACINTOSH   OPERATING   SYSTEM
Process Management
The Memory Manager
Heap Zones and Subzones
Pointers
xvii
xxi
xxi
xx   ii
XXll
1
3
3
4
5
6
7
8
8
11
18
23
24
25
26
26
27
28
28
vii

Reading notes: Source text is a table of contents with page numbers; roman numeral page references and an OCR-split entry ("xx ii", "1/0") may be misread.

Languages: English

[Original PDF page 6](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-c2987fe361ffb6c20e089ed33d2cddc60ec7d31f64911ae7fdda228499d9fbe9)

Transcribed text:

Viii   CONTENTS
CHAPTER3
Handles and Master Pointers
Memory Allocation Algorithm
Memory Manager Routines
The Segment Loader
Segmentation Bugs
Creating Processes   Under   the Finder
MultiFinder
The File System
Low- and High-level Routines
Param Blocks
Types and Creators
Finder Information
High-level File System Routines
Data Organization on Volumes
The Input/Output System
Apple   Talk
The Start Code and the Boot Process
System Error Handler
Boot Blocks
Booting Continued
Booting-Installing MacsBug
Booting-Installing Patches and INITs
OSPeek-Pascal   Desk Accessory
ADBKey-Assembly Language INIT
Zero-C   Tool
Conclusion
Recommended Reading
QUICKDRAW
Graphics   Ports
Bit Maps
Coordinate Systems
Graphics Operations
Patterns
Cursors
Icons
Color QuickDraw
The Font Manager
28
30
31
32
34
34
36
38
38
39
40
42
42
44
46
47
49
50
52
54
54
55
56
69
70
73
74
75
76
77
78
79
81
81
82
83
83

Reading notes: Source appears to be a table of contents rather than advertising copy; no headline, products, prices or dates are explicitly advertised.

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-53753520d45d35ff742e996eef2c5f3c0527626e5b8b74f0581dcea03592b167)

Transcribed text:

The   Print   Manager
Mandel-Pascal   Application
Mandel.r-Rez Source Code for Resources
Graph-C Tool
MacQ-C Application
MacQ.r-Rez Source Code for Resources
Conclusion
Recommended Reading
CHAPTER 4   THE   MACINTOSH   TOOLBOX
The Resource Manager
Resource Maps
Resource Attributes
Resource Manager Routines
The Event Manager
FKEYs
Mouse Events
Key Events
Activate and Update Events
Other   Events
The Window Manager
Drawing in Windows
Auxiliary Window Routines
The Control Manager
The Menu Manager
Menus and the   User   Interface
TextEdit
The Dialog Manager
Dialogs and the   User   Interface
The Desk Manager
The Scrap Manager
Utilities
OS   Utilities
Toolbox Utilities
Package   Manager
Pack   0--List   Manager
Pack   2-Disk Initialization
Pack   3-StdFile
CONTENTS   ix
86
87
99
100
107
118
120
120
1 21
122
126
126
127
128
130
130
131
131
132
132
133
134
135
136
138
138
139
141
143
144
144
144
145
145
145
146
146

Reading notes: Source is a table of contents rather than advertising copy; no advertised products or prices are present. Page numbers in the contents list are not reliably aligned with entries.

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-e1ad01fa6e036846f2fc933d408bd03df5cdd14c28ff42f17f348b41dd54df02)

Transcribed text:

X   CONTENTS
Pack   4-SANE Arithmetic
Pack   5-SANE Transcendentals
Pack   6-Intemational String   Utilities
Pack   7-Binary-Decimal Conversions
Pack   12-Color   Picker
Dump-C Tool
ListRsrc-C Tool
CleanRsrc-C   Tool
MacsBugKey-Assembly Language FKEY
RotateWindows-Assembly Language FKEY
MF Switcher-Assembly Language FKEY
Conclusion
Recommended Reading
CHAPTER 5   SANE
SANE Functionality
History of SANE
Software SANE versus 68881 SANE
Portability Among Numeric Environments
NaNs and Infinities
Remainders, Modulo, and Rounding
Fixed and Fract Arithmetic
NumTheory-C Tool
Hash-C Tool
Rand-C Tool
Solar-Pascal   Tool
Sun-Pascal   Tool
Sun-C   Tool
Det-C Tool
Conclusion
Recommended Reading
CHAPTER 6   M PW
History of   MPW
MPW Overview
The   MPW   Interface
146
146
146
147
147
147
152
156
159
159
160
161
161
162
162
163
164
165
167
168
169
170
174
177
182
193
198
203
207
208
209
209
211
211

Reading notes: Table of contents page; no product names, prices, or dates are advertised in the copy. Some page numbers and words are run together or spaced irregularly in the extracted text, such as 'Intemational' and 'Solar-Pascal'.

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-e54fcc7bafec929f6246a3f32422181bf1b460e8953af8496942685ec16250f4)

Transcribed text:

CONTENTS   Xi
Shell Command Language   213
Alias Substitution   213
Evaluation of Structured Constructs   214
Variable and Command Substitution   214
Blank Interpretation, File Name Generation,   I/0   Redirection, and
Execution   215
MPW Shell Built-In Commands   216
MPW Documentation   218
MPW Tools   219
MPW Text Tools   221
MPW   Object   Tools   222
MPW Resource Tools   222
Startup-Shell Script   223
MakeCTool-Make Script   228
MakeCTool68881-Make Script   230
Build-Shell Script   230
BuildTools-Shell Script   231
RenameWild-Shell Script   232
InitDisks-Shell Script   233
DeleteUnits-Shell Script   234
CompareSources-Shell Script   234
LibList-Shell Script   235
Ob   j-C Tool   235
An XCMD Library Project   239
TwoCol-C Tool   251
Conclusion   253
Recommended Reading   253
CHAPTER?   ASSEMBLY   LANGUAGE
The MPW Assembler
The 95-percent/5-percent Rule
Leaming Assembly Language
Memory-Assembly Language Desk Accessory
DKAD-Assembly Language Application Shell
DKAD.r-Rez Source Code for DKAD Resources
DisAsm-C Tool
Conclusion
Recommended Reading
255
255
256
257
258
264
274
281
285
285

Reading notes: Source is a table of contents; no headline or advertised products are present. OCR-like spacing in entries such as 'Ob   j-C Tool' and 'I/0' is uncertain.

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/1#scan-fdd4d649500a87baf1fe9640b784362bb2829a02b4502e68253f0df2a6837caf)

Transcribed text:

Xii   CONTENTS
CHAPTER 8   THE C   LANGUAGE
History of C
Building C Tools
A Note for MPW C   2.0   Users
DeCom-C Tool
FastCat-C Tool
Substitute-C Tool
Reduce-C Tool
Sign-C   Tool
Squash-C   Tool
WordText-C Tool
Text Tool-C Tool
TextTool.r-Rez   Source   Code for a Commando Interface
Sort-C   Tool
Sort.r-Rez   Source   Code for a Commando Interface
Index-C Tool
Options
Examples
lndex.r-Rez   Source   Code for a Commando Interface
Conclusion
Recommended Reading
CHAPTER9   THE   PASCAL   LANGUAGE
History of Pascal
Apple's Pascals
Apple's Object-oriented Pascals
Pascal on Macintosh Today
Object   Pascal
MacApp
StyleTest-Pascal Application
StyleTest.r-Rez   Source   Code for StyleTest Resources
GraphSort-Pascal   Application
Conclusion
Recommended Reading
286
286
287
288
289
290
293
294
296
298
300
303
310
313
321
323
324
327_
347
352
352
353
353
354
355
355
356
356
357
369
371
387
388

Reading notes: Table of contents page numbers appear in a run without clear alignment to entries Some OCR-like irregularities such as 'lndex' and '327_' may be damaged characters

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/d57253029611829724fcc9f3077b729a8bb978077342d43ae883a0ff8415506a/On_Macintosh_Programming_Advanced_Techniques_1990.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-on-macintosh-programming-advanced-techniques-1990-68f583/2.md)
