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 / CPM / IMP / I2AP-10.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  31KB  |  1,267 lines

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