home *** CD-ROM | disk | FTP | other *** search
- ;
- ; -------------------------------------------------------------------
- ; I/O drivers using BYERSX's extended BDOS calls
- ;
- ; local console input status
- ; a,f
- constat:
- mvi a,66; Console status call
- jmp dos
- ;
- ; input (a) from local keyboard
- ; a,f
- conin: mvi a,67; Console input call
- jmp dos
- ;
- ; char (e) to local console
- ; a,f
- conout: mvi a,68; Console output call (char is in 'E')
- jmp dos
- ;
- ; check carrier presence (or checks disabled)
- ; a,f
- mdcarck:
- call getstatus
- xri carcks; Carrier checks enabled
- ani carcks
- rnz; Disabled, signal carrier on
- mvi a,65; Carrier check
- jmp dos
- ;
- ; input from modem, no ready checks
- ; a,f
- mdinp: mvi a,64; Modem input
- jmp dos
- ;
- ; output char (a) to modem, no ready checks
- ; f
- mdoutp: push d
- mov e,a; Put character in 'E'
- mvi a,63; Modem output
- call dos
- mov a,e; ensure (a) unchanged
- pop d
- ret
- ;
- ; modem output status
- ; a,f
- mdoutst:
- mvi a,62; Modem output status
- jmp dos
- ;
- ; Get modem input status
- ; a,f
- mdinst: mvi a,61; Modem input status
- ; " "
- ; BDOS call (a), preserving registers. Can't return word value
- ; a,f
- dos: push h
- push d
- push b
- mov c,a
- call bdos
- pop b
- pop d
- pop h
- ret
- ;
- ; Get current modem speed
- ; a,f
- mspeed: push d
- mvi e,0; query subcommand
- mvi a,sgbaud
- call dos; returns 1..10
- pop d
- ani 0fh; ignore stops/parity
- rz; default 110 baud if unknown
- dcr a; Put in range 0..9
- ret
- ;
- ; This end is the cpu, not a terminal. Using CCP stack.
- ; Delay for remote end to close files and return to terminal mode
- ; a,f,d,e,h,l
- waitxit:
- lhld waitm; l is delay in 0.1 secs
- waitx1: call delay
- dcr l
- jnz waitx1
- ret
- ;
- ; delay (de) millisecs
- ; a,f
- dodelay:
- mvi a,delayms
- jmp dos; delay and exit
- ;
- ; 100 millisec delay
- ; a,f
- delay: push d
- lxi d,100
- call dodelay; delay 0.1 sec
- pop d
- ret
- ;
- ; Get CPU clock rate in 100 khz units
- ; a,f
- clkspd: mvi a,2; subcommand
- jmp dorsx
- ;
- ; check RSX presence. Allows for changes under CPM 3
- ; a,f
- chkrsx: mvi a,0; presence query
- ; " "
- ; rsx sub-command (a)
- ; a,f
- dorsx: push d
- mov e,a
- mvi d,0; so enquiry works, cant kill
- mvi a,rsxmast
- call dos
- pop d
- ora a; set flags on returned value
- ret
- ;
- ; get system status byte
- ; a,f
- getstatus:
- mvi a,systate
- ; " "
- ; query a system variable for dos call (a)
- ; *** USE ONLY for calls that use 0ffh as enquiry ***
- ; a,f
- sysquery:
- push d
- mvi e,0ffh
- call dos
- pop d
- ret
- ;
- ; set/get wheel/system status. a=0ffh to get, else set
- ; a,f
- setstatus:
- push d
- mov e,a
- mvi a,systate
- call dos
- pop d
- ret
- ;
- ; turn disk motors off
- ; a,f
- dskstp: mvi a,047h
- jmp dorsx
- ;
- ; advance local timers by 1 min
- ; a,f
- advmin: mvi a,04ah
- jmp dorsx
- ;
- ; delay "pause" milliseconds for line turn-around to allow some
- ; main-frames to become live on receive. Disturb no registers
- turn: push psw
- push d
- lda pause
- mov e,a
- mvi d,0
- ora a; Speed up if configured to zero
- cnz dodelay; delay pause millisecs
- pop d
- pop psw
- ret
- ;
- 9