;>-------!-------!-------!-------!-------!--------------------------------------R ; .Z80 ;Removed - not ZSM macro ; ASEG ; ditto ; REV EQU 1 ;overlay revision number LVL EQU 'E' ;overlay level ( as in Revision 0.1C ) ; ; Overlay for the Spectrum +3 running CP/M Plus from Locomotive Software ; ; This overlay is a .zsm file and needs to be assembled with the ZSM ; assembler. Use the following procedure: ; 1: Assemble:- zsm mexovly.@@@ (for default drives.) ; 2: Overlay with MLOAD eg. ; MLOAD MEXVNC=MEX.COM,MEXOVLY.HEX ; ; WRITTEN BY RNC AT LOCOMOTIVE SOFTWARE LTD : 25 JAN 88 ; BUT PLACED INTO THE PUBLIC DOMAIN ; ; CONVERTED TO ZSM FORMAT BY F.T.GOWEN AND MEXVTX-LIKE MODE ROUTINES ; ADDED. REVISIONS C ONWARDS INCLUDE FURTHER OPTIONS TO THE SET COMMAND ; TO IMPROVE FILE TRANSFER BETWEEN TWO MICRO-COMPUTERS (EG. THE SPECTRUM ; AND THE AMSTRAD NC200 NOTEBOOK), ESPECIALLY WHEN AUX: HAS BEEN CONNECTED ; TO THE STANDARD SIO PORT OF THE SPECTRUM (AS OPPOSED TO THE SPECTRE ; COMMS. PACK). ; ; REV. E - NOVEMBER 1995, F.T.GOWEN ; ; CAUTIONS: ; ; 1) The SET V23C and SET V23T options give incorrect file transfer times, ; especially if you are sending a file at 75 baud (Arggghh) ; BELL EQU 07H ;bell LF EQU 0AH ;linefeed CR EQU 0DH ;carriage return ESC EQU 1BH ;escape ; YES EQU 0FFH NO EQU 0 ; ; MEX service processor stuff ; MEX EQU 0D00H ;address of the service processor INMDM EQU 255 ;get char from port to A, CY=no more in 100 ms TIMER EQU 254 ;delay 100ms * reg B TMDINP EQU 253 ;B=# secs to wait for char, cy=no char CHEKCC EQU 252 ;check for ^C from KBD, Z=present SNDRDY EQU 251 ;test for modem-send ready RCVRDY EQU 250 ;test for modem-receive ready SNDCHR EQU 249 ;send a character to the modem (after sndrdy) RCVCHR EQU 248 ;recv a char from modem (after rcvrdy) LOOKUP EQU 247 ;table search: see CMDTBL comments for info PARSFN EQU 246 ;parse filename from input stream BDPARS EQU 245 ;parse baud-rate from input stream SBLANK EQU 244 ;scan input stream to next non-blank EVALA EQU 243 ;evaluate numeric from input stream LKAHED EQU 242 ;get nxt char w/o removing from input GNC EQU 241 ;get char from input, cy=1 if none ILP EQU 240 ;inline print DECOUT EQU 239 ;decimal output PRBAUD EQU 238 ;print baud rate ; ; Spectrum definitions ; BDOS EQU 0005H ;standard BDOS ; BDOS calls CONIN EQU 1 CONOUT EQU 2 AUXIN EQU 3 AUXOUT EQU 4 AXINST EQU 7 ;Not CP/M 80 - deduced from ZCN usage AXOTST EQU 8 ; " - " PRINT EQU 9 ;BDOS/MEX print-string function call ; MODRCVB EQU 01H ;Mask for character received MODRCVR EQU 01H ;Value when character HAS been received MODSNDB EQU 00H ;Mask for able to send MODSNDR EQU 00H ;Value when we CAN send (Yes! we can ALWAYS send!) ; CDSAINIT EQU 00B6H CDSABAUD EQU 00B9H CDSAPARM EQU 00BCH FIND_FID EQU 00ECH COMMON EQU 0C000H ;Bottom of Common Memory Area ; SERIAL EQU 0 ;SERIAL port, ie. Spectre Comms Pack SIO EQU 8 ;SIO port. ; ORG 100H ; DEFS 3 ;(for "JMP START" instruction) ; PMODEM: DEFB NO ;yes=PMMI S-100 Modem SMODEM: DEFB NO ;yes=HAYES Smartmodem, no=non-PMMI TPULSE: DEFB 'P' ;T=touch, P=pulse (Smartmodem-only) CLOCK: DEFB 37 ;clock speed in MHz x10, 25.5 MHz max. ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc. MSPEED: DEFB 5 ;0=110 1=300 2=450 3=600 4=710 5=1200 ;6=2400 7=4800 8=9600 9=19200 BYTDLY: DEFB 1 ;0=0 delay 1=10ms 5=50 ms - 9=90 ms ;default time to send character in terminal ;mode file transfer for slow BBS. CRDLY: DEFB 1 ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms ;default time for extra wait after CRLF ;in terminal mode file transfer COLUMS: DEFB 4 ;number of DIR columns shown SETFL: DEFB YES ;yes=user-added Setup routine SCRTST: DEFB YES ;Cursor control routine ACKNAK: DEFB NO ;yes=resend a record after any non-ACK ;no=resend a record after a valid NAK BAKFLG: DEFB YES ;yes=change any file same name to .BAK CRCDFL: DEFB YES ;yes=default to CRC checking TOGCRC: DEFB YES ;yes=allow toggling of CRC to Checksum CVBS: DEFB NO ;yes=convert backspace to rub TOGLBK: DEFB YES ;yes=allow toggling of bksp to rub ADDLF: DEFB NO ;no=no LF after CR to send file in ;terminal mode (added by remote echo) TOGLF: DEFB YES ;yes=allow toggling of LF after CR TRNLOG: DEFB NO ;yes=allow transmission of logon ;write logon sequence at location LOGON SAVCCP: DEFB NO ;yes=do not overwrite CCP LOCNXT: DEFB NO ;yes=local command if EXTCHR precedes ;no=external command if EXTCHR precedes TOGLOC: DEFB YES ;yes=allow toggling of LOCONEXTCHR LSTTST: DEFB YES ;yes=allow toggling of printer on/off XOFTST: DEFB NO ;yes=chcks for XOFF from remote while ;sending a file in terminal mode XONWT: DEFB NO ;yes=wait for XON after CR while ;sending a file in terminal mode TOGXOF: DEFB YES ;yes=allow toggling of XOFF checking IGNCTL: DEFB NO ;yes=CTL-chars above ^M not displayed EXTRA1: DEFB 0 ;for future expansion EXTRA2: DEFB 0 ;for future expansion BRKCHR: DEFB '@'-40H ;^@ = Send a 300 ms. break tone NOCONN: DEFB 'N'-40H ;^N = Disconnect from the phone line LOGCHR: DEFB 'L'-40H ;^O = Send logon LSTCHR: DEFB 'P'-40H ;^P = Toggle printer UNSAVE: DEFB 'R'-40H ;^R = Close input text buffer TRNCHR: DEFB 'T'-40H ;^T = Transmit file to remote SAVCHR: DEFB 'Y'-40H ;^Y = Open input text buffer EXTCHR: DEFB '^'-40H ;^^ = Send next character ; DEFB 0,0 ;Not used ; INCTL1: JP ICTL1 DEFB 0,0,0,0,0,0,0 OTDAT: JP ODATA DEFB 0,0,0,0,0,0,0 INPORT: JP INDATA DEFB 0,0,0,0,0,0,0 MASKR: AND MODRCVB RET ;bit to test for receive ready TESTR: CP MODRCVR RET ;value of receive bit when ready MASKS: AND MODSNDB RET ;bit to test for send ready TESTS: CP MODSNDR RET ;value of send bit when ready ; ; Unused area: was once used for special PMMI functions, ; Now used only to retain compatibility with MDM overlays. ; You may use this area for any miscellaneous storage you'd ; like but the length of the area *must* be 12 bytes. ; DEFS 12 ; ; Special modem function jump table: if your overlay cannot handle ; some of these, change the jump to "DEFS 3", so the code present in ; MEX will be retained. Thus, if your modem can't dial, change the ; JMP PDIAL at DIALV to DEFS 3, and MEX will print a "not-implemented" ; diagnostic for any commands that require dialing. ; DIALV dials the digit in A. See the comments at PDIAL for specs. ; DISCV disconnects the modem ; GOODBV is called just before MEX exits to CP/M. If your overlay ; requires some exit cleanup, do it here. ; INMODV is called when MEX starts up; use INMODV to initialize the modem. ; NEWBDV is used for phone-number baud rates and is called with a baud-rate ; code in the A register, value as follows: ; A=0: 110 baud A=1: 300 baud A=2: 450 baud ; A=3: 600 baud A=4: 710 baud A=5: 1200 baud ; A=6: 2400 baud A=7: 4800 baud A=8: 19200 baud ; If your overlay supports the passed baud rate, it should store the ; value passed in A at MSPEED (107H), and set the requested rate. If ; the value passed is not supported, you should simply return (with- ; out modifying MSPEED) -or- optionally request a baud-rate from the ; user interactively. ; NOPARV is called at the end of each file transfer; your overlay may simply ; return here, or you may want to restore parity if you set no-parity ; in the following vector (this is the case with the PMMI overlay). ; ; PARITV is called at the start of each file transfer; your overlay may simply ; return here, or you may want to enable parity detection (this is the ; case with the PMMI overlay). ; SETUPV is the user-defined command ... to use this routine to build your own ; MEX command, set the variable SETFL (10BH) non-zero, and add your SET ; code. You can use the routine presented in the PMMI overlay as a ; guide for parsing, table lookup, etc. ; SPMENU is provided only for MDM compatibility, and is not used by MEX 1.0 for ; any purpose (it will be gone in MEX 2). ; VERSNV is called immediately after MEX prints its sign-on message at cold ; startup -- use this to identify your overlay in the sign-on message ; (include overlay version number in the line). ; BREAKV is provided for sending a BREAK (-B in terminal mode). If your ; modem doesn't support BREAK, or you don't care to code a BREAK rou- ; tine, you may simply execute a RET instruction. ; LOGON: DEFS 2 ;needed for MDM compat, not ref'd by MEX DIALV: DEFS 3 ;dial digit in A (see info at PDIAL) DISCV: JP GOODBYE ;disconnect the modem GOODBV: RET DEFS 2 ;called before exit to CP/M INMODV: JP INITMOD ;initialization. Called at cold-start NEWBDV: JP NEWBAUD ;set baud rate NOPARV: DEFS 3 ;set modem for no-parity PARITV: DEFS 3 ;set modem parity SETUPV: JP SETCMD ;SET cmd: jump to a RET if you don't write SET SPMENV: DEFS 3 ;not used with MEX VERSNV: JP SYSVER ;Overlay's voice in the sign-on message BREAKV: RET ;send a break is a null operation DEFS 2 ; ; The following jump vector provides the overlay with access to special ; routines in the main program (retained and supported in the main pro- ; gram for MDM overlay compatibility). These should not be modified by ; the overlay. ; Note that for MEX 2.0 compatibility, you should not try to use these ; routines, since this table will go away with MEX 2.0 (use the MEX ; service call processor instead). ; ILPRTV: DEFS 3 ;replace with MEX function 9 INBUFV: DEFS 3 ;replace with MEX function 10 ILCMPV: DEFS 3 ;replace with table lookup funct. 247 INMDMV: DEFS 3 ;replace with MEX function 255 NXSCRV: DEFS 3 ;not supported by MEX (returns w/no action) TIMERV: DEFS 3 ;replace with MEX function 254 ; ; Clear/screen and clear/end-of-screen. Each routine must use the ; full 9 bytes alloted (may be padded with nulls). ; These routines (and other screen routines that MEX 2.0 will sup- ; port) will be accessed through a jump table in 2.0, and will be ; located in an area that won't tie the screen functions to the ; modem overlay (as the MDM format does). ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear ; entire screen. ; CLREOS: LD DE,EOSMSG LD C,PRINT CALL MEX RET ; CLRSCRN:LD DE,CLSMSG LD C,PRINT CALL MEX RET ; SYSVER: CALL ILPRT DEFB 'Spectrum Plus 3 with Spectre Comms Pack:',CR,LF DEFB 'Version ' DEFB REV/10+'0','.',REV .MOD. 10+'0',LVL DEFB '(Last Mod. 11/1995 [FTG])',CR,LF,0 RET ; N/B ORIGINAL .MAC FILE HAD MOD NOT .MOD. ; EOSMSG: DEFB ESC,'J$' CLSMSG: DEFB ESC,'H',ESC,'E$' ; ICTL1: ;Get status of character i/o needs to return bits to ; indicate ready-to-send & character-available PUSH BC LD C,AXINST;ask input status CALL BDOS ;FF if character available, 00 if none POP BC RET ; ODATA: ;Send character LD C,AUXOUT LD E,A JP BDOS ; INDATA: ;Get character LD C,AUXIN JP BDOS ; GOODBYE: ;Set DTR low to disconnect some modems LD A,80H ;drop DTR CALL USRINIT LD B,3 ;DELAY 300 MS. LD C,TIMER CALL MEX LD A,7FH ;raise DTR CALL USRINIT ; Reset to "normal" screen CALL ILPRT DEFB ESC,'1',ESC,'32',ESC,'40',ESC,'50' DEFB ESC,'H',ESC,'E',0 RET ; USRINIT:CALL USERF CDSI: DEFW CDSAINIT ;Default SIO: SERIAL's patched via FIND_FID RET FIDSTR: DEFB 'SERIAL $' MSG1: DEFB 'NOT ' MSG2: DEFB 'FOUND',CR,LF,'$' SAVCOM: DEFS 8 ; INITMOD: ;initialisation LD HL,(0001H) ;address of WBOOT LD DE,87 ;offset of USERF ADD HL,DE LD DE,USERF LD BC,3 LDIR ;copy to where we can use it easily ; Set Screen Mode 2 etc. CALL ILPRT DEFB ESC,'0',ESC,'32',ESC,'41',ESC,'51' DEFB ESC,'H',ESC,'E',0 LD HL,COMMON LD DE,SAVCOM LD BC,8 LDIR ;Save used area of Common Memory LD DE,FIDSTR PUSH DE LD C,PRINT CALL MEX POP HL LD DE,COMMON LD BC,8 LDIR ;Copy FIDSTR ("SERIAL ") into Common Memory LD DE,COMMON ;Now attempt to find SERIAL.FID AND A ;Clear carry flag CALL USERF DEFW FIND_FID JR NC,NOTFND ;SERIAL.FID not found, print error message PUSH HL LD C,PRINT LD DE,MSG2 CALL MEX POP HL LD DE,32 ;FID's private jumpblock offset ADD HL,DE ;HL --> JP CDSAINIT for SERIAL LD (SCDSI),HL INC HL INC HL INC HL ;HL --> JP CDSAPARM for SERIAL LD (SCDSP),HL INC HL INC HL INC HL ;HL --> JP CDSABAUD for SERIAL LD (SCDSB),HL JR RCVRCOM NOTFND: LD C,PRINT LD DE,MSG1 CALL MEX RCVRCOM:LD HL,SAVCOM LD DE,COMMON LD BC,8 LDIR ;ReCoVeR saved COMmon memory data LD BC,SERPAR ;point to default parameters for SERIAL device INITDEV:LD HL,DEVICE ;save device code LD (HL),C INC HL LD (HL),B LD A,(BC) ;fetch parameters - Device code (DEVLST offset) INC BC PUSH BC LD HL,DEVLST LD E,A LD D,0 ADD HL,DE LD E,(HL) INC HL LD D,(HL) INC HL PUSH HL EX DE,HL LD DE,BAUDTB LD BC,8 LDIR ;Copy Baud rate table POP HL LD E,(HL) INC HL LD D,(HL) INC HL LD (CDSI),DE LD E,(HL) INC HL LD D,(HL) INC HL LD (CDSB),DE LD E,(HL) INC HL LD D,(HL) LD (CDSP),DE POP BC LD A,0FFH ;Handshake always on! PUSH AF LD A,(BC) ; - Parity LD E,A INC BC LD A,(BC) ; - Stop bits LD D,A INC BC LD A,(BC) ; - Tx bits LD L,A LD H,L ; - Rx bits INC BC LD A,(BC) ; - MSPEED LD (MSPEED),A INC BC LD A,(BC) ; - VMODE LD (VMODE),A POP AF CALL USRINIT LD HL,MSPEED LD E,(HL) ;save requested speed LD (HL),5 ;pretend 1200 in case split baud rate LD A,(VMODE) ;-1 unless we are working a split baud CP 1 LD HL,0208H JP Z,SETBAUD ;jump if 75/1200 LD HL,0802H JP C,SETBAUD ;jump if 1200/75 LD A,E ;change baud rate to requested value NEWBAUD: ;set a new baud rate LD D,0 LD E,A LD HL,BAUDTB ;point to table ADD HL,DE ;point to timer value LD A,(HL) CP 1 RET C ;Not implemented (carry => error) LD A,E LD (MSPEED),A ;update the variable LD A,-1 LD (VMODE),A ;cancel split-baud rate LD H,(HL) ;Rx baud rate LD L,H ;Tx baud rate ; SETBAUD: CALL USERF CDSB: DEFW CDSABAUD ;Default SIO: SERIAL's patched via FIND_FID OR A ;clear carry to show OK RET ; BAUDTB: ;TABLE OF BAUDRATE PARAMETERS DEFB 00H ;110 baud (not used) DEFB 06H ;300 baud DEFB 00H ;450 baud (not used) DEFB 00H ;600 baud (not used) DEFB 00H ;710 baud (not used) DEFB 08H ;1200 baud DEFB 00H ;2400 baud (not used) DEFB 0CH ;4800 baud DEFB 00H ;9600 baud (not used) DEFB 00H ;19200 baud (not used) ; ; The remainder of this overlay implements a very versatile SET command ; SETCMD: ;MEX has parsed a SET command LD C,SBLANK ;any arguments? CALL MEX JP C,SETSHO ;if not, go print out values LD DE,CMDTBL ;parse command LD C,LOOKUP ;get function code CALL MEX ;pass to MEX processor JP C,SETERR ;error if not recognised JP (HL) ;else execute command ; SETERR: CALL ILPRT DEFB CR,LF,'SET command error',CR,LF,0 RET ; ; SET command table ... note that tables are constructed of command- ; name (terminated by high bit=1) followed by word-data-value returned ; in HL by MEX service processor LOOKUP. Table must be terminated by ; a binary zero. ; Note that LOOKUP attempts to find the next item in the input stream ; in the table passed to it in HL ... if found, the table data item is ; returned in HL; if not found, LOOKUP returns carry set. ; CMDTBL: DEFB '?'+80H ;"set ?" DEFW STHELP DEFB 'BAU','D'+80H ;"set baud" DEFW STBAUD DEFB 'V23','C'+80H ;"set v23c" DEFW V23C DEFB 'V23','T'+80H ;"set v23t" DEFW V23T DEFB 'ONLIN','E'+80H ;"set online" DEFW ONLINE DEFB 'OFFLIN','E'+80H;"set offline" DEFW OFFLINE DEFB 'MOD','E'+80H ;"set screen mode" DEFW STMODE DEFB 'AUX:','='+80H ;"set aux:= device" DEFW STAUXEQ DEFB 0 ;<<=== table terminator ; ; SET AUX:= device device-table - format is the same as the command table. ; DEVTBL: DEFB '?'+80H ;"set aux:= ?" DEFW STAXHLP DEFB 'SERIA','L'+80H ;"set aux:= serial" DEFW STSERL DEFB 'SIO0','3'+80H ;"set aux:= sio03" DEFW STSIO03 DEFB 'SIO1','2'+80H ;"set aux:= sio12" DEFW STSIO12 DEFB 'SIO9','6'+80H ;"set aux:= sio96" DEFW STSIO96 DEFB 0 ; SETSHO: ;SET : print current statistics CALL SYSVER ;who we are CALL BDSHOW ;baud rate CALL CRLF ;print newline CALL ONOFFS ;on/offline CALL STAXSHO ;current device parameters CALL CRLF JP CRLF ; STHELP: ;SET ? command LD DE,HLPMSG LD C,PRINT JP MEX ; HLPMSG: DEFB CR,LF,'SET command, Spectrum +3' DEFB CR,LF DEFB CR,LF,'SET BAUD ... set baud rate' DEFB CR,LF,' BAUD values are:300, (600), 1200, (2400),' DEFB CR,LF,' 4800 & (9600);(not SERIAL)' DEFB CR,LF,'SET V23T ... set 1200 baud Rx, 75 baud Tx' DEFB CR,LF,'SET V23C ... set 75 baud Rx, 1200 baud Tx' DEFB CR,LF,'SET ONLINE ... raise DTR' DEFB CR,LF,'SET OFFLINE ... drop DTR' DEFB CR,LF,'SET MODE n ... select screen mode:-' DEFB CR,LF,' n=0 - 32 col., n=1 - 51 col., n=2 - 80 columns.' DEFB CR,LF,'SET AUX:= device ... define which device HAS been' DEFB CR,LF,' connected to AUX - to see list of valid devices' DEFB CR,LF,' type SET AUX:= ? .' DEFB CR,LF,'$' ; STBAUD: ;SET BAUD nnn command LD C,BDPARS ;function code CALL MEX ;let MEX look up code JP C,SETERR ;invalid code CALL NEWBAUD ;no, try to set it JP C,SETERR ;not-supported code ; BDSHOW: ;display the current baud rate LD A,(VMODE) ;get V23 mode INC A JR NZ,BDSPLIT ;jump if a split baud rate ;*** simple baud rate CALL ILPRT DEFB 'Baud rate: ',0 LD A,(MSPEED) LD C,PRBAUD JP MEX ;get MEX to print the baud rate ;*** split baud rates BDSPLIT:CALL ILPRT DEFB 'Split baud rate ',0 LD A,(VMODE) OR A JR Z,V23S2 ;jump if 1200/75 CALL ILPRT DEFB '75/1200',0 JR V23END V23S2: CALL ILPRT DEFB '1200/75',0 V23END: CALL ILPRT DEFB ' (Rx/Tx)',CR,LF,0 RET ; V23T: ;set 1200/75 XOR A LD HL,0802H JR V23COM ; V23C: ;set 75/1200 LD A,1 LD HL,0208H V23COM: LD (VMODE),A ;record new speed LD A,5 LD (MSPEED),A ;pretend we are at 1200 baud CALL SETBAUD ;set new speed JP BDSHOW ;print what we have done ; ONLINE: LD A,7FH ;raise DTR JR LINECOM ; OFFLINE:LD A,80H ;drop DTR LINECOM:LD (ONOFF),A ;save new state CALL USRINIT ;and command it ; ONOFFS: ;display current ON/OFFline state LD A,(ONOFF) CP 7FH LD DE,ONMSG ;assume online JR NZ,OFFS LD DE,OFFMSG ;else offline OFFS: LD C,PRINT CALL MEX ;print which CALL ILPRT DEFB 'line',CR,LF,0 RET ; ONMSG: DEFB 'Off$' OFFMSG: DEFB 'On$' ; ILPRT: ;Print in-line message LD C,ILP ;get function code JP MEX ;go do it ; CRLF: ;newline CALL ILPRT DEFB CR,LF,0 RET ; STMODE: ;SET MODE n COMMAND LD C,EVALA ;Fetch mode number (n) CALL MEX JR NC,BADMODE ;No mode given LD A,H OR A JR NZ,BADMODE ;n>15, or negative LD A,L CP 3 JR NC,BADMODE ;n>3 ADD 30H LD (MODECOD),A ;Adjust print string CALL ILPRT DEFB ESC,'0',ESC,'3' MODECOD:DEFB '2',ESC,'41',ESC,'51',ESC,'H',ESC,'E',0 RET BADMODE:CALL ILPRT DEFB 'Only MODES 0-2 allowed!',CR,LF,0 RET ; STAUXEQ: ;SET AUX:= device command (MEX has parsed SET AUX:=) LD C,SBLANK ;any arguments CALL MEX JP C,STAXSHO ;if not, print current device and default parameters LD DE,DEVTBL ;parse device LD C,LOOKUP ;get function code CALL MEX ;pass to MEX processor JP C,SETERR ;error if not recognised JP (HL) ; STAXHLP:LD DE,AUXMSG LD C,PRINT JP MEX ; AUXMSG: DEFB CR,LF,'SET AUX:= device command: device list:-' DEFB CR,LF DEFB CR,LF,'SERIAL - Spectre Comms Pack (1200/1200)' DEFB CR,LF,'SIO03 - Serial Port (300/300)' DEFB CR,LF,'SIO12 - Serial Port (1200/1200)' DEFB CR,LF,'SIO96 - Serial Port (9600/9600)' DEFB CR,LF,'$' ; STSERL: LD BC,SERPAR JP INITDEV ; STSIO03:LD BC,SIO03 JP INITDEV ; STSIO12:LD BC,SIO12 JP INITDEV ; STSIO96:LD BC,SIO96 JP INITDEV ; STAXSHO:CALL ILPRT DEFB 'DEVICE AUX:= ',0 LD HL,DEVICE ;fetch device address LD E,(HL) INC HL LD D,(HL) INC DE ;skip past device data INC DE INC DE INC DE INC DE INC DE LD C,PRINT ;and get mex to print device name CALL MEX CALL CRLF CALL USERF ;fetch current parameters CDSP: DEFW CDSAPARM ;Default SIO: SERIAL's patched via FIND_FID PUSH HL ;save them PUSH DE PUSH AF CALL ILPRT DEFB 'Handshake is ',0 POP AF AND A LD DE,ONMSG ;assume On JR Z,HISON LD DE,OFFMSG ;else Off HISON: LD C,PRINT CALL MEX ;print which CALL ILPRT DEFB CR,LF,'Parity = ',0 POP DE LD A,E PUSH DE AND A JR NZ,ODDEVN CALL ILPRT DEFB 'None',0 JR PRSTOP ODDEVN: CP 1 JR NZ,EVEN CALL ILPRT DEFB 'Odd',0 JR PRSTOP EVEN: CALL ILPRT DEFB 'Even',0 PRSTOP: CALL ILPRT DEFB CR,LF,'Stop bits = ',0 POP DE LD A,D AND A JR NZ,GTONE CALL ILPRT DEFB '1',0 JR TXRX GTONE: CP 1 JR NZ,TWO CALL ILPRT DEFB '1.5',0 JR TXRX TWO: CALL ILPRT DEFB '2',0 TXRX: CALL ILPRT DEFB CR,LF,'Tx/Rx = ',0 POP HL LD A,L PUSH HL AND 0FH ADD 30H LD (TXCODE),A CALL ILPRT TXCODE: DEFB 30H,'/',0 POP HL LD A,H AND 0FH ADD 30H LD (RXCODE),A CALL ILPRT RXCODE: DEFB 30H,CR,LF,0 RET ; USERF: JP USERF ;patched by INITMOD! ; VMODE: DEFB -1 ;-1 = normal, 0 = V23T, 1 = V23C ONOFF: DEFB 7FH ;7FH = ONLINE, 80 = OFFLINE SERPAR: DEFB SERIAL,00H,00H,08H,5,-1 ;Device Code, Parity NONE, 1 STOP ; bit, 8 Tx & Rx BITS, 1200 Bd, Norm'l DEFB 'SERIAL$' SIO03: DEFB SIO,00H,00H,08H,1,-1 ;Device Code, Parity NONE, 1 STOP ; bit, 8 Tx & Rx BITS, 300 Bd, Norm'l DEFB 'SIO 300$' SIO12: DEFB SIO,00H,00H,08H,5,-1 ;Device Code, Parity NONE, 1 STOP ; bit, 8 Tx & Rx BITS, 1200 Bd, Norm'l DEFB 'SIO 1200$' SIO96: DEFB SIO,00H,00H,08H,8,-1 ;Device Code, Parity NONE, 1 STOP ; bit, 8 Tx & Rx BITS, 9600 Bd, Norm'l DEFB 'SIO 9600$' DEVICE: DEFW SERPAR ; DEVLST: DEFW SERBDT SCDSI: DEFW CDSAINIT ;Overwritten with the correct SCDSB: DEFW CDSABAUD ;addresses if the call to FIND_FID SCDSP: DEFW CDSAPARM ;is successful DEFW SIOBDT DEFW CDSAINIT DEFW CDSABAUD DEFW CDSAPARM ; ; Baud rate tables: SERBDT: DEFB 00H ;110 baud (not used) DEFB 06H ;300 baud DEFB 00H ;450 baud (not used) DEFB 00H ;600 baud (not used) DEFB 00H ;710 baud (not used) DEFB 08H ;1200 baud DEFB 00H ;2400 baud (not used) DEFB 0CH ;4800 baud DEFB 00H ;9600 baud (not used) DEFB 00H ;19200 baud (not used) ; SIOBDT: DEFB 00H ;110 baud (not used) DEFB 06H ;300 baud DEFB 00H ;450 baud (not used) DEFB 07H ;600 baud DEFB 00H ;710 baud (not used) DEFB 08H ;1200 baud DEFB 0AH ;2400 baud DEFB 0CH ;4800 baud DEFB 0EH ;9600 baud DEFB 00H ;19200 baud (not used) ; ; NOTE: MUST TERMINATE PRIOR TO 0B00H (with Smartmodem) ; 0D00H (without Smartmodem) ; END