# Programming The PowerPC 1994 — source transcripts, page 1

[Canonical transcript page](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/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-programming-the-powerpc-1994-b24673/1#scan-268b999b22aac14577d13d45a287503e84bde6197a8da1bf407d9e8786f55ce0)

Transcribed text:

New Technology Building Blocks

Programming The PowerPC

Programming Native Applications for the New Power Macintosh

DISK INCLUDED

Learn how to exploit the new RISC processors

Develop native applications for the new Power Macs

Learn to port existing programs from 680x0 to native PowerPC

Examples in MetroWerks CodeWarrior and Symantec C++

Series Editor: Tony Meadow
Bear River Associates

M&T BOOKS

Dan Parks Sydow

Image description: A book cover with a dark blue and black layout, large white title text, a red-orange circuit-board image of an eye on the right, a floppy disk icon labeled DISK INCLUDED on the left, and a bear logo for Bear River Associates near the bottom.

Reading notes: The small text on the circuit-board image (such as 'R 139' and 'C64') is not transcribed as it is part of the artwork rather than advertising copy. The 'Series Editor' line and the 'Bear River Associates' logo text are small and were read with moderate confidence.

Printed product names: MetroWerks CodeWarrior · Symantec C++

Languages: English

[Original Image 1](https://www.vintageapple.net/files/a3dbdf9ff1cfa7889bd723f75a305e20bd6a1ad20b00619cbf504e4da269398f/081141b771e6936efe013fb7.webp)

### PDF page 1

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-8db31f1fe3b297ca015c5ade32159674d7d371477d182ccda1787afc53c058c3)

Transcribed text:

New Technology Building Blocks

Programming The PowerPC

Programming Native Applications for the New Power Macintosh

DISK INCLUDED

• Learn how to exploit the new RISC processors

• Develop native applications for the new Power Macs

• Learn to port existing programs from 680x0 to native PowerPC

• Examples in MetroWerks CodeWarrior and Symantec C++

Series Editor: Tony Meadow
Bear River Associates

BEAR RIVER ASSOCIATES

M&T BOOKS

Dan Parks Sydow

Image description: A book cover with a black header band, a blue lower panel, a green-gray side strip, and a red-orange circuit-board image of an eye in the right-center area.

Reading notes: Small circuit-board labels within the eye image (such as R 138 and C64) are not transcribed as they are not part of the printed copy. The bear logo text 'BEAR RIVER ASSOCIATES' is small and was transcribed from the logo area.

Printed product names: Programming The PowerPC · MetroWerks CodeWarrior · Symantec C++

Languages: English

[Original PDF page 1](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=1)

### PDF page 2

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-656c05426d9e922c810063e7a701c85cb99ccf535811c85f1718e938d070ac13)

Transcribed text:

PROGRAMMING THE POWERPC

DAN PARKS SYDOW

M&T BOOKS

Image description: A centered bold black title above an illustration of a PowerPC microchip with the label 'Power PC' on its top surface, with the author name and M&T Books logo below on a white background.

Reading notes: Faint background text fragments at the top and middle of the page are not legible and were omitted.

Languages: English

[Original PDF page 2](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=2)

### PDF page 3

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-5ba8ac399c23dd3c1280f23720523bc9c950183f222108c17d1002d7888a7724)

Programming the Power PC

Transcribed text:

M&T Books
A Division of   MIS:Press,   Inc.
A Subsidiary of Henry Holt and Company, Inc.
115 West 18th   Street
New   York,   New   York   10011
©   1994 by M&T Books
Printed   in the United   States   of America
All rights reserved. No part of this book may be reproduced or transmitted in any form or
by any means, electronic or mechanical, including photocopying, recording, or by any infor-
mation storage and retrieval system, without prior written permission from the   Publisher.
Contact the   Publisher   for information on foreign rights.
Limits of Liability and Disclaimer of Warranty
The Author and   Publisher   of this book have used their best efforts in preparing the book
and the programs contained in it. These efforts include the development, research, and
testing of the theories and programs to determine their effectiveness.
The Author and   Publisher   make no warranty of any kind, expressed or implied, with regard
to these programs or the documentation contained in this book. The Author and   Publisher
shall not be liable in any event for incidental or consequential damages in connection with, or
arising out of, the furnishing, performance, or use of these programs.
All products, names and services are trademarks or registered trademarks of their respective
companies.
Library of Congress Cataloging-in-Publication Data
Sydow,   Dan   P.
Programming   the   Power   PC   : programming native applications for the new power
Macintosh   I   Dan   Parks   Sydow.
p.   cm.
Johnson's name appears first on the earlier edition.
Includes index.
ISBN   1-55851-400-7 : $34.95
1. Macintosh (Computer) -Programming.
ming.   I.   Title.
2.   PowerPC   microprocessors-Program-
QA76.8.M3S965   1994
005.265-dc20
97   96   95   94   4   3   2   1
Development Editor: Michael   Sprague
Production Editor:   Patricia   Wallen   burg
Copy Editors: Greg Robertson
Technical Editor:   Peter   Ferranti
94-37488
CIP

