home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 364b.lha / PCQ_v1.1 / Runtime / PCQ / CheckIO.asm next >
Encoding:
Assembly Source File  |  1990-04-08  |  749 b   |  28 lines

  1. *
  2. *    CheckIO.asm (of the PCQ Pascal runtime library)
  3. *    Copyright (c) 1989 Patrick Quaid
  4. *
  5. *    If IO checking is enabled, this routine is called after each
  6. *    library IO routine.  If there has been an error, this routine
  7. *    will exit the program with an appropriate error.
  8. *
  9. *    This routine expects no particular registers, and if there
  10. *    is no error the registers will all be returned intact.  The
  11. *    PSW will be changed.
  12. *
  13.  
  14.     XREF    _p%exit
  15.     XREF    _ExitAddr
  16.     XREF    _p%IOResult
  17.  
  18.     XDEF    _p%CheckIO
  19. _p%CheckIO
  20.     tst.l    _p%IOResult        ; has there been an IO error?
  21.     beq.s    1$            ; no error
  22.     move.l    _p%IOResult,d0        ; set up for call
  23.     move.l    (sp),_ExitAddr        ; use CALLERS address
  24.     jsr    _p%exit            ; it might return....
  25. 1$    rts                ; return to regularly scheduled program
  26.  
  27.     END
  28.