; ; SIO & CTC Chip port addresses: ; BPORT: EQU 50H ;Aux Port divisor latch of 8253 CTC. BPORT2: EQU 53H ;counter timer mode control. BASEP: EQU 70H ;Zilog SIO. ; MODDAT: EQU BASEP ;modem data port MODCT1: EQU BASEP+1 ;modem status/control port MODCT2: EQU BASEP+1 ;2nd modem status/control port ; ; Port status masks: ; MDRCVB: EQU 001H ;bit to test for receive MDRCVR: EQU 001H ;value when ready MDSNDB: EQU 004H ;bit to test for send MDSNDR: EQU 004H ;value when ready MDDCDB: EQU 008H ;carrier detect bit MDDCDA: EQU 000H ;value when active MDCTSB: EQU 020H ;clear to send bit ; ; Port commands (output to MODCT1): ; RESCHN: EQU 018H ;reset channel RESSTA: EQU 010H ;reset external status WRREG1: EQU 000H ;value to write to register 1 WRREG3: EQU 0C1H ;8 bits/char, rx on WRREG4: EQU 044H ;16x, 1 stop, no parity DTROFF: EQU 000H ;dtr and rts off DTRON: EQU 0EAH ;drt on, rts on, tx on, 8 bit/char ONINS: EQU 030H ;error reset BRKON: EQU 0FAH ;dtr on, rts on, tx on, break on, 8 bit/char BRKOFF: EQU 0EAH ;dtr on, rts on, tx on, break off, 8 bit/char ; MSPEED: DB 5 ;0=110 1=300 2=450 3=600 4=710 5=1200 ;6=2400 7=4800 8=9600 9=19200 default INCTL1: IN MODCT1 ! RET ;in modem control port ; OTDATA: OUT MODDAT ! RET ;out modem data port ; INPORT: IN MODDAT ! RET ;in modem data port ; MASKR: ANI MDRCVB ! RET ;bit to test for receive ready TESTR: CPI MDRCVR ! RET ;value of rcv. bit when ready MASKS: ANI MDSNDB ! RET ;bit to test for send ready TESTS: CPI MDSNDR ! RET ;value of send bit when ready ; INMODV: JMP INIMOD ;initialize at cold-start NEWBDV: JMP NWBAUD ;sets baud rate associated with# NOPARV: RET ! NOP ! NOP ;(by-passes PMMI routine) PARITV: RET ! NOP ! NOP ;(by-passes PMMI routine) ; CLREOS: MVI C,ILP ;clear to end of screen CALL MEX DB ESCP,59H,0,0,0 RET ; CLS: MVI C,ILP ;home cursor and clear to end of screen CALL MEX DB 1EH,ESCP,59H,0,0 RET ; ; Following sends a 300 ms break tone to reset some time-share computers. ; SBREAK: MVI A,5 ;setup to write reg 5 OUT MODCT1 MVI A,BRKON ;dtr on, rts on, tx on, break on, 8 bit/char JMP GOODB1 ; ; Following sents DTR low for 300 ms to disconnect most modems. ; DISCON: MVI A,5 ;setup to write reg 5 OUT MODCT1 MVI A,DTROFF ;dtr off hangup ; GOODB1: OUT MODCT1 MVI B,3 ;300ms delay MVI C,TIMER CALL MEX GOODBY: MVI A,5 ;setup to write reg 5 OUT MODCT1 MVI A,DTRON ;dtr on, rts on, tx on, 8 bit/char OUT MODCT1 ;enable modem RET ; ; Setup the modem port (Morrow Auxillary Serial Port). ; INIMOD: MVI A,4 ;setup to write reg 4 OUT MODCT1 MVI A,WRREG4 ;16x, 1 stop, no parity OUT MODCT1 ; MVI A,1 ;setup to write reg 1 OUT MODCT1 MVI A,WRREG1 ;value to write to register 1 OUT MODCT1 ; MVI A,3 ;setup to write reg 3 OUT MODCT1 MVI A,WRREG3 ;initialize receive register OUT MODCT1 ; MVI A,5 ;setup to write reg 5 OUT MODCT1 MVI A,DTRON ;dtr on, 8 bit/char, tx enable, rts OUT MODCT1 ;enabling modem ; IN MODDAT ;clean out garbage IN MODDAT ;make sure its clear LDA MSPEED JMP NWBAUD ;setup baudrate ; ; Following sets the baud rate. If you do not support a particular rate, ; then put the label in front of the SETINV routine. If the baud change ; was successful, make SURE the Zero flag is set. ; SETUPR: MVI C,SBLANK ;ANY ARGUMENTS? CALL MEX JC TELL ;IF NOT, GO DISPLAY BAUD LXI D,CMDTBL MVI C,LOOKUP CALL MEX ;PARSE ARGUMENT PUSH H ;SAVE ANY PARSED ARGUMENT ADRS ON STACK RNC ;IF WE HAVE ONE, RETURN TO IT POP H ;OOPS, INPUT NOT FOUND IN TABLE MVI C,ILP CALL MEX ;TELL USER INPUT NOT VALID DB CR,LF DB 'Only 300 or 1200 allowed on SET command' DB CR,LF,0 RET ; CMDTBL: DB '30','0'+80H DW OK300 DB '120','0'+80H DW OK1200 DB 0 ; TELL: MVI C,ILP CALL MEX ;PRINT CURRENT BAUD RATE DB CR,LF,'Baud rate is now: ',0 LDA MSPEED MVI C,PRBAUD CALL MEX RET ; OK300: MVI A,1 ;value for MSPEED STA MSPEED MVI A,3EH ;Aux:= Mode 3 (Channel 0) LXI D,BD300 ;baud rate value JMP LOADBD ;go do it ; OK1200: MVI A,5 STA MSPEED MVI A,3EH LXI D,BD1200 JMP LOADBD ; LOADBD: OUT BPORT2 ;counter timer mode control MOV A,E OUT BPORT ;Aux Port divisor latch LOW MOV A,D OUT BPORT ;Aux Port divisor latch HIGH OUT BPORT XRA A RET ; BAUDBF: DB 10,0 DS 10 ; NWBAUD: CPI 1 JZ OK300 CPI 5 JZ OK1200 RET ; BD110: EQU 08E0H BD300: EQU 0342H BD450: EQU 022AH BD600: EQU 01A0H BD710: EQU 015FH BD1200: EQU 00D0H BD2400: EQU 0068H BD4800: EQU 0034H BD9600: EQU 001AH BD19200: EQU 000DH ;