Reading notes: Primary heading reads 'Programming the Power PC' with subtitle 'programming native applications for the new power Macintosh'; exact heading boundary is uncertain. Cataloging text split across lines ('Program-ming') may affect subject heading reading.

Printed product names: Macintosh (Computer) · PowerPC microprocessors

Printed prices: $34.95

Printed dates: 1994 · ©   1994 · 97   96   95   94   4   3   2   1

Languages: English

[Original PDF page 3](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=3)

### PDF page 4

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-3822ebb3b2ad4e04c3551d61c35dffdcb938c7e6e4406faeca16d6e44792edab)

Image description: The image is a plain, blank white page with no visible artwork, layout, or printed content.

Reading notes: No visible text found; image appears entirely blank white.

[Original PDF page 4](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=4)

### PDF page 5

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-e87203e15bcf1325ced568e10e312d22afe37acb8cb841db67bd927c5ff416e7)

Transcribed text:

ACKNOWLEDGMENTS
Anthony Meadow,   Bear River Associates, for being the only person I
know who can completely and accurately outline his thoughts for an
entire book in one five minute conversation.
Michael Sprague,   Development Editor, M&T Books, for his patience,
sense of humor, patience, input, patience, encouragement, and, least I
forget, for his patience.
Patty Wallenburg,   Production Editor, M&T Books, for a page layout
effort that resulted in such a polished looking book.
Peter   Ferrante,   Apple Computer, for another suggestion-filled technical
book and software review.
Steve Devino,   Teradyne, Inc., for additional software reviewing.
Dave Hirsh,   for granting permission to include his data fork erasing
utility program, DFerase, with this package.
Carol,e   McClendon,   Waterside Productions, for making this book
happen.
William Barnekow,   Professor, Milwaukee   School   of Engineering, for
sparking my interest in computers and computer architecture.

Reading notes: Source text has irregular spacing and a stray comma in 'Carol,e McClendon' that may be an extraction artifact

Languages: English

[Original PDF page 5](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=5)

### PDF page 6

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-69ad025f59235478c5451413635d8b20b40dbb8c2355fb3434d2005fd58a1254)

TABLE OF CONTENTS

Transcribed text:

TABLE   OF   CONTENTS
introduction   xvii
What's on the Disk   XIX
What   You   Need   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   XIX
Why This Book is for   You   xx
CHAPTER 1
The PowerPC and the Power Macs   1
The Need for a New   Chip   . . . . . . . . . . . . . . . . . . . . . . . . .   2
CISC   and   RISC   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   2
RISC   Leads to More Than Just   Speed   . . . . . . . . . . .   4
The   Power   Macintosh Line   . . . . . . . . . . . . . . . . . . . . . . . .   5
Features of the New Macs   . . . . . . . . . . . . . . . . . . . . .   5
The Customer Base   . . . . . . . . . . . . . . . . . . . . . . . . . .   8
Is It   Still   a Mac?   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   9
vii

Reading notes: Chapter heading spacing and page numbers are irregular in the extracted table of contents

Printed product names: PowerPC · Power Macintosh · Power Macs

Languages: English

[Original PDF page 6](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=6)

### PDF page 7

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-5c16215f2427cc7017062606c83080f5fe32e9a737db5e70428a86d07d1ad472)

Transcribed text:

Programming the PowerPC
The   PowerPC   System Software   . . . . . . . . . . . . . . . . .   9
Software Compatibility . . . . . . . . . . . . . . . . . . . . . . . .   I   0
Hardware Compatibility   . . . . . . . . . . . . . . . . . . . . . .   10
Developer Support . . . . . . . . . . . . . . . . . . . . . . . . . . .   10
Chapter Summary   11
CHAPTER   2
CISC   and   RISC   Technologies   13
CISC   and the   680x0   Series   . . . . . . . . . . . . . . . . . . . . . . . . .   14
Why   CISC?   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   14
Instruction Execution on a   680x0   . . . . . . . . . . . . . . .   14
The Timing of Instructions on a   680x0   . . . . . . . . . .   17
CISC-Fast,   But Not Fast Enough   . . . . . . . . . . . . . .   20
RISC   and the   Power   Mac   Series   . . . . . . . . . . . . . . . . . . . .   20
Why   RISC?   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   20
Instruction Execution on a   Power   Mac   . . . . . . . . . .   21
The Timing of Instructions on a   Power   Mac   . . . . . .   25
Chapter   Summary   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   27
CHAPTER   3
PowerPC Architecture   29
viii
Branch   Processing   Unit   . . . . . . . . . . . . . . . . . . . . . . . . . . .   30
Instruction Fetching   . . . . . . . . . . . . . . . . . . . . . . . . .   30
Instruction Fetching and the Branch Unit . . . . . . . .   32
Superscaling   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   36
The Superscalar Design
Branch   Processing   Unit
37
38

