← Programming the Macintosh in Assembly Language

Programming the Macintosh in Assembly Language

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

SYBEX Programming the Macintosh™ in Assembly Language Steve Williams

A red book cover with the SYBEX logo at top left, large cream title text, and a framed illustration of a striped rainbow Apple logo with a silver key threaded through it on a gray-blue background, with the author name in black at bottom.

Reading notes: The 'TM' mark after Macintosh is small and superscript; it is transcribed as ™.

Languages
English
PDF page 1

SYBEX Programming the Macintosh™ in Assembly Language Steve Williams

A book cover with a red background, cream-colored title lettering, a SYBEX logo in the upper left, and a framed illustration of a rainbow-striped Apple logo with a silver key on a gray-blue background, with the author name at the bottom.

Reading notes: Title is split across several lines with horizontal rules between 'Programming the' and 'Macintosh' and between 'Macintosh' and 'in Assembly Language'; reading order follows the visual layout. The trademark symbol ™ after Macintosh is small and superscripted; it is included as printed.

Languages
English
PDF page 2

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

PDF page 3

Programming the Macintosh in Assembly Language Steve Williams SYBEX® Berkeley • Paris • Düsseldorf • London

A book title page with bold italic title text at top, a grid-patterned square containing a white apple silhouette with a microchip graphic over it, the author name in italic below, and the SYBEX logo with city names at the bottom.

Reading notes: Faint background text or bleed-through is visible on the right side of the page and was not transcribed.

Languages
English
PDF page 4

Cover art by Peni Choux Book design by Sharon Leong Apple, Lisa, Lisa Pascal Workshop, Macintosh Development System, MacsBug, MacWorks, MaxDB, and TermBug are trademarks of Apple Computer, Inc. Consulair C is a trademark of Consulair Corp. CP/M and CP/M-68K are trademarks to Digital Research, Inc. Macintosh is a licensed trademark of Apple Computer, Inc. Microsoft and Microsoft BASE are trademarks of Microsoft Corp. Motorola and UNI DOS are trademarks of Motorola, Inc. PDP-11 is a trademark of Digital Equipment Corp. UNIX is a trademark of Bell Labs. SYBEX is not affiliated with any manufacturer. Every effort has been made to supply complete and accurate information. However, SYBEX assumes no responsibility for its use, nor for any infringements of patents or other rights of third parties which would result. Copyright©1986 SYBEX Inc., 2344 Sixth Street, Berkeley, CA 94710. World rights reserved. No part of this publication may be stored in a retrieval system, transmitted, or reproduced in any way, including but not limited to photocopy, photograph, magnetic or other record, without the prior agreement and written permission of the publisher. Library of Congress Card Number: 85-62542 ISBN 0-89588-263-9 Printed by Haddon Craftsmen Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1

Reading notes: Copyright line lists 1986; ISBN and Library of Congress numbers are identifiers rather than dates

Printed product names
Apple Lisa · Lisa Pascal Workshop · Macintosh Development System · MacsBug · MacWorks · MaxDB · TermBug · Consulair C · CP/M · CP/M-68K · Macintosh · Microsoft BASE · Motorola · UNI DOS · PDP-11 · UNIX
Printed dates
1986 · 85-62542
Languages
English
PDF page 5

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

PDF page 6

vi CONTENTS Acknowledgments xxi Introduction xxii Chapter 1 Basic Concepts WHAT IS PROGRAMMING? 1 Algorithms 2 Programming Languages 2 Flowcharts 3 HOW DOES A COMPUTER WORK? 5 Memory S Input/Output Devices 7 Central Processing Unit 7 CPU Organization 7 Stored Program Execution 9 Data Representation 11 What's in a K? 17 Operations on Binary Numbers 18 Extensions 24 SUMMARY 24 EXERCISES 24 1

