home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / BEEHIVE / COMMS / IMP-OV5A.LBR / I2AP-9.AZM / I2AP-9.ASM
Assembly Source File  |  2000-06-30  |  31KB  |  1,236 lines

  1.  
  2. ; I2AP-9.ASM - Apple ][ overlay file for IMP - 06/01/87
  3. ;
  4. ;        BASIS = 6551 (built-in divisor)
  5. ;        APR   = 6850 (uses divide by 16 or by 64)
  6. ;        CCS   = 6850 (uses divide by 16 or by 64)
  7. ;        CPS   = 2651 (built-in divisor)
  8. ;        SSC   = 6551 (built-in divisor)
  9. ;        VERSA = 6850 (uses divide by 16 or by 64)
  10. ;
  11. ; This overlay file adapts Apple II computers with various serial cards
  12. ; and external 2400 bps modems to IMP.COM.  It supports the following
  13. ; configurations:
  14. ;
  15. ;     NOTE:    If you have trouble disonnecting from the
  16. ;        phone line, you may not have a normal DTR
  17. ;        setup to turn off the modem.  In that case,
  18. ;        set the NODTR: option at 011E to YES, to
  19. ;        provide ATH0 to disonnect.  (This assumes
  20. ;        you have a Hayes-compatible type modem with
  21. ;        "AT" command set.)
  22. ;
  23. ;
  24. ; CP/M adapter cards:
  25. ; ------------------
  26. ;    ALS CP/M 3.0 adapter card
  27. ;    Applied Engineering Z80+ or Z80C
  28. ;    Microsoft Softcard Z80 equivalent
  29. ;    PCPI Applicard
  30. ;    BASIS 108 System (German Apple)
  31. ;
  32. ; Serial cards
  33. ; ------------
  34. ;    a) ALS Dispatcher card
  35. ;     * b) Apricorn serial card (see note below about baudrate) - 6850
  36. ;    c) CCS 7710 serial card (see note below about baudrate) - 6850
  37. ;    d) Apple Supera Serial Comcard - 6551
  38. ;    e) Mountain Hardware CPS Multifunction card  -    2651
  39. ;    f) Apple SSC communications interface  -  6551
  40. ;    g) SSM serial interface -
  41. ;    h) Prometheus Versacard with software baud select - 6850
  42. ;
  43. ;     * The 6850 has no baudrate generator.  It relies on the user
  44. ;    setting a dip switch to the maximum speed he wants to use.
  45. ;    The program then uses the 6850 in the "divide by 16" mode
  46. ;    to get that speed.  It can then change to "divide by 64"
  47. ;    to get the only other speed available.    This type system
  48. ;    normally limits the user to 1200 and 300 baud.    If you
  49. ;    set the dip switches for 2400, then you could only get
  50. ;    2400 and 600, eliminating both 1200 and 300 baud.  Using
  51. ;    either the Apricorn or CCS 7710 board just about precludes
  52. ;    the user from wanting to obtain a new modem with 2400 bps.
  53. ;    The 6850 uses the last two bits to select the divisor.    01
  54. ;    gives "divide by 16" and 10 gives "divide by 64".
  55. ;
  56. ;-----------------------------------------------------------------------
  57. ;
  58. ; You will want to look this file over carefully.  There are a number of
  59. ; options that you can use to configure the program to suit your taste.
  60. ;
  61. ; Edit this file for your preferences then follow the "TO USE:" example
  62. ; shown below.
  63. ;
  64. ; Many terminals will clear the screen with a CTL-Z.  If yours does, put
  65. ; a 1AH at CLEAR: (010AH).  Many terminals use two characters, the first
  66. ; normally an ESC.  For example, ESC *.  In this case put '*' at CLEAR:
  67. ; (The ESC will automatically be typed with no CTL-character present.)
  68. ; If you don't know what your terminal uses, put a 0 at CLEAR: and IMP
  69. ; will scroll up 24 blank lines to clear the CRT for things like MENU,
  70. ; looking at the function key table, typing CTL-Z in command mode, etc.
  71. ;
  72. ; Use the "SET" command to change the baudrate when desired.  The value
  73. ; at MSPEED controls the baudrate when the program is first called up.
  74. ;
  75. ;    TO USE: First edit this file filling in answers for your own
  76. ;        equipment.  Then assemble with ASM.COM or equivalent
  77. ;        assembler.  Then use MLOAD to merge into the main file:
  78. ;
  79. ;        MLOAD IMP.COM=IMP.COM,I2AP-x.HEX
  80. ;
  81. ;                    - Notes by Irv Hoff W6FFC
  82. ;
  83. ;-----------------------------------------------------------------------
  84. ;              MC6850 ACIA I/O information
  85. ;
  86. ;     NOTE:    If using a serial card with the Motorola
  87. ;        MC6850 ACIA, this chip does not have a DTR
  88. ;        output.  It does have a RTS (request to send)
  89. ;        option which we have used to substitute for
  90. ;        the missing DTR.  This comes out on pin 4
  91. ;        of the RS-232 DB-25 pin connector.  Hook that
  92. ;        to the modem's pin 20.    Be sure then to have
  93. ;        the DTR toggle switch on the modem itself in
  94. ;        the "remote DTR voltage" position.  For Hayes
  95. ;        modems this is switch 1 (should be "up".)  The
  96. ;        normal Hayes configuration are switches 3,5,8
  97. ;        down, 1,2,4,6,7 up.
  98. ;
  99. ;        If you have any trouble disconnecting, then set
  100. ;        the NODTR: option in the list below to YES and
  101. ;        it will then use ATH0 to disconnect.  This may
  102. ;        take 3-4 seconds.
  103. ;
  104. ; The CCS 7710 serial card is set up as DCE rather than the more usual
  105. ; DTE, and requires a special cable.....the following cable configura-
  106. ; ion is necessary to work with this overlay -----
  107. ;
  108. ;          MODEM pin       CCS pin
  109. ;
  110. ;        2        3
  111. ;        3        2
  112. ;        5        4
  113. ;        8        20
  114. ;        7        7
  115. ;        20        5
  116. ;
  117. ; Hayes 1200 switch 6 must be down...(DCD true)
  118. ;                        - Norman Beeler
  119. ;
  120. ;----------------------------------------------------------------------
  121. ;                 VERSAcard
  122. ;
  123. ; To use SET with the Prometheus VERSAcard a small hardware change must
  124. ; be made, since the VERSAcard only supports baud rate selection via DIP
  125. ; switches.  This change will allow the VERSAcard to be switched between
  126. ; 300 and 1200 baud via software.  A wire should be attached from Pin
  127. ; #12 on U16 (IC marked 8126) on the VERSAcard into Annunciator #3 (Pin
  128. ; #12) on the Apple game port.    This will allow switch #4 on s2 of the
  129. ; VERSAcard to be toggled by setting or clearing annunciator #3. The de-
  130. ; fault baud rate is set at MSPEED Below either (300 or 1200).
  131. ;
  132. ; Note: This method could be extended to all other VERSAcard baud rates
  133. ;    and by using Annunciators 0,1,2 but 300 and 1200 are really
  134. ;    needed for a modem program. The DIP switches on the VERSAcard
  135. ;    should be set as follows:
  136. ;
  137. ; On switch bank #2:
  138. ;            S2 - ON
  139. ;            S3 - OFF
  140. ;            S4 - OFF
  141. ;            S5 - OFF
  142. ;
  143. ;
  144. ;     NOTE:    If you have trouble disonnecting from the
  145. ;        phone line, you may not have a normal DTR
  146. ;        setup to turn off the modem.  In that case,
  147. ;        set the NODTR: option at 011E to YES, to
  148. ;        provide ATH0 to disonnect.  (This assumes
  149. ;        you have a Hayes-compatible type modem with
  150. ;        "AT" command set.)
  151. ;
  152. ;
  153. ;     _________________
  154. ;    |          |
  155. ;    | 7 6 5 4 3 2 1 0 |   6850 ACIA for serial I/O
  156. ;    |_________________|
  157. ;
  158. ;      CR1 CR0     Function
  159. ;       0   0     1
  160. ;    *  0   1    16    (for 1200 bps)
  161. ;    +  1   0    64    (changes to 300 baud)
  162. ;       1   1    Master reset
  163. ;
  164. ;    CR4 CR3 CR2
  165. ;     0   0     0     7 bits, even parity, 2 stop bits
  166. ;     0   0     1     7 bits,    odd parity, 2 stop bits
  167. ;     0   1     0     7 bits, even parity, 1 stop bit
  168. ;     0   1     1     7 bits,    odd parity, 1 stop bit
  169. ;     1   0     0     8 bits,     no parity, 2 stop bits
  170. ;      * 1   0     1     8 bits,     no parity, 1 stop bit
  171. ;     1   1     0     8 bits, even parity, 1 stop bit
  172. ;     1   1     1     8 bits,    odd parity, 1 stop bit
  173. ;
  174. ;      CR6 CR5
  175. ;       0   0     RTS low,  Xmit interrupt disabled
  176. ;       0   1     RTS low,  Xmit interrupt enabled
  177. ;    *  1   0     RTS high, Xmit interrupt disabled
  178. ;       1   1     RTS low,  Xmit interrupt disabled, break sent
  179. ;
  180. ;        CR7
  181. ;         0         Interrupts disabled
  182. ;    *    1         Enables recieve buffer full, overrun, low-to-high
  183. ;               transition on the data carrier detect.
  184. ;
  185. ;                    - Notes by Irv Hoff W6FFC
  186. ;
  187. ; =   =  =   =     =   =     =   =     =   =     =   =     =   =     =   =     =   =
  188. ;
  189. ; 06/01/87  Improved the GOODBYE routine, added BREAK routine, needs
  190. ;    v9     IMP245 to use it.  (Set for ESC Q at present.)
  191. ;                    - Irv Hoff
  192. ;
  193. ; 08/01/86  Fixed to work correctly with the ALS Dispatcher serial card.
  194. ;    v8                 - Irv Hoff
  195. ;
  196. ; 02/27/86  Fixed several sections so the BASIS 108 option would work
  197. ;    v7     correctly.            - Irv Hoff
  198. ;
  199. ; 01/17/85  Added the Applied Engineering Z80 card.  Added the Apricorn
  200. ;    v6     serial card, fixed a problem with the CCS serial card so the
  201. ;        program would assemble correctly.  Note added to tell about
  202. ;        the CCS and Apricorn being limited to 300/1200 bps, if 2400
  203. ;        bps is needed, likely will want a different serial card.
  204. ;                    - Irv Hoff
  205. ;
  206. ; 09/27/85  Fixed compile errors for CCS serial option, added DTR sup-
  207. ;    v5     port, modem cable description (for CCS board, only).
  208. ;                    - Norman Beeler
  209. ;
  210. ; 09/22/85  Corrected SSC INITMOD1 routine - changed JMP to CALL.
  211. ;    v4                 - Douglas Thom
  212. ;
  213. ; 09/15/85  Added SET300 in CPS INITMOD to fix cold boot problem.
  214. ;    v3                 - Norman Beeler
  215. ;
  216. ; 08/27/85  Added to support the BASIS 108
  217. ;    v2                 - Clay Walker
  218. ;
  219. ; 07/17/85  Written to work with IMP    - Irv Hoff
  220. ;    v1
  221. ;
  222. ; =   =  =   =     =   =     =   =     =   =     =   =     =   =     =   =     =   =
  223. ;
  224. ;
  225. YES    EQU    0FFH
  226. NO    EQU    0
  227. ;
  228. ;
  229. ;====================== CUSTOMIZATION EQUATES ==========================
  230. ;
  231. SLOT    EQU    2        ; Slot of serial interface
  232. SLOTOFF    EQU    16*SLOT        ; Serial card slot offset
  233. ;
  234. ;
  235. ; CP/M adapter cards for Apple ][
  236. ;
  237. ALSCARD       EQU    NO        ; Yes if using ALS CP/M card
  238. APPLIED       EQU    NO        ; Yes if using Applied Engineering Z80
  239. PCPI       EQU    NO        ; Yes if using PCPI Applicard CP/M card
  240. BASIS       EQU    NO        ; Yes if BASIS 108
  241. MICROSOFT  EQU    YES        ; Yes if Microsoft Softcard CP/M card
  242. ;
  243. ;
  244. ; Serial I/O cards for Apple ][
  245. ;
  246. ALSDSP    EQU    NO        ; Yes for ALS Dispatcher
  247. APR    EQU    NO        ; Yes for Apricorn serial card
  248. CCS    EQU    NO        ; Yes for CCS 7710
  249. COMCARD    EQU    NO        ; Yes for Apple Comcard
  250. CPS    EQU    NO        ; Yes for CPS card
  251. SSC    EQU    YES        ; Yes for Super Serial Card
  252. SSM    EQU    NO        ; Yes for SSM serial card
  253. VERSA    EQU    NO        ; Yes for Prometheus VERSAcard
  254. ;
  255. CPSPRT    EQU    NO        ; Yes if using CPS parallel printer port
  256. ;
  257. ;
  258. ;-----------------------------------------------------------------------
  259. ;
  260.      IF    ALSCARD    OR PCPI
  261. MAPOFF    EQU    0        ; No memory remapping for either
  262.      ENDIF            ; ALSCARD OR PCPI
  263. ;
  264.      IF    APPLIED    OR MICROSOFT
  265. MAPOFF    EQU    2000H        ; Microsoft strikes again
  266.      ENDIF            ; APPLIED OR MICROSOFT
  267. ;
  268. ;
  269. ;-----------------------------------------------------------------------
  270. ;
  271.      IF    BASIS
  272. MDDATP    EQU    0E098H        ; Data Port
  273. MDCTL1    EQU    0E099H        ; Status Port
  274. MDCTL2    EQU    0E09AH        ; Command Port
  275. MDCTL3    EQU    0E09BH        ; Control Port
  276. MDRCV    EQU    08H        ; Same as SSC (6551 ACIA)
  277. MDSND    EQU    10H        ;  "
  278. MDTXE    EQU    10H        ;  "
  279.      ENDIF            ; BASIS
  280. ;
  281. ;
  282. ;-----------------------------------------------------------------------
  283. ;
  284.      IF    APR
  285. MDCTL1    EQU    0C08EH+SLOTOFF+MAPOFF ; Status port of Apricorn
  286. MDDATP    EQU    0C08FH+SLOTOFF+MAPOFF ; Data port of Apricorn
  287.      ENDIF            ; APR
  288. ;
  289. ;
  290. ;-----------------------------------------------------------------------
  291. ;
  292.      IF    CCS
  293. MDCTL1    EQU    0C080H+SLOTOFF+MAPOFF ; Status port of CCS 7710
  294. MDDATP    EQU    0C081H+SLOTOFF+MAPOFF ; Data port of CCS 7710
  295.      ENDIF            ; CCS
  296. ;
  297. ;
  298. ;-----------------------------------------------------------------------
  299. ;
  300.      IF    ALSDSP OR COMCARD OR VERSA
  301. MDCTL1    EQU    0C08EH+SLOTOFF+MAPOFF ; Status port of Comcard
  302. MDDATP    EQU    0C08FH+SLOTOFF+MAPOFF ; Data port of Comcard
  303.      ENDIF            ; ALSDSP OR COMCARD OR VERSA
  304. ;
  305. ;
  306. ;-----------------------------------------------------------------------
  307. ;
  308.      IF    CPS
  309. MDCPST    EQU    0C0F9H+SLOT*100H+MAPOFF    ; Printer status port
  310. MDDATP    EQU    0C0FAH+SLOT*100H+MAPOFF    ; Data port of CPS card
  311. MDCTL1    EQU    0C0FBH+SLOT*100H+MAPOFF    ; Status port of CPS card
  312. MDCTL2    EQU    0C0FCH+SLOT*100H+MAPOFF    ; Second CPS status port
  313. MDCPRT    EQU    0C0FDH+SLOT*100H+MAPOFF    ; Printer data port
  314. MDCR    EQU    0C0FEH+SLOT*100H+MAPOFF    ; Control port of CPS card
  315. MDRCV    EQU    2        ; Bit to test for receive
  316. MDSND    EQU    1        ; Bit to test for send
  317. MDTXE    EQU    5        ; Modem send buffer empty
  318.      ENDIF            ; CPS
  319. ;
  320. ;
  321. ;-----------------------------------------------------------------------
  322. ;
  323.      IF    SSC
  324. MDDATP    EQU    0C088H+SLOTOFF+MAPOFF ; SSC data port
  325. MDCTL1    EQU    0C089H+SLOTOFF+MAPOFF ; SSC status port
  326. MDCTL2    EQU    0C08AH+SLOTOFF+MAPOFF ; SSC mode port
  327. MDCTL3    EQU    0C08BH+SLOTOFF+MAPOFF ; SSC control port
  328. MDRCV    EQU    08H        ; Bit to test for received data
  329. MDSND    EQU    10H        ; Bit to test for ready to send
  330. MDTXE    EQU    10H        ; Modem send buffer empty
  331.      ENDIF            ; SSC
  332. ;
  333. ;
  334. ;-----------------------------------------------------------------------
  335. ;
  336.      IF    SSM
  337. MDCTL1    EQU    0C084H+SLOTOFF+MAPOFF ; Status port of SSM
  338. MDDATP    EQU    0C085H+SLOTOFF+MAPOFF ; Data port of SSM
  339.      ENDIF            ; SSM
  340. ;
  341. ;
  342. ;-----------------------------------------------------------------------
  343. ;
  344.      IF    NOT SSC    AND NOT    CPS AND    NOT BASIS
  345. MDRCV    EQU    1        ; Bit to test for receive
  346. MDSND    EQU    2        ; Bit to test for send
  347. MDTXE    EQU    2        ; Modem send buffer empty
  348.      ENDIF            ; NOT SSC AND NOT CPS
  349. ;
  350. ;
  351. ;-----------------------------------------------------------------------
  352. ;
  353.      IF    VERSA
  354. AN3CLR    EQU    0C05EH+MAPOFF    ; Clear annunciator #3
  355. AN3SET    EQU    0C05FH+MAPOFF    ; Set        "        #3
  356.      ENDIF            ; VERSA
  357. ;
  358. ;
  359. ;-----------------------------------------------------------------------
  360. ;
  361. ; General equates
  362. ;
  363. ESC    EQU    '['-40H        ; ^[ = Escape
  364. BELL    EQU    'G'-40H        ; ^G = Bell character
  365. LF    EQU    'J'-40H        ; ^J = Linefeed
  366. NEXTRY    EQU    'K'-40H        ; ^K = Try next phone number now
  367. CR    EQU    'M'-40H        ; ^M = Carriage return
  368. CLEARSC    EQU    'Z'-40H        ; ^Z = Clear screen, command mode only
  369. EOFCHAR    EQU    'Z'-40H        ; ^Z = End of file
  370. ;
  371. ;
  372. ;-----------------------------------------------------------------------
  373. ;
  374. ;
  375.     ORG    0100H
  376. ;
  377.     DS    3    ; Skip the data area below
  378. ;
  379. ;
  380. ; These routines and equates are at the beginning of the program so
  381. ; they can be patched by a monitor or overlay file without re-assembling
  382. ; the program.
  383. ;
  384. MSPEED:     DB    5    ; 0=110 1=300 2=450 3=600 4=710 5=1200        103H
  385.             ; 6=2400 7=4800 8=9600 9=19200 default
  386. HS2400:     DB    NO    ; Yes=2400 bps highest speed            104H
  387. HS1200:     DB    YES    ; Yes=1200 bps highest speed            105H
  388. RACAL:     DB    NO    ; Yes=Racal-Vadic 1200V or 2400V or 2400PA    106H
  389. PROMODM: DB    NO    ; Yes=Prometheus ProModem 1200 bps        107H
  390. RESVD1:     DB    NO    ; Reserved for special modems            108H
  391. RESVD2:     DB    NO    ; Reserved for special modems            109H
  392. ;
  393. CLEAR:     DB    '*'    ; Clear screen character (ESC not needed)    10AH
  394. ;
  395.       IF    PCPI
  396. CLOCK:     DB    6    ; Clock speed in MHz, 25.5 MHz max.        10BH
  397.             ; NOTE:  DO NOT MULTIPLY BY 10 FOR APPLICARD
  398.       ENDIF        ; PCPI
  399. ;
  400.       IF    NOT PCPI
  401. CLOCK:     DB    20    ; Clock speed in MHz x10, 25.5 MHz max.     10BH
  402.       ENDIF        ; NOT PCPI
  403. ;
  404.             ; 20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  405. BYTDLY:     DB    9    ; 0=0 delay  1=10ms  5=50 ms - 9=90 ms        10CH
  406.             ;   default time to send character in ter-
  407.             ;   minal mode file transfer for slow BBS
  408. CRDLY:     DB    9    ; 0=0 delay 1=100 ms 5=500 ms - 9=900 ms    10DH
  409.             ;   default time for extra wait after CRLF
  410.             ;   in terminal mode file transfer
  411. NOFCOL:     DB    5    ; Number of directory columns shown        10EH
  412. TCHPUL:     DB    'T'    ; T=tone, P=Pulse (Hayes 2400 modems)        10FH
  413. ;.....
  414. ;
  415. ;
  416. ADDLFD:     DB    NO    ; Yes=add LF after CR to send file in terminal    110H
  417.             ;   mode (normally added by remote echo)
  418. CONVRUB: DB    YES    ; Yes=convert rub to backspace            111H
  419. CRCDFLT: DB    YES    ; Yes=default to CRC checking            112H
  420. IGNRCTL: DB    YES    ; Yes=CTL-chars above ^M not displayed        113H
  421. ;.....
  422. ;
  423. ;
  424. EXTCHR:     DB    '['-40H    ; ESC = preceeds local control character    114H
  425. EXITCHR: DB    'E'    ; Exit character                115H
  426. FILESND: DB    'F'    ; Send file when in terminal mode        116H
  427. NOCONCT: DB    'N'    ; Disconnect from phone line            117H
  428. LOGCHR:     DB    'L'    ; Send logon                    118H
  429. LSTCHR:     DB    'P'    ; Toggle printer                119H
  430. UNSAVCH: DB    'R'    ; Close input text buffer            11AH
  431. SAVECHR: DB    'Y'    ; Open input text buffer            11BH
  432. CLEARS:     DB    'Z'    ; Clears screen, terminal mode            11CH
  433. BRKCHR:     DB    'Q'    ; Send a break tone                11DH
  434. NODTR:     DB    NO    ; YES if no DTR and need ATH0 to disconnect    11EH
  435. ;.....
  436. ;
  437. ;
  438. ; Handles in/out ports for data and status
  439. ;
  440. I$MDCTL1: JMP    RCVCTL1        ; In modem control port         11FH
  441.       DB    0,0,0,0,0,0,0    ; Spares if needed            122H
  442. ;
  443. I$MDTXE:  JMP    RCVCTL1        ;                    129H
  444.       DB    0,0,0,0,0,0,0    ;                    12CH
  445. ;
  446. I$MDDATP: JMP    RCVDATP        ;in modem data port            133H
  447.       DB    0,0,0,0,0,0,0    ;                    146H
  448. ;
  449. O$MDDATP: JMP    SNDDATP        ; Out modem data port            13DH
  450.       DB    0,0,0,0,0,0,0    ; Spares if needed            140H
  451. ;.....
  452. ;
  453. ;
  454. A$MDRCV:  ANI    MDRCV        ;                    147H
  455.       RET            ;                    149H
  456. ;
  457. C$MDRCV:  CPI    MDRCV        ;                    14AH
  458.       RET            ;                    14CH
  459. ;
  460. A$MDSND:  ANI    MDSND        ;                    14DH
  461.       RET            ;                    14FH
  462. ;
  463. C$MDSND:  CPI    MDSND        ;                    150H
  464.       RET            ;                    152H
  465. ;
  466. A$MDTXE:  ANI    MDTXE        ;                    153H
  467.       RET            ;                    155H
  468. ;
  469. C$MDTXE:  CPI    MDTXE        ;                    156H
  470.       RET            ;                    158H
  471. ;.....
  472. ;
  473. ;
  474. ; Special exit vector, used by some computers to reset interrupt vectors
  475. ;
  476. J$EXITVEC:RET            ;                    159H
  477.       DB    0,0        ;                    15AH
  478. ;.....
  479. ;
  480. ;
  481. ; Jump vectors needed by each overlay
  482. ;
  483. J$GOODBYE:JMP    GOODBYE        ; Disconnects modem by dropping DTR    15CH
  484. J$INITMOD:JMP    INITMOD        ; Initializes modem, autosets baudrate    15FH
  485. J$STUPR:  JMP    STUPR        ; SET routine to change baudrate    162H
  486. J$SYSVR:  JMP    SYSVR        ; Signon message            165H
  487. ;.....
  488. ;
  489. ;
  490. ; "AT" command strings, can be replaced in individual overlay if needed
  491. ;
  492. J$STRNGA: DS    3        ; 1200 bps "AT" string            168H
  493. J$STRNG1: DS    3        ; 2400 bps "AT" string            16BH
  494. ;
  495. ;
  496. ; Next fourteen lines should not be changed by user overlay as these go
  497. ; to specific locations in the main program, not in the overlay.
  498. ;
  499. J$CMDSPL: DS    3        ; Allows entry of baudrate on CMD line    16EH
  500. J$CRLF:      DS    3        ; Turns up one new line on display    171H
  501. J$DIAL:      DS    3        ; Start of dialing routine        174H
  502. J$DSCONT: DS    3        ; Terminates modem use            177H
  503. J$GOLST:  DS    3        ; Printer routine, needed by Apple //e    17AH
  504. J$ILPRT:  DS    3        ; Prints an inline string, 0 to end    17DH
  505. J$INBUF:  DS    3        ; Stores a keybd string for comparison    180H
  506. J$INLNCP: DS    3        ; Inline "compare strings" routine    183H
  507. J$INMDM:  DS    3        ; Max .1 sec wait for modem character    186H
  508. J$RCVRSP: DS    3        ; For 3801 I/O use (TV-803)        189H
  509. J$SNDCHR: DS    3        ; Sends a character to the modem    18CH
  510. J$SNDSTR: DS    3        ; Sends a string to the modem, $ to end 18FH
  511. J$TIMER:  DS    3        ; .1 second timer (amount in 'B' reg.)    192H
  512. J$BREAK:  JMP    SENDBRK        ; Break routine             195H
  513. J$NEW2:      DB    0,0,0        ; For future needs            198H
  514. ;.....
  515. ;
  516. ;
  517. ; For 2400 bps auto-stepdown units
  518. ;
  519. MANUAL:      DB    0        ; For manual selection flag        19BH
  520. J$300:      JMP    OK300        ; Sets baudrate to 300 baud        19CH
  521. J$1200:      JMP    OK1200        ; Sets baudrate to 1200 bps        19FH
  522. J$2400:      JMP    OK2400        ; Sets baudrate to 2400 bps        1A2H
  523. ;.....
  524. ;
  525. ;
  526. LOGPTR:    DW    LOGON        ; Pointer to display LOGON message    1A5H
  527. ;
  528. SYSVR:    CALL    J$ILPRT        ; Display the following line        1A7H
  529.      IF    BASIS
  530.     DB    'Basis 108 with built in serial port ',CR,LF    ;    1AAH
  531.     DB    0
  532.     RET
  533.      ENDIF            ; BASIS
  534. ;
  535.      IF    NOT BASIS
  536.     DB    'Apple ][ with '
  537.      ENDIF            ; NOT BASIS
  538. ;
  539.      IF    ALSCARD
  540.     DB    'ALS CP/M Card'
  541.      ENDIF            ; ALSCARD
  542. ;
  543.      IF    PCPI
  544.     DB    'PCPI Applicard'
  545.      ENDIF            ; PCPI
  546. ;
  547.      IF    APPLIED
  548.     DB    'Applied Engineering'
  549.      ENDIF            ; APPLIED
  550. ;
  551.      IF    MICROSOFT
  552.     DB    'CP/M 2.2 Card'
  553.      ENDIF            ; MICROSOFT
  554. ;
  555.     DB    CR,LF,'  and '
  556. ;
  557.      IF    VERSA
  558.     DB    'VERSAcard'
  559.      ENDIF            ; VERSA
  560. ;
  561.      IF    ALSDSP
  562.     DB    'ALS Dispatcher'
  563.      ENDIF            ; ALSDSP
  564. ;
  565.      IF    APR
  566.     DB    'Apricorn serial card'
  567.      ENDIF            ; APR
  568. ;
  569.      IF    CCS
  570.     DB    'CCS 7710 Card'
  571.      ENDIF            ; CCS
  572. ;
  573.      IF    COMCARD
  574.     DB    'Comcard'
  575.      ENDIF            ; COMCARD
  576. ;
  577.      IF    CPS
  578.     DB    'CPS card - serial function'
  579.      ENDIF            ; CPS
  580. ;
  581.      IF    SSC
  582.     DB    'Super Serial Card'
  583.      ENDIF            ; SSC
  584. ;
  585.      IF    SSM
  586.     DB    'SSM Serial Interface'
  587.      ENDIF            ; SSM
  588. ;
  589.      IF    NOT    BASIS
  590.     DB    ' in slot ',SLOT+30H,CR,LF
  591.     DB    0
  592.     RET
  593.      ENDIF            ; NOT BASIS
  594. ;.....
  595. ;
  596. ;
  597. ;-----------------------------------------------------------------------
  598. ;
  599. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  600. ;     end of your last routine should terminate by 0400H (601 bytes
  601. ;     available after start of SYSVER).
  602. ;
  603. ;-----------------------------------------------------------------------
  604. ;
  605. ; You can put in a message at this location which can be called up with
  606. ; (special character-L).  You can put in several lines.  End with a 0.
  607. ;
  608. LOGON:    DB    'Hello from a happy computer user',CR,0
  609. ;
  610. ;-----------------------------------------------------------------------
  611. ;
  612. ; This routine sends a break tone for 300 ms
  613. ;
  614. SENDBRK:
  615.      IF    CPS
  616.     MVI    A,80H        ; Open command
  617.     CALL    SNDMDCR
  618.     MVI    A,3FH        ; Keeps DTR, sends break tone
  619.     JMP    GOODBYE1
  620.      ENDIF            ; CPS
  621. ;
  622.      IF    BASIS OR SSC
  623.     MVI    A,0FH
  624.     JMP    GOODBYE+2
  625.      ENDIF            ; BASIS OR SSC
  626. ;
  627.      IF    APR OR CCS OR VERSA
  628.     CALL    RCVCTL1        ; Get the current status and speed
  629.     STA    SBTEMP        ; Store it for now
  630.     MVI    A,0F5H        ; Set break tone
  631.     JMP    GOODBYE1    ; Send the 300 ms break tone
  632.      ENDIF            ; APR OR CCS OR VERSA
  633. ;
  634.     RET            ; Any others, exit with no break tone
  635. ;.....
  636. ;
  637. ;
  638. SBTEMP:    DB    0        ; Temporary storage to remember speed
  639. ;.....
  640. ;
  641. ;
  642. ; This routine sets DTR low for 300 ms to disconnect the phone
  643. ;
  644.      IF    APR OR CCS OR VERSA
  645. GOODBYE:
  646.     CALL    RCVCTL1        ; Get the current status and speed
  647.     STA    SBTEMP        ; Store it for now
  648.     MVI    A,0D5H        ; Turn off DTR
  649. ;
  650. GOODBYE1:
  651.     CALL    SNDCTL1        ; Send to the Modem
  652.     MVI    B,3        ; Delay 300 ms to hang up phone
  653.     CALL    J$TIMER
  654.     LDA    SBTEMP        ; Get original status and speed back
  655.     CALL    SNDCTL1
  656.     MVI    A,0B5H        ; Turn everything back on
  657.     CALL    SNDCTL1
  658.     XTHL            ; Short delay to complete command
  659.     XTHL
  660.     RET
  661.       ENDIF            ; APR OR CCS OR VERSA
  662. ;
  663.      IF    SSC OR BASIS
  664. GOODBYE:
  665.     MVI    A,0AH        ; Turn off DTR
  666.     CALL    SNDCTL2
  667.     MVI    B,3        ; Delay 300 ms to hang up phone
  668.     CALL    J$TIMER
  669.     MVI    A,0BH        ; Set DTR, Rx, Irq
  670.     CALL    SNDCTL2
  671.     XTHL            ; Short delay to complete command
  672.     XTHL
  673.     RET
  674.      ENDIF            ; SSC or BASIS
  675. ;
  676.      IF    CPS
  677. GOODBYE:
  678.     MVI    A,80H        ; Open command
  679.     CALL    SNDMDCR
  680.     MVI    A,1DH        ; RTS, DTR off, send break
  681. ;
  682. GOODBYE1:
  683.     CALL    SNDCTL1
  684.     MVI    B,3        ; Delay 300 ms to hang up phone
  685.     CALL    J$TIMER
  686.     MVI    A,37H        ; RTS, ERR reset errors, Rx, DTR, Tx
  687.     CALL    SNDCTL1
  688.     MVI    A,0        ; Close command
  689.     CALL    SNDMDCR
  690.     MVI    B,5        ; Short delay to complete command
  691.     CALL    J$TIMER
  692.     RET
  693.      ENDIF            ; CPS
  694. ;
  695. ;
  696. ; If none of the above, then set NODTR to YES to disconnect with ATH0
  697. ;
  698.     CALL    J$ILPRT
  699.     DB    CR,LF,'++ DOES NOT DROP DTR, USE "BYE" ++',BELL,CR,LF,0
  700.     RET            ; Just in case was none of these
  701. ;.....
  702. ;
  703. ;
  704. ;=========================== INITMOD ===================================
  705. ;
  706. ;
  707.      IF    ALSCARD
  708. INITMOD:
  709.     LHLD    1        ; Initialize our local jumps to the BIOS
  710.     LXI    D,60H
  711.     DAD    D
  712.     SHLD    APREAD+1
  713.     INX    H
  714.     INX    H
  715.     INX    H
  716.     SHLD    APWRITE+1
  717.     RET
  718.      ENDIF            ; ALSCARD
  719. ;.....
  720. ;
  721. ;
  722.      IF    APR OR CCS
  723. INITMOD:
  724.     LDA    MSPEED        ; Get the selected value
  725.     CPI    1        ; 300 bps
  726.     JZ    OK300
  727.     CPI    5        ; 1200 bps
  728.     JZ    OK1200
  729.     CPI    6        ; 2400 bps
  730.     JZ    OK2400
  731.     CPI    8        ; 9600 bps
  732.     JZ    OK9600
  733.     JMP    STUPR1        ; Else ask what is wanted
  734. ;
  735. INITMOD1:
  736.     MOV    A,B        ; Get the baudrate back, 8 bits 1 stop
  737.     CALL    SNDCTL1        ; ACIA control register
  738.     XTHL            ; Short delay to complete command
  739.     XTHL
  740.     RET
  741.      ENDIF            ; APR OR CCS
  742. ;.....
  743. ;
  744. ;
  745. ; The following may be used to initialize the Mountain Hardware CPS
  746. ; Multifunction Card.
  747. ;
  748.      IF    CPS
  749. INITMOD:
  750.     CALL    OK300        ; Necessary for cold boot
  751.     CALL    CPSPRINT    ; Install special CPS printer routine
  752.     LDA    MSPEED        ; Get the selected value
  753.     CPI    1        ; 300 bps
  754.     JZ    OK300
  755.     CPI    5        ; 1200 bps
  756.     JZ    OK1200
  757.     CPI    6        ; 2400 bps
  758.     JZ    OK2400
  759.     CPI    8        ; 9600 bps
  760.     JZ    OK9600
  761.     JMP    STUPR1        ; Else ask what is wanted
  762. ;.....
  763. ;
  764. ;
  765. INITMOD1:
  766.     MVI    A,80H        ; Open command
  767.     CALL    SNDMDCR
  768.     MVI    A,4EH        ; 1 stop, 8 bits, 16x
  769.     CALL    SNDDATP
  770.     MOV    A,B        ; Get the baudrate back
  771.     CALL    SNDDATP
  772.     MVI    A,37H        ; RTS, ERR reset errors, Rx, DTR, Tx
  773.     CALL    SNDCTL1
  774.     XRA    A        ; Close command
  775.     CALL    SNDMDCR
  776.     MVI    B,5        ; 1/2 second delay for CPS board
  777.     CALL    J$TIMER
  778.     RET
  779.      ENDIF            ; CPS
  780. ;.....
  781. ;
  782. ;
  783.      IF    BASIS OR SSC
  784. INITMOD:
  785.     MVI    A,0BH        ; Set DTR, Rx, Irq
  786.     CALL    SNDCTL2
  787.     XTHL            ; Short delay to complete command
  788.     XTHL
  789. ;
  790.     LDA    MSPEED        ; Get the selected value
  791.     CPI    1        ; 300 bps
  792.     JZ    OK300
  793.     CPI    5        ; 1200 bps
  794.     JZ    OK1200
  795.     CPI    6        ; 2400 bps
  796.     JZ    OK2400
  797.     CPI    8        ; 9600 bps
  798.     JZ    OK9600
  799.     JMP    STUPR1        ; Else ask what is wanted
  800. ;.....
  801. ;
  802. ;
  803. INITMOD1:
  804.     MOV    A,B        ; Get the baudrate back
  805.     CALL    SNDCTL3        ; Store default baudrate
  806.     XTHL            ; Short delay to complete command
  807.     XTHL
  808.     RET
  809.      ENDIF            ; BASIS OR SSC
  810. ;.....
  811. ;
  812. ;
  813. ; The following routine initializes the VERSAcard to the default baud
  814. ; rate which is set at MSPEED above.  If MSPEED is set to something
  815. ; other than 300 or 1200 this routine does not alter the annunciator
  816. ; settings.
  817. ;
  818.      IF    VERSA
  819. INITMOD:
  820.     RET
  821. ;
  822. INITMOD1:
  823.     LDA    MSPEED        ; Set annunciators to known state
  824.     CPI    1        ; Is it 300 ?
  825.     JZ    OK300
  826.     CPI    5        ; Is it 1200 ?
  827.     JZ    OK1200
  828.     RET
  829.      ENDIF            ; VERSA
  830. ;.....
  831. ;
  832. ;
  833. ; If none of the above cards
  834. ;
  835.     MVI    A,0FFH        ; These systems do not support DTR
  836.     STA    NODTR        ; So set 'NODTR:' for sending ATH0
  837.     RET            ; From 'CALL INITMOD'
  838. ;.....
  839. ;
  840. ;
  841. ; The routine that checks to see if the printer is ready does not work
  842. ; with the CPS card.  This routine changes it.    It overwrites the area
  843. ; in the main program that normally checks printer status from a BDOS
  844. ; call with our own status checks.
  845. ;
  846. CPSPRINT:
  847.      IF    CPS AND    CPSPRT    ; If printer uses CPS printer port
  848.     CALL    J$GOLST        ; Get GOLIST+1 in 'HL'
  849.     LXI    B,PRCHECK    ; Put routine at GOLIST+1
  850.     MOV    M,C
  851.     INX    H
  852.     MOV    M,D
  853.     XCHG            ; Now get GOLIST+15 into 'HL' from 'DE'
  854.     LXI    B,PRINTCHAR    ; Put routine at GOLIST+15
  855.     MOV    M,C
  856.     INX    H
  857.     MOV    M,D
  858.     RET
  859. ;.....
  860. ;
  861. ;
  862. ; Substitute routines for status checks and printing:
  863. ;
  864. PRCHECK:CALL    RCVCPST        ; Read the status port
  865.     ANI    40H        ; Mask off unused bits
  866.     RET
  867. ;.....
  868. ;
  869. ;
  870. PRINTCHAR:
  871.     MOV    A,C        ; Move character to 'A' register
  872.     JMP    SNDCPRT        ; Send it to the printer
  873.      ENDIF            ; CPS AND CPSPRT
  874. ;
  875.     RET            ; In case CPSPRT was set to 'NO'
  876. ;.....
  877. ;
  878. ;
  879. ;========================== APPLE I/O ==================================
  880. ;
  881.      IF    APPLIED    OR BASIS OR MICROSOFT
  882. SNDCTL1:STA    MDCTL1
  883.     RET
  884. ;
  885. SNDDATP:STA    MDDATP
  886.     RET
  887. ;
  888. RCVCTL1:LDA    MDCTL1
  889.     RET
  890. ;
  891. RCVDATP:LDA    MDDATP
  892.     RET
  893.      ENDIF            ; APPLIED OR BASIS OR MICROSOFT
  894. ;.....
  895. ;
  896. ;
  897.       IF    CPS AND    (APPLIED OR MICROSOFT)
  898. SNDCPRT: STA    MDCPRT
  899.      RET
  900. ;
  901. SNDMDCR: STA    MDCR
  902.      RET
  903. ;
  904. RCVCPST: LDA    MDCPST
  905.      RET
  906.       ENDIF            ; CPS AND (APPLIED OR MICROSOFT)
  907. ;.....
  908. ;
  909. ;
  910.       IF    BASIS OR SSC AND (APPLIED OR MICROSOFT)
  911. RCVCTL2: LDA    MDCTL2
  912.      RET
  913. ;
  914. RCVCTL3: LDA    MDCTL3
  915.      RET
  916. ;
  917. SNDCTL2: STA    MDCTL2
  918.      RET
  919. ;
  920. SNDCTL3: STA    MDCTL3
  921.      RET
  922.       ENDIF            ; BASIS OR SSC AND (APPLIED OR MICROSOFT)
  923. ;.....
  924. ;
  925. ;
  926.       IF    VERSA AND (APPLIED OR MICROSOFT)
  927. RCVAN3C: LDA    AN3CLR
  928.      RET
  929. ;
  930. RCVAN3S: LDA    AN3SET
  931.      RET
  932.      ENDIF            ; VERSA AND (APPLIED OR MICROSOFT)
  933. ;.....
  934. ;
  935. ;
  936.       IF    ALSCARD
  937. SNDCTL1: PUSH    H
  938.      LXI    H,MDCTL1
  939.      JMP    POKE
  940. ;
  941. SNDDATP: PUSH    H
  942.      LXI    H,MDDATP
  943. ;
  944. POKE:     PUSH    D
  945.      PUSH    B
  946.      CALL    APWRITE
  947.      POP    B
  948.      POP    D
  949.      POP    H
  950.      RET
  951.       ENDIF            ; ALSCARD
  952. ;.....
  953. ;
  954. ;
  955.       IF    ALSCARD
  956. RCVCTL1: PUSH    H
  957.      LXI    H,MDCTL1
  958.      JMP    PEEK
  959. ;
  960. RCVDATP: PUSH    H
  961.      LXI    H,MDDATP
  962. ;
  963. PEEK:     PUSH    D
  964.      PUSH    B
  965.      CALL    APREAD
  966.      POP    B
  967.      POP    D
  968.      POP    H
  969.      RET
  970. ;.....
  971. ;
  972. ;
  973. ; These are the jump locations to the ALS BIOS
  974. ;
  975. APREAD:     JMP    $-$
  976. APWRITE: JMP    $-$
  977.       ENDIF            ; ALSCARD
  978. ;.....
  979. ;
  980. ;
  981.       IF    ALSCARD    AND CPS
  982. SNDCPRT: PUSH    H
  983.      LXI    H,MDCPRT
  984.      JMP    POKE
  985. ;
  986. SNDMDCR: PUSH    H
  987.      LXI    H,MDCR
  988.      JMP    POKE
  989. ;
  990. RCVCPST: PUSH    H
  991.      LXI    H,MDCPST
  992.      JMP    PEEK
  993.       ENDIF            ; ALSCARD AND CPS
  994. ;.....
  995. ;
  996. ;
  997.       IF    ALSCARD    AND SSC
  998. RCVCTL3: PUSH    H
  999.      LXI    H,MDCTL3
  1000.      JMP    PEEK
  1001. ;
  1002. SNDCTL2: PUSH    H
  1003.      LXI    H,MDCTL2
  1004.      JMP    POKE
  1005. ;
  1006. SNDCTL3: PUSH    H
  1007.      LXI    H,MDCTL3
  1008.      JMP    POKE
  1009.       ENDIF            ; ALSCARD AND SSC
  1010. ;.....
  1011. ;
  1012. ;
  1013.       IF    ALSCARD    AND VERSA
  1014. RCVAN3C: PUSH    H
  1015.      LXI    H,AN3CLR
  1016.      JMP    PEEK
  1017. ;
  1018. RCVAN3S: PUSH    H
  1019.      LXI    H,AN3SET
  1020.      JMP    PEEK
  1021.       ENDIF            ; ALSCARD AND VERSA
  1022. ;.....
  1023. ;
  1024. ;
  1025.       IF    PCPI
  1026. RDBYTE     EQU    0FFE0H        ; Read 1 byte from Apple (A = byte)
  1027. WRBYTE     EQU    0FFE3H        ; Write 1 byte to Apple (C = byte)
  1028. RDWORD     EQU    0FFE6H        ; Read 2 bytes from Apple (DE = word)
  1029. WRWORD     EQU    0FFE9H        ; Write 2 bytes to Apple (DE = word)
  1030. PEEK1     EQU    6        ; Command
  1031. POKE1     EQU    7        ; Command
  1032. ;
  1033. SNDCTL1: PUSH    D
  1034.      LXI    D,MDCTL1
  1035.      JMP    POKE
  1036. ;
  1037. SNDDATP: PUSH    D
  1038.      LXI    D,MDDATP
  1039. ;
  1040. POKE:     PUSH    B
  1041.      MOV    B,A
  1042.      MVI    C,POKE1
  1043.      CALL    WRBYTE
  1044.      CALL    WRWORD
  1045.      MOV    C,B
  1046.      CALL    WRBYTE
  1047.      POP    B
  1048.      POP    D
  1049.      RET
  1050. ;...
  1051. ;
  1052. ;
  1053. RCVCTL1: PUSH    D
  1054.      LXI    D,MDCTL1
  1055.      JMP    PEEK
  1056. ;
  1057. RCVDATP: PUSH    D
  1058.      LXI    D,MDDATP
  1059. ;
  1060. PEEK:     PUSH    B
  1061.      MVI    C,PEEK1
  1062.      CALL    WRBYTE
  1063.      CALL    WRWORD
  1064.      CALL    RDBYTE
  1065.      POP    B
  1066.      POP    D
  1067.      RET
  1068.       ENDIF            ; PCPI
  1069. ;.....
  1070. ;
  1071. ;
  1072.       IF    PCPI AND CPS
  1073. SNDCPRT: PUSH    D
  1074.      LXI    D,MDCPRT
  1075.      JMP    POKE
  1076. ;
  1077. SNDMDCR: PUSH    D
  1078.      LXI    D,MDCR
  1079.      JMP    POKE
  1080. ;
  1081. RCVCPST: PUSH    D
  1082.      LXI    D,MDCPST
  1083.      JMP    PEEK
  1084.       ENDIF            ; PCPI AND CPS
  1085. ;.....
  1086. ;
  1087. ;
  1088.       IF    PCPI AND SSC
  1089. RCVCTL3: PUSH    D
  1090.      LXI    D,MDCTL3
  1091.      JMP    PEEK
  1092. ;
  1093. SNDCTL2: PUSH    D
  1094.      LXI    D,MDCTL2
  1095.      JMP    POKE
  1096. ;
  1097. SNDCTL3: PUSH    D
  1098.      LXI    D,MDCTL3
  1099.      JMP    POKE
  1100.       ENDIF            ; PCPI AND SSC
  1101. ;.....
  1102. ;
  1103. ;
  1104.       IF    PCPI AND VERSA
  1105. RCVAN3C: PUSH    D
  1106.      LXI    H,AN3CLR
  1107.      JMP    PEEK
  1108. ;
  1109. RCVAN3S: PUSH    D
  1110.      LXI    H,AN3SET
  1111.      JMP    PEEK
  1112.       ENDIF            ; PCPI AND VERSA
  1113. ;.....
  1114. ;
  1115. ;
  1116. ;-----------------------------------------------------------------------
  1117. ;
  1118. ; Use the 'SET' command to select a desired baud rate
  1119. ;
  1120. STUPR    EQU    $
  1121. ;
  1122.      IF    ALSDSP OR COMCARD OR SSM
  1123.     RET
  1124.      ENDIF            ; ALSDSP OR COMCARD OR SSM
  1125. ;
  1126.      IF    NOT ALSDSP OR NOT COMCARD OR NOT SSM
  1127.     CALL    J$CMDSPL    ; Gives us CMDBUF+6
  1128.     JNC    STUPR2
  1129. ;
  1130. STUPR1:    CALL    J$ILPRT
  1131.     DB    'Input Baud Rate (300, 1200, 2400, 9600): ',0
  1132.     LXI    D,BAUDBUF    ; Point to new input buffer
  1133.     CALL    J$INBUF
  1134.     CALL    J$CRLF
  1135.     LXI    D,BAUDBUF+2
  1136. ;
  1137. STUPR2:    CALL    J$INLNCP    ; Compare BAUDBUF+2 with chars. below
  1138.     DB    '300',0
  1139.     JNC    OK300        ; Go if got match
  1140.     CALL    J$INLNCP
  1141.     DB    '1200',0
  1142.     JNC    OK1200
  1143.     CALL    J$INLNCP
  1144.     DB    '2400',0
  1145.     JNC    OK2400
  1146.     CALL    J$INLNCP
  1147.     DB    '9600',0
  1148.     JNC    OK9600
  1149.     CALL    J$ILPRT        ; All matches failed, tell operator
  1150.     DB    '++ Incorrect entry ++',CR,LF,BELL,CR,LF,0
  1151.     JMP    STUPR1        ; Try again
  1152. ;
  1153.      IF    NOT (ALSDSP OR VERSA)
  1154. OK300:    MVI    A,1        ; MSPEED 300 baud value
  1155.     MVI    B,BD300        ; Get 300 baud value for 2651 in 'B'
  1156.     JMP    LOADBD        ; Go load everything
  1157. ;
  1158. OK1200:    MVI    A,5
  1159.     MVI    B,BD1200
  1160.     JMP    LOADBD
  1161. ;
  1162. OK2400:    XRA    A
  1163.     STA    MANUAL
  1164.     MVI    A,6
  1165.     MVI    B,BD2400
  1166.     JMP    LOADBD
  1167. ;
  1168. OK9600:    MVI    A,8
  1169.     MVI    B,BD9600
  1170. ;
  1171. LOADBD:    STA    MSPEED        ; Change time-to-send to match baudrate
  1172.     JMP    INITMOD1    ; Reset to new baudrate
  1173.      ENDIF            ; NOT (ALSDSP OR VERSA)
  1174. ;.....
  1175. ;
  1176. ;
  1177.      IF    ALSDSP
  1178. OK300:
  1179. OK1200:
  1180. OK2400:
  1181. OK9600:    RET
  1182.      ENDIF            ; ALSDSP
  1183. ;
  1184.      IF    VERSA
  1185. OK300:    CALL    RCVAN3C        ; Clear Annunciator #3 for 300 baud
  1186.     MVI    A,1        ; Set MSPEED for 300 baud
  1187.     STA    MSPEED        ; For 300 baud
  1188.     RET
  1189. ;
  1190. OK1200:    CALL    RCVAN3S        ; Set Annunciator #3 for 1200 baud
  1191.     MVI    A,5        ; Set MSPEED for 1200 bps
  1192.     STA    MSPEED        ; For 1200 baud
  1193.     RET
  1194. ;
  1195. OK2400:    JMP    OK1200        ; Does not support 2400 bps
  1196. ;
  1197. OK9600:    JMP    OK1200        ; Does not support 9600 bps
  1198.      ENDIF            ; VERSACARD
  1199. ;.....
  1200. ;
  1201. ;
  1202. ; Table of baud rate parameters
  1203. ;
  1204.      IF    APR OR CCS
  1205. BD300    EQU    16H        ; Divide by 64 (set by last 2 bits 10)
  1206. BD1200    EQU    15H        ; Divide by 16 (set by last 2 bits 01)
  1207. BD2400    EQU    00H        ; See note at the top for other speeds
  1208. BD9600    EQU    00H
  1209.      ENDIF            ; APR OR CCS
  1210. ;
  1211.      IF    CPS
  1212. BD300    EQU    35H
  1213. BD1200    EQU    37H
  1214. BD2400    EQU    3AH
  1215. BD9600    EQU    3EH
  1216.      ENDIF            ; CPS
  1217. ;
  1218.      IF    SSC OR BASIS
  1219. BD300    EQU    16H
  1220. BD1200    EQU    18H
  1221. BD2400    EQU    1AH
  1222. BD9600    EQU    1EH
  1223.      ENDIF            ; SSC
  1224. ;
  1225. BAUDBUF:DB    10,0,0,0,0,0
  1226.     DB    0,0,0,0,0,0
  1227. ;
  1228.      ENDIF            ; NOT ALSDSP OR NOT COMCARD OR NOT SSM
  1229. ;.....
  1230. ;
  1231. ;
  1232. ;-----------------------------------------------------------------------
  1233. ; NOTE: Must terminate prior to 0400H
  1234. ;
  1235.     END
  1236.