`
`IBG 1036
`
`CBM of U.S. Patent No. 7,693,768
`
`
`
`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, butrather 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,
`MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT.
`THIS MANUAL 13 SOLD “ AS IS” AND YOU, THE PURCHASER, ARE ASSUMJNG THE
`ENTIRE RISK AS TO THE USE OF AND RELIANCE ON THIS MANUAL.
`
`IN NO EVENT WILI.. APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL,
`lNClDEN'I‘AL,OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR
`OMISSION IN THIS MANUAL, even if advised of the possibility of possible 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 warrattties 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.
`
`0002
`0002
`
`
`
`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
`equalssize 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.
`
`IIIIIIII
`IIIII no
`
`IIIIIIIIIIIIIIII
`uunuao -nuns-
`
`—---4
`
`II
`
`I4-3II40u
`-IIIIuII:
`IIon
`IIll5I
`I1IIIqIIIII
`
`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 Eixels 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 362 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 oEf—screen hit
`image.
`
`3/QIB3 Espinosa-Rose
`
`/QUICKJQUIKDRAH.2
`
`0003
`0003
`
`
`
`varinbie
`
`actress
`
`128K: 31 FFFF
`
`""'
`
`123x swoon
`*” 3°“”"'*°“’ am moo
`
`,E__ (5cmBm)12eK: sumo
`512K: $?A?DO
`
`(-- (BulPtr)
`
`<-— A5 = (Curl-entA5)
`
`<-~ (A5)
`
`(—- (CUSIBCRBOQB)
`
`(—.(H¢'-'8DE|'!€|)
`
`16
`
`Memory Manager Programmer's Guide
`
`size (Dries)
`
`.;.;.-_. .;.-.:.;........................
`
`23
`740
`we
`
`alternate :_creen butter
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`’
`
`sieck
`
`
`
`system heap
`
`-
`
`system global: and
`trap. dispatch table
`
`(— (Anplzone)
`
` (— (syszone)
`
`
`
`3300
`
`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 is used by
`the System Error Handler. Note that the addresses of these buffers are
`different for different-sized computers.
`
`Thete 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 Ptovides a
`routine for specifying that an alternate screen or sound buffer will be
`used a
`
`The memory organization of a Lisa running Hacworks is shown in Figure
`19.
`
`10/9/81: Chernieoff-Hacker
`
`IHEH,-HGR.}MEM.I.2
`
`0004
`0004
`
`
`
`MEMORY ORGANIZATION
`
`17
`
`size (bytes)
`
`variable
`
`address‘
`
`(__ (scrnaoae)
`
`hardware interface
`
`appiicetion parameters
`
`| Quickoraw global:
`
`(—- M T
`
`(__ §B:;“,,,:‘;°’
`
`‘M: EEFBS
`512K: $461786
`W, mm
`mac: mass
`(__ A5 3 ccuflenms)
`
`6- (A5)
`(— (curstackflasc)
`
`1”: 512K: V8000
`
`32*“ {
`
`no {
`0
`32
`
`40
`
`16K
`2816
`
`<-— SP . A7
`
`-43:
`
`.—
`
`-‘J..a.—.ad»———.
`a
`appincetnon heap
`system heap
`syatemglobela
`
`(
`(-— Apoizone)
`(S 2
`3 one)
`y
`
`é——
`
`SCDEJO
`saw
`
`- igure 10. 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 Heag 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.
`
`10[9/84 chernicoff-Hacker
`
`lHEH.MGRlHEM.I.2
`
`0005
`0005