Reading notes: Source text appears to be a table of contents with OCR-like spacing artifacts (e.g., 'S' for 'Memory' page number, 'K?' in 'What's in a K?') Page numbers and character 'S' in the Memory entry may be misread

Languages
English
PDF page 7

Chapter2 68000 Architecture

Chapter2 68000 Architecture INTRODUCTION 29 REGISTER SET 30 Address Registers 30 Data Registers 31 Program Counter 32 Status Register 32 DATA ORGANIZATION IN MEMORY 34 Bytes, Words, and Longwords 35 BCD 36 Floating Point 36 ASCII 38 ADDRESSING MODES 38 Effective Address 39 Data Register Direct Addressing 40 Address Register Direct Addressing 41 Address Register Indirect Addressing 43 Address Register Indirect Addressing with Post-increment 44 Address Register Indirect Addressing with Pre-decrement 46 Address Register Indirect Addressing with Dispiacement 47 Address Register Indirect Addressing with Index 49 Absolute Short Addressing 51 Absolute Long Addressing 52 Program Counter with Displacement 54 Program Counter with Index 55 Immediate Mode 57 Status Register Addressing 58 vii 29

Languages
English
PDF page 8

viii STACKS AND STACK FRAMES 59 How a Stack Works 59 68000 Hardware Stack 60 Stack Implemented in Software 61 Stack Frames 62 SUMMARY 62 EXERCISES 64 Chapter3 68000 Instruction Set INTRODUCTION 67 INSTRUCTION CLASSES 67 Data Movement 68 Integer Arithmetic Operations 68 Logical Operations 69 Shift and Rotate Operations 69 Bit Manipulation Operations 70 Binary Coded Decimal Instructions 70 Program Control Instructions 70 System Control Operations 71 PROGRAM DEVELOPMENT MECHANICS 71 Editing 72 Backups 73 Assembling 75 Linking 75 EXEC 75 Debugging 76 Example-Summing the First Five Integers 78 67

Languages
English
PDF page 9

DDT-68K 83 Example 84 INSTRUCTIONS 88 Effective Address Operands 88 ABCD Instruction 89 ADD Instruction 92 ADDA lnstruqion 95 ADDI Instruction 97 ADDQ Instruction 99 ADDX Instruction 101 AND Instruction 103 ANDI Instruction 105 ASL Instruction 108 ASR Instruction 111 Bee (Conditional Branch) Instruction 114 BCHG Instruction 120 BCLR Instruction 122 BSET Instruction 124 BSR Instruction 126 BTST Instruction 128 CHK Instruction 131 CLR Instruction 133 CMP Instruction 135 CMPA Instruction 138 CMPI Instruction 140 CMPM Instruction 142 DBcc Instruction 144 DIVS Instruction 148 DIVU Instruction 150 EOR Instruction 152 EORI Instruction 154 EXG Instruction 156 EXT Instruction 158 ix

Reading notes: Table of contents listing for an instruction set reference; page numbers are printed but no advertised content is present OCR artifacts such as 'lnstruqion' and 'Bee' in place of 'Bcc' and 'Bcc (Conditional Branch)'

Languages
English
PDF page 10

x ILLEGAL Instruction 160 JMP Instruction 161 JSR Instruction 163 LEA Instruction 165 LINK Instruction 167 LSL Instruction 170 LSR Instruction 172 MOVE Instruction 174 MOVE to CCR Instruction 176 MOVE to SR Instruction 178 MOVE from SR Instruction 180 MOVE USP Instruction 182 MOVEA Instruction 183 MOVEM Instruction 185 MOVEP Instruction 190 MOVEQ Instruction 193 MULS Instruction 195 MULU Instruction 197 NBCD Instruction 199 NEG Instruction 201 NEGX Instruction 203 NOP Instruction 205 NOT Instruction 206 OR Instruction 208 ORI Instruction 210 PEA Instruction 212 RESET Instruction 214 ROL Instruction 215 ROR Instruction 218 ROXL Instruction 221 ROXR Instruction 224 RTE Instruction 227 RTR Instruction 229 RTS Instruction 230

Reading notes: Index-style table of contents listing instruction names with page numbers; no advertised products, prices, or dates present.

Languages
English
PDF page 11

Chapter4 Simple Macintosh Programs

SBCD Instruction 231 Sec Instruction 234 STOP Instruction 237 SUB Instruction 238 SUBA Instruction 240 SUBI Instruction 242 SUBQ Instruction 244 SUBX Instruction 246 SWAP Instruction 248 TAS Instruction 249 TRAP Instruction 251 TRAPV Instruction 252 TST Instruction 253 UNLK Instruction 255 SUMMARY 256 EXERCISES 256 Chapter4 Simple Macintosh Programs INTRODUCTION 259 THE HELLO WORLD PROGRAM 260 The Hello.asm File 260 The Hello.link File 261 The Hello.job File 261 Running the Hello World Program 261 OUTPUT CONVERSION ROUTINES 262 Converting Binary to Hexadecimal 263 Converting Binary to Decimal 264 xi 259

Reading notes: Chapter heading run together as 'Chapter4' in source text

Languages
English