← The Complete Book of Macintosh Assembly Language Programming, Volume II

The Complete Book of Macintosh Assembly Language Programming, Volume II

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

The Complete Book of Macintosh Assembly Language Programming Volume II Dan Weston "The Complete Book of Macintosh Assembly Language Programming, Volumes I and II, are a must for anyone serious about programming the Mac. They contain information not found anywhere else, and cover the real-life problems of a software developer." David Smith, Publisher MacTutor

A book cover with a bold yellow and gray diamond lattice background, large navy title text with a large stylized "M" in "Macintosh", the author name in navy below, and a white endorsement box with magenta and black text at the bottom.

Reading notes: Title is split across the large 'Macintosh' wordmark and smaller 'The Complete Book of' and 'Assembly Language Programming Volume II' lines; reading order follows the visual arrangement. Endorsement box text reads as a quotation with magenta highlighted title and italic 'must'; the hyphenated 'any-where' is a line break in the original.

Printed product names
The Complete Book of Macintosh Assembly Language Programming
Languages
English
PDF page 1

"The Complete Book of Macintosh Assembly Language Programming, Volumes I and II, are a must for anyone serious about programming the Mac. They contain_information not found any- where else, and cover the real-life problems e>f a software developer." David Smith, Publisher MacTutor

Reading notes: No headline is present in the supplied copy; the quotation is body text. 'e>f' in 'real-life problems e>f a software developer' is likely an OCR error for 'of' and needs checking against the page. 'contain_information' appears to be missing a space or contain an underscore artifact and needs checking. 'any-where' is a line-break hyphenation that should be read as 'anywhere'. Irregular spacing in the supplied copy may reflect layout, and the reading order of the attribution lines is uncertain. No prices, dates, or years appear in the supplied copy, and the transcript is empty per the instruction to use the separately preserved extracted text.

Printed product names
The Complete Book of Macintosh Assembly Language Programming
Languages
English
PDF page 2

Save yourself hours of typing

Save yourself hours of typing A source code disk containing all the programs in this book is available from the author. Use the card below or send $14.95 to: Source Code Disk #3 Nerdworks 195 23rd NE Salem, OR 97301 ------------------------------------------------ Order Form - please print Name _______________________ Address---------------------- City-------------- State_ Zip ___ Date-------------- Please enclose a check or money order for $14.95. The price includes shipping and handling. Send orders to: Source Code Disk #3 Nerdworks 195 23rd NE Salem, OR 97301 ./

Reading notes: Transcript intentionally left empty because exact extracted text is preserved separately; other fields are based only on the supplied copy. Headline spacing was normalized from the extracted text (original showed multiple spaces between words). The 'Date' label on the order form is a blank field label, not a printed date, so printedDates is empty. The trailing './' line and the dashed separator lines appear to be extraction artifacts or layout rules rather than advertised copy. Multiple-space gaps in the body text (for example 'Use the' and 'Salem, OR') are likely layout spacing from extraction and were not treated as meaningful.

Printed product names
Source Code Disk #3
Printed prices
$14.95
Languages
English
PDF page 3

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

Reading notes: No visible text found; the page appears blank white, so transcript and printed fields are empty.

PDF page 4

The Complete Book of acintosh Assembly Language Programming Volume II Dan Weston Scott, Foresman and Company Glenview, Illinois London

Reading notes: The leading 'M' of 'Macintosh' appears damaged or missing in the source, reading as 'acintosh'. Headline reconstructed from fragmented lines; word spacing in the source is irregular.

Languages
English
PDF page 5

