`CBM of U.S. Pat. No. 7,676,411
`
`
`
`Copyright
`Copyright © 1982, 1983, 1984, 1985 Apple Computer, Inc. All Rights Reserved.
`20525 Mariani Avenue
`Cupertino. CA 95014
`(408) 996-1010
`
`This manual is copyrighted. Under the Copyright laws, this manual may not be copied, in whole
`or in part, without written consent of Apple. Under the law, copying includes translating into
`another language or format.
`
`Macintosh is a trademark licensed to Apple Computer, Inc.
`
`Apple, the Apple logo, the Macintosh logo, Macwrite, MacDraw, and MacPaint are trademarks of
`Apple Computer, Inc.
`
`Lisa is a registered trademark ot‘Apple Computer, Inc.
`
`Simultaneously published in the U.S.A. and Canada.
`
`Limitation on warranty and Liabilities
`Inside Macintosh is a working document used by Apple’s own programmers and developers
`which describes the hardware and software associated with the Macintosh computer. This is at
`preliminary edition that is incomplete and may contain errors. Apple itself does not rely solely on
`this document, butratlter subjects all of its products to extensive testing prior to introduction.
`Further, Apple is continuing to improve its products and the contents of this manual may be
`obsoleted as a result of changes to Apple products. Accordingly, Apple makes no warranty that
`this manual is accurate or complete and notifies all readers that the specifications of its products are
`subject to change without notice.
`
`APPLE MAKES NO WARRANTY OR REPRESENTATION, EITI-{ER EXPRESS OR
`IMPLIED, WITH RESPECT TO THIS MANUAL, ITS ACCURACY, CONTENT,
`MERCHANTABHJTY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT,
`'I'I~TIS MANUAL IS SOLD “ AS IS” AND YOU, THE PURCHASER, ARE ASSUMING THE
`ENTIRE RISK AS TO THE USE OF AND RELIANCE ON THIS MANUAL.
`
`IN NO EVENT WILL APPLE BE LIA BLE FOR DIRECT, INDIRECT, SPECIAL,
`INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR
`OMISSION IN THIS MANUAL, even if advised of the possibility of possibic damages resulting
`therefrom.
`
`No Apple dealer, agent, or employee is authorized to make any modification, ex tension, or addition
`to this warranty.
`
`‘ Some states do not allow the exclusion or limitation of implied warranties or liability for incidental
`or consequential damages, so the above limitation may not apply to you. This warranty gives you
`specific legal rights, and you may also have other rights which vary from state to state.
`
`
`
`12
`
`Quickbraw Programmer's Guide
`
`The Bit
`
`Ima e
`
`A bit image is a collection of bits in memory which have a rectilinear
`representation.
`Take a collection of words in memory and lay them en
`to end so that bit 15 of the Iowestwnumbered word is on the left and
`
`Then take this
`bit ¢ of the highest-numbered word is on the far right.
`array of bits and divide it, on word boundaries,
`into a number of
`equal-size rows. Stack these rows vertically so that the first row is
`on the top and the last row is on the bottom.
`The result is a matrix
`like the one shown in Figure 5 - rows and columns of bits, with each
`row containing the same number of bytes. The number of bytes in each
`row of the bit image is called the 53g_width of
`that image.
`
`—---4
`
`IIin
`IIll|I
`
`I13II40t
`IIIIIIIII:
`I1IIICIIIII
`
`Figure 5.
`
`A Bit Image
`
`A bit image can be stored in any static or dynamic variable, and can be
`of any length that
`is a multiple of
`the row width.
`
`The upper
`The Macintosh screen itself is one large visible bit image.
`21,888 bytes of memory are displayed as a matrix of 175,194 pixels on
`the screen, each bit corresponding to one pixel.
`If a bit's value is
`9, its pixel is white; if the bit's value is 1,
`the pixel is black.
`
`The screen is 3&2 pixels tall and 512 pgxels wide, and the row width of
`its bit image is 64 bytes.
`Each pixel on the screen is square:
`there
`are 72 pixels per inch in each direction-
`
`( hand)
`
`Since each pixel on the screen represents one bit in a
`bit image, wherever this document says "bit", you can
`substitute "pixel" if the bit image is the Macintosh
`screen. Likewise,
`this document often refers to pixels
`on the screen where the discussion applies equally to
`bits in an off—screen bit
`image.
`
`3/2/83 Espinosa-Rose
`
`/QUICK/QUIKDRAH.2
`
`
`
`16
`
`Memory Manager Programmer's Guide
`
`si2e<I=y1es)
`
`-:-;-‘_. .:.'.:.:..........
`
`23
`740
`we
`
`
`
`
`alternate screen bufler
`
`
`
`
`
`
`
`
`
`veriabie
`
`games:
`
`123x: $1FFFF
`
`""'
`
`12o<- swoon
`*‘ 3°“"""°“’ s12s<=svv=c-on
`
`£__ {Sc,,,Bm)12eK: sumo
`512K: $7A?DO
`
`(- (BulPtr)
`
`(- A5 = (CUffel'I1A5)
`
`<-~ (A5)
`
`(—- (curstackfieae)
`
`(—.(H¢'-'8DE|'!¢|)
`
`
`
`’
`
`fleck
`
`
`
`system heep
`
`-
`
`system global: and
`trap. dispatch table
`
`(— (hnplzone)
`
` (— (syszone)
`
`
`
`$BUU
`
`Figure 9. Macintosh RAn Organization
`
`At (almost) the very end of memory are the main sound buffer, used by
`the Sound Driver to control the sounds emitted by the built-in speaker
`and the Disk Driver to control disk motor speed, and the main screen
`buffer, which holds the bit image to be displayed on the Macintosh
`screen.
`The area between the main screen and sound buffers 13 used by
`the System Error Handler. Note that the addresses of these buffers are
`dtfferent for different-sized computers-
`
`There are alternate screen and sound buffers for special applications.
`If you use either or both of these,
`the space available for use by your
`application is reduced accordingly.
`The Segment Loader Provides a
`routine for specifying that an alternate screen or sound buffer will be
`l.I3ed e
`
`The memory organization of :1 Lisa running Hacworks is shown in Figure
`19.
`
`10/‘H84 Chetnicoff-Hacker
`
`/HEH.HGRIP£Bl4o I-2
`
`
`
`MEMORY ORGAHIZATIOH
`
`17
`
`size (bytes)
`
`variable
`
`address‘
`
`hardware interface
`
`eppiication parameters
`
`no {
`t
`32
`
`40
`
`‘ Quickoraw global:
`
`(—- M T
`
`(__ §B:‘;;:;”
`
`‘M: SEE F86
`512K:
`4EFBB
`W, icm
`s12»<=s«-aces
`(__ A5 3 (cmenms)
`t
`6- (A5)
`(— (curstackflasc)
`
`3m{ f__ (swam) m: ssaouo 512K:$78000
`
`<-— SP .2 A7
`
`-43:
`
`.—
`
`-‘J..a.—.ab———.
`a
`appincatnon heap
`system heap
`syatemglobola
`
`(
`(-— ADNZON‘-')
`(S 2
`3 one)
`Y
`
`é——
`
`SCOEJO
`$800
`
`16K
`2816
`
`- igure lfl. Lisa RAM Organization
`
`MMORY MANAGER DATA STRUCTURES
`
`This section discusses the internal data structures of the Memory
`Manager. You don't need to know this information if you're just using
`the Memory Manager routinely to allocate and release blocks of memory
`from the application heap zone.
`
`Structure of Hang Zones
`
`Each heap zone begins with a 52-byte zone header and ends with a 12-
`byte zone trailer (see Figure 11).
`The header contains all the
`information the Memory Manager needs about that heap zone;
`the trailer
`is just a minimum-size free block (described in the next section}
`placed at the end of the zone as a marker. All
`the remaining space
`between the header and trailer is available for allocation.
`
`l0/9I8& cherniooff-Hacker
`
`iHEM.HGRlHEM.I.2