; I2MD-2B.ASM - Morrow MD-2/3 ROM Rev.2x-3.x overlay for IMP - 06/20/88 ; ; USES 8251A I/O and 8253-5 baudrate generator at 2 MHz ; ; Version for LATER Morrow MD-2/3 floppy disk CP/M 2.2 models--ROM Rev. ; 2.x-3.x (parallel port & 8253-5 programmable baudrate generator). DO NOT ; USE FOR EARLY MD-2/3, ROM Rev. 1.x models, which use I2MO-x instead. ; Morrow nonstandard proprietary (CTS-made) MM300 modem NOT SUPPORTED. ; ; This is not an official overlay authorized by IMP author Irv Hoff, & may ; not be distributed without this notice. ; IMP 2 overlays have a 6-character name, beginning 'I2', then 2 characters ; indicating make & model of computer, then '-' & the version number. ; Here, the letter 'B' following official name indicates issue by BAMDUA/ ; BAKUP for user group members & group needs. Any added numbers are version. ; For group needs in this issue, some options are preselected, options not in ; official release may be added for some models, &/or comments are added. ; ; (1) CORRECT CABLE--It is recommended IMP be used with a shielded hardware ; handshaking correct computer-modem cable, although it will work with less. ; It is recommended you NOT use flat ribbon cable & do NOT connect pins 9- ; 19, 21, & 23-25, which some manufacturers use for nonstandard purposes. ; ; The correct cable for 100% standard RS232C DTE serial ports is straight ; through on pins 2-8 & 20, also 22, if ring indicator supported. ; The minimum cable for DTE ports is straight through on pins 2, 3 & 7. ; ; A DCE or straight-through-to-printer serial port is by definition non- ; standard, since a computer or terminal is not a DCE device, but some ; computers have only that type of port. The correct cable for many DCE ; ports crosses pins 2-3, 4-5 & 6-20, pin 7 straight through. Some cables for ; models with 8251A chip (no DCD) also work & are similar, except modem pin 8 ; instead of 6 is crossed to computer pin 20. The minimum cable for DCE ports ; crosses pins 2-3, straight through on 7. DCE ports vary considerably. ; ; All Morrow MD factory default DB25 serial ports are nonstandard DCE with ; output voltages on pins 9, 10 & 14. JPB Printer/Modem ports also have +12V ; out on pin 8, 'DCD out' in manuals. Both described DCE cables handshake OK. ; ; (2) CORRECT SYSTEM SETUP--Most CP/M computers have system software programs ; with names like BAUD, SETBAUD or SETUP, which should be run before modem ; use or direct cable transfer. Set baudrate to the highest rate BOTH your ; computer & modem (or computer connected by direct cable) support. If you ; can choose, also set hardware handshake, not Xon/Xoff, & do not assign the ; same port you are using for modem/transfer as printer port (LIST device). ; ; (3) MODEM TYPES--IMP supports Hayes-compatible AT-command-set modems only. ; 1200 & 2400 baud modems are different models with different initialization, ; so IMP's SET command alone cannot change type, only speed within type. ; Assemble separate program versions for 1200 & 2400 baud modems. Hayes & ; some compatibles use terse or verbose mode. In verbose mode, messages from ; the modem can be displayed in complete words. Some compatibles (Prometheus ; & Racal-Vadic) use terse mode only. Some compatibles (early Avatex) use ; verbose only. IMP distribution default is terse only. Use overlay I2VB-x ; if needed, or if you want & can use verbose mode. ; ; (4) MODEM DIP SWITCHES--Hayes & many compatible modems have dip switches ; that can force on 3 modem handshaking pins 5=CTS, 8=DCD, 20=DTR. With ; handshaking cable, NORMAL use forces NONE. Pins 5 &/or 8 may be forced, ; if the connected computer's port/controller needs a signal on either line ; to function. Force pin 20, if your computer/cable does not handshake ; with it & modem does not function without it; but then ability to hang up ; means either turning off modem manually or setting IMP NODTR equate = YES. ; ; (5) HOW IMP WORKS--IMP generic files, documentation & utilities are in ; IMP245.ARK or .LBR. Because it must work with so many port, modem & cable ; types, IMP does not check by handshake if modem is turned on, correctly ; connected & working. That is up to user. With handshaking cable, when ; program loads, call is made or SET command is used, initialization routine ; turns DTR=on (modem function) & RTS=on (modem raises carrier & can answer ; incoming call) & default settings in effect. When program-user's command ; hangs up phone at user end or sends break tone, official versions turn off ; RTS. Since it is also possible to use IMP with less than full handshaking ; cable & to exit IMP with or without hanging up phone at user end & to make ; voice calls on the same phone line between modem calls, glitches may occur ; if user does not think. E.g., modem left on may answer voice calls with ; unwanted carrier tone, if disconnected from other end or not by handshake; ; program left on may not answer wanted incoming calls, if disconnect issued ; & no reinitialization. However, custom settings made within program while ; online need not be repeated, if user exits & reenters without hang-up, as ; IMP stores these at a low memory address & restores them when it reloads. ; ; (6) USER OPTIONS--Most users with nonstandard DCE serial ports have null ; cables/adapters really intended for connecting 2 DTEs, which do not hand- ; shake correctly with a modem & are in effect minimum cables. These should ; set NODTR=YES. Most users with standard DTE ports should set NODTR=NO. ; ; Terminals that clear screen with CTRL-Z include ADM, Kaypro, MDT-20, Qume. ; Those that use ESC * include Freedom, MDT-50 & -60, MT70, Televideo, Wyse. ; ; IMP distribution default 8 data bits/no parity/1 stop bit, normal BBS use. ; Some mainframes demand 7 data bits/even parity/1 stop bit, reassemble. ; Poor timers on some early 2400 baud modems may require increased stop bits. ; ; BAMDUA/BAKUP version default 1.5 stop bits, since BAMDUA & MOR BBSs 44 Mg ; each, with user needs obtainable nowhere else, use early CTS 2400 modems. ; This causes 5% slowdown when uploading to other BBSs, but works on all. ; ; This version leaves RTS on after hang-up, makes it easy to answer incoming ; call with modem, if handshaking. Turn off modem manually when done. ; ; Morrow MD versions set NODTR = YES, since many null adapter types are used. ; Different versions for Rev.1 & Rev.2 MD-2/3. MD-HD vers. uses JPC AUX port. ; Morrow factory-original CP/M system automatically uses right terminal code. ; MD clear screen default is ESC *. Few customized systems need IMP revision. ; ; I2NM-2B overlay contains frequent user-dialed numbers, also use it to turn ; off call waiting, route long distance through designated carriers, etc. ; For PC Pursuit use IMP to download PCPIMPx.ARK/LBR, install it yourself. ; ; --------------------------------------------------------------------------- ; ; You will want to look this file over carefully. There are a number of ; options that you can use to configure the program to suit your taste. ; This file adapts Morrow MD-2/3 Rev.2.x-3.x to the IMP modem program. ; This computer has 2 serial ports & 1 parallel (Centronics) printer port. ; It is for later MD-2/3 with no internal dip switches. Earlier models ; did not have a baudrate generator but had internal dip switches to se- ; lect various baud rates for the printer. ; ; Edit this file for your preferences then follow the "TO USE:" example ; shown below. ; ; Many terminals will clear the screen with a CTL-Z. If yours does, put ; a 1AH at CLEAR: (010AH). Many terminals use two characters, the first ; normally an ESC. For example, ESC *. In this case put '*' at CLEAR: ; (The ESC will automatically be typed with no CTL-character present.) ; If you don't know what your terminal uses, put a 0 at CLEAR: and IMP ; will scroll up 24 blank lines to clear the CRT for things like MENU, ; looking at the function key table, typing CTL-Z in command mode, etc. ; ; TO USE: 1st edit this file filling in equates for your equipment & needs. ; Then assemble w/ASM.COM, MAC.COM or equivalent assembler: ; ; A>ASM I2MD-x OR A>MAC I2MD-x ; (assumes ASM extension, creates HEX file) ; ; Then use MLOAD (v.2.5 or higher) to merge into the main file: ; ; A>MLOAD IMPout.COM=IMPinput.COM,I2MD-x.HEX ; ; = = = = = = = = = = = = = = = = = = ; ; 06/20/88 BAMDUA/BAKUP version. Quick change to reassembe as 7 data ; v2b bits/parity even/1 stop to call mainframe by selecting 1 ; equate. Tested Avatex 1200hc. -Ilbert Butler ; ; 06/01/87 Improved the GOODBYE routine, added BREAK routine, needs ; v2 IMP245 to use it. - Irv Hoff ; ; 10/27/85 Written to work with IMP - Irv Hoff ; ; = = = = = = = = = = = = = = = = = ; ; YES EQU 0FFH NO EQU 0 ; ; ; Following routine sets data bits for calling BBS or mainframe, stop bits ; For direct cable transfers between computers, use any BBS setting ; Set ONE AND ONLY ONE of the following to YES, all the rest to NO: ; BBS10 EQU NO ; Call BBS, 8 data bits/no parity/1 stop bit BBS15 EQU YES ; Call BBS, 8 data bits/no parity/1.5 stop bits BBS20 EQU NO ; Call BBS, 8 data bits/no parity/2 stop bits MNFM7 EQU NO ; Call mainframe, 7 data bits/even parity/1 stop bit ; ; ; Values shown are for a 8251A ; PORT EQU 0FEH ; Your base port (data or status) MDCTL1 EQU PORT+1 ; Modem control port MDDATP EQU PORT ; Modem data port MDRCV EQU 02H ; Modem receive ready MDSND EQU 01H ; Modem send ready bit MDTXE EQU 05H ; Modem send buffer empty, holding buffer empty ; COMMND EQU 0F3H ; Baudrate command port for control/status BRPORT EQU 0F2H ; Baudrate select port ; MDMODE EQU 82H ; Insures 8251 is out of mode with DTR high MDRSET EQU 42H ; Resets USART for additional commands ; ; IF sequence sets data bits, stop bits, parity as needed by selection above. ; IF BBS10 ; Call BBS, 1 stop bit MDSET1 EQU 4EH ; 1 stop bit, no parity, 8 data bits, x16 clk ENDIF ; end BBS10 ; IF BBS15 ; Call BBS, 1.5 stop bits (BAMDUA & MOR) MDSET1 EQU 8EH ; 1.5 stop bits, no parity, 8 data bits, x16 clk ENDIF ; end BBS15 ; IF BBS20 ; Call BBS, 2 stop bits (too many errors sending) MDSET1 EQU 0CEH ; 2 stop bits, no parity, 8 data bits, x16 clk ENDIF ; end BBS20 ; IF MNFM7 ; Call mainframe w/7 data bits, even par, 1 stop bit MDSET1 EQU 7AH ; 1 stop bit, even par, 8 data bits, x16 clk ENDIF ; end MNFM7 ; MDCOM EQU 37H ; Reset error flags, RTS on, DTR on, RCV & TX ready ; ; ; ;----------------------------------------------------------------------- ; ESC EQU '['-40H ; ^[ = Escape BELL EQU 'G'-40H ; ^G = Bell character LF EQU 'J'-40H ; ^J = Linefeed NEXTRY EQU 'K'-40H ; ^K = Try next phone number, abort this try CR EQU 'M'-40H ; ^M = Carriage return CLEARSC EQU 'Z'-40H ; ^Z = Clears screen, command mode only EOFCHAR EQU 'Z'-40H ; ^Z = End of file ; ; ;----------------------------------------------------------------------- ; ; ORG 0100H ; ; DS 3 ; Skip the data area below ; ; ; These routines and equates are at the beginning of the program so ; they can be patched by a monitor or overlay file without re-assembling ; the program. ; MSPEED: DB 5 ; 0=110 1=300 2=450 3=600 4=710 5=1200 103H ; 6=2400 7=4800 8=9600 9=19200 default HS2400: DB NO ; Yes=2400 bps highest speed 104H HS1200: DB YES ; Yes=1200 bps highest speed 105H RACAL: DB NO ; Yes=Racal-Vadic 1200V or 2400V or 2400PA 106H PROMODM: DB NO ; Yes=Prometheus ProModem 1200 bps 107H RESVD1: DB NO ; Reserved for special modems 108H RESVD2: DB NO ; Reserved for special modems 109H ; ; CLEAR: DB '*' ; Clear screen character (ESC not needed) 10AH CLOCK: DB 40 ; Clock speed in MHz x10, 25.5 MHz max. 10BH ; 20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc. BYTDLY: DB 4 ; 0=0 delay 1=10ms 5=50 ms - 9=90 ms 10CH ; default time to send character in ter- ; minal mode file transfer for slow BBS CRDLY: DB 4 ; 0=0 delay 1=100 ms 5=500 ms - 9=900 ms 10DH ; default time for extra wait after CRLF ; in terminal mode file transfer NOFCOL: DB 5 ; Number of directory columns shown 10EH TCHPUL: DB 'T' ; T=tone, P=Pulse (Hayes 2400 modems) 10FH ;..... ; ; ADDLFD: DB NO ; Yes=add LF after CR to send file in terminal 110H ; mode (normally added by remote echo) CONVRUB: DB YES ; Yes=convert rub to backspace 111H CRCDFLT: DB YES ; Yes=default to CRC checking 112H IGNRCTL: DB YES ; Yes=CTL-chars above ^M not displayed 113H ;..... ; ; EXTCHR: DB '['-40H ; ESC = preceeds local control character 114H EXITCHR: DB 'E' ; Exit character 115H FILESND: DB 'F' ; Send file when in terminal mode 116H NOCONCT: DB 'N' ; Disconnect from phone line 117H LOGCHR: DB 'L' ; Send logon 118H LSTCHR: DB 'P' ; Toggle printer 119H UNSAVCH: DB 'R' ; Close input text buffer 11AH SAVECHR: DB 'Y' ; Open input text buffer 11BH CLEARS: DB 'Z' ; Clears screen, terminal mode 11CH BRKCHR: DB 'Q' ; Send a break tone 11DH NODTR: DB YES ; YES if no DTR and need ATH0 to disconnect 11EH ;..... ; ; ; Handles in/out ports for data and status ; I$MDCTL1: IN MDCTL1 ; 11FH RET ; IN modem control port 121H DB 0,0,0,0,0,0,0 ; Spares if needed 122H ; I$MDTXE: IN MDCTL1 ; (Needed for SIO or DART register 1 129H RET ; 12BH DB 0,0,0,0,0,0,0 ; 12CH ; I$MDDATP: MVI A,37H ; 133H OUT MDCTL1 ; 135H IN MDDATP ; 137H RET ; 139H DB 0,0,0 ; Spares if needed 13AH ; O$MDDATP: OUT MDDATP ; 13DH RET ; OUT modem data port 13FH DB 0,0,0,0,0,0,0 ; Spares if needed 140H ;..... ; ; A$MDRCV: ANI MDRCV ; 147H RET ; 149H ; C$MDRCV: CPI MDRCV ; 14AH RET ; 14CH ; A$MDSND: ANI MDSND ; 14DH RET ; 14FH ; C$MDSND: CPI MDSND ; 150H RET ; 152H ; A$MDTXE: ANI MDTXE ; 153H RET ; 155H ; C$MDTXE: CPI MDTXE ; 156H RET ; 158H ;..... ; ; ; Special exit vector, used by some computers to reset interrupt vectors ; J$EXITVEC:RET ; 159H DB 0,0 ; 15AH ;..... ; ; ; Jump vectors needed by each overlay ; J$GOODBYE:JMP GOODBYE ; Disconnects modem by dropping DTR 15CH J$INITMOD:JMP INITMOD ; Initializes modem, autosets baudrate 15FH J$STUPR: JMP STUPR ; SET routine to change baudrate 162H J$SYSVR: JMP SYSVR ; Signon message 165H ;..... ; ; ; "AT" command strings, can be replaced in individual overlay if needed ; J$STRNGA: DS 3 ; 1200 bps "AT" string 168H J$STRNG1: DS 3 ; 2400 bps "AT" string 16BH ; ; ; Next fourteen lines should not be changed by user overlay as these go ; to specific locations in the main program, not in the overlay. ; ; J$CMDSPL: DS 3 ; Allows entry of baudrate on CMD line 16EH J$CRLF: DS 3 ; Turns up one new line on display 171H J$DIAL: DS 3 ; Start of dialing routine 174H J$DSCONT: DS 3 ; Terminates modem use 177H J$GOLST: DS 3 ; Printer routine, needed by Apple //e 17AH J$ILPRT: DS 3 ; Prints an inline string, 0 to end 17DH J$INBUF: DS 3 ; Stores a keybd string for comparison 180H J$INLNCP: DS 3 ; Inline "compare strings" routine 183H J$INMDM: DS 3 ; Max .1 sec wait for modem character 186H J$RCVRSP: DS 3 ; For 3801 I/O use (TV-803) 189H J$SNDCHR: DS 3 ; Sends a character to the modem 18CH J$SNDSTR: DS 3 ; Sends a string to the modem, $ to end 18FH J$TIMER: DS 3 ; .1 second timer (amount in 'B' reg.) 192H J$BREAK: JMP SENDBRK ; Break routine 195H J$NEW2: DB 0,0,0 ; For future needs 198H ;..... ; ; ; For 2400 bps auto-stepdown units ; MANUAL: DB 0 ; For manual selection flag 19BH J$300: JMP OK300 ; Sets baudrate to 300 baud 19CH J$1200: JMP OK1200 ; Sets baudrate to 1200 bps 19FH J$2400: JMP OK2400 ; Sets baudrate to 2400 bps 1A2H ;..... ; ; LOGPTR: DW LOGON ; Pointer to display LOGON message 1A5H ; SYSVR: CALL J$ILPRT ; Display the following line 1A7H DB 'Version for Morrow MD-2/3 ROM Rev.2.x-3.x Printer/' ; 1AAH DB 'Modem port 0FEH' DB CR,LF,0 RET ;..... ; ; ;----------------------------------------------------------------------- ; ; NOTE: You can change the SYSVER message to be longer or shorter. The ; end of your last routine should terminate by 0400H (601 bytes ; available after start of SYSVER). ; ;----------------------------------------------------------------------- ; ; You can put in a message at this location which can be called up with ; (special character-L). You can put in several lines. End with a 0. ; LOGON: DB 'This is a Morrow MD-2/3 Rev.2-3 computer',CR,LF,0 ; ;----------------------------------------------------------------------- ; ; This routine sets a 300 ms break tone ; SENDBRK: MVI A,3FH ; Set break tone, DTR & RTS on, error reset JMP GOODBYE+2 ; Send break w/GOODBYE, skipping 1st 2 bytes ;..... ; ; ; This routine sets DTR low for 300 ms to disonnect the phone ; GOODBYE: MVI A,1DH ; Send break, DTR & RTS off, error reset OUT MDCTL1 ; Send to status port MVI B,3 ; Delay 300 ms to hang up phone CALL J$TIMER MVI A,MDCOM ; Normal send/receive with DTR OUT MDCTL1 ; Send to status port RET ;..... ; ; ; Sets 8251 to 8 bits, DTR, RCV and TX ready ; INITMOD: MVI A,MDMODE ; Insure 8251 is out of mode OUT MDCTL1 ; Send to status port XTHL ; Small delay to complete command XTHL MVI A,MDRSET ; Reset the 8251A for new command OUT MDCTL1 ; Send to status port XTHL ; Small delay to complete command XTHL MVI A,MDSET1 ; Set stop pulse, parity, data bits, clk OUT MDCTL1 ; Send to status port XTHL ; Small delay to complete command XTHL MVI A,MDCOM ; Error reset, RCV, DTR, TX ready OUT MDCTL1 ; Send to status port XTHL ; Small delay to complete command XTHL ; LDA MSPEED ; Get the selected value CPI 1 ; 300 bps JZ OK300 CPI 5 ; 1200 bps JZ OK1200 CPI 6 ; 2400 bps JZ OK2400 CPI 8 ; 9600 bps JZ OK9600 JMP STUPR1 ; Else ask what is wanted ;..... ; ; ; STUPR: CALL J$CMDSPL ; Gives us CMDBUF+6 JNC STUPR2 ; STUPR1: CALL J$ILPRT DB 'Input Baud Rate (300, 1200, 2400, 9600): ',0 LXI D,BAUDBUF ; Point to new input buffer CALL J$INBUF CALL J$CRLF LXI D,BAUDBUF+2 ; STUPR2: CALL J$INLNCP ; Compare BAUDBUF+2 with chars. below DB '300',0 JNC OK300 ; Go if got match CALL J$INLNCP DB '1200',0 JNC OK1200 CALL J$INLNCP DB '2400',0 JNC OK2400 CALL J$INLNCP DB '9600',0 JNC OK9600 CALL J$ILPRT ; All matches failed, tell operator DB '++ Incorrect entry ++',CR,LF,BELL,CR,LF,0 JMP STUPR1 ; Try again ; OK300: MVI A,1 ; MSPEED 300 baud value LXI H,BD300 ; Get 300 baud parameters in 'HL' JMP LOADBD ; Go load them ; OK1200: MVI A,5 LXI H,BD1200 JMP LOADBD ; OK2400: XRA A STA MANUAL ; Reset to maximum auto-speed MVI A,6 LXI H,BD2400 JMP LOADBD ; OK9600: MVI A,8 LXI H,BD9600 ; LOADBD: STA MSPEED ; Change time-to-send to match baudrate MVI A,0BEH OUT COMMND ; Baudrate generator command port MOV A,L ; CTC command word OUT BRPORT MOV A,H ; Get baudrate byte OUT BRPORT RET ;..... ; ; ; Table of baudrate parameters ; BD300 EQU 417 ; 125100/300 converted to hex value BD1200 EQU 104 ; 125100/1200 BD2400 EQU 52 ; 125100/2400 BD9600 EQU 13 ; 125100/9600 ; BAUDBUF:DB 10,0,0,0,0,0 DB 0,0,0,0,0,0 ; ; end ;----------------------------------------------------------------------- ; ; NOTE: Must terminate by 0400H ; END