5 |
WRITING A DRIVER
******************************************************************
************
**
*THE CODE BELOW HANDLES FINAL RETURN CODES.
FINALSTAT:
BSR POSTSTAT | POSTSTAT IS A SUBROUTINE THAT POSTS FINAL |
STATUS
* POSTSTAT RETURNS THE Z BIT=1 IF STATUS IS O.K.
******************************************************************
************
**
*THE CODE BELOW IS A COMMON EXIT CODE FOR THIS DRIVER.
RET_OUT
BTST #13,D0 | RTE REQUIRED? |
IF <EQ> THEN |
|
BSR RESTORE_REG | A3 IS THE INPUT TO THIS REGISTER RESTORE |
ROUTINE |
|
RTE | EXECUTE THE RTE FOR THE SCSI FIRMWARE |
ENDI |
|
*THERE ARE ONLY TWO WAYS TO ACTUALLY ’EXIT’ THIS CALLER ROUTINE.
*1. IS TO EXIT VIA THE EXECUTION OF AN RTE. (A TASK WAS INTERRUPTED BY THE
*SCSI BUS AND THE EXECUTION OF THE RTE WILL RESUME THAT TASK.)
*2. A ROUTINE CALLED THIS DRIVER BY A SUBROUTINE CALL. IT IS RETURNED TO WITH
*THE EXECUTION OF AN RTS.
*
*ALL OTHER ’EXITS’ GO BACK TO THE SCSI FIRMWARE (FOR THIS EXAMPLE).
RTS