Reading notes: Table of contents page numbers and some section titles have irregular spacing and possible OCR spacing artifacts

Printed product names: PowerPC · 680x0 · Power Mac

Languages: English

[Original PDF page 7](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=7)

### PDF page 8

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-57234668bf0aaeb2b5da14368f3406f1189d041b160e0f80f4aefdd88a926ddf)

Table of Contents

Transcribed text:

Table   of Contents
Integer   Unit   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   38
Floating-Point   Unit   . . . . . . . . . . . . . . . . . . . . . . . . . .   38
Cache   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   39
Data Cache   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   39
Instruction Cache   . . . . . . . . . . . . . . . . . . . . . . . . . . . .   41
Chapter   Summary   43
CHAPTER   4
PowerPC   System   Software:
The   Emulator   and Mixed Mode   45
The   PowerPC   System   Software   . . . . . . . . . . . . . . . . . . . . .   46
Ported   System   Software Routines   . . . . . . . . . . . . . . .   46
The New   System   Software   . . . . . . . . . . . . . . . . . . . . .   49
PowerPC   Execution of   System   Software Routines   . .   50
The   68LC040   Emulator   . . . . . . . . . . . . . . . . . . . . . . . . . . .   55
The Mixed Mode Manager   . . . . . . . . . . . . . . . . . . . . . . . .   57
Instruction   Set   Architecture   . . . . . . . . . . . . . . . . . . .   58
Cross-Mode Calls   . . . . . . . . . . . . . . . . . . . . . . . . . . . .   58
680x0   to   PowerPC   Cross-Mode Calls   . . . . . . . . . . . .   59
PowerPC   to   680x0   Cross-Mode Calls   . . . . . . . . . . . .   60
The Programmer's Role in Mode-Switching   . . . . . .   61
Chapter   Summary   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   63
CHAPTER 5
PowerPC   System   Software   Code Fragments   65
The   PowerPC   Runtime Environment   . . . . . . . . . . . . . . . .   66
What the Runtime Environment Is   . . . . . . . . . . . . . .   66
ix

Languages: English

[Original PDF page 8](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=8)

### PDF page 9

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-72a2fb48f4fe7a4e315282b094b2707279530577f57826e091848e7a67a9f780)

Transcribed text:

Programming the PowerPC
A New Runtime Environment-
And Why   It   Was Needed   . . . . . . . . . . . . . . . . . . . .   66
Import Libraries   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   67
Linked Libraries and Import Libraries   . . . . . . . . . . .   68
Advantages oflmport Libraries . . . . . . . . . . . . . . . . .   69
Code Fragments   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   73
About Code Fragments   . . . . . . . . . . . . . . . . . . . . . . .   73
The   Code   Fragment Manager   . . . . . . . . . . . . . . . . . .   74
Transition Vectors   . . . . . . . . . . . . . . . . . . . . . . . . . . .   78
The Table of Contents   . . . . . . . . . . . . . . . . . . . . . . . .   79
Chapter   Summary   84
CHAPTER   6
PowerPC   Compilers   87
x
The Metrowerks CodeWarrior Compilers   88
What Metrowerks Consists   Of   . . . . . . . . . . . . . . . . . .   88
Creating a CodeWarrior   Project   . . . . . . . . . . . . . . . .   90
Adding to the   Project   . . . . . . . . . . . . . . . . . . . . . . . . .   92
The   Prefix   File   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   96
Creating the Resource File   . . . . . . . . . . . . . . . . . . . .   98
The   MWdemoPPC   Source   Code   . . . . . . . . . . . . . . . .   100
Creating the   PowerPC   Application   . . . . . . . . . . . . . .   103
Symantec's Cross-Development Kit (CDK)   . . . . . . . . . . . .   105
What the CDK Consists   Of   . . . . . . . . . . . . . . . . . . . .   105
Installing AppleScript   . . . . . . . . . . . . . . . . . . . . . . . .   106
Using AppleScript to Update   ANSI   Libraries   . . . . .   107
Creating a Folder to Hold Your   Power   Mac   Project   109
Creating the Resource File   . . . . . . . . . . . . . . . . . . . .   112

