Important: The information in this document is obsolete and should not be used for new development.
MyDeviceHandler
Whenever an ADB device sends data (for example, in response to a Talk Register 0 command), the ADB Manager calls the device handler associated with that ADB device. You can provide a device handler to handle data from your ADB device.
PROCEDURE MyDeviceHandler; {parameters passed in registers}DESCRIPTION
When the ADB Manager calls a device handler, it passes parameters to the device handler in registers A0, A1, A2, and D0, as described next.SPECIAL CONSIDERATIONS
ADB device handlers are always called at interrupt time; they must follow all rules for interrupt-level processing as described in Inside Macintosh: Processes.ASSEMBLY-LANGUAGE INFORMATION
On entry to your device handler, the ADB Manager passes parameters in the following registers:
Register Value A0 A pointer to the data sent by the device. This area contains data stored as a Pascal string (maximum 8 bytes data preceded by one length byte). A1 A pointer to the device handler routine. A2 A pointer to the data area (if any) associated with the device handler. D0 The ADB command number (byte) that resulted in the device handler being called. A device handler should handle the data pointed to by register A0 in a manner appropriate to the device. For example, the mouse device handler interprets the data it receives in register A0 and posts an event to the event queue.
A device handler can use the area pointed to by register A2 to store global data as needed. (If a device handler needs a global data area, its installation code should allocate the needed memory at the same time it installs the device handler's address into the ADB device table.)
SEE ALSO
See "Writing an ADB Device Handler," beginning on page 5-29, for information on installing and creating an ADB device handler.