Programming the 68000: Macintosh Assembly Language
From the originals
13 scansMachine-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
HAYDEN Macintosh Library Programming the 68000 Macintosh Assembly Language Edwin Rosenzweig & Harland Harrison
A book cover with a blue-to-green gradient background, an orange-bordered image of an eye whose iris reflection shows a beige Macintosh computer with keyboard and mouse against a cloudy sky, and a wavy cyan line crossing the cover.
Reading notes: The 'HAYDEN' and 'Macintosh Library' header text is stylized; 'Macintosh Library' is in a cursive script and was read as such. Author names are set in widely letter-spaced type and were transcribed as printed.
- Languages
- English
PDF page 1
HAYDEN Macintosh Library Programming the 68000 Macintosh Assembly Language Edwin Rosenzweig & Harland Harrison
A book cover with a blue-to-green gradient background, an orange top band, and a large close-up illustration of an eye whose iris shows a beige Macintosh computer with keyboard and mouse against a blue sky with clouds, with a cyan wavy line crossing the design.
Reading notes: Title and author names are clearly legible; the HAYDEN and Macintosh Library series text is stylized script and was transcribed as read. Faint rectangular translucent patches appear on the cover but do not obscure text.
- Languages
- English
PDF page 2
PDF page 3
Programming the68000 Macintosh TM Assembly Language Edwin Rosenzweig and Harland Harrison [JJ Hayden Book Company A DIVISION OF HAYDEN PUBLISHING COMPANY, INC. HASBROUCK HEIGHTS, NEW JERSEY /
Reading notes: Spacing in the title and author line is irregular, possibly from OCR A bracketed symbol '[JJ' appears near the author line and may be a damaged character
- Languages
- English
PDF page 4
Acquisitions Editor: BILL GROUT Production Editor: HoNNIE GROFF Cover design: JJM BERNARD Cover photo: Lou OooRIGEORGE BAQUERO Composition: ELIZABETH 'IYPEsErnNG CoMll'\NY Printed and bound by: COMMAND WEB OFFSET, INC. Library of Congress Cataloging-in-Publication Data Rosenzweig, EJ. (Edwin J.) Programming the 68000. Includes index. 1. Motorola 68000 (Microprocessor)-Programming. 2. Assembler language (Computer program language) I. Harrison, Harland. II. Title. QA76.8.M6895R67 1986 005.265 86-3085 ISBN 0-8104-6310-5 Quilt Circuit is a trademark of Bishop Graphics, Inc., Wlstlake Village, CA. People in Places is a trademark of Data and .Information Software Company, Inc. San Francisco, CA. PCMacBASIC is a trademark of Pterodactyl Software, Fairfax, CA. Copyright © 1986 by Hayden Book Company. All rights reserved. No part of this book may be reprinted, or reproduced, or utilized in any form or by any elec- tronic, mechanicai, or other means, now known or hereafter invented, including photocopying and recording, or in any information storage and retrieval system, without permission in writing from the Publisher, with the exception that programs may be stored and retrieved electronically for personal use. Printed in the United States of America 1 2 3 4 5 6 7 8 9 Printing 86 87 88 89 90 91 92 93 94 Year
Reading notes: Some OCR-like spacing and character errors appear in the copyright and imprint lines, e.g. 'Wlstlake', 'mechanicai', 'IYPEsErnNG'. Credit lines include scrambled characters such as 'JJM BERNARD' and 'Lou OooRIGEORGE BAQUERO' whose intended names are uncertain. Reading order of the composition and printing credits is ambiguous.
- Printed product names
- Quilt Circuit · People in Places · PCMacBASIC
- Printed dates
- 1986 · 86-3085 · 1 2 3 4 5 6 7 8 9 · 86 87 88 89 90 91 92 93 94
- Languages
- English
PDF page 5
Preface This book assumes that you have some knowledge of programming. We expect you to know how to code a simple BASIC or Pascal program. If you know how to program in assembler, so much the better. However, we also realize that you may never have progranimed in assembler before, don't know what a linker is, etc. Tupics such as binaiy and hexadecimal are covered in appendices so the less advanced program- mer can go there for additional knowledge about assembly language programming. If you know another assembler language such as the 8080, 6502, 8088, Z80, or even 360/370, then you will find this book that much easier-you can skip most of the appendices. There are two essential processes involved in reading this book. One is the process of learning about 68000 assembly language. The other process is learning your way around the Macintosh operating system-its "guts" which make all the graphics, menus, and windows possible. Assembler is the gateway to the heart of the Macintosh. If you program in Pascal or BASIC and want to keep programming .in those languages, a knowledge of assembler is veiy useful-especially iii debugging. You will find that certain routines have to be made· fast and compact-your knowledge of assembler will be invaluable then. However, the main reason that any assembler language programmer gives for wanting to program in assembler is the feeling of POWER. You can actually get down into the insides of the machine and make it perform to its maximum capability. With the sophistication of 68000 assembler and the Macintosh ROMs, your coding won't be that much slower than coding in a highe~level language and your debugging will probably be faster. There is also a certain FUN in programming in assembler which you don't get when programming in a highe~level language. We suppose it is
Reading notes: Source text contains OCR-style spacing and hyphenation artifacts (e.g., 'tupics', 'binaiy', 'progranimed', 'highe~level') that may be misreadings.
- Languages
- English
PDF page 6
the same thrill a mechanic gets from tuning up a fine race car or any mad tinkerer gets from a new invention. We look forward to helping people learn to program in 68000 as- sembler on the Macintosh without having to struggle as we did. Of course, we didn't have this book to help us! This book was written just the way Pterodactyl Software, the company of which we are both part, is run. Ed Rosenzweig wrote the less technical chapters while Harland Harrison wrote the more technical, detailed chapters and the sample program. EDWIN RoSENZWEIG AND HARLAND HARRISON (Fairfax and Belmont, California)
Reading notes: Source text appears to be a fragment; the primary heading is not included, so headline is null.
- Printed product names
- Macintosh · 68000
- Languages
- English
PDF page 7
Acknowledgments W. \VOuld like to thank the following people: Mike McGrath, Bill Grout, and the people at Hayden-for all their help. April Post-for helping with the illustrations. Kirk Austin and Bruce Southwick-for proving, by reading the manu- script and immediately starting to write code, that one could learn Macintosh assembler and the 68000 through this book. Rema Harrison-for patience and understanding. Lori Sweet-for patience while an author struggled.
Reading notes: Line-break hyphenation in 'manu-script' and 'Hayden-for' may affect reading order Possible OCR artifact in 'W. \VOuld' at the start of the first line
- Printed product names
- Macintosh · 68000
- Languages
- English
PDF page 8
Organization of this Book 'l~is book is written so that people who want to learn assembly language on the Macintosh computer can learn at their own pace. If you know a higher level language such as Pascal, BASIC, or C but have never programmed in assembler then you should read all the chapters in sequence with detours to the appendices where appropriate. If you have programmed in assembler before, you can skim the first chapter, skip the appendix on binary and hexadecimal, and start your in-depth reading with Chapter 2, The Addressing Modes of the 68000. You an also skim the sections on assemblers and linkers in Chapter 6. The section on 68000 hardware is very interesting (it explains why· all addresses must start on even boundaries, for example) but it, too, can be skimmed.
Reading notes: Stray characters such as 'l~is' and 'You an' appear to be OCR or damage artifacts. Possible missing punctuation or words, e.g. 'You an also skim'. Heading and page-level layout not present in supplied copy; no primary heading identified.
- Languages
- English
PDF page 9
Summary of the Chapters The first chapter, Introduction to Assembly Language, shows how assembly language relates to higher level languages, what a linker does, how the Macintosh editor and assemblers work, what the format of an assembler file is, what addresses are, and some information about the registers and stack of the 68000. This chapter gets you up to speed with the tools and concepts necessary to start learning 68000 assembler. People not previously exposed to assembly language may want to read Appendix A, The Binary Numbering System, at this time. The second chapter, The Addressing Modes of the 68000, describes all the various ways of finding where the data is located. When using the 68000 there are twelve different ways you can address data including modes as powerful as Program Counter relative with index and displacement. This chapter is one of the building blocks of the rest of the book; it must be understood completely before continuing. The third chapter, The 68000 Instruction Set, describes every 68000 op code (short for operation code) and related operands. The op codes are arranged by frequency of use. As a reference, Appendix B contains timing information and complete formats. Appendix Bis an alphabetical listing. Appendix C contains effects on condition codes for each 68000 instruction. The fourth chapter, Sample Programs, contains a series of simple subprograms so that you can see concrete examples of how 68000 assembler is put t9gether into workable programs. This chapter shows how to compare two strings, how to optimize assembler, how to convert from hexadecimal to decimal, how to write a key stroke handler, how to do simple arithmetic operations. The fifth chapter, Overview of the 68000 Hardware, describes how the 68000 looks to a programmer. Here such questions as why instructions
Reading notes: Final sentence of the fifth chapter summary is truncated mid-sentence. Word split 't9gether' appears to be an OCR error for 'together'.
- Languages
- English
PDF page 10
must start on an even byte and what a bus line does are answered. This information is helpful to the programmer who wants to better understand the idiosyncrasies of the 68000 microprocessor. The sixth chapter, Macintosh Tuols, describes the assembler, linker, and resource compiler in detail. Here you will learn the steps necessary to create working Macintosh programs once you have assembled a program. The seventh chapter, The Mac Environment, describes how windows, menus, and dialog boxes are handled, what events are, Update and Activate events, resource files, memory and jump tables. The eighth chapter, Macintosh ROM Calls, explains how Macintosh ROM calls are made via traps. How to make a ROM call in assembler is illustrated. Heaps and handles are discussed, sample QuickDraw ROM calls are described. The ninth chapter, SimpleCalc, has a complete sample program and an explanation of its internals. SimpleCalc is a simple integer spreadsheet program written in MDS assembler. Many of the procedures you will need to program a Macintosh application are shown in this example. The tenth chapter, Some Advanced Subroutines Not in SimpleCalc, shows sample assembler code to make TuolBox calls for such functions as using the Memory Manager, creating variable text in a dialog box, cursor handling, dragging selections with the mouse, changing menu items, printing, and using the SANE floating point package.
Reading notes: Several words appear misspelled in the source copy, such as 'Tuols' and 'TuolBox', which may be OCR errors for 'Tools' and 'ToolBox'. Source fragment begins mid-sentence and may not be the start of the document.
- Printed product names
- Macintosh · SimpleCalc · QuickDraw · SANE
- Languages
- English
PDF page 11
Contents Chapter 1 Introduction to Assembly Language 1 Who Will Find 'Ibis Book Helpful 1 Assembler Used in 'Ibis Book 1 Why Should You Use Assembly Language? 1 Relationship of Higher Level Languages to Assembler 2 How to Program in 88000 on a Mac 7 The Editor 8 The Assembler 9 Getting Closer to the Hardware 12 Addresses 12 Internals of the 88000 Microprocessor 13 Condition Code Pbrtion of Status Register 19 Machine Language 21 _Chapter 2 'Ihe Addressing Modes oi the 68000 23 Inherent Mode 23 1. Immediate Mode 25 2. Data Register Direct Mode 28 3. Address Register Direct Mode 28 4. Absolute Short Mode 27 5. Absolute Long Mode 29 8. Addressing Register Indirect Mode 30
Reading notes: OCR errors in table of contents (e.g., 'Ibis' for 'This', 'Pbrtion', 'Ihe', 'Addressing Register Indirect' ordering) Chapter 2 heading and numbering garbled; page numbers for several entries uncertain
- Languages
- English