Reading notes: Table of contents page numbers and chapter layout are not verifiable from the supplied text alone.

Printed product names: Metrowerks CodeWarrior · Symantec's Cross-Development Kit (CDK) · AppleScript · MWdemoPPC · Power Mac

Languages: English

[Original PDF page 9](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=9)

### PDF page 10

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-346cf57b60622aa06408f8acf56191d2ef7e41858d0ae5d56024394bcf15111e)

Transcribed text:

Table   of Contents
Opening the   CDK   Project   . . . . . . . . . . . . . . . . . . . . .   115
Required Resources   . . . . . . . . . . . . . . . . . . . . . . . . . .   119
The   CDKdemoPPC   Source   Code   . . . . . . . . . . . . . . .   121
Creating the   PowerPC   Application   . . . . . . . . . . . . . .   126
Chapter   Summary   . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   131
CHAPTER   7
Universal   Procedure Pointers   133
Universal   Procedure   Pointer   Theory   134
Procedure   Pointers   and the   680x0   Processor   . . . . .   134
Universal   Procedure   Pointers   and the   PowerPC   . . .   136
Using   U   niversalProcPtrs   . . . . . . . . . . . . . . . . . . . . . . . . . .   140
Using   a   UniversalProcPtr   in a
Call   to ModalDialog()   . . . . . . . . . . . . . . . . . . . . . .   140
How the Compiler   Chooses   Between
ProcPtr   and   U   niversalProcPtr   . . . . . . . . . . . . . . . .   144
Using   UniversalProcPtrs   In   Other   Toolbox   Calls   . .   146
UniversalProcPtr   Example   Programs   . . . . . . . . . . . . . . . .   152
ModalDialog() and   UPPs   . . . . . . . . . . . . . . . . . . . . .   152
Another Example of   User   Items and   UPPs   . . . . . . .   157
Chapter   Summary   164
CHAPTER   8
Fat Binary   Applications   167
Fat Application Theory   168
Applications and   680x0/PowerPC   Compatibility   . .   168
Structure of a   680x0   Application   . . . . . . . . . . . . . . .   171
xi

Reading notes: Source text is a table of contents with dot leaders; no body copy, headline, products, prices or dates present.

Languages: English

[Original PDF page 10](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=10)

### PDF page 11

[Cite this scan](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/1#scan-82b470338fff2bd3fc9a08460b89cd6cb8b5612435a97a6310cbbda59dfeaa83)

Transcribed text:

Programming the PowerPC
Structure of a PowerPC   Application   ............ .
Structure of a Fat Application ................. .
Using CodeWarrior to Create Fat Apps   ............. .
Creating the PowerPC Version ................ .
Creating the   680x0   Version ................... .
Creating the Fat Binary ...................... .
Using Symantec's CDK to Create FatApps ........... .
Creating the PowerPC Version ................ .
Creating the   680x0   Version ................... .
Creating the Fat Binary ...................... .
Gracefully Exiting a PowerPC-only App ............. .
PowerPC-only   Applications   and   User-Friendliness   .
The   680x0   Resource File
The   680x0   Source Code
Copying the Resources to the PowerPC-only App ..
Stripping Fat   Applications   ........................ .
Converting a Fat Binary to a PowerPC Application   .
Converting a Fat Binary to a   680x0   Application   ...
Chapter Summary
173
173
176
176
179
181
184
185
187
190
193
194
195
196
197
200
200
202
208
CHAPTER 9
The PowerPC Numerics Environment   209
xii
Switching from   SANE   to PowerPC Numerics   210
PowerPC Numerics Data Formats   . . . . . . . . . . . . . . . . . . .   211
The Single Format   . . . . . . . . . . . . . . . . . . . . . . . . . . .   212
The Double Format   . . . . . . . . . . . . . . . . . . . . . . . . . .   212
The Double-Double Format   . . . . . . . . . . . . . . . . . . .   212
Numeric Data Format Summary   . . . . . . . . . . . . . . . .   212

Reading notes: Source appears to be a table of contents; page numbers are listed without clear reading-order context

Languages: English

[Original PDF page 11](https://www.vintageapple.net/files/1036439515b824de581b3949342b5b0b4770650892ce13dc109b6c0189990591/Programming_The_PowerPC_1994.pdf#page=11)

[Next transcribed scans](https://www.vintageapple.net/transcripts/media/va-programming-the-powerpc-1994-b24673/2.md)
