home *** CD-ROM | disk | FTP | other *** search
- 11-May-88 21:26:13-MDT,2727;000000000000
- Return-Path: <u-lchoqu%sunset@cs.utah.edu>
- Received: from cs.utah.edu by SIMTEL20.ARPA with TCP; Wed, 11 May 88 21:26:10 MDT
- Received: by cs.utah.edu (5.54/utah-2.0-cs)
- id AA03924; Wed, 11 May 88 21:26:47 MDT
- Received: by sunset.utah.edu (5.54/utah-2.0-leaf)
- id AA29300; Wed, 11 May 88 21:26:45 MDT
- Date: Wed, 11 May 88 21:26:45 MDT
- From: u-lchoqu%sunset@cs.utah.edu (Lee Choquette)
- Message-Id: <8805120326.AA29300@sunset.utah.edu>
- To: rthum@simtel20.arpa
- Subject: SendBreak.asm
-
- ;------------------------
- ; SendBreak desk accessory
- ; by Brian H. Powell brian@sally.UTEXAS.EDU
- ; cs.Powell@r20.UTEXAS.EDU
- ; brian@ut-sally.UUCP
- ;
- ; This desk accessory is used to send a break out the modem port
- ; with the serial driver. The break condition lasts about 12 ticks
- ; (one-fifth of a second.)
- ;------------------------
-
- include :equ_files:traps.txt
- include :equ_files:sysequ.txt
-
- OrnEntry
- dc.w 0 ; We don't need time, need a goodbye kiss,
- ; or respond to control calls.
- dc.w 0 ; We don't need time
- dc.w 0 ; We don't respond to any events
- dc.w 0 ; We don't have a menu
-
- ; offsets to driver routines:
- dc.w OrnOpen-OrnEntry ; Open
- dc.w done-OrnEntry ; Prime
- dc.w done-OrnEntry ; Control
- dc.w done-OrnEntry ; Status
- dc.w done-OrnEntry ; Close
-
- OrnTitle dc.b 10,0
- dc.b 'SendBreak'
- .align 2
-
- ; The following are the driver reference numbers for the two output ports.
- modemPort equ -7
- printerPort equ -9
-
- ; We'll need 28 bytes for the parameter block.
- paramblocksize equ 28
-
- ; misc. equates
- numTicks equ 12 ; number of ticks to delay (one-fifth second)
- SetBrk equ 12 ; Control code for set break
- ClrBrk equ 11 ; Control code for clear break
-
- ;______________________________________________________________________
-
- OrnOpen
- move.l #paramblocksize,d0 ; Create a pointer to a parameter
- _NewPtr ; block.
- bne.s error1 ; If it failed, beep
- move.l a0,a1 ; make a copy of the pointer.
-
- clr.l ioCompletion(a0) ; no completion routine
- move.w #modemPort,ioRefNum(a0) ; use the modem port
- move.w #SetBrk,csCode(a0) ; secret code for the start break
- _Control ; control call.
- tst.w d0 ; Was there an error?
- bne.s error2 ; If so, release memory and beep
-
- move.l #numticks,a0 ; we want to delay for "numticks".
- _Delay
-
- move.l a1,a0 ; restore the pointer to a0
- move.w #ClrBrk,csCode(a0) ; secret code for the clear break
- _Control ; control call.
- tst.w d0 ; Was there an error?
- bne.s error2 ; If so, release memory and beep
-
- _DisposPtr ; If not, release memory and return
- bra.s done
-
- error2 _DisposPtr
- error1 move.w #15,-(sp) ; if there was an error, beep.
- _SysBeep
- done rts
-
- end
-