.TITLE SPEED - SET REMOTE PORT BAUD RATE .IDENT /2.6/ .ENABL LC ;+ ; ; Free software BY ; Project Software & Development, Inc. ; ; This software is furnished for free and may be used and copied as ; desired. This software or any other copies thereof may be provided or ; otherwise made available to any other person. No title to and ; ownership of the software is hereby transferred or allowed. ; ; The information in this software is subject to change without notice ; and should not be construed as a commitment by PROJECT SOFTWARE ; AND DEVELOPMENT, INC. ; ; PROJECT SOFTWARE assumes no responsibility for the use or reliability ; of this software on any equipment whatsoever. ; ; Project Software & Development, Inc. ; 14 Story St. ; Cambridge, Ma. 02138 ; 617-661-1444 ; ; ; Title: SPEED ; Author: Gary Larsen & Robin Miller ; Date: February 18, 1982 ; ; Description: ; ; This module has the various subroutines to setup the local ; and remote terminal characteristics. ; ; Modification History: ; ;- .ENABL AMA .NLIST BEX .MCALL ASTX$S, QIOW$S ; LOCAL EQUATES SPDSIZ = 5 ; SIZE OF ENTRYS IN TABLE BELL = 7 ; ASCII BELL CR = 13. ; CARRIAGE RETURN LF = 10. ; LINE FEED ESC = 27. ; ESCAPE CTRLY = 25. ; CONTROL/Y SPACE = 32. ; SPACE ; SETUP THE RATE TABLE .MACRO BAUDS,RATES .ASCII /RATES/ .NCHR N,RATES .BLKB SPDSIZ-N .ENDM SPDADR: .BYTE TC.RSP ; RECEIVE SPEED BIT RSPEED::.BYTE S.9600 ; DEFAULT RECEIVE SPEED .BYTE TC.XSP ; TRANSMIT SPEED BIT XSPEED: .BYTE S.9600 ; DEFAULT TRANSMIT SPEED SPDLEN = .-SPDADR ; CALCULATE THE SIZE SPDENT::.WORD DEFSPD ; POINTER TO THE BAUD RATE ; ; ASCII messages. ; RATEQ: .ASCII %Enter the baud rate for the remote port (% SPDDEF: .BLKB 8. ; STORE DEFAULT BAUD RATE HERE RATEH: .ASCIZ %BAUD% INTRQ: .ASCII %Enter the RSXNET interrupt character (% INTDEF: .BLKB 6. ; STORE DEFAULT INTERRUPT HERE INTRH: .ASCIZ %INTERRUPT% .EVEN ; ENTRIES FOR THE BAUD RATE TABLE SPDTBL: BAUDS <50> BAUDS <75> BAUDS <100> BAUDS <110> BAUDS <134> BAUDS <150> BAUDS <200> BAUDS <300> BAUDS <600> BAUDS <1200> BAUDS <1800> BAUDS <2000> BAUDS <2400> BAUDS <3600> BAUDS <4800> BAUDS <7200> DEFSPD: BAUDS <9600> BAUDS BAUDS .BYTE -1 .EVEN ; TABLE OF VALUES FOR THE TRANSMIT AND RECEIVE BITS SPDEQU: .BYTE S.50 .BYTE S.75 .BYTE S.100 .BYTE S.110 .BYTE S.134 .BYTE S.150 .BYTE S.200 .BYTE S.300 .BYTE S.600 .BYTE S.1200 .BYTE S.1800 .BYTE S.2000 .BYTE S.2400 .BYTE S.3600 .BYTE S.4800 .BYTE S.7200 .BYTE S.9600 .BYTE S.EXTA .BYTE S.EXTB .EVEN .SBTTL SPEED - SET THE REMOTE PORT SPEED ;+ ; ; SPEED - SET THE REMOTE PORT SPEED ; ; This routine is used to set the DZ or DH baud rate for a specified ; communications port (terminal line). If the port being used is a ; DL11 or DLV11 which can't have the baud rate changed, any baud rate ; is acceptable (the error is ignored). ; ;- SPEED:: CALL $SAVAL ; SAVE EM ALL MOV #RATEH,HLPADR ; SETUP ADDRESS OF HELP ; Setup the default speed in the question. MOV #SPDDEF,R0 ; STORE BAUD RATE HERE MOV SPDENT,R1 ; POINTER TO BAUD RATE CALL MOVE ; MOVE IT MOVB #'),(R0)+ ; SETUP MOVB #':,(R0)+ ; LAST MOVB #SPACE,(R0)+ ; PART CLRB (R0) ; OF MESSAGE ; Try to read the command file from the .INI file. CALL GETINI ; GET INI FILE COMMAND LINE BCC 20$ ; IF CC, GOT ONE 10$: CALL CLOINI ; CLOSE THE INI FILE IF OPEN MOV #INCMD,R1 ; STORE THE RESPONSE HERE MOV #RATEQ,R2 ; ADDRESS OF THE PROMPT CALL PROMPT ; ASK FOR BAUD RATE TST BCKFLG ; NEED TO BACKUP ? BNE 50$ ; IF NE, YES (EXIT) 20$: MOV #INCMD,R0 ; ADDRESS OF USER INPUT MOV SPDENT,R5 ; POINTER TO CURRENT ENTRY TSTB (R0) ; USE THE DEFAULT SPEED ? BEQ 30$ ; IF EQ, YES MOV #SPDTBL,R1 ; ADDRESS OF THE TABLE MOV #SPDSIZ,R2 ; SIZE OF AN ENTRY IN THE SPEED TABLE MOV #-1,EXACT ; FORCE EXACT MATCH CALL COMPAR ; IS THE SPEED VALID BCC 30$ ; IF CC, YES (CONTINUE) CALL GETHLP ; ELSE GET THEM HELP BR 10$ ; AND REASK THE QUESTION 30$: MOV R5,SPDENT ; SAVE THE TABLE ENTRY ADDRESS MOV R5,R3 ; COPY THE TABLE ENTRY ADDRESS CLR R2 ; QUOTIENT FOR DIVIDE SUB #SPDTBL,R3 ; FIND THE SPOT RELATIVE TO THE TABLE DIV #SPDSIZ,R2 ; CALCULATE THE OFFSET MOVB SPDEQU(R2),RSPEED ; BAUD RATE FROM TABLE FOR RECEIVE MOVB RSPEED,XSPEED ; MAKE TRANSMIT THE SAME 40$: QIOW$S #SF.SMC,#REMOTE,#REMOTE,,#RIOSB,,<#SPDADR,#SPDLEN> ; ; The above call will fail if trying to set the speed on a DL11. ; It only works on variable speed interfaces such as the DZ11. ; For this reason, we must ignore the error return and hope !!! ; ; CALL CHKRIO ; DID WE GET AN ERROR 50$: RETURN ; IF NO, RETURN .SBTTL INTCHR - SETUP THE INTERRUPT CHARACTER ;+ ; ; INTCHR - This routine setsup the character to be used as the ; interrupt to return to RSXNET command mode. ; ; All registers are preserved. ; ;- INTCHR:: CALL $SAVAL ; SAVE ALL REGISTERS ; Setup the default in the queston. MOV #INTDEF,R0 ; STORE INTERRUPT HERE MOVB INTRPT,R1 ; COPY THE INTERRUPT BYTE MOVB R1,(R0)+ ; COPY IT TO OUTPUT BUFFER CMPB R1,#37 ; IS IT A CONTROL CHARACTER ? BHI 3$ ; IF HI, NO MOVB #'^,-1(R0) ; PRINT CONTROL AS ^ ADD #100,R1 ; MAKE CONTROL PRINTABLE MOVB R1,(R0)+ ; AND STORE IN OUTPUT BUFFER 3$: MOVB #'),(R0)+ ; SETUP MOVB #':,(R0)+ ; LAST MOVB #SPACE,(R0)+ ; PART CLRB (R0) ; OF MESSAGE ; Try to read the command file from the .INI file. CALL GETINI ; TRY TO READ FROM .INI FILE BCS 10$ ; IF CS, READ FROM TERMINAL MOV #INCMD,R0 ; ADDRESS OF INPUT COMMAND TSTB (R0) ; DID WE READ A BLANK LINE ? BNE 5$ ; IF NE, NO MOVB #CR,(R0) ; YES, SHOW DEFAULT WITH 5$: CMPB #'^,(R0) ; CONVERT NEXT BYTE TO CONTROL ? BNE 40$ ; IF NE, NO (CONTINUE) INC R0 ; POINT TO THE NEXT BYTE BICB #^C37,(R0) ; CONVERT TO CONTROL BYTE BR 40$ ; AND CONTINUE ... 10$: CALL CLOINI ; CLOSE THE .INI FILE IF OPEN CLR BCKFLG ; CLEAR THE BACKUP FLAG MOV #INTRQ,R4 ; ADDRESS OF INTERRUPT CHARACTER QUES. CALL WRITE ; AND WRITE IT TO THE LOCAL TERMINAL QIOW$S #IO.RAL,#LOCAL,#LOCAL,,#LIOSB,,<#INCMD,#1> ; GET THE REPLY CALL CHKLIO ; WAS THERE AN ERROR ? MOV #CRLF,R4 ; SET TO WRITE SINGLE SPACE CALL WRITE ; AND GO DO IT MOV #INCMD,R0 ; ADDRESS OF INPUT BUFFER BICB #^C177,(R0) ; CLEAR THE PARITY BIT ; Either escape or a question mark can be used for help. CMPB #ESC,(R0) ; DID THEY TYPE AN ESCAPE BEQ 20$ ; IF EQ, YES CMPB #'?,(R0) ; DID THEY ASK FOR HELP ? BNE 30$ ; IF NE, NO 20$: MOV #INTRH,HLPADR ; MOVE IN HELP TYPE CALL GETHLP ; AND GET IT FOR THEM BR 10$ ; AND REASK THE QUESTION ; Check for exclaimation for backing up to previous question. 30$: CMPB #'!,(R0) ; DO THEY WISH TO BACKUP ? BNE 40$ ; IF NE, NO INC BCKFLG ; SET BACKUP FLAG BR 60$ ; AND EXIT ; Check for the default answer. 40$: CMPB #CR,(R0) ; DID THEY ACCEPT THE DEFAULT ? BEQ 60$ ; IF EQ, YES (LEAVE ALONE) ; Setup the new interrupt character. 50$: MOVB (R0),INTRPT ; SAVE THE INTERRUPT CHARACTER 60$: RETURN ; AND RETURN .END