home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel Volume 2 #1
/
carousel.iso
/
mactosh
/
da
/
modemdtr.sit
/
modem.asm
< prev
next >
Wrap
Assembly Source File
|
1986-08-13
|
2KB
|
64 lines
;------------------------
; modemDTR 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 tell the 128K ROM serial driver
; to not negate DTR the next time it closes. This is useful when you
; want to quit a terminal program and not lose the connection. (For
; example, to change terminal programs or return to the Finder for
; housekeeping.) On a Macintosh with 64K ROMs, it just beeps.
;------------------------
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 9,0
dc.b 'modemDTR'
.align 2
; The following are the driver reference numbers for the two output ports.
modemPort equ -7
printerPort equ -9
; We'll need 29 bytes for the parameter block.
paramblocksize equ 29
;______________________________________________________________________
OrnOpen
move.l #paramblocksize,d0 ; Create a pointer to a parameter
_NewPtr ; block.
bne.s error1 ; If it failed, beep
clr.l ioCompletion(a0) ; no completion routine
move.w #modemPort,ioRefNum(a0) ; use the modem port
move.w #16,csCode(a0) ; secret code for this control call
move.b #$80,csParam(a0) ; ditto
_Control
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