Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Devices /
Chapter 5 - ADB Manager / ADB Manager Reference
Application-Defined Routines / ADB Command Completion Routines


MyCompletionRoutine

When you use the ADBOp function to send a command to an ADB device, the ADB Manager calls your completion routine when the ADB device has completed the command.

PROCEDURE MyCompletionRoutine;   {parameters passed in registers}
DESCRIPTION
The ADB Manager passes parameters to a completion routine in registers A0, A1, A2, and D0, as described next.

ASSEMBLY-LANGUAGE INFORMATION
On entry to your completion routine, the ADB Manager sets the following registers:
RegisterValue
A0A pointer to the data area specified by the buffer parameter to the ADBOp function. This area contains data stored as a Pascal string (maximum 8 bytes of data preceded by one length byte). For example, data returned by an ADB device in response to a Talk command issued by a call to the ADBOp function can be accessed through this pointer.
A1A pointer to the completion routine.
A2A pointer to the data area that was specified by the data parameter to the ADBOp function. Your completion routine can use this area to store information; for example, to set a flag indicating that the command has completed.
D0The ADB command number (byte) that resulted in the completion routine being called.

SEE ALSO
See Listing 5-2 on page 5-25 for an example of a completion routine.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996