home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / c-kermit / ck9asm.a < prev    next >
Text File  |  2020-01-01  |  2KB  |  95 lines

  1. * ck9asm.a
  2. * ========
  3. * Assembler code to give Kermit access to OS9 service calls 
  4. * that were not supported by the C libraries when it was 
  5. * written prior to the release of OS-9 v2.4
  6. *
  7. * Author: unknown
  8. * Date:   unknown
  9. *
  10. * Version 2.4 now supports signal masking, setting and deleting
  11. * alarms, but still does not provide access to the I$SetStt SS_Break
  12. * SCF driver function which causes a BREAK to be sent. 
  13. *
  14. * As a consequence, and to avoid changing code that handles alarms
  15. * the entire module has been retained.
  16. *
  17. * 27/06/1998 - Change by Martin Gregorie, gregorie@logica.com
  18. *
  19. *              With Ckermit V193 the data area has expanded to
  20. *              more than 64K. Consequently this module has been
  21. *              changed so error exit paths use 32 bit offsets to
  22. *              set the errno global.
  23. *
  24.     psect
  25.  
  26. sigmask:
  27.         link a5,#$0000
  28.         move.l d1,-(a7)
  29.         move.l d0,d1
  30.         moveq #0,d0
  31.         os9 F$SigMask
  32.         bcs.s sigerr
  33.         moveq #0,d0
  34. sigret
  35.         move.l (a7)+,d1
  36.         unlk a5
  37.         rts
  38. sigerr
  39.         move.l #errno,d2
  40.         move.l d1,0(a6,d2.l)
  41.         moveq #-1,d0
  42.         bra.s sigret
  43.  
  44. remove_alarm:
  45.         link a5,#$0000
  46.         movem.l d1,-(a7)
  47.         moveq.l #0,d0
  48.         move.w  #A$Delete,d1
  49.         os9     F$Alarm
  50.         exg     d0,d1
  51.         movem.l (a7)+,d1
  52.         bcc.s   return_success
  53.         bra.s   return_error
  54.  
  55. add_alarm:
  56.         link a5,#$0000
  57.         movem.l d1-d3,-(a7)
  58.         move.l  d0,d3
  59.         move.l  d1,d2
  60.         moveq.l #0,d0
  61.         move.w  #A$Set,d1
  62.         lsl.l   #8,d3                   times 256
  63.         bset.l  #31,d3                  1/256 seconds
  64.         os9     F$Alarm
  65.         exg     d0,d1
  66.         movem.l (a7)+,d1-d3
  67.         bcc.s   return_success
  68.  
  69. return_error
  70.         move.l  #errno,d2
  71.         move.l  d0,0(a6,d2.l)
  72.         moveq   #-1,d0
  73.         bra.s   ret
  74. return_success
  75.         moveq #0,d0
  76. ret
  77.         unlk a5
  78.         rts
  79.  
  80. *int    send_break(path) int path;
  81. * sends a break on path using the SS_break setstat call to the driver
  82. * return 0 on success, -1 on error with appropriate errorcode in errno
  83. send_break:
  84.         link a5,#$0000
  85.         movem.l d1,-(a7)
  86.         move.w  #SS_Break,d1
  87.         os9     I$SetStt
  88.         exg     d0,d1
  89.         movem.l (a7)+,d1
  90.         bcc.s   return_success
  91.         bra.s   return_error
  92.  
  93.  
  94.     ends
  95.