ADC Home > Reference Library > Technical Notes > Legacy Documents > Mac OS 9 & Earlier >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
IntroductionIf your software is written in a high-level language like Pascal or C and if you adhere to the guidelines listed in Inside Macintosh, many of the questions in this note won't concern you. If you develop in assembly language, you should read each question carefully. If you answer any question "yes," your software may encounter difficulty running on future Macintosh computers, and you should take the recommended action to change your software. Do you depend on 68000 instructions which require that the processor be in supervisor mode?In general, your software should not include instructions which depend on supervisor mode. These include modifying the contents of the status register. Most programs which modify the status register are only changing the Condition Code Register (CCR) half of the status register, so an instruction which addresses the CCR will work fine. Also, your software should not use the User Stack Pointer (USP) or turn interrupts on and off. Do you have code which executes in response to an exception and relies on the position of data in the exception's local stack frame?Exception stack frames vary on different microprocessors in the 68000 family,
some of which may be used in future Macintosh computers. You should avoid using
the
Do you use low-memory globals not documented in Inside Macintosh?Other microprocessors in the 68000 family use the exception vectors in
locations Do you make assumptions about the file system which are not consistent with both the original Macintosh File System and the Hierarchical File System?Your applications should be compatible with both file systems. The easiest way to do this is to stick to the old files system trap calls (which work with both file systems) and avoid direct manipulation of data structures such as file control blocks and volume control blocks whenever possible. Do you depend on the system or application heaps starting at a hard-coded address?The starting addresses and the size of the system and application heaps has
already changed (Macintosh vs. Macintosh Plus) and will change again in the future.
Use the global Do you look through the system's queues directly?In general, you should avoid examining queue elements directly. Instead, use the Operating System calls to manipulate queue elements. Do you directly address memory-mapped hardware such as the VIA, the SCC, or the IWM?You should avoid accessing this memory directly and use trap calls instead (disk driver, serial driver, etc.). Future machines may include a memory management unit (MMU) which may prevent access to memory-mapped hardware. Also, these memory-mapped devices may not be present on future machines. The addresses of these devices are likely to change, so if you must access the hardware directly, get the base address of the device from the appropriate low-memory global (obtainable from includes and interface files): device globalVIA $1D4 SCCRd $1D8 SCCWr $1DC IWM $1E0 Do you assume the location or size of the screen?The location, size, and bit depth of the screen is different in various
machines. You can determine its location and size by examining the QuickDraw
global variable Does your software fail on some Macintosh models or on A/UX?If so, you should determine the reason. Failure to run on all versions of the Macintosh may indicate problems which will prevent your software from working on future machines. Failure to run on A/UX, Apple's Unix for the Macintosh, also may indicate such problems. Do you change master pointer flags of relocatable blocks directly with BSET or BCLR instructions?In the future and on A/UX, all 32 bits of a master pointer may be used, with
the flags byte moved elsewhere. Use the Memory Manager calls Do you check for 128K, 512K, and 1M RAM sizes?You should be flexible enough to allow for non-standard memory sizes. This will allow your software to work in environments like MultiFinder. Is your software incompatible with a third-party vendor's hardware?If so, the incompatibility may prevent your software from working on future machines. You should research the incompatibility and try to determine a solution. Do you rely on system resources being in RAM?On most of our systems, some system resources are in ROM. You should not assume, for example, that you can regain RAM space by releasing system resources. Does your software have timing-sensitive code?Various Macintoshes run at different clock speeds, so timing loops will be
invalid. You can use the trap call Do you have code which writes to addresses within the code itself?A memory management unit (MMU) may one day prevent code from writing to addresses within code memory. Also, some microprocessors in the 68000 family cache code as it's encountered. Your data blocks should be allocated on the stack or in heap blocks separate from the code, and your code should not modify itself. Do you rely on keyboard key codes rather than ASCII codes?The various keyboards are slightly different; future keyboards may be different from them. For textual input, you should read ASCII codes rather than key codes. Do you rely on the format of packed addresses in the trap dispatch table?The trap dispatch table is different on various Macintoshes. There's no
guarantee of the trap table's format in the future. You should use the system
calls Do you use the Resource Manager calls
|
Acrobat version of this Note (48K). |
|