; Title 'MEXPlus overlay for the Osborne I version 1.6' ; ; ; (delete above title line if not assembling with MAC) ; ; REV EQU 16 ;overlay revision level ; ; MEX Osborne I OVERLAY VERSION 1.5: written 08/27/84 by Bob Schultz ; ; based on MXO-PM10 by Ron Fowler ; ; 08/02/86 Simplified for use with MexPlus. Removed all code ; associated with modem since they are installed ; already in MexPlus. Did retain however some ; set commands for Hayes type modems for convenience. ; All are marked with +++H for changes or deletion. ; - Dick Le Bleu ; ; 03/02/86 Changed complement of set commands - Dick Le Bleu ; ; ; 08/27/84 Reduced the size of the code to be compatible with the new ; MXM logical modem overlays. Added a SET LF command to add ; a line feed after a carriage return for those nasty systems ; that don't send line feeds. Note that this feature must be ; OFF if you are using a protocol transfer. Removed the ; SET TX and SET RX commands which did not seem to be all ; that useful. ; ; 06/23/84 Added 19200 baud. I don't know if this is really useful ; since you need an external clock to receive properly. ; ; 05/02/84 Written but not released ; ; ALL of the MEX and MDM overlays for the Osborne I that I've seen ; have a rather nasty bug. If you capture enough text to fill up ; memory the serial port routines will be overwritten and the system ; will do very strange things. This overlay fixes that problem. It ; is fully configured with send break and disconnect routines. It ; has all of the bells and whistles that I could think of in the SET ; command. (A few of them are not documented in the SET ? help menu. ; See if you can find them without looking at the source) ; ; The SET command allows you to do everything possible with the ; 6850 ACIA except for enabling the interrupts. ; ; The RS-232 connector on the Osborne is rather strange. It seems to ; have been designed as a printer port so that a serial printer could ; be used at the same time as a modem. The data going out to the RS-232 ; connector is turned off when RTS is active. Hence the SET RTS command. ; RTS should be INACTIVE if you're using the RS-232 connector and ACTIVE ; if you're using the MODEM connector. ; ; The rest of the SET commands were added because I was having so much ; fun adding new commands. Being able to redefine the screen width without ; having to run SETUP can be quite handy at times. I don't suppose that ; very many of you will ever run WordStar remotely, but if you do you can ; easily change your arrow keys to WS. The screen width, arrow keys ; and auto-scroll are NOT defined by MEX. They are set by the system that ; you booted from. MEX just makes temporary changes as the occasion demands. ; The state of all of the other SET commands are saved when you CLONE MEX. ; ; Bob Schultz ; Sysop, Micro Computers of Canada RCP/M 416-299-3443 ; ; A full-featured SET command processor ; is implemented to select between modems as well as set ; specific characteristics of each one. The following table ; outlines the SET command options: ; ; SET Command ; ; DELAY (seconds) YES ; BAUD YES ; ORIG (originate mode) YES ; ANSWER (mode) YES ; MONITOR (speaker on) YES ; QUIET (speaker off) YES ; MANUALO (turn off carrier tone YES ; for Originate mode) ; MANUALA (turn on carrier tone YES ; for Answer mode) ; ;............ ; ; ; This overlay includes the smartmodem dialing routine from ; MXO-SM13.ASM by Ron Fowler which has been slightly modified ; to allow programmable delay for answer. ; ; This overlay is intended to be fully compatible with the ; MEX structure and should be readily upward compatible with ; the predicted MEX 2.0. ; ; Calling conventions for the various overlay entry points ; are detailed more fully in the PMMI overlay (MXO-PMxx.ASM, ; where xx=revision number). ; ;------------------------------------------------------------ ; ; Misc equates ; NO EQU 0 YES EQU 0FFH TPA EQU 100H CR EQU 13 LF EQU 10 TAB EQU 9 BS EQU 8 ESC EQU 1BH BDOS EQU 5 CLRSCR EQU 1AH ; ; Various bit patterns for the 6850 ; RESET EQU 3 ;reset 6850 BAUD3 EQU 2 ;300 baud BAUD12 EQU 1 ;1200 baud BAUDMSK EQU 3 ;mask to get baud rate bits BITMSK EQU 1CH ;mask to get parity, etc. bits RTSBIT EQU 40H ;setting this bit turns RTS OFF BRKBIT EQU 60H ;bits to set to send break ; ; Port definitions (even though it's not a port) ; PORT EQU 2A00H MODCTL EQU PORT ;status register for RS232 MODDAT EQU PORT+1 ;data resister for RS232 MDSNDB EQU 02H ;bit to test for ready to send MDSNDR EQU 02H ;modem send ready when high MDRCVB EQU 01H ;bit to test for received data MDRCVR EQU 01H ;modem receive ready when high ; ; MEX service processor ; 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 ; ; CONOUT EQU 2 ;simulated BDOS function 2: console char out PRINT EQU 9 ;simulated BDOS function 9: print string INBUF EQU 10 ;input buffer, same structure as BDOS 10 ; DCONIO EQU 6 ;BDOS Direct Console I/O function # DCONIN EQU 0FFH ;BDOS DCONIO flag for input BDOS EQU 5 ;address of BDOS function caller ; ORG TPA ;we begin ; ; DB 0C3H ;MexPlus standard for OVR file DS 2 ;MEX has a JMP START here ; ; The following variables are located at the beginning of the program ; to facilitate modification without the need of re-assembly. They will ; be moved in MEX 2.0. ; PMODEM: DB NO ;yes=PMMI modem \ / These 2 locations are not SMODEM: DB NO ;yes=Smartmodem / \ referenced by MEX TPULSE: DB 'P' ;T=touch, P=pulse (not referenced by MEX) CLOCK: DB 40 ;clock speed x .1, up to 25.5 mhz. MSPEED: DB 5 ;sets display time for sending a file ;0=110 1=300 2=450 3=600 4=710 ;5=1200 6=2400 7=4800 8=9600 9=19200 BYTDLY: DB 8 ;default time to send character in ;terminal mode file transfer (0-9) ;0=0 delay, 1=10 ms, 5=50 ms, 9=90 ms CRDLY: DB 5 ;end-of-line delay after CRLF in terminal ;mode file transfer for slow BBS systems ;0=0 delay, 1=100 ms, 5=500 ms, 9=900 ms COLUMS: DB 3 ;number of directory columns SETFL: DB YES ;yes=user-defined SET command SCRTST: DB YES ;yes=if home cursor and clear screen ;routine at CLRSCRN DB 0 ;was once ACKNAK, now spare BAKFLG: DB YES ;yes=make .BAK file CRCDFL: DB YES ;yes=default to CRC checking ;no=default to Checksum checking TOGCRC: DB YES ;yes=allow toggling of Checksum to CRC CVTBS: DB NO ;yes=convert backspace to rub TOGLBK: DB YES ;yes=allow toggling of bksp to rub ADDLF: DB NO ;no=no LF after CR to send file in ;terminal mode (added by remote echo) TOGLF: DB YES ;yes=allow toggling of LF after CR TRNLOG: DB NO ;yes=allow transmission of logon ;write logon sequence at location LOGON ; *** this MUST be YES *** (or you'll get bitten by a nasty bug) SAVCCP: DB YES ;yes=do not overwrite CCP LOCNXT: DB NO ;yes=local cmd if EXTCHR precedes ;no=not local cmd if EXTCHR precedes TOGLOC: DB YES ;yes=allow toggling of LOCNXTCHR LSTTST: DB YES ;yes=allow toggling of printer on/off ;in terminal mode. Set to no if using ;the printer port for the modem XOFTST: DB NO ;yes=allow testing of XOFF from remote ;while sending a file in terminal mode XONWT: DB NO ;yes=wait for XON after sending CR while ;transmitting a file in terminal mode TOGXOF: DB YES ;yes=allow toggling of XOFF testing IGNCTL: DB YES ;yes=do not send control characters ;above CTL-M to CRT in terminal mode ;no=send any incoming CTL-char to CRT EXTRA1: DB 0 ;for future expansion EXTRA2: DB 0 ;for future expansion BRKCHR: DB '@'-40H ;^@ = Send a 300 ms. break tone NOCONN: DB 'N'-40H ;^N = Disconnect from phone line LOGCHR: DB 'L'-40H ;^L = Send logon LSTCHR: DB 'P'-40H ;^P = Toggle printer UNSVCH: DB 'R'-40H ;^R = Close input text buffer TRNCHR: DB 'T'-40H ;^T = Transmit file to remote SAVCHR: DB 'Y'-40H ;^Y = Open input text buffer EXTCHR: DB '^'-40H ;^^ = Send next character ; ; Equates used only by PMMI routines grouped together here. ; PRATE: DB 250 ;125=20pps dialing, 250=10pps DB 0 ;not used ; ; Low-level modem I/O routines: this will be replaced with ; a jump table in MEX 2.0 (you can insert jumps here to longer ; routines if you'd like ... I'd recommend NOT putting part of ; a routine in this area, then jumping to the rest of the routine ; in the non-fixed area; that will complicate the 2.0 conversion) ; INCTL1: JMP INSTAT ;in modem control port DB 0,0,0,0,0,0,0 ;spares if needed for non-PMMI ; OTDATA: JMP OUTDAT ;out modem data port DB 0,0,0,0,0,0,0 ;spares if needed for non=PMMI ; INPORT: JMP INDAT ;in modem data port DB 0,0,0,0,0,0,0 ;spares if needed for non-PMMI ; ; Bit-test routines. These will be merged with the above ; routines in MEX 2.0 to provide a more reasonable format ; MASKR: ANI MDRCVB ! RET ;bit to test for receive ready TESTR: CPI MDRCVR ! RET ;value of receive bit when ready MASKS: ANI MDSNDB ! RET ;bit to test for send ready TESTS: CPI MDSNDR ! 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. ; DS 12 ; ; Special modem function jump table: if your overlay cannot handle ; some of these, change the jump to "DS 3", so the code present in ; MEX will be retained. Thus, if your modem can't dial, change the ; JMP PDIAL at DIALV to DS 3, and MEX will print a "not-implemented" ; diagnostic for any commands that require dialing. ; ; LOGON: DS 2 ;needed for MDM compat, not ref'd by MEX DIALV: DS 3 ; Moved to SM routines DISCV: JMP PDISC ;disconnect the modem, leave this one tho GOODBV: JMP GOODBY ;called before exit to CP/M INMODV: JMP NITMOD ;initialization. Called at cold-start NEWBDV: JMP PBAUD ;set baud rate NOPARV: RET!NOP!NOP ;set modem for no-parity PARITV: RET!NOP!NOP ;set modem parity SETUPV: JMP SETCMD ;SET cmd: jump to a RET if you don't write SET SPMENV: RET!NOP!NOP ;not used with MEX VERSNV: JMP SYSVER ;Overlay's voice in the sign-on message BREAKV: JMP PBREAK ;send a break ; ; 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: DS 3 ;replace with MEX function 9 INBUFV: DS 3 ;replace with MEX function 10 ILCMPV: DS 3 ;replace with table lookup funct. 247 INMDMV: DS 3 ;replace with MEX function 255 NXSCRV: DS 3 ;not supported by MEX (returns w/no action) TIMERV: DS 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). ; CLREOS: LXI D,EOSMSG MVI C,PRINT CALL MEX RET ; ; CLS: LXI D,CLSMSG ;null unless patched MVI C,PRINT JMP MEX ; ;------------------------------------------------------------ ; ; *** END OF FIXED FORMAT AREA *** ; ;------------------------------------------------------------ ; ; The Osborne modem routines must reside above 4000H. They get ; moved to the page below BDOS and the vectors to them are patched ; to the actual addresses. They cannot be protected by patching ; the JMP at location 5 because MEX (and MDM as a matter of fact) ; looks at it before calling this routine. The problem is solved ; by telling MEX to save the CCP and then telling it to warmboot ; on exit to CPM. ; NITMOD: LHLD BDOS+1 ;get the start of BDOS DCR H ;one page lower PUSH H ;save the address LXI D,OSOUT ;point to the code to be relocated LXI B,CDLEN ;length of code XCHG DB 0EDH,0B0H ;Z80 LDIR POP H ;get the relocation address back SHLD POSOUT+1 ;patch the call for control out LXI D,OSIN-OSOUT ;length of the routine DAD D ;correct address SHLD POSIN+1 ;patch the call for status in DAD D ;correct address SHLD PODOUT+1 ;patch the call for data out DAD D ;correct address SHLD PODIN+1 ;patch the call for data in ; NITMOD2: LDA MONFLG ;GET MONITOR DEFAULT ORA A MVI A,'0' ;SPEAKER OFF JZ NITMOD4 MVI A,'1' ;SPEAKER ON NITMOD4: STA SMINIT+3 ;PUT IT IN SMINIT STRING LDA ANSFLG ;GET MODE DEFAULT ORA A MVI A,'0' ;ORIGINATE JZ NITMOD5 MVI A,'1' ;ANSWER NITMOD5: STA SMINIT+8 ;PUT IT IN SMINIT STRING LXI H,SMINIT SINIT: CALL SMSEND ;SEND THE INIT STRING SMTLP1: MVI C,INMDM ;WAIT FOR MODEM RESPONSE CALL MEX JNC SMTLP1 ;EAT EVERYTHING UNTIL SILENCE FOR ; LDA MODCTB ;memory image of 6850 control register ANI 0DFH ;make sure interrupts are off STA MODCTB ;save 6850 control register image LDA MSPEED ;get the baud rate code JMP PBAUD ;set the baud rate ; ; Sends a 300 msec break. Will work only with the modem connector. ; PBREAK: LDA MODCTB ;get the last modem control byte ORI BRKBIT ;set the transmit break bit low CALL OUTCTL ;send it to the modem MVI B,3 MVI C,TIMER CALL MEX ;send a space tone for 200 ms. LDA MODCTB ;get the last modem control byte JMP OUTCTL ;restore to normal ; ; Toggles RTS for 300 msec to disconnect the modem. ; RTS is not available on the RS232 connector. ; PDISC: LDA MODCTB ;last 6850 control byte XRI RTSBIT ;toggle RTS CALL OUTCTL ;send to 6850 PUSH B MVI B,3 ;wait for modem to disconnect MVI C,TIMER ;0.1 second per timer interval CALL MEX POP B LDA MODCTB ;restore 6850 control byte JMP OUTCTL ; ; Exit routine. We're being a bit sneaky here. ; GOODBY: XRA A ;force a warm boot STA SAVCCP RET ; ; ;------------------------------------------------------------ ; ; Set baud-rate code in A (if supported by your modem overlay). PMMI ; supports only five rates, which are validated here. NOTE: this routine ; (ie, the one vectored through NEWBDV) should update MSPEED with the ; passed code, but ONLY if that rate is supported by the hardware. ; PBAUD: PUSH H ;don't alter anybody PUSH D PUSH B MOV E,A ;code to DE MVI D,0 LXI H,BAUDTB ;offset into table DAD D MOV A,M ;fetch code ORA A ;0? (means unsupported code) STC ;return error for STBAUD caller JZ PBEXIT ;exit if so LDA MODCTB ;last 6850 control byte ANI 0FFH AND NOT BAUDMSK ;clear out baud bits ORA M ;put new baud bits in ANI 7FH ;strip off interrupt bit STA MODCTB CALL OUTCTL ;stuff 6850 control register MOV A,E ;get speed code back STA MSPEED ;make it current PBEXIT: POP B ;all done POP D POP H RET ; ; Table of baud rate bits for supported rates ; BAUDTB: DB 0,BAUD3 OR 80H,0,0,0 ;110,300,450,600,710 DB BAUD12 OR 80H,0,0,0 ;1200,2400,4800,9600 DB 0 ;19200 ; ; Sign-on message ; SYSVER: LXI D,SOMESG MVI C,PRINT JMP MEX ; SOMESG: DB CR,LF,ESC,')' ;into half intensity DB 'Osborne I overlay V' DB REV/10+'0' DB '.' DB REV MOD 10+'0' DB CR,LF DB ' by Dick Le Bleu',CR,LF DB ESC,'(' ;out of half intensity DB '$' RET ; ; Newline on console ; CRLF: MVI A,CR CALL TYPE MVI A,LF ;fall into TYPE ; ; type char in A on console ; TYPE: PUSH H ;save 'em PUSH D PUSH B MOV E,A ;align output character MVI C,CONOUT ;print via MEX CALL MEX POP B POP D POP H RET ; ; strings to clear-to-end-of-screen, and clear-screen ; EOSMSG: DB CR,LF,'$' ;clear to end-of-screen CLSMSG: DB CLRSCR,'$' ;clear whole screen ; ; Data area ; MODCTB: DB 14H OR RTSBIT ;modem control byte ;default 8N1 RTS off LFFLG: DB 0 ;if non zero will send LF to console after CR DOLF: DB 0 ;if non zero an LF should be sent to console ; ;------------------------------------------------------------ ; Control is passed here after MEX parses a SET command. ; SETCMD: MVI C,SBLANK ;any arguments? CALL MEX JC SETSHO ;if not, go print out values LXI D,CMDTBL ;parse command CALL TSRCH ;from table PUSH H ;any address on stack RNC ;if we have one, execute it POP H ;nope, fix stack ; SETERR: LXI D,SETEMS MVI C,PRINT CALL MEX CALL CRLF RET ; SETEMS: DB CR,LF,'SET command error',CR,LF DB 'Type ',ESC,')SET ?',ESC,'( for help',CR,LF,LF,'$' ; ; 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: DB '?'+80H ;"set ?" DW STHELP DB 'ORI','G'+80H ; ORIGINATE MODE +++H DW ORIG ; +++H DB 'ANSWE','R'+80H ; ANSWER MODE +++H DW ANS ; +++H DB 'MONITO','R'+80H ; MONITOR ON +++H DW MONIT ; +++H DB 'QUIE','T'+80H ; MONITOR OFF +++H DW QUIET ; +++H DB 'DELA','Y'+80H ; SET DELAY +++H DW DELAY ;+++H DB 'BAU','D'+80H ;"set baud" DW STBAUD DB 'BIT','S'+80H ;"set bits" DW STBITS DB 'WIDT','H'+80H ;"set width" DW STWID DB 'SCROL','L'+80H ;"set scroll" DW STSCRL DB 'ARRO','W'+80H ;"set arrow" DW STARR DB 'MANUAL','O'+80H ; SET MANUAL ORIGINATE +++H DW MANUALO ;+++H DB 'MANUAL','A'+80H ; SET MANUAL ANSWER +++H DW MANUALA ;+++H DB 0 ;Table terminator ; ; SET : print current statistics ; SETSHO: LXI H,SHOTBL ;get table of SHOW subroutines SETSLP: MOV E,M ;get table address INX H MOV D,M INX H MOV A,D ;end of table? ORA E RZ ;exit if so PUSH H ;save table pointer XCHG ;adrs to HL CALL GOHL ;do it CALL CRLF ;print newline MVI C,CHEKCC ;check for console abort CALL MEX POP H ;it's done JNZ SETSLP ;continue if no abort RET ; GOHL: PCHL ; ; table of SHOW subroutines ; SHOTBL: DW CLS DW CRLF DW MDSHOW ;+++H DW TPSHOW ;+++H DW MONSHO ;+++H DW DLSHOW ;+++H DW BDSHOW DW BTSHOW DW WDSHOW DW SCSHOW DW ARSHOW ; DW 0 ;<<== table terminator ; ; SET ? processor ; STHELP: LXI D,HLPMSG MVI C,PRINT JMP MEX ; ; The help message ; HLPMSG: DB CLRSCR,'SET command, Osborne I version',CR,LF,LF DB ESC,')SET ORIG',ESC,'(',TAB ;+++H DB ' ...set Originate mode',CR,LF ;+++H DB ESC,')SET ANSWER',ESC,'(',TAB ;+++H DB ' ...set Answer mode',CR,LF ;+++H DB ESC,')SET MONITOR',ESC,'(',TAB ;+++H DB ' ...set Monitor ON',CR,LF ;+++H DB ESC,')SET QUIET',ESC,'(',TAB ;+++H DB ' ...set Monitor OFF',CR,LF ;+++H DB ESC,')SET DELAY',ESC,'( <',ESC,')nn',ESC,'(>' ;+++H DB ' ...set Answer delay',CR,LF ;+++H DB ESC,')SET MANUALO',ESC,'(',TAB ;+++H DB ' ...set Manual Originate',CR,LF ;+++H DB ESC,')SET MANUALA',ESC,'(',TAB ;+++H DB ' ...set Manual Answer',CR,LF ;+++H DB ESC,')SET WIDTH',ESC,'( <',ESC,')nn',ESC,'(>' DB ' ...set screen width to nn',CR,LF DB ESC,')SET SCROLL',ESC,'(',TAB DB ' ...toggle auto scroll',CR,LF DB ESC,')SET ARROW',ESC,'(',TAB DB ' ...toggle Arrow Keys (CPM/WS)',CR,LF DB ESC,')SET BAUD',ESC,'( <',ESC,')300',ESC,'(> <' DB ESC,')1200',ESC,'(>',CR,LF DB ESC,')SET BITS',ESC,'( <',ESC,')7E2',ESC,'(> <',ESC,')7O2' DB ESC,'(> <',ESC,')7E1',ESC,'(> <',ESC,')7O1',ESC,'(>',CR,LF DB ' <',ESC,')8N2',ESC,'(> <',ESC,')8N1',ESC,'(> <' DB ESC,')8E1',ESC,'(> <',ESC,')8O1',ESC,'(>',CR,LF,LF DB '$' ; ; SET BAUD processor ; STBAUD: MVI C,BDPARS ;function code CALL MEX ;let MEX look up code JC SETERR ;invalid code STBD1: CALL PBAUD ;no, try to set it JC SETERR ;not-supported code CALL CRLF CALL BDSHOW JMP CRLF BDSHOW: CALL ILPRT DB ESC,')',0 LDA MSPEED MVI C,PRBAUD ;use MEX routine CALL MEX CALL ILPRT DB BS,BS,BS,BS,ESC,'( Baud',CR,LF,0 RET ; ; SET MODE PROCESSOR ---- SET MODEM SELECTION TO INTERNAL OR EXTERNAL +++H ; ORIG: XRA A STA ANSFLG ;SET ORIG FLAG LXI H,SMO ;SEND OUT ATS0=0 CALL SINIT JMP MDSHOW ; SMO: DB 'ATS0=0',CR,0 SMA: DB 'ATS0=1',CR,0 ; ANS: MVI A,0FFH STA ANSFLG ;SET ANS FLAG LXI H,SMA ;SEND OUT ATS0=1 CALL SINIT CALL MDSHOW RET ; MDSHOW: LDA ANSFLG ORA A JZ MDORIG CALL MILP DB ESC,')Auto-answer mode',ESC,'(',CR,LF,0 RET MDORIG: CALL MILP DB ESC,')Originate mode:',ESC,'( auto-answer disabled',CR,LF,0 RET ; ; ; Display dial processor +++H ; Removed SET TONE and PULSE because MexPLUS has STAT DIAL "P" & "T" ; TPSHOW: LDA TPULSE CPI 'T' JZ TPTONE CALL MILP DB ESC,')Pulse ',ESC,'(Dial',CR,LF,0 RET TPTONE: CALL MILP DB ESC,')Tone ',ESC,'(Dial',CR,LF,0 RET ; ; Monitor control processor +++H ; QUIET: XRA A STA MONFLG LXI H,SMQT CALL SINIT JMP MONSHO MONIT: MVI A,0FFH STA MONFLG LXI H,SMMON CALL SINIT MONSHO: LDA MONFLG ORA A JZ MONOFF CALL MILP DB ESC,')Speaker ',ESC,'(On',CR,LF,0 RET MONOFF: CALL MILP DB ESC,')Speaker ',ESC,'(Off',CR,LF,0 RET SMQT: DB 'ATM0',CR,0 SMMON: DB 'ATM1',CR,0 ; ; Set manual processor +++H ; MANUALO: MVI A,00H STA ANSFLG LXI H,SMMANO CALL SMSEND JMP OFF MANUALA: MVI A,0FFH STA ANSFLG LXI H,SMMANA CALL SMSEND OFF: MVI B,10 ;WAIT 1 SEC CALL MTIME RET ; ; Set delay processor +++H ; DELAY: MVI C,EVALA CALL MEX MOV A,H ORA A JNZ SETERR MOV A,L STA NDELAY CALL BNTOASC SHLD SMDELAY+5 ;save ascii equiv in string LXI H,SMDELAY ;send new delay to modem CALL SINIT DLSHOW: CALL MILP DB 'Answer Delay is ',0 LDA NDELAY MOV L,A MVI H,0 MVI C,DECOUT CALL MEX CALL MILP DB ' seconds',0 RET ; ;BNTOASC - Convert binary number in A (<63H)to two ASCII chars in HL ; in usual reverse order ie. MSD in L, LSD in H BNTOASC: LXI H,00FFH ;prepare..L=-1 BN10: INR L SBI 10 ;Subtract 10 JNC BN10 ;one more time if no borrow ADI 10 ;too far add 10 back ORI 030H ;remainder to ASCII MOV H,A ;Least significant digit to H MOV A,L ;now quotient ORI 030H ;to ascii MOV L,A ;MSD in L RET ; ; SET SCROLL toggle auto scroll ; STSCRL: LHLD 1 ;first page of bios MVI L,68H ;offset of scroll flag MOV A,M XRI 0FFH ;toggle it MOV M,A CALL CRLF CALL SCSHOW JMP CRLF ; SCSHOW: CALL ILPRT DB 'Auto-scroll ',ESC,')O',0 LHLD 1 ;first page of bios MVI L,68H ;offset of scroll flag MOV A,M ORA A JZ OFFMSG ONMSG: CALL ILPRT DB 'N',0 JMP OUTHLF ; OFFMSG: CALL ILPRT DB 'FF',0 JMP OUTHLF ; ; SET WIDTH screen width ; STWID: MVI C,EVALA CALL MEX ;get numeric MOV A,H ;validate ORA A JNZ SETERR MOV A,L CPI 30 ;30 seems small enough JC SETERR CPI 129 ;128 is max JNC SETERR STA 0EF6CH ;screen width byte CALL CRLF CALL WDSHOW JMP CRLF ; WDSHOW: CALL ILPRT DB 'Screen Width ',ESC,')',0 LDA 0EF6CH MOV L,A MVI H,0 MVI C,DECOUT CALL MEX OUTHLF: CALL ILPRT DB ESC,'(',CR,LF,0 RET ; ; SET ARROW toggle arrow keys ; STARR: LHLD 1 ;first page of bios MVI L,7FH ;offset of vector to cursor up MOV E,M INX H MOV D,M XCHG ;hl now points to cursor up MOV A,M XRI 0BH XOR 05H ;toggle cursor up MOV M,A INX H MOV A,M XRI 0CH XOR 04H ;toggle cursor right MOV M,A INX H MOV A,M XRI 0AH XOR 18H ;toggle cursor down MOV M,A INX H MOV A,M XRI 08H XOR 13H ;toggle cursor left MOV M,A CALL CRLF CALL ARSHOW JMP CRLF ; ARSHOW: CALL ILPRT DB 'Arrow Keys ',ESC,')',0 LHLD 1 ;first page of bios MVI L,7FH ;offset of vector to cursor up key MOV E,M INX H MOV D,M XCHG ;hl points to cursor up MOV A,M CPI 0BH JZ CPMSG CALL ILPRT DB 'WS',0 JMP OUTHLF ; CPMSG: CALL ILPRT DB 'CPM',0 JMP OUTHLF ; ; SET BITS number of bits, parity and number of stop bits ; STBITS: LXI D,BITTBL ;point to table of commands CALL TSRCH ; and search it JC SETERR LDA MODCTB ANI 0FFH AND NOT BITMSK ;zero number of bits ORA L ; and put in new value STA MODCTB CALL OUTCTL ;send to 6850 CALL CRLF CALL BTSHOW JMP CRLF ; BTSHOW: LDA MODCTB ;6850 control register image ANI BITMSK ;keep only the parity etc. bits LXI H,SAYTBL ;start of jump table for text routines RRC ;correct to provide offset into table MOV E,A MVI D,0 ;DE now has offset DAD D ;HL now points to correct entry in table MOV E,M INX H MOV D,M ;DE now has address of correct routine PUSH D RET ;jump to it ; ; These are the routines to display character length, parity and number ; of stop bits. The bits for these values are not independent in the 6850 ; which makes this code the easiest way to do it. ; SAY7E2: CALL SAY7 CALL SAYHE JMP SAYH2 ; SAY7O2: CALL SAY7 CALL SAYHO JMP SAYH2 ; SAY7E1: CALL SAY7 CALL SAYHE JMP SAYH1 ; SAY7O1: CALL SAY7 CALL SAYHO JMP SAYH1 ; SAY8N2: CALL SAY8 CALL SAYN SAYH2: CALL ILPRT DB ESC,')2',0 SAYSS: CALL ILPRT DB ESC,'( Stop Bits',CR,LF,0 RET ; SAY8N1: CALL SAY8 CALL SAYN JMP SAYH1 ; SAY8E1: CALL SAY8 CALL SAYHE JMP SAYH1 ; SAY8O1: CALL SAY8 CALL SAYHO SAYH1: CALL ILPRT DB ESC,')1',0 CALL ILPRT DB ESC,'( Stop Bit',CR,LF,0 RET ; ; SAY7: CALL ILPRT DB ESC,')7',0 JMP SAYBITS ; SAY8: CALL ILPRT DB ESC,')8',0 SAYBITS: CALL ILPRT DB ESC,'( Bits ',0 RET ; SAYHE: CALL ILPRT DB ESC,')EVEN',0 JMP SAYPAR ; SAYHO: CALL ILPRT DB ESC,')ODD',0 JMP SAYPAR ; SAYN: CALL ILPRT DB ESC,')NO',0 SAYPAR: CALL ILPRT DB ESC,'( Parity ',0 RET ; ; jump table for the bit text output routines ; SAYTBL: DW SAY7E2 DW SAY7O2 DW SAY7E1 DW SAY7O1 DW SAY8N2 DW SAY8N1 DW SAY8E1 DW SAY8O1 ; ; table for BITS ; BITTBL: DB '7E','2'+80H DW 0000H DB '7O','2'+80H DW 0004H DB '7E','1'+80H DW 0008H DB '7O','1'+80H DW 000CH DB '8N','2'+80H DW 0010H DB '8N','1'+80H DW 0014H DB '8E','1'+80H DW 0018H DB '8O','1'+80H DW 001CH ; DB 0 ;<<== table terminator ; ; Compare next input-stream item in table @DE; CY=1 ; if not found, else HL=matched data item ; TSRCH: MVI C,LOOKUP ;get function code JMP MEX ;pass to MEX processor ; ; Print in-line message ... blows away C register ; ILPRT: MVI C,ILP ;get function code JMP MEX ;go do it ; ; end of SET command ; ; Send string to the External Modem ; SMSEND: MVI C,SNDRDY ;WAIT FOR MODEM READY CALL MEX JNZ SMSEND MOV A,M ;FETCH NEXT CHARACTER INX H ORA A ;END? RZ ;DONE IF SO MOV B,A ;NO, POSITION FOR SENDING MVI C,SNDCHR ;NOPE, SEND THE CHARACTER CALL MEX JMP SMSEND ; ; General utility routines ; MILP: MVI C,ILP ;IN-LINE PRINT JMP MEX RET ; MTIME: MVI C,TIMER ;MEX TIMER JMP MEX RET ; ;--------------------------------------------------------------- ; ; These are the special Osborne modem routines ; If you make any changes, be sure not to move the labels associated ; with the CALL $-$ statements. ; ;--------------------------------------------------------------- ; ; stuff the control register on the 6850 ; OUTCTL: POSOUT: CALL $-$ ;patched to OSOUT by NITMOD RET ; ; Get the status ; INSTAT: POSIN: CALL $-$ ;patched to OSIN by NITMOD RET ; ; Send the data ; OUTDAT: PODOUT: CALL $-$ ;patched to ODOUT by NITMOD RET ; ; Get the data ; INDAT: PODIN: CALL $-$ ;patched to ODIN by NITMOD RET ; ;--------------------------------------------------------------- ; ; Routines that get relocated one page below BDOS ; OSOUT: DI OUT 0 ;into shadow mode STA MODCTL ;send control byte OUT 1 ;back to RAM EI RET ; OSIN: DI OUT 0 ;into shadow mode LDA MODCTL ;get status byte OUT 1 ;back to RAM EI RET ; ODOUT: DI OUT 0 ;into shadow mode STA MODDAT ;send data byte OUT 1 ;back to RAM EI RET ; ODIN: DI OUT 0 ;into shadow mode LDA MODDAT ;get data byte OUT 1 ;back to RAM EI RET ; CDLEN: EQU $-OSOUT ;length of code to move ; ;========================================================================== ; Data Area ;========================================================================== ; ; Miscellaneous Default Data ; MSPDSV: DB 0 ;SAVE MODEM MSPEED MONFLG: DB 0FFH ;0: MONITOR OFF - 0FFH: MONITOR ON ANSFLG: DB 0 ;0: ORIGINATE - 0FFH: ANS NDELAY: DB 30 ;NO. SECONDS FOR ANSWER ; SMINIT: DB 'ATM1 S0=0 S7=30 X1',CR,0 ;MODEM INIT STRING SMDELAY: DB 'ATS7=30',CR,0 SMMANO: DB 'ATC0',CR,0 SMMANA: DB 'ATC1',CR,0 ; ;------------------------------------------------------------ ; ; End of Osborne I MEX modem overlay ; ;------------------------------------------------------------ ; END