This book is for my children, Sarah and Asa. ISBN 0-673-18583-4 Copyright © 1987 Scott, Foresman and Company. All Rights Reserved. Printed in the United States of America. Library of Congress Cataloging-in-Publication Data (Revised for vol. 2) Weston, Dan The complete book of Macintosh assembly language programming. Bibliography: v. 1, p. ; v. 2, p. Includes indexes. 1. Macintosh (Computer)-Programming. 2. Assembler language (Computer program language). I. Title. QA76.8.M3W47 1986 5.265 86-3866 ISBN 0-673-18379-3 (v. 1) ISBN 0-673-18583-4 (v. 2) I 2 3 4 5 6-KPF-91 90 89 88 87 86 Apple, MacPaint, MacDraw, MacWrite, and Finder are trademarks of Apple Computer, Inc. Macin- tosh is a trademark licensed to Apple Computer Inc. Microsoft and MS-DOS are trademarks of Microsoft Corporation. UNIX is a trademark of AT&T. GEM is a trademark of Digital Research, Inc. PostScript is a trademark of Adobe Systems, Inc. Notice of Liability The information in this book is distributed on an "As Is" basis, without warranty. Neither the author nor Scott, Foresman and Company shall have any liability to customer or any other person or entity with respect to any liability, loss, or damage caused or alleged to be caused directly or indirectly by the programs contained herein. This includes, but is not limited to, interruption of service, loss of data, loss of business or anticipatory profits, or consequential damages from the use of the programs. Scott, Foresman Professional Publishing Group books are available for bulk sales at quantity discounts. For information, please contact: Marketing Manager, Professional Books, Professional Publishing Group, Scott, Fores- man and Company, 1900 East Lake Avenue, Glenview, IL 60025.

Reading notes: Printed page numbers in the bibliography line are blank ('p. ; v. 2, p.') and the Library of Congress catalog code '5.265' is ambiguous in reading order

Printed product names
Apple · MacPaint · MacDraw · MacWrite · Finder · Macintosh · MS-DOS · UNIX · GEM · PostScript
Printed dates
1987 · 1986 · 86-3866
Languages
English
PDF page 6

D Contents CHAPTER 1 Memory Management and Debugging 1 The Application Heap 1 The System Heap 3 Low-Memory Globals 3 The Trap Dispatch Table 5 The Screen and Sound Buffers 6 The Application Globals 7 The Big Picture 10 Pointers 10 Handles 13 A Closer Look at the Heap 16 Getting Ready to Look at the Heap 16 Identifying Heap Objects 17 Using the Find Command to Identify Heap Objects 19 Two More Unidentified Objects 21 Other Identified Objects 22 Debugging Strategy 23 Program Segmentation 24 Summary 26 CHAPTER 2 New ROM-Old ROM 27 The Toolbox and the Operating System 27 The Trap Mechanism 28 Trap Dispatch Table 31 64K ROM 31 128K ROM 32

Reading notes: Source is a table of contents rather than advertising copy; no products, prices or dates are advertised.

Languages
English
PDF page 7

Patching ROM 32 Trap Words and Trap Numbers 33 Two Strategies for Patching ROM 33 System-Based ROM Patch 34 Application-Based ROM Patch 39 New Routines in 128K ROM 44 Determining Which ROM Is Installed 46 Summary 47 CHAPTER 3 The Clipboard and Switcher: Sharing Data Between Programs 48 What Kinds of Data Go on the Clipboard? 49 The Desk Scrap and the Private Scrap 50 Is the Private Scrap Really Necessary? 53 Desk Scrap in Memory and on Disk 53 Putting Information on the Clipboard 54 Getting Information off the Clipboard 56 When to Convert the Clipboard 58 Program Startup and Termination 58 Activate/Deactivate Events and Clipboard Conversion 59 An Alternate Method for Controlling Clip Conversion 59 How Does Switcher Convert the Clipboard? 66 The Desk Accessory Ruse 67 The Switcher Event 70 Summary 73 CHAPTER 4 Using the Print Manager 75 Available Printers 75 QuickDraw, GrafPorts, and Printers 77 Using the Print Manager 78 The Glue Routines 79 Opening the Printer Resource File 79 Setting Up a Print Record 80 The Print Manager Dialogs 81 Opening the Print Document/grafPort 84 The Printing Loop 85 Spool Printing the Document 86 Closing the Print Manager 87 Example Program Module 88 The Documentation Header 88

Languages
English
PDF page 8

Setting Up the Stack Frame 89 Opening the Print Manager 90 Filling in the Print Record 90 Using the Print Manager Dialogs 91 Opening the Printing Port 91 Calculating the Page Size 92 Determining the Number of Copies 93 Imaging Each Page 94 Spool Printing 98 Cleaning Up 99 Optimizing for the LaserWriter 100 Installing Print Idle Procedures 102 Tweeking the Print Record 106 Summary 110 CHAPTER 5 HFS, MFS, and the Standard File Package 112 HFS-MFS Compatibility 113 Using the Standard File Package 115 Parameters for SFGetFile 116 The File Filter Procedure 117 The Dialog Hook Procedure 119 Parameters for SFPutFile 122 Using the File Manager with SFReply Records 122 Determining If HFS or MFS Is Active 125 Searching for Files Directly on MFS Volumes 126 Searching for Files Directly on HFS Volumes 132 Recursion and HFS 132 HFS-Specific Routines 135 HFSFileSearch Code 136 Summary 145 CHAPTER 6 Making Your Macintosh Talk 147 Overview of MacinTalk 147 The MacinTalk Driver 148 CheapTalkII: A Simple Speech Application Example 149 The Documentation Header 150 Making the Connection to SpeechASM.Rel 151 Setting Up Equates 151

