home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / modem / mxh-oexz.asm < prev    next >
Encoding:
Assembly Source File  |  1994-09-02  |  29.1 KB  |  1,107 lines

  1. ;     Title  'MexPlus Overlay for the Osborne Executive Computer Version 1.0'
  2. ;    Modelled from MXO-KP41.ASM Overlay
  3. ;            - Dick LeBleu
  4. ;
  5. ; Misc equates
  6. ;
  7. REV    EQU    10        ;OVERLAY REVISION LEVEL
  8. ;
  9. NO    EQU    0
  10. YES    EQU    0FFH
  11. ;
  12. TPA    EQU    100H
  13. ;
  14. CR    EQU    13
  15. LF    EQU    10
  16. TAB    EQU    9
  17. ;
  18. ;
  19. ;  A full-featured SET command processor
  20. ;  is implemented to select between modems as well as set
  21. ;  specific characteristics of each one.  The following table
  22. ;  outlines the SET command options:
  23. ;
  24. ;    SET Command
  25. ;
  26. ;    PORT (Modem,Printer)               NOT ANY MORE
  27. ;    DELAY <n> (seconds)           YES
  28. ;    BAUD <rate>               YES
  29. ;    ORIG (originate mode)           YES
  30. ;    ANSWER    (mode)               YES
  31. ;    MONITOR (speaker on)           YES
  32. ;    QUIET (speaker off)           YES
  33. ;    PARITY (Odd, Even, None)       YES
  34. ;    STOPBITS (1, 1.5, 2)           YES
  35. ;    LENGTH (5, 6, 7, or 8)           YES
  36. ;    MANUALO (turn off carrier tone       YES
  37. ;        for Originate mode)
  38. ;    MANUALA (turn on carrier tone       YES
  39. ;        for Answer mode)
  40. ;
  41. ;............
  42. ;
  43. ;
  44. ;  This overlay includes portions of the smartmodem dialing routine from
  45. ;  MXO-SM13.ASM by Ron Fowler.
  46. ;
  47. ;  This overlay is intended to be fully compatible with the
  48. ;  MEX structure and should be readily upward compatible with
  49. ;  the predicted MEX 2.0.
  50. ;
  51. ;  Calling conventions for the various overlay entry points
  52. ;  are detailed more fully in the PMMI overlay (MXO-PMxx.ASM,
  53. ;  where xx=revision number).
  54. ;
  55. ;  History:
  56. ;;11/30/88     I discovered that this overlay is apparently too
  57. ;;         big for use with Z3PLUS (or something?). When I 
  58. ;;         got Z3PLUS, (and after a lot of PEEKing both in
  59. ;;         and out of MEX+) I discovered that when I ran 
  60. ;;         MEX+ with this overlay installed, it "trashed"
  61. ;;         the first 4 bytes in the Z3ENV so ZCPR specific
  62. ;;          programs would not run.  However I like most features
  63. ;;               of the improved SET command.  I re-wrote nothing.
  64. ;;          All I did was get rid of the PORT switching (which
  65. ;;         I never had a use for) parts of the SET command.
  66. ;;         Everything that I commented out has two semi-colons
  67. ;;         (like this comment) in front of it so others with more
  68. ;;         knowledge can perhaps find a smarter fix.  This overlay
  69. ;;         is a little smaller in size and causes no problems on
  70. ;;               my Exec. with Z3PLUS.
  71. ;;                                Don Strait, Cincinnati, OH.  
  72. ; 04/04/87       Revised for Osborne Executive computer for use
  73. ;         with both modem and printer ports
  74. ;
  75. ; 08/03/86  1.0  Modified for MexPlus by Dick Le Bleu. Removed
  76. ;         Tone and Pulse Dial since they are now a STAT
  77. ;         command.  Also most routines for the Dial and
  78. ;         Smdisconnect have been removed. All references
  79. ;         to Anchor modems removed since MexPlus can now
  80. ;         be STAT to SMDISC instead of DTR type DISC.
  81. ;
  82. ; 30/12/85  1.0  Modified for iBEX by Dick Le Bleu.  Added set port
  83. ;         command for switching between port A(Blue) and
  84. ;         B(Black).
  85. ;
  86. ;  9/19/84  4.1  Fixed DISCON1 routine for non-Anchors, was leaving
  87. ;         DTR and RTS off, now lowers them for one sec and
  88. ;         raises it.. Also added code to dial routine to allow
  89. ;         any character (other than ^C) typed during a dial
  90. ;         command to abort THAT dial attempt, but will
  91. ;         proceed with repetition or next command. ^C will
  92. ;         abort call in progress and any other CALL cmds
  93. ;         lined up. (This is for "dumb" Smartmodems that
  94. ;         don't detect busy, if you hear busy, just hit
  95. ;         the space bar and it will give it up and try the
  96. ;         next one or try calling again.) -- Kim Levitt
  97. ;
  98. ;  9/9/84   4.0  Upgraded internal modem support to include
  99. ;         SET PARITY, STOPBITS, and LENGTH.
  100. ;         Corrected error when setting STOPBITS to 1.5, which
  101. ;         was resetting parity off at the same time.  With the
  102. ;         the improvements to the internal modem support, all
  103. ;         features of SUPRTERM are now supported by this overlay.
  104. ;         Enhanced SET MANUAL processing for internal modem
  105. ;         to support manual Originate or Answer carrier tones.
  106. ;         Version level changed to eliminate confusion between
  107. ;         2.X and 3.X overlays currently in circulation.
  108. ;         Updated comments and documentation in all sections.
  109. ;                           Terry Carroll
  110. ;
  111. ;  8/26/84  2.8  Added equate to support Anchor Signalman Mark XII modem.
  112. ;         This overlay now supports DSC, dial abort (^C),
  113. ;         and accurate SET DELAY processing for Anchor modems.
  114. ;         Also incorporated the PARITY, STOPBITS and LENGTH
  115. ;         commands from the Norm Saunders overlay (MXO-KP3X) in
  116. ;         an attempt to unify the MEX overlay identity crisis.
  117. ;
  118. ;  8/03/84  2.7  Added call to DISCON: (disconnect routine) in the
  119. ;         Smartmodem dialing routine at SMDMOFF:.  It appeared that
  120. ;         when either the delay timer timed out or a CTRL -C
  121. ;         abort coincided with a connect, the modem did
  122. ;         connect, even though the overlay responded with
  123. ;         NO ANSWER. Added these calls to make sure there
  124. ;         is no unannounced connect.    John C. Smith
  125. ;
  126. ;  6/10/84  2.6  Undid revision 2.5.  MEX is intended NOT to disconnect
  127. ;         from the phone line on re-entering CPM; DCD detection
  128. ;         supports this function as well as preventing the
  129. ;         modem initialization string from being sent to the
  130. ;         remote computer.  For Smartmodem, set switch 6 up;
  131. ;         for other modems, enable DCD detection.  Also,
  132. ;         the internal modem initialization had been commented
  133. ;         out without documentation.  This defeats one-half
  134. ;         of the value of this overlay.    Restored this
  135. ;         initialization.
  136. ;
  137. ;  6/03/84  2.5  Commented out three lines    Dennis Quinn
  138. ;         at NITMOD2 which prevented    Royal Oak, MI
  139. ;         "off the shelf" Smartmodem
  140. ;         from being initialized.  Reason for this is that
  141. ;         the Smartmodem asserts DCD even when no carrier
  142. ;         is being detected unless the case is opened and
  143. ;         an option switch is set.  Side effect of commenting
  144. ;         out these lines is re-entering MEX will transmit
  145. ;         the initialization sequence to the remote if you
  146. ;         are on-line.  If you set the appropriate option
  147. ;         switch (I can't remember which switch it is and
  148. ;         my Smartmodem book is at the office), uncomment
  149. ;         the code and all will be well.
  150. ;
  151. ;  6/02/84  2.4  Code was turning off RTS    Dennis Quinn
  152. ;         after disconnect sequence.    Royal Oak, MI
  153. ;         This was causing problems
  154. ;         with certain modems which are more intelligent than
  155. ;         the Smartmodem and require RTS before they will
  156. ;         assert CTS.  Enabled 110 baud operation for those
  157. ;         who are masochists.
  158. ;
  159. ;
  160. ;  5/29/84  2.2  Corrected SET ? to display    Steve Sanders
  161. ;         proper SET ORIG command instead
  162. ;         of SET ORIGINATE
  163. ;
  164. ;  5/18/84  1.0  Original version        John Smith - Manlius, NY
  165. ;
  166. ;  Credits:
  167. ;
  168. ;  M7KP-1 overlay structure by Irv Hoff
  169. ;  Smartmodem dialing routine by Ron Fowler
  170. ;
  171. ;  Bug Reports:
  172. ;
  173. ;  Would appreciate a note of any problems be left on the
  174. ;  Computers Etc. RBBS at 315-446-7793.
  175. ;
  176. ;
  177. ;------------------------------------------------------------
  178. ;
  179. ; Osborne default port definitions
  180. ;
  181. MODEM    EQU    YES        ; Modem Port selected
  182. ;;PRNT    EQU    NO        ; Printer Port selected
  183. DCD    EQU    YES        ;if supported by port
  184. ;
  185.     IF    MODEM
  186. EXPORT    EQU    0CH        ;base external port
  187. SELPRT    EQU    0
  188.     ENDIF            ;modem port
  189. ;
  190. ;;IF    PRNT
  191. ;;EXPORT    EQU    0EH        ;base external port
  192. ;;SELPRT    EQU    0FFH
  193. ;;    ENDIF            ;printer port
  194.  
  195. EXTCT1    EQU    EXPORT+1    ;external modem status port
  196. EXTDAT    EQU    EXPORT        ;external modem data port
  197. ;
  198. BRPORT    EQU    04H        ; CTC timer port to set baudrate
  199. ;
  200. ; Executive bit definitions
  201. ;
  202. MDRCVB    EQU    01H        ;modem receive bit (DAV)
  203. MDRCVR    EQU    01H        ;modem receive ready
  204. MDSNDB    EQU    04H        ;modem send bit
  205. MDSNDR    EQU    04H        ;modem send ready bit
  206. MDSDCD    EQU    08H        ;modem DCD ready bit
  207. ;
  208. ; MEX Service Processor
  209. ;
  210. MEX    EQU    0D00H        ;address of the service processor
  211. INMDM    EQU    255        ;get char from port to A, CY=no more in 100 ms
  212. TIMER    EQU    254        ;delay 100ms * reg B
  213. TMDINP    EQU    253        ;B=# secs to wait for char, cy=no char
  214. CHEKCC    EQU    252        ;check for ^C from KBD, Z=present
  215. SNDRDY    EQU    251        ;test for modem-send ready
  216. RCVRDY    EQU    250        ;test for modem-receive ready
  217. SNDCHR    EQU    249        ;send a character to the modem (after sndrdy)
  218. RCVCHR    EQU    248        ;recv a char from modem (after rcvrdy)
  219. LOOKUP    EQU    247        ;table search: see CMDTBL comments for info
  220. PARSFN    EQU    246        ;parse filename from input stream
  221. BDPARS    EQU    245        ;parse baud-rate from input stream
  222. SBLANK    EQU    244        ;scan input stream to next non-blank
  223. EVALA    EQU    243        ;evaluate numeric from input stream
  224. LKAHED    EQU    242        ;get nxt char w/o removing from input
  225. GNC    EQU    241        ;get char from input, cy=1 if none
  226. ILP    EQU    240        ;inline print
  227. DECOUT    EQU    239        ;decimal output
  228. PRBAUD    EQU    238        ;print baud rate
  229. ;
  230. CONOUT    EQU    2        ;simulated BDOS function 2: console char out
  231. PRINT    EQU    9        ;simulated BDOS function 9: print string
  232. INBUF    EQU    10        ;input buffer, same structure as BDOS 10
  233. ;
  234. DCONIO    EQU    6        ;BDOS Direct Console I/O function #
  235. DCONIN    EQU    0FFH        ;BDOS DCONIO flag for input
  236. BDOS    EQU    5        ;address of BDOS function caller
  237. ;
  238. ;
  239.     ORG    TPA        ;we begin
  240. ;
  241.     DB    0C3H        ;flags a LOADable overlay
  242.     DS    2        ;MEX has a JMP START here
  243. ;
  244.     DS    2        ;not used by MEX
  245. TPULSE:    DB    'T'        ;T=touch, P=pulse (Used by this overlay)
  246. CLOCK:    DB    40        ;clock speed x .1, up to 25.5 mhz.
  247. MSPEED:    DB    5        ;sets display time for sending a file
  248.                 ;0=110    1=300  2=450  3=600  4=710
  249.                 ;5=1200 6=2400 7=4800 8=9600 9=19200
  250. BYTDLY:    DB    5        ;default time to send character in
  251.                 ;terminal mode file transfer (0-9)
  252.                 ;0=0 delay, 1=10 ms, 5=50 ms, 9=90 ms
  253. CRDLY:    DB    5        ;end-of-line delay after CRLF in terminal
  254.                 ;mode file transfer for slow BBS systems
  255.                 ;0=0 delay, 1=100 ms, 5=500 ms, 9=900 ms
  256. COLUMS:    DB    5        ;number of directory columns
  257. SETFL:    DB    YES        ;yes=user-defined SET command
  258. SCRTST:    DB    YES        ;yes=if home cursor and clear screen
  259.                 ;routine at CLRSCRN
  260.     DB    0        ;was once ACKNAK, now spare
  261. BAKFLG:    DB    YES        ;yes=make .BAK file
  262. CRCDFL:    DB    YES        ;yes=default to CRC checking
  263.                 ;no=default to Checksum checking
  264. TOGCRC:    DB    YES        ;yes=allow toggling of Checksum to CRC
  265. CVTBS:    DB    NO        ;yes=convert backspace to rub
  266. TOGLBK:    DB    YES        ;yes=allow toggling of bksp to rub
  267. ADDLF:    DB    NO        ;no=no LF after CR to send file in
  268.                 ;terminal mode (added by remote echo)
  269. TOGLF:    DB    YES        ;yes=allow toggling of LF after CR
  270. TRNLOG:    DB    NO        ;yes=allow transmission of logon
  271.                 ;write logon sequence at location LOGON
  272. SAVCCP:    DB    YES        ;yes=do not overwrite CCP
  273. LOCNXT:    DB    NO        ;yes=local cmd if EXTCHR precedes
  274.                 ;no=not local cmd if EXTCHR precedes
  275. TOGLOC:    DB    YES        ;yes=allow toggling of LOCNXTCHR
  276. LSTTST:    DB    YES        ;yes=allow toggling of printer on/off
  277.                 ;in terminal mode. Set to no if using
  278.                 ;the printer port for the modem
  279. XOFTST:    DB    NO        ;yes=allow testing of XOFF from remote
  280.                 ;while sending a file in terminal mode
  281. XONWT:    DB    NO        ;yes=wait for XON after sending CR while
  282.                 ;transmitting a file in terminal mode
  283. TOGXOF:    DB    YES        ;yes=allow toggling of XOFF testing
  284. IGNCTL:    DB    NO        ;yes=do not send control characters
  285.                 ;above CTL-M to CRT in terminal mode
  286.                 ;no=send any incoming CTL-char to CRT
  287. EXTRA1:    DB    0        ;for future expansion
  288. EXITCHR: DB    'E'-40h        ;for future expansion
  289. BRKCHR:    DB    '@'-40H        ;^B = Send a 300 ms. break tone
  290. NOCONN:    DB    'N'-40H        ;^N = Disconnect from phone line
  291. LOGCHR:    DB    'L'-40H        ;^L = Send logon
  292. LSTCHR:    DB    'P'-40H        ;^P = Toggle printer
  293. UNSVCH:    DB    'R'-40H        ;^R = Close input text buffer
  294. TRNCHR:    DB    'T'-40H        ;^T = Transmit file to remote
  295. SAVCHR:    DB    'Y'-40H        ;^Y = Open input text buffer
  296. EXTCHR:    DB    '^'-40H        ;^^ = Send next character
  297. ;
  298.     DS    2        ;not used
  299. ;
  300. ; Low-level modem I/O routines.
  301. ;
  302. INCTL1:    JMP    INC        ;in modem control port
  303.     DS    7        ;spares if needed for non-PMMI
  304. ;
  305. OTDATA:    JMP    OUTD        ;out modem data port
  306.     DS    7        ;spares if needed for non=PMMI
  307. ;
  308. INPORT:    JMP    IND        ;in modem data port
  309.     DS    7        ;spares if needed for non-PMMI
  310. ;
  311. ; Bit-test routines.
  312. ;
  313. MASKR:    ANI MDRCVB ! RET    ;bit to test for receive ready
  314. TESTR:    CPI MDRCVR ! RET    ;value of receive bit when ready
  315. MASKS:    ANI MDSNDB ! RET    ;bit to test for send ready
  316. TESTS:    CPI MDSNDR ! RET    ;value of send bit when ready
  317. ;
  318. DCDCHK:    JMP    CHKDCD
  319. RNGCHK:    JMP    CHKRNG
  320.     DB    0,0,0,0,0
  321. ;
  322. SMDISC:    DS    3        ;now in mdm ovl (SMDISC)
  323. DIALV:    DS    3        ; "  "  "  "
  324. DISCV:    JMP    DISCON        ;hardware disconnect
  325. GOODBV:    JMP    GOODBYE        ;called before exit to CP/M
  326. INMODV:    JMP    NITMOD        ;initialization. Called at cold-start
  327. NEWBDV:    JMP    PBAUD        ;set baud rate
  328. NOPARV:    RET!NOP!NOP        ;set modem for no-parity
  329. PARITV:    RET!NOP!NOP        ;set modem parity
  330. SETUPV:    JMP    SETCMD        ;SET cmd: jump to a RET if you don't write SET
  331. SPMENV:    RET!NOP!NOP        ;not used with MEX
  332. VERSNV:    JMP    SYSVER        ;Overlay's voice in the sign-on message
  333. BREAKV:    JMP    SBREAK        ;send a break
  334. ;
  335. ; MDM calls supported in MEX 1.0 but not recommended for use.
  336. ;
  337. ILPRTV:    DS    3        ;replace with MEX function 9
  338. INBUFV:    DS    3        ;replace with MEX function 10
  339. ILCMPV:    DS    3        ;replace with table lookup funct. 247
  340. INMDMV:    DS    3        ;replace with MEX function 255
  341. NXSCRV:    DS    3        ;not supported by MEX (returns w/no action)
  342. TIMERV:    DS    3        ;replace with MEX function 254
  343. ;
  344. ; Not required since MexPlus uses terminal overlay
  345. ;
  346. CLREOS:    DS    9        ;clear to end of screen
  347. ;
  348. CLS:    DS    9        ;clear screen
  349. ;
  350.     ORG    0200H
  351. ;------------------------------------------------------------
  352. ;
  353. ; end of fixed area
  354. ;
  355. ;------------------------------------------------------------
  356. ;
  357. ; input control/status port
  358. ;
  359. INC:    MVI    A,10H
  360.     CALL    OUTCTL1
  361.     CALL    INSTAT
  362.     RET
  363. ;
  364. ; * *    All i/o to serial port made through here to allow
  365. ;    changing port address ie Modem vs Printer
  366. ;
  367. ;  write control reg
  368. ;
  369. OUTCTL1:  OUT    EXTCT1
  370.       RET
  371. ;
  372. ;  read status register
  373. ;
  374. INSTAT:      IN    EXTCT1
  375.       RET
  376. ;
  377. ; input data port
  378. ;
  379. IND:    IN    EXTDAT
  380.     RET
  381. ;
  382. ; output data port
  383. ;
  384. OUTD:    OUT    EXTDAT
  385.     RET
  386. ;
  387. ; Check for DCD on
  388. ;
  389. CHKDCD:    PUSH B ! PUSH D    ! PUSH H
  390.     CALL    INC
  391.     ANI    08H
  392.     JZ    DCDRET        ;no carrier present
  393.     MVI    A,0FFH        ;carrier present
  394. DCDRET:    POP H !    POP D !    POP B
  395.     RET
  396. ;
  397. CHKRNG:    XRA    A        ;CLEAR    A
  398.     RET            ;not used
  399. ;
  400. ; Print out the overlay version
  401. ;
  402. SYSVER:      CALL    MILP
  403.       DB    CR,LF
  404.       DB    'MexPlus Overlay - Version for Osborne Executive - '
  405.       DB    REV/10+'0'
  406.       DB    '.'
  407.       DB    REV MOD    10+'0'
  408.       DB    CR,LF
  409.       DB    0
  410.       RET
  411. ;
  412. ; Break, disconnect and goodbye routines
  413. ;
  414. SBREAK:      MVI    A,5
  415.       CALL    OUTCTL1
  416.       LDA    REG5
  417.       ORI    00010000B    ;ENABLE BREAK
  418.       CALL    OUTCTL1
  419.       MVI    B,3        ;DELAY 300 MS.
  420.       CALL    MTIME
  421.       MVI    A,5
  422.       CALL    OUTCTL1
  423.       LDA    REG5
  424.       ANI    11101111B    ;TURN OFF BREAK
  425.       CALL    OUTCTL1
  426.       RET
  427. ;
  428. ; Disconnect Routine
  429. ;
  430. DISCON:      MVI    A,5
  431.       CALL    OUTCTL1        ;SEND TO THE STATUS PORT
  432.       MVI    A,01101000B    ;TURN OFF DTR/RTS
  433.       CALL    OUTCTL1
  434.       MVI    B,10        ;WAIT ONE SECOND
  435.       MVI    C,TIMER
  436.       CALL    MEX
  437.       MVI    A,5        ;TURN IT BACK ON
  438.       CALL    OUTCTL1
  439.       LDA    REG5
  440.       CALL    OUTCTL1
  441.       RET
  442. ;
  443. ; GOODBYE routines are called by MEX prior to exit to CP/M
  444. ;
  445. GOODBYE:  MVI    B,3        ;DELAY 300 MS.
  446.       CALL    MTIME
  447.       RET
  448. ;
  449. ; Initialize RS-232 port and default modes.
  450. ;
  451. NITMOD:      CALL    INC        ;SEE IF MODEM IS CONNECTED, I.E., RETURNING
  452.       ANI    08H        ;TO ACTIVE MODEM FROM CPM
  453.       RNZ            ;SKIP IF CONNECTED
  454. ;
  455. ;      Initialize Internal RS-232 and PIO port
  456. ;
  457. NITMOD2:  LDA    REG5
  458.       CALL    NITSIO
  459.       LDA    MONFLG        ;GET MONITOR DEFAULT
  460.       ORA    A
  461.       MVI    A,'0'        ;SPEAKER OFF
  462.       JZ    NITMOD4
  463.       MVI    A,'1'        ;SPEAKER ON
  464. NITMOD4:  STA    SMINIT+3    ;PUT IT IN SMINIT STRING
  465.       LDA    ANSFLG        ;GET MODE DEFAULT
  466.       ORA    A
  467.       MVI    A,'0'        ;ORIGINATE
  468.       JZ    NITMOD5
  469.       MVI    A,'1'        ;ANSWER
  470. NITMOD5:  STA    SMINIT+8    ;PUT IT IN SMINIT STRING
  471.       LXI    H,SMINIT
  472. SINIT:      CALL    SMSEND        ;SEND THE INIT STRING
  473. SMTLP1:      MVI    C,INMDM        ;WAIT FOR MODEM RESPONSE
  474.       CALL    MEX
  475.       JNC    SMTLP1        ;EAT EVERYTHING UNTIL SILENCE FOR
  476.       RET            ; 100 MSEC
  477. ;
  478. ;    Initialize the Zilog SIO chip for either port
  479. ;
  480. NITSIO:      MVI    A,00H        ;Select reg. 0
  481.       CALL    OUTCTL1
  482.       LDA    REG0        ;Command byte
  483.       CALL    OUTCTL1
  484.       MVI    A,04H        ;Select reg. 4
  485.       CALL    OUTCTL1
  486.       LDA    REG4        ;Receive/transmit control byte
  487.       CALL    OUTCTL1
  488.       MVI    A,03H        ;Select reg. 3
  489.       CALL    OUTCTL1
  490.       LDA    REG3        ;Receiver logic byte
  491.       CALL    OUTCTL1
  492.       MVI    A,05H        ;Select reg. 5
  493.       CALL    OUTCTL1
  494.       LDA    REG5        ;Transmitter logic byte
  495.       CALL    OUTCTL1
  496. NITEND:      RET
  497. ;
  498. ;
  499. ; Set command processor
  500. ;
  501. SETCMD:      MVI    C,SBLANK    ;ANY ARGUMENTS?
  502.       CALL    MEX
  503.       JC    SETSHO        ;IF NOT, DISPLAY DEFAULT(S)
  504.       LXI    D,CMDTBL
  505.       MVI    C,LOOKUP
  506.       CALL    MEX        ;PARSE THE ARGUMENT
  507.       PUSH    H        ;SAVE ANY PARSED ARGUMENTS ON STACK
  508.       RNC            ;IF WE HAVE ONE, RETURN TO IT
  509.       POP    H        ;OOPS, INPUT NOT FOUND IN TABLE
  510. SETERR:      LXI    D,SETEMS
  511.       MVI    C,PRINT
  512.       CALL    MEX
  513.       CALL    CRLF
  514.       RET
  515. SETEMS:      DB    CR,LF,'SET command error',CR,LF,'$'
  516. ;
  517. SETBAD:      LXI    D,SETBMS
  518.       MVI    C,PRINT
  519.       CALL    MEX
  520.       RET
  521. SETBMS:      DB    CR,LF,'SET command not valid for modem',CR,LF,'$'
  522. ;
  523. ; Argument table
  524. ;
  525. CMDTBL:      DB    '?'+80H            ; HELP
  526.       DW    SETHELP
  527. ;;      DB    'MDMPOR','T'+80H    ; MODEM PORT COMMAND
  528. ;;      DW    MDMPORT
  529. ;;      DB    'PRTPOR','T'+80H    ; PRINTER PORT COMMAND
  530. ;;      DW    PRTPORT
  531.       DB    'ORI','G'+80H        ; ORIGINATE MODE
  532.       DW    ORIG
  533.       DB    'ANSWE','R'+80H        ; ANSWER MODE
  534.       DW    ANS
  535. ;      DB    'TON','E'+80H        ; TONE DIALING
  536. ;      DW    STTONE
  537. ;      DB    'PULS','E'+80H        ; PULSE DIALING
  538. ;      DW    STPULSE
  539.       DB    'MONITO','R'+80H    ; MONITOR ON
  540.       DW    MONIT
  541.       DB    'QUIE','T'+80H        ; MONITOR OFF
  542.       DW    QUIET
  543.       DB    'BAU','D'+80H        ; SET BAUD
  544.       DW    STBAUD
  545.       DB    'DELA','Y'+80H        ; SET DELAY
  546.       DW    DELAY
  547.       DB    'PARIT','Y'+80H        ; SET PARITY
  548.       DW    STPRTY
  549.       DB    'STOPBIT','S'+80H    ; SET STOPBITS
  550.       DW    STSTOP
  551.       DB    'LENGT','H'+80H        ; SET LENGTH
  552.       DW    STBITS
  553.       DB    'MANUAL','O'+80H    ; SET MANUAL ORIGINATE
  554.       DW    MANUALO
  555.       DB    'MANUAL','A'+80H    ; SET MANUAL ANSWER
  556.       DW    MANUALA
  557.       DB    0            ;TABLE TERMINATOR
  558. ;
  559. ;  "SET (no args): PRINT CURRENT STATISTICS
  560. ;
  561. SETSHO:      CALL    MILP
  562.       DB    CR,LF
  563.       DB    'SET values:',CR,LF,0
  564.       CALL    CRLF
  565. ;;      CALL    PORTSHOW
  566. ;;      CALL    CRLF
  567.       CALL    MDSHOW
  568.       CALL    CRLF
  569.       CALL    TPSHOW
  570.       CALL    CRLF
  571.       CALL    BDSHOW
  572.       CALL    CRLF
  573.       CALL    DLSHOW
  574.       CALL    CRLF
  575.       CALL    MONSHO
  576.       CALL    CRLF
  577.       CALL    CRLF
  578.       CALL    SHPRTY
  579.       CALL    CRLF
  580.       CALL    SHSTOP
  581.       CALL    CRLF
  582.       CALL    SHBITS
  583.       CALL    CRLF
  584.       CALL    CRLF
  585.       RET
  586. ;
  587. ; "SET ?" processor
  588. ;
  589. SETHELP:  CALL    MILP
  590. ;;      DB    CR,LF,'SET MDMPORT'
  591. ;;      DB    CR,LF,'SET PRTPORT'
  592.       DB    CR,LF,'SET ORIG'
  593.       DB    CR,LF,'SET ANSWER'
  594. ;      DB    CR,LF,'SET TONE'
  595. ;      DB    CR,LF,'SET PULSE'
  596.       DB    CR,LF,'SET DELAY     - <N> seconds'
  597.       DB    CR,LF,'SET PARITY    - OFF, EVEN or ODD'
  598.       DB    CR,LF,'SET STOPBITS  - 1, 1.5 or 2'
  599.       DB    CR,LF,'SET LENGTH    - 5, 6, 7 or 8'
  600.       DB    CR,LF,'SET QUIET     - Speaker OFF'
  601.       DB    CR,LF,'SET MONITOR   - Speaker ON'
  602.       DB    CR,LF,'SET BAUD      - 300, 1200, 2400, 4800, 9600 '
  603.       DB    CR,LF,'SET MANUALO   - Manual Originate mode'
  604.       DB    CR,LF,'SET MANUALA   - Manual Answer mode'
  605.       DB    CR,LF,CR,LF,0
  606.       RET
  607. ;
  608. ; SET PORT processor
  609. ;
  610. ;;MDMPORT:  MVI    A,0DH        ; reset ports called in
  611. ;;      STA    OUTCTL1+1    ; sio outputs
  612. ;;      STA    INSTAT+1    ; 0D=porta ctl/stat
  613. ;;      DCR    A        ; 0C=porta data
  614. ;;      STA    IND+1
  615. ;;      STA    OUTD+1
  616. ;;      CALL    NITSIO
  617. ;;      XRA    A        ; save port for portshow
  618. ;;      STA    PORT
  619. ;;      JMP    PORTSHOW
  620. ;;;
  621. ;;PRTPORT:  MVI    A,0FH        ; reset ports called in
  622. ;;      STA    OUTCTL1+1    ; sio outputs
  623. ;;      STA    INSTAT+1    ; 0F=portB ctl/stat
  624. ;;      DCR    A        ; 0E=portB data
  625. ;;      STA    IND+1
  626. ;;      STA    OUTD+1
  627. ;;      CALL    NITSIO
  628. ;;      MVI    A,0FFH        ; save port for portshow
  629. ;;      STA    PORT
  630. ;
  631. ;;PORTSHOW:
  632. ;;      LDA    PORT
  633. ;;      ORA    A        ;Set flags..
  634. ;;      JNZ    PRT1
  635. ;;      CALL    MILP
  636. ;;      DB    'Port selected - A (Modem)',0
  637. ;;      RET
  638. ;;PRT1:      CALL    MILP
  639. ;;      DB    'Port selected - B (Printer)',0
  640. ;;      RET
  641. ;
  642. ;;PORT:      DB    SELPRT
  643. ;
  644. ; "SET BAUD" processor
  645. ;
  646. STBAUD:      MVI    C,BDPARS    ;FUNCTION CODE: PARSE A BAUDRATE
  647.       CALL    MEX        ;LET MEX LOOK UP CODE
  648.       JC    SETERR        ;JUMP IF INVALID CODE
  649.       CALL    PBAUD        ;NO, TRY TO SET IT
  650.       JC    SETERR        ;IF NOT ONE OF OURS, BOMB OUT
  651. BDSHOW:      LDA    MSPEED        ;GET CURRENT BAUD RATE
  652.       MVI    C,PRBAUD    ;LET MEX PRINT IT
  653.       CALL    MEX
  654.       RET
  655. ;
  656. ; This routine sets baud rate passed as MSPEED code in A.
  657. ; Returns CY=1 if baud rate not supported.
  658. ;
  659. PBAUD:      PUSH    H        ;DON'T ALTER ANYBODY
  660.       PUSH    D
  661.       PUSH    B
  662.       MOV     B,A        ; save speed
  663.       ADD    A        ;Double A table is in words
  664.       MOV    E,A        ;MSPEED X 2 INDEX TO DE
  665.       MVI    D,0
  666.       LXI    H,BAUDTB    ;OFFSET INTO TABLE
  667.       DAD    D
  668.       MOV    A,M        ;FETCH Baudrate low
  669.       ORA    A        ;0 MEANS UNSUPPORTED CODE
  670.       STC            ;PREP CARRY IN CASE UNSUPPORTED
  671.       JZ    PBEXIT        ;EXIT IF BAD
  672.  
  673.       OUT    BRPORT        ; send low byte
  674.       INX    H        ; Step to upper
  675.       MOV    A,M        ; Get "MSP" baud rate byte
  676.       OUT    BRPORT
  677.  
  678.       MOV    A,B        ; recall baudrate
  679.       STA    MSPEED        ;SET IT
  680.       ORA    A        ;RETURN NO ERRORS
  681. PBEXIT:      POP    B
  682.       POP    D
  683.       POP    H
  684.       RET
  685. ;
  686. BAUDTB:      DW    0        ;110 (not supported)
  687.       DW    0180H        ;300 
  688.       DW    0        ;450 (not supported)
  689.       DW    0        ;600 (not supported)
  690.       DW    0        ;710 (not supported)
  691.       DW    60H        ;1200
  692.       DW     30H        ;2400
  693.       DW    18H        ;4800
  694.       DW    0CH        ;9600
  695.       DW    0        ;19200
  696. ;
  697. ; SET MODE PROCESSOR ---- SET MODEM SELECTION TO INTERNAL OR EXTERNAL
  698. ;
  699. ORIG:      XRA    A
  700.       STA    ANSFLG        ;SET ORIG FLAG
  701.       LXI    H,SMO        ;SEND OUT ATS0=0
  702.       CALL    SINIT
  703.       JMP    MDSHOW
  704. ;
  705. SMO:      DB    'ATS0=0',CR,0
  706. SMA:      DB    'ATS0=1',CR,0
  707. ;
  708. ANS:      MVI    A,0FFH
  709.       STA    ANSFLG        ;SET ANS FLAG
  710.       LXI    H,SMA        ;SEND OUT ATS0=1
  711.       CALL    SINIT
  712.       CALL    MDSHOW
  713.       RET
  714. ;
  715. MDSHOW:      LDA    ANSFLG
  716.       ORA    A
  717.       JZ    MDORIG
  718.       CALL    MILP
  719.       DB    'Auto-answer mode',0
  720.       RET
  721. MDORIG:      CALL    MILP
  722.       DB    'Originate mode: auto-answer disabled',0
  723.       RET
  724. ;
  725. ;
  726. ; Monitor control processor
  727. ;
  728. QUIET:      XRA    A
  729.       STA    MONFLG
  730.       LXI    H,SMQT
  731.       CALL    SINIT
  732.       JMP    MONSHO
  733. MONIT:      MVI    A,0FFH
  734.       STA    MONFLG
  735.       LXI    H,SMMON
  736.       CALL    SINIT
  737. MONSHO:      LDA    MONFLG
  738.       ORA    A
  739.       JZ    MONOFF
  740.       CALL    MILP
  741.       DB    'Speaker On',0
  742.       RET
  743. MONOFF:      CALL    MILP
  744.       DB    'Speaker Off',0
  745.       RET
  746. SMQT:      DB    'ATM0',CR,0
  747. SMMON:      DB    'ATM1',CR,0
  748. ;
  749. ; display dial stat
  750. ;
  751. TPSHOW:      LDA    TPULSE        
  752.       CPI    'T'
  753.       JZ    TPTONE
  754.       CALL    MILP
  755.       DB    'Pulse Dial',0
  756.       RET
  757. TPTONE:      CALL    MILP
  758.       DB    'Tone Dial',0
  759.       RET
  760. ;
  761. ; Set manual processor
  762. ;
  763. MANUALO:  MVI    A,00H
  764.       STA    ANSFLG
  765.       LXI    H,SMMANO
  766.       CALL    SMSEND
  767.       JMP    OFF
  768. MANUALA:  MVI    A,0FFH
  769.       STA    ANSFLG
  770.       LXI    H,SMMANA
  771.       CALL    SMSEND
  772. OFF:      MVI    B,10        ;WAIT 1 SEC
  773.       CALL    MTIME
  774.       RET
  775. ;
  776. ; Set delay processor
  777. ;
  778. DELAY:      MVI    C,EVALA
  779.       CALL    MEX
  780.       MOV    A,H
  781.       ORA    A
  782.       JNZ    SETERR
  783.       MOV    A,L
  784.       STA    NDELAY
  785.       CALL    BNTOASC
  786.       SHLD    SMDELAY+5    ;save ascii equiv
  787.       LXI    H,SMDELAY    ;send new delay to modem
  788.       CALL    SINIT
  789. DLSHOW:      CALL    MILP
  790.       DB    'Answer Delay is ',0
  791.       LDA    NDELAY
  792.       MOV    L,A
  793.       MVI    H,0
  794.       MVI    C,DECOUT
  795.       CALL    MEX
  796.       CALL    MILP
  797.       DB    ' seconds',0
  798.       RET
  799. ;
  800. ;BNTOASC - Convert binary number in A to two ASCII chars in HL
  801. ;
  802. BNTOASC:
  803.     PUSH    PSW
  804.     LXI    H,00FFH        ;prepare..L=-1
  805. BN10:    INR    L
  806.     SBI    10        ;Subtract 10
  807.     JNC    BN10        ;one more time if no borrow
  808.     ADI    10        ;too far
  809.     ORI    030H        ;to ASCII
  810.     MOV    H,A        ;Low digit to H 
  811.     MOV    A,L        ;now upper
  812.     ORI    030H        ;to ascii
  813.     MOV    L,A        ;Upper in L
  814.     POP    PSW
  815.     RET
  816. ;
  817. ;    SET PARITY command: reset transmit/receive parity
  818. ;
  819. ;        Parity is controlled by bits 0 and 1 of
  820. ;        the byte sent to the SIO write-register
  821. ;        4 as follows:
  822. ;
  823. ;           Parity    Bit 1       Bit 0
  824. ;             Off      -         0
  825. ;             Odd      0         1
  826. ;             Even      1         1
  827. ;
  828. STPRTY:      MVI    C,SBLANK    ;check for parity code
  829.       CALL    MEX        ;
  830.       JC    SETERR        ;if none, print error
  831.       LXI    D,PARTBL    ;check for proper syntax
  832.       MVI    C,LOOKUP
  833.       CALL    MEX
  834.       PUSH    H        ;match found, go do it!
  835.       RNC            ;
  836.       POP    H        ;no match: fix stack and
  837.       JMP    SETERR        ;  print error
  838. ;
  839. PROFF:      LDA    REG4        ;get register 4 byte
  840.       ANI    0FEH        ;reset bit 0
  841.       JMP    PARTB1        ;
  842. PREVEN:      LDA    REG4        ;
  843.       ORI    003H        ;set bits 0 & 1
  844.       JMP    PARTB1        ;
  845. PRODD:      LDA    REG4        ;
  846.       ORI    001H        ;set bit 0
  847.       ANI    0FDH        ;reset bit 1
  848. PARTB1:      STA    REG4        ;
  849.       CALL    NITSIO        ;re-initialize the USART
  850.       CALL    SHPRTY        ;print the result
  851.       RET            ;
  852. SHPRTY:      CALL    MILP        ;display parity
  853.       DB    'Parity:  ',TAB,' ',0
  854.       LDA    REG4        ;
  855.       ANI    001H        ;test bit 0
  856.       CPI    0        ;if bit0=0 then parity off
  857.       JNZ    SHPRT1        ;
  858.       CALL    MILP        ;
  859.       DB    'Off',0        ;
  860.       RET
  861. SHPRT1:      LDA    REG4        ;
  862.       ANI    002H        ;test bit 1
  863.       CPI    0        ;if bit1=0 then parity odd
  864.       JNZ    SHPRT2        ;
  865.       CALL    MILP        ;
  866.       DB    'Odd',0        ;
  867.       RET            ;
  868. SHPRT2:      CALL    MILP        ;
  869.       DB    'Even',0    ;
  870.       RET
  871. ;
  872. ;    SET PARITY command table
  873. ;
  874. PARTBL:      DB    'OF','F'+80H    ;"set parity off"
  875.       DW    PROFF
  876.       DB    'EVE','N'+80H    ;"set parity even"
  877.       DW    PREVEN
  878.       DB    'OD','D'+80H    ;"set parity odd"
  879.       DW    PRODD
  880.       DB    0        ;<<== end of parity table
  881. ;
  882. ;    SET STOPBITS command: reset number of stop bits
  883. ;
  884. ;        The number of stop bits is controlled by bits
  885. ;        2 and 3 of the byte sent to the SIO write-
  886. ;        register 4, as follows:
  887. ;
  888. ;            Stop bits       Bit 3    Bit 2
  889. ;            1         0          1
  890. ;               1.5         1          0
  891. ;            2         1          1
  892. ;
  893. ;
  894. STSTOP:      MVI    C,SBLANK    ;check for stop bits
  895.       CALL    MEX        ;
  896.       JC    SETERR        ;if none, print error
  897.       LXI    D,STPTBL    ;check for proper syntax
  898.       MVI    C,LOOKUP
  899.       CALL    MEX        ;
  900.       PUSH    H        ;match found, go do it!
  901.       RNC            ;
  902.       POP    H        ;no match: fix stack and
  903.       JMP    SETERR        ;  print error
  904. ;
  905. STOP01:      LDA    REG4        ;get register 4 byte
  906.       ANI    0F7H        ;reset bit 3
  907.       ORI    004H        ;set bit 2
  908.       JMP    STSTP1        ;
  909. STOP02:      LDA    REG4        ;
  910.       ORI    00CH        ;set bits 2 and 3
  911.       JMP    STSTP1        ;
  912. STOP15:      LDA    REG4        ;
  913.       ORI    008H        ;set bit 3
  914.       ANI    0FBH        ;reset bit 2
  915. STSTP1:      STA    REG4        ;
  916.       CALL    NITSIO        ;
  917.       CALL    SHSTOP        ;print the result
  918.       RET
  919. SHSTOP:      CALL    MILP        ;display stop-bits
  920.       DB    'Stop bits:',TAB,' ',0
  921.       LDA    REG4        ;
  922.       ANI    004H        ;test bit 2
  923.       CPI    0        ;if bit2=0 then 1.5
  924.       JNZ    SHSTP1        ;
  925.       CALL    MILP        ;
  926.       DB    '1.5',0        ;
  927.       RET
  928. SHSTP1:      LDA    REG4        ;
  929.       ANI    008H        ;test bit 3
  930.       CPI    0        ;if bit3=0 then 1
  931.       JNZ    SHSTP2        ;
  932.       CALL    MILP        ;
  933.       DB    '1',0        ;
  934.       RET
  935. SHSTP2:      CALL    MILP        ;
  936.       DB    '2',0        ;
  937.       RET
  938. ;
  939. ;    SET STOPBITS command table
  940. ;
  941. STPTBL:      DB    '1'+80H        ;"set stop 1"
  942.       DW    STOP01
  943.       DB    '2'+80H        ;"set stop 2"
  944.       DW    STOP02
  945.       DB    '1.','5'+80H    ;"set stop 1.5"
  946.       DW    STOP15
  947.       DB    0        ;<<== End of stop-bits table
  948. ;
  949. ;    SET LENGTH command: set bits per character
  950. ;
  951. ;        The number of bits per character is controlled for
  952. ;        the receiver circuit by bits 6 and 7 of the byte
  953. ;        sent to the SIO write-register 3 and for the trans-
  954. ;        mitter circuit by bits 5 and 6 of the byte sent to
  955. ;        the SIO write-register 5.  The assumption has been
  956. ;        made here that both transmission and reception will
  957. ;        be carried on at the same number of bits per charac-
  958. ;        ter.  The bit configurations are shown for register
  959. ;        3 only, but are the same for register 5:
  960. ;
  961. ;            BPC     Bit 7        Bit 6
  962. ;             5          0          0
  963. ;             6          1          0
  964. ;             7          0          1
  965. ;             8          1          1
  966. ;
  967. STBITS:      MVI    C,SBLANK    ;check for bits/char
  968.       CALL    MEX        ;
  969.       JC    SETERR        ;if none, print error
  970.       LXI    D,BITTBL    ;check for proper syntax
  971.       MVI    C,LOOKUP
  972.       CALL    MEX
  973.       PUSH    H        ;match found, go do it!
  974.       RNC            ;
  975.       POP    H        ;no match: fix stack and
  976.       JMP    SETERR        ;  print error
  977. ;
  978. BIT5:      LDA    REG3        ;
  979.       ANI    0BFH        ;reset bit 6
  980.       ANI    07FH        ;reset bit 7
  981.       STA    REG3        ;
  982.       LDA    REG5        ;
  983.       ANI    0DFH        ;reset bit 5
  984.       ANI    0BFH        ;reset bit 6
  985.       JMP    STBTS1        ;
  986. BIT6:      LDA    REG3        ;
  987.       ANI    0BFH        ;reset bit 6
  988.       ORI    080H        ;set bit 7
  989.       STA    REG3        ;
  990.       LDA    REG5        ;
  991.       ANI    0DFH        ;reset bit 5
  992.       ORI    040H        ;set bit 6
  993.       JMP    STBTS1        ;
  994. BIT7:      LDA    REG3        ;
  995.       ORI    040H        ;set bit 6
  996.       ANI    07FH        ;reset bit 7
  997.       STA    REG3        ;
  998.       LDA    REG5        ;
  999.       ORI    020H        ;set bit 5
  1000.       ANI    0BFH        ;reset bit 6
  1001.       JMP    STBTS1        ;
  1002. BIT8:      LDA    REG3        ;
  1003.       ORI    040H        ;set bit 6
  1004.       ORI    080H        ;set bit 7
  1005.       STA    REG3        ;
  1006.       LDA    REG5        ;
  1007.       ORI    020H        ;set bit 5
  1008.       ORI    040H        ;set bit 6
  1009. STBTS1:      STA    REG5        ;
  1010.       CALL    NITSIO        ;
  1011.       CALL    SHBITS        ;print the result
  1012.       RET
  1013. SHBITS:      CALL    MILP        ;display bits/char
  1014.       DB    'Bits/char:',TAB,' ',0
  1015.       LDA    REG5        ;
  1016.       ANI    040H        ;test bit 6
  1017.       CPI    0        ;if bit6=0 then 6 bpc
  1018.       JNZ    SHBTS2        ;
  1019.       LDA    REG5        ;
  1020.       ANI    020H        ;test bit 5
  1021.       CPI    0        ;if bit5=0 then 5 bpc
  1022.       JNZ    SHBTS1        ;
  1023.       CALL    MILP        ;
  1024.       DB    '5',0        ;
  1025.       RET            ;
  1026. SHBTS1:      CALL    MILP        ;
  1027.       DB    '7',0        ;
  1028.       RET            ;
  1029. SHBTS2:      LDA    REG5        ;
  1030.       ANI    020H        ;test bit 5
  1031.       CPI    0        ;if bit5=0 then 6 bpc
  1032.       JNZ    SHBTS3        ;
  1033.       CALL    MILP        ;
  1034.       DB    '6',0        ;
  1035.       RET            ;
  1036. SHBTS3:      CALL    MILP        ;
  1037.       DB    '8',0        ;
  1038.       RET
  1039. ;
  1040. ;    SET LENGTH command table
  1041. ;
  1042. BITTBL:      DB    '5'+80H        ;"set bits 5"
  1043.       DW    BIT5
  1044.       DB    '6'+80H        ;"set bits 6"
  1045.       DW    BIT6
  1046.       DB    '7'+80H        ;"set bits 7"
  1047.       DW    BIT7
  1048.       DB    '8'+80H        ;"set bits 8"
  1049.       DW    BIT8
  1050.       DB    0        ;<<== end of bpc table
  1051. ;
  1052. ;
  1053. ;
  1054. ; Send string to the External Modem
  1055. ;
  1056. SMSEND:      MVI    C,SNDRDY    ;WAIT FOR MODEM READY
  1057.       CALL    MEX
  1058.       JNZ    SMSEND
  1059.       MOV    A,M        ;FETCH NEXT CHARACTER
  1060.       INX    H
  1061.       ORA    A        ;END?
  1062.       RZ            ;DONE IF SO
  1063.       MOV    B,A        ;NO, POSITION FOR SENDING
  1064.       MVI    C,SNDCHR    ;NOPE, SEND THE CHARACTER
  1065.       CALL    MEX
  1066.       JMP    SMSEND
  1067. ;
  1068. ; General utility routines
  1069. ;
  1070. MILP:      MVI    C,ILP        ;IN-LINE PRINT
  1071.       JMP    MEX
  1072.       RET
  1073. ;
  1074. MTIME:      MVI    C,TIMER        ;MEX TIMER
  1075.       JMP    MEX
  1076.       RET
  1077. ;
  1078. CRLF:      CALL    MILP        ;PRINT CARRIAGE RETURN, LINE FEED
  1079.       DB    CR,LF,0
  1080.       RET
  1081. ;
  1082. ;==========================================================================
  1083. ;                 Data Area
  1084. ;==========================================================================
  1085. ;
  1086. ; Default UART parameters (Initalized for External RS-232)
  1087. ;
  1088. REG0:      DB    00011000B    ;RESET CHANNEL
  1089. REG3:      DB    11000001B    ;ENABLE RECEIVE AT 8 BITS/CHAR
  1090. REG4:      DB    01000100B    ;NO PARITY, 1 STOP BIT, CLOCK X16
  1091. REG5:      DB    11101010B    ;ENABLE TRANSMIT AT 8 BITS/CHAR
  1092. ;
  1093. ; Miscellaneous Default Data
  1094. ;
  1095. MSPDSV:      DB    0        ;SAVE MODEM MSPEED
  1096. MONFLG:      DB    0FFH        ;0: MONITOR OFF - 0FFH: MONITOR ON
  1097. ANSFLG:      DB    0        ;0: ORIGINATE    - 0FFH: ANS
  1098. NDELAY:      DB    30        ;NO. SECONDS FOR ANSWER
  1099. ;
  1100. SMINIT:      DB    'ATM1 S0=0 S7=30 X1',CR,0    ;MODEM INIT STRING
  1101. SMDELAY:  DB    'ATS7=30',CR,0    
  1102. SMMANO:      DB    'ATC0',CR,0
  1103. SMMANA:      DB    'ATC1',CR,0
  1104. ;
  1105.       END
  1106. 7=30 X1',CR,0    ;MODEM INIT STRING
  1107. SMDELAY:  DB    'AT