Reading notes: Source is a table of contents listing chapters and page numbers rather than advertising copy, so no advertised products, prices, or dates are present.

Languages
English
PDF page 9

Defining Macros 152 Setting Up Global Variables for Speech 153 Initialization 154 Opening the Driver 154 Opening the Dialog 155 Speaking Pretranslated Speech 157 The Dialog Loop 158 The Dialog Filter Procedure 159 Translating English to Phonetics and Then Speaking 165 Checking the Rate and Pitch 167 Setting the Speech Mode 171 Ending the Program 173 Memory Considerations 174 Putting It All Together 175 Summary 178 CHAPTER 7 Dialog User Items 179 Defining User Items in the Resource File 180 The Documentation Header 183 Iriitialization 184 Installing User Items 186 ModalDialog Loop 188 Filter Procedure 189 Line Drawing User Item Big Button User Item Quitting the Program TrackRect Utility Routine The Lllik File 205 194 196 199 200 User Items and Segmentation: Possible Problems 205 Summary 207 CHAPTER 8 RAM Disk+ 208 RAM Disk Installer 209 Memory Layout 210 The Documentation Header 212 The Equates 213 Global Variables 214

Reading notes: Source appears to be a table of contents with chapter and page numbers rather than advertising copy. Some OCR spacing irregularities (e.g., 'Iriitialization', 'Lllik') may be damaged characters.

Languages
English
PDF page 10

Initialization and Entry 214 The First Pass 217 The Second Pass 226 Pevice Drivers: Overview 237 Structure of Device Drivers 237 The Driver Header 238 Entry and Exit Conventions 239 RAM Disk Driver 241 The Open Routine 242 The Prime Routine 244 The Control Routine 247 The Status Routine 250 The Close Routine 251 The Link Files 251 The Resource Compiler File: Putting It All Together 252 Summary 256 CHAPTER 9 The List Manager 257 Using PACKO to Access the List Manager 258 Creating a New List 259 Filling in the List Cells 264 Disposing of a List 265 Mouse Clicks in a Cell 266 Finding the Selected Cells 267 Changing the Size of a List Window 269 Updating a List Window 272 Activating a List Window 274 Customizing the List Manager 275 The Init Routine 278 The Draw Routine 278 The Highlight Routine 281 Creating an LDEF Resource 282 Icon Lister Program 283 Building a List of Icons 284 Setting the Selection Parameters 287 Summary 288

Reading notes: Source appears to be a table of contents with page numbers rather than advertising copy; no headline, products, prices, or dates identified. Some chapter titles contain irregular spacing, e.g. 'Pevice Drivers: Overview' likely corresponds to 'Device Drivers: Overview'.

Languages
English
PDF page 11

APPENDIX A Source Code Listing

APPENDIX A Source Code Listing initPatch.ASM 289 initPatch. LINK 291 initPatch.R 292 AppPatch.ASM 293 PrintModule.ASM 295 MFSFileSearch.ASM 303 HFSFileSearch.ASM 306 CheapTalkll.ASM 310 CheapTalklI.pNK 322 CheapTalkll.R 323 UITest.ASM 325 UITest.LINK 333 UITest.R 334 TrackRect.ASM 335 RD+ Install.ASM 338 RD+ Install.LINK 351 RD+ Install.R 352 RAMDisk + .ASM 355 RAMDisk +.LINK 360 ListMacros 361 Lister.ASM 364 Lister.LINK 347 Lister.R 380 LDEF2.ASM 382 LDEF2.LINK 386 lconList.ASM 387 lconList. LINK 398 lconList.R 399 APPENDIX B Other Sources of Macintosh Information 401 APPENDIX C Trap Words and Heap Compaction Information 403

Reading notes: Source listing contains irregular spacing between words, possibly from OCR or layout extraction Some filenames show inconsistent spacing such as 'initPatch. LINK' and 'Lister.LINK'

Languages
English