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 / MEX / MXO-XE12.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  16KB  |  598 lines

  1. ; MXO-XE10.ASM -- XEROX 820 and 820-II overlay file for MEX10.  05/24/84
  2. ;
  3. ; You will want to look this file over carefully. There are a number of
  4. ; options that you can use to configure the program to suit your taste.
  5. ; This file adapts the XEROX 820 and 820-II computers to MDM7xx.
  6. ;
  7. ; Edit this file for your preferences then follow the "TO USE:" example
  8. ; shown below.
  9. ;
  10. ; Use the "SET" command to change the baudrate when desired.  It starts
  11. ; out at 300 baud when the program is first called up.
  12. ;
  13. ;    TO USE: First edit this file filling in answers for your own
  14. ;        equipment.  Then assemble with ASM.COM or equivalent
  15. ;        assembler.  Then use MLOAD to overlay the the results
  16. ;        of this program to the original .COM file.
  17. ;
  18. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  19. ; 08/23/84 - Restored code for manipulating the
  20. ;            z80 sio (# of bits and parity) and patch
  21. ;            to mask 'DEL' characters going to screen
  22. ;            in terminal mode.                  - Mike Komorowski
  23. ; 05/24/84 - MEXified overlay            - Biff Bueffel
  24. ; 11/11/83 - Renamed to M7XE-1.ASM, no changes    - Irv Hoff
  25. ; 07/27/83 - Renamed to work with MDM712    - Irv Hoff
  26. ; 07/01/83 - Revised to work with MDM711    - Irv Hoff
  27. ; 06/22/83 - Revised to work with MDM710    - Irv Hoff
  28. ; 05/27/83 - Updated to work with MDM709    - Irv Hoff
  29. ; 05/15/83 - Revised to work with MDM708    - Irv Hoff
  30. ; 04/11/83 - Updated to work with MDM707    - Irv Hoff
  31. ; 04/04/83 - Updated to work with MDM706    - Irv Hoff
  32. ; 03/03/83 - Modified MDM705KP for XEROX
  33. ;         820-II computers with external
  34. ;         modems                - David Wurz    
  35. ;
  36. ;============================================================================
  37. ;
  38. BELL:        EQU    07H        ;bell
  39. CR:        EQU    0DH        ;carriage return
  40. ESC:        EQU    1BH        ;escape
  41. LF:        EQU    0AH        ;linefeed
  42. ;
  43. YES:        EQU    0FFH
  44. NO:        EQU    0
  45. ;
  46. ; MEX service processor stuff
  47. ;
  48. MEX    EQU    0D00H        ;address of the service processor
  49. INMDM    EQU    255        ;get char from port to A, CY=no more in 100 ms
  50. TIMER    EQU    254        ;delay 100ms * reg B
  51. TMDINP    EQU    253        ;B=# secs to wait for char, cy=no char
  52. CHEKCC    EQU    252        ;check for ^C from KBD, Z=present
  53. SNDRDY    EQU    251        ;test for modem-send ready
  54. RCVRDY    EQU    250        ;test for modem-receive ready
  55. SNDCHR    EQU    249        ;send a character to the modem (after sndrdy)
  56. RCVCHR    EQU    248        ;recv a char from modem (after rcvrdy)
  57. LOOKUP    EQU    247        ;table search: see CMDTBL comments for info
  58. PARSFN    EQU    246        ;parse filename from input stream
  59. BDPARS    EQU    245        ;parse baud-rate from input stream
  60. SBLANK    EQU    244        ;scan input stream to next non-blank
  61. EVALA    EQU    243        ;evaluate numeric from input stream
  62. LKAHED    EQU    242        ;get nxt char w/o removing from input
  63. GNC    EQU    241        ;get char from input, cy=1 if none
  64. ILP    EQU    240        ;inline print
  65. DECOUT    EQU    239        ;decimal output
  66. PRBAUD    EQU    238        ;print baud rate
  67. ;
  68. PRINT    EQU    9        ;MEX/BDOS print-string function call
  69.  
  70. ;
  71. PORT:        EQU    04H        ;XEROX 820, II serial output port
  72. MODCTL1:    EQU    PORT+2        ;Modem control port
  73. MODDATP:    EQU    PORT        ;Modem data port
  74. MODCTL2:    EQU    PORT+2        ;Modem status port
  75. MODRCVB:    EQU    01H        ;Your bit to test for receive
  76. MODRCVR:    EQU    01H        ;Your value when receive ready
  77. MODSNDB:    EQU    04H        ;Your bit to test for send
  78. MODSNDR:    EQU    04H        ;Your value when send ready        
  79. ;
  80.         ORG    100H
  81. ;
  82. ;
  83. ; Change the clock speed to suit your system
  84. ;
  85.         DS    3    ;(for  "JMP   START" instruction)
  86. ;
  87. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  88. SMARTMODEM:    DB    NO     ;yes=HAYES Smartmodem, no=non-PMMI    104H
  89. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  90. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  91.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  92. MSPEED:        DB    5    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  93.                 ;6=2400 7=4800 8=9600 9=19200 default
  94. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  95.                 ;default time to send character in ter-
  96.                 ;minal mode file transfer for slow BBS.
  97. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  98.                 ;default time for extra wait after CRLF
  99.                 ;in terminal mode file transfer
  100. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  101. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  102. SCRNTEST:    DB    NO    ;Cursor control routine         10CH
  103. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  104.                 ;no=resend a record after a valid NAK
  105. BAKUPBYTE:    DB    YES    ;yes=change any file same name to .BAK    10EH
  106. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  107. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  108. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  109. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  110. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  111.                 ;terminal mode (added by remote echo)
  112. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  113. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  114.                 ;write logon sequence at location LOGON
  115. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  116. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  117.                 ;no=external command if EXTCHR precedes
  118. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  119. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  120. XOFFTST:    DB    NO    ;yes=check for XOFF from remote    while    11AH
  121.                 ;sending a file in terminal mode
  122. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  123.                 ;sending a file in terminal mode
  124. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  125. IGNORCTL:    DB    NO     ;yes=CTL-chars above ^M not displayed    11DH
  126. EXTRA1:        DB    0    ;for future expansion            11EH
  127. EXTRA2:        DB    0    ;for future expansion            11FH
  128. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  129. 20H
  130. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  131. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  132. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  133. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  134. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  135. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  136. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  137. ;
  138. ;
  139.         DS    2        ;                128H
  140. IN$MODCTL1:    MVI    A,10H        ;channel 0, reset interrupts    12AH
  141.         OUT    MODCTL1
  142.         IN    MODCTL1        ;get the status bits
  143.         RET
  144.         DS    3
  145. ;
  146. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  147.         DS    7
  148. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  149.         DS    7
  150. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  151. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of receive bit when rdy    14BH
  152. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  153. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  154.         DS    6        ;                154H
  155. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port     15AH
  156. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem status port        15DH
  157. ;
  158. ;
  159.         DS    2        ;Not used by MEX        160H
  160.         DS    6        ;                162H
  161. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  162. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  163. JMP$NEWBAUD    JMP    SETUPR         ;Change baudrate        16EH
  164.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  165.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  166. JMP$SETUPR:    JMP    SETUPR        ;                177H
  167.         DS    3        ;                17AH
  168. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  169. JMP$BREAK:    JMP    SENDBRK        ;                180H
  170. ;
  171. ;
  172. ; Do not change the following six lines.
  173. ;
  174. JMP$ILPRT:    DS    3        ;                183H
  175. JMP$INBUF    DS    3        ;                186H
  176. JMP$INLNCOMP:    DS    3        ;                189H
  177. JMP$INMODEM    DS    3        ;                18CH
  178. JMP$NXTSCRN:    DS    3        ;                18FH
  179. JMP$TIMER:    DS    3        ;                192H
  180. ;
  181. ;
  182. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  183. ; entire screen.  
  184. ;
  185. CLREOS:        LXI    D,EOSMSG
  186.         MVI    C,PRINT
  187.         CALL    MEX
  188.         RET            
  189. ;
  190. CLRSCRN:    LXI    D,CLSMSG
  191.         MVI    C,PRINT
  192.         CALL    MEX
  193.         RET            
  194. ;
  195. ;
  196. SYSVER:        MVI    C,ILP        ;                1A7H
  197.         CALL    MEX
  198.         DB    'Mex  Version 1.2 FOR XEROX 820-II'            
  199.         DB    CR,LF,0
  200.         RET
  201. ;
  202. SENDBRK:  MVI    A,5
  203.       OUT    MODCTL1
  204.       MVI    A,0F8H        ;SEND A BREAK TONE
  205.       JMP    GOODBYE1
  206. ;
  207. GOODBYE:  MVI    A,5
  208.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  209.       MVI    A,68H        ;TURN OFF DTR
  210. ;
  211. GOODBYE1: OUT    MODCTL1
  212.       MVI    B,3        ;WAIT FOR 300 MS.
  213.       MVI    C,TIMER
  214.       CALL    MEX
  215.       MVI    A,5
  216.       OUT    MODCTL1
  217.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  218.       OUT    MODCTL1
  219.       RET
  220. ;.....
  221. ;
  222. ;The following are used in setting up the Z80 SIO.
  223. ;No need to change for another micro if INIT and SETUP are FALSE.
  224. ;
  225. ;control bytes
  226. RSTINS    EQU    18H    ;reset SIO - register 0
  227. RSTERR    EQU    30H    ;reset parity and overrun flags - register 0
  228. REG1INS    EQU    0    ;no interrupts - register 1
  229. REG3INS    EQU    0C1H    ;8 Rx bits, Rx enable -register 3
  230. RENABL    EQU    1    ;Rx enable
  231. REG4INS    EQU    44H    ;16X baud rate, 1 stop bit, no parity - register 4
  232. CLK16    EQU    40H    ;16X baud rate
  233. REG5INS    EQU    0EAH    ;8 Tx bits, Tx enable, RTS, DTR - register 5
  234. ONINS    EQU    8AH    ;Tx enable, RTS, DTR - register 5
  235. OFFINS    EQU    68H    ;8 Tx bits, Tx enable, no RTS, no DTR -register 5
  236. ;End of Z80 SIO specific equates for initialization.
  237. BAUD12    EQU    07H    ;1200 baud (SET TO 1200 BAUD FOR MY VERSION- MCK)
  238. ;
  239. ;The following is used to initialize the Z80 SIO on execution
  240. ;of MODEM9.
  241. ;
  242. INITMOD:
  243.     MVI    A,5        ;MSPEED 1200 baud value
  244.     STA    MSPEED
  245. ;
  246.     MVI    A,0        ;select register 0
  247.     OUT    MODCTL1 
  248.     MVI    A,RSTINS
  249.     OUT    MODCTL1
  250.           MVI    A,4
  251.     OUT    MODCTL1
  252. PARM2:    MVI    A,REG4INS
  253.     OUT    MODCTL1
  254.     MVI    A,1        ;select register 1
  255.     OUT    MODCTL1
  256.     MVI    A,REG1INS
  257.     OUT    MODCTL1
  258.     MVI    A,3        ;select register 3
  259.     OUT    MODCTL1
  260. PARM1:    MVI    A,REG3INS
  261.     OUT    MODCTL1
  262.     MVI    A,5        ;select register 5
  263.     OUT    MODCTL1
  264. PARM3:    MVI    A,REG5INS
  265.     OUT    MODCTL1
  266. SETBD:    MVI    A,BAUD12    ;now set up for 1200 baud (MK)
  267.     OUT    00
  268.     RET
  269. ;
  270. ;
  271. ;
  272. ;The following routine changes the baud rate, stop bits and parity on
  273. ;the Z80 SIO from the command level. Note the routine MUST modify the
  274. ;parameters used by the INITMOD routine.
  275. ;
  276. ;The following are parameters/masks used in setting word length
  277. ;stop bits and parity for the Z80 SIO.
  278. MSKWD    EQU    0C0H    ;word length mask
  279. RSEVEN    EQU    40H    ;receive seven bit word
  280. REIGHT    EQU    0C0H    ;receive eight bit word
  281. TSEVEN    EQU    20H    ;transmit seven bit word
  282. TEIGHT    EQU    60H    ;transmit eight bit word
  283. MSKST    EQU    0CH    ;stop bit mask
  284. ONE    EQU    04H    ;one stop bit
  285. TWO    EQU    0CH    ;two stop bits
  286. MSKPA    EQU    03H    ;mask for parity bits
  287. NONE    EQU    00H    ;no parity
  288. ODD    EQU    01H    ;odd parity
  289. EVEN    EQU    03H    ;even parity
  290. ;
  291. ;
  292. SETUPR:    PUSH    H
  293.     CALL    JMP$ILPRT
  294.     DB    '                 UART/Modem Control',CR,LF,LF,LF
  295.     DB    'Current settings -',CR,LF,0
  296.     CALL    SETTIM2
  297.     CALL    GIVEPRM
  298.     CALL    JMP$ILPRT
  299.     DB    CR,LF
  300.     DB    'Enter choices below - <CR> for no change',CR,LF,0
  301. AGAIN:    LXI    D,BAUDBUF    ;point to input buffer for ILCOMP
  302.     CALL    JMP$ILPRT
  303.     DB    'Baud Rate (300, 600, 1200, 2400, 4800, 9600): ',0
  304.     CALL    JMP$INBUF
  305.     LXI    D,BAUDBUF+2
  306.     CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  307.     DB    '300',0
  308.     MVI    A,1
  309.     JNC    OK        ;go if got match
  310.     CALL    JMP$INLNCOMP
  311.     DB    '600',0
  312.     MVI    A,3
  313.     JNC    OK
  314.     CALL    JMP$INLNCOMP
  315.     DB    '1200',0
  316.     MVI    A,5
  317.     JNC    OK
  318.     CALL    JMP$INLNCOMP
  319.     DB    '2400',0
  320.     MVI    A,6
  321.     JNC    OK
  322.     CALL    JMP$INLNCOMP
  323.     DB    '4800',0
  324.     MVI    A,7
  325.     JNC    OK
  326.     CALL    JMP$INLNCOMP
  327.     DB    '9600',0
  328.     MVI    A,8
  329.     JNC    OK
  330.     CALL    JMP$INLNCOMP
  331.     DB    ' ',0
  332.     JNC    AGAIN2
  333.     CALL    JMP$INLNCOMP
  334.     DB    CR,0
  335.     JNC    AGAIN2
  336.     CALL    WRONG
  337.     JMP    AGAIN        ;try again
  338. ;
  339. OK:    STA    INITMOD+1
  340.     STA    MSPEED
  341.     DCR    A        
  342.     ADD    A
  343.     MVI    D,0
  344.     MOV    E,A
  345.     LXI    H,BD300
  346.     DAD    D
  347.     MOV    A,M        ;get baud rate
  348.     STA    SETBD+1        ;store in INITMOD
  349. ;
  350. AGAIN2:    LXI    D,BAUDBUF    ;point to input buffer for ILCOMP
  351.     CALL    JMP$ILPRT
  352.     DB    'Word Length (7, 8): ',0
  353.     CALL    JMP$INBUF
  354.     LXI    D,BAUDBUF+2
  355.     CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  356.     DB    '7',0
  357.     MVI    A,RSEVEN
  358.     MVI    B,TSEVEN
  359.     JNC    OK2
  360.     CALL    JMP$INLNCOMP
  361.     DB    '8',0
  362.     MVI    A,REIGHT
  363.     MVI    B,TEIGHT
  364.     JNC    OK2
  365.     CALL    JMP$INLNCOMP
  366.     DB    ' ',0
  367.     JNC    AGAIN3
  368.     CALL    JMP$INLNCOMP
  369.     DB    CR,0
  370.     JNC    AGAIN3
  371.     CALL    WRONG
  372.     JMP    AGAIN2
  373. ;
  374. OK2:    STA    RWDLEN
  375.     MOV    A,B
  376.     STA    TWDLEN
  377. ;
  378. AGAIN3:    LXI    D,BAUDBUF    ;point to input buffer for ILCOMP
  379.     CALL    JMP$ILPRT
  380.     DB    'Stop Bits (1, 2): ',0
  381.     CALL    JMP$INBUF
  382.     LXI    D,BAUDBUF+2
  383.     CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  384.     DB    '1',0
  385.     MVI    A,ONE
  386.     JNC    OK3
  387.     CALL    JMP$INLNCOMP
  388.     DB    '2',0
  389.     MVI    A,TWO
  390.     JNC    OK3
  391.     CALL    JMP$INLNCOMP
  392.     DB    ' ',0
  393.     JNC    AGAIN4
  394.     CALL    JMP$INLNCOMP
  395.     DB    CR,0
  396.     JNC      AGAIN4
  397.     CALL    WRONG
  398.     JMP    AGAIN3
  399. ;
  400. OK3:    STA    STPLN
  401. ;
  402. AGAIN4:    LXI    D,BAUDBUF    ;point to input buffer for ILCOMP
  403.     CALL    JMP$ILPRT
  404.     DB    'Parity (None, Even, Odd): ',0
  405.     CALL    JMP$INBUF
  406.     LXI    D,BAUDBUF+2
  407.     CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  408.     DB    'NONE',0
  409.     MVI    A,NONE
  410.     JNC    OK4        ;go if got match
  411.     CALL    JMP$INLNCOMP
  412.     DB    'EVEN',0
  413.     MVI    A,EVEN
  414.     JNC    OK4
  415.     CALL    JMP$INLNCOMP
  416.     DB    'ODD',0
  417.     MVI    A,ODD
  418.     JNC    OK4
  419.     CALL    JMP$INLNCOMP
  420.     DB    ' ',0
  421.     JNC    GOSET
  422.     CALL    JMP$INLNCOMP
  423.     DB    CR,0
  424.     JNC    GOSET    
  425.     CALL    WRONG
  426.     JMP    AGAIN4        ;try again
  427. ;
  428. OK4:    STA    PARIT
  429. ;
  430. GOSET:    LDA    RWDLEN
  431.     MOV    B,A
  432.     MVI    A,RENABL
  433.     ADD    B
  434.     STA    PARM1+1
  435.     LDA    TWDLEN
  436.     MOV    B,A
  437.     MVI    A,ONINS
  438.     ADD    B
  439.     STA    PARM3+1
  440.     LDA    STPLN
  441.     MOV    B,A
  442.     LDA    PARIT
  443.     ADD    B
  444.     MOV    B,A
  445.     MVI    A,CLK16
  446.     ADD    B
  447.     STA    PARM2+1
  448.     CALL    JMP$ILPRT
  449.     DB    CR,LF
  450.     DB    'New settings -',CR,LF,0
  451.     CALL    SETTIM2
  452.     CALL    GIVEPRM
  453.     POP    H
  454.     JMP    INITMOD        ;reset Z80 SIO
  455. ;
  456. GIVEPRM:
  457.     CALL    GETPRM
  458.     CALL    JMP$ILPRT
  459.     DB    'Word length is ',0
  460.     LDA    RWDLEN
  461.     CPI    RSEVEN
  462.     JNZ    NOTSEV
  463.     CALL    JMP$ILPRT
  464.     DB    'seven',0
  465.     JMP    GIVEST
  466. NOTSEV:    CALL    JMP$ILPRT
  467.     DB    'eight',0
  468. GIVEST:    CALL    JMP$ILPRT
  469.     DB    ', number of stop bits is ',0
  470.     LDA    STPLN
  471.     CPI    ONE
  472.     JNZ    NOTONE
  473.     CALL    JMP$ILPRT
  474.     DB    'one',0
  475.     JMP    GIVEPA
  476. NOTONE:    CALL    JMP$ILPRT
  477.     DB    'two',0
  478. GIVEPA:    CALL    JMP$ILPRT
  479.     DB    ', parity is ',0
  480.     LDA    PARIT
  481.     CPI    NONE
  482.     JNZ    NOTNON
  483.     CALL    JMP$ILPRT
  484.     DB    'none',CR,LF,0
  485.     RET
  486. NOTNON:    LDA    PARIT
  487.     CPI    ODD
  488.     JNZ    NOTODD
  489.     CALL    JMP$ILPRT
  490.     DB    'odd',CR,LF,0
  491.     RET
  492. NOTODD:    CALL    JMP$ILPRT
  493.     DB    'even',CR,LF,0
  494.     RET
  495. ;
  496. GETPRM:    LDA    PARM1+1    ;get present word length
  497.     ANI    MSKWD    
  498.     STA    RWDLEN
  499.     LDA    PARM2+1    ;get stop bits and parity
  500.     MOV    B,A
  501.     ANI    MSKST
  502.     STA    STPLN
  503.     MOV    A,B
  504.     ANI    MSKPA
  505.     STA    PARIT
  506.     RET
  507. ;
  508. WRONG:    CALL    JMP$ILPRT    ;all matches failed - tell operator
  509.     DB    '++ Incorrect entry ++',CR,LF,BELL,0
  510.     RET
  511. ;
  512. SETTIM2:
  513.     LDA    SETUPTST
  514.     ORA    A
  515.     JNZ    SETTIM3
  516.     CALL    JMP$ILPRT
  517.     DB    'Rate for the S mode time-to-send message is set to ',0
  518.     JMP    SETTIM4
  519. SETTIM3:
  520.     CALL    JMP$ILPRT
  521.     DB    'Modem speed is ',0
  522. SETTIM4:
  523.     CALL    BAUDPRT
  524.     RET
  525. ;
  526. ;Shows baud rates set for 'time to send' file transfer.
  527. ;
  528. BAUDPRT:
  529.     LXI    H,BAUDSPD
  530.     MVI    D,0
  531.     LDA    MSPEED        ;GET BAUD RATE CODE
  532.     ADD    A        ;X2
  533.     MOV    E,A
  534.     DAD    D        ;POINT TO CORRECT RATE
  535.     MOV    A,M        ;GET FIRST DIGIT
  536.     CALL    0F00CH
  537.     INX    H
  538.     MOV    A,M        ;GET SECOND DIGIT
  539.     CALL    TYPE  
  540.     LDA    MSPEED        ;CHECK FOR GREATER THAN 1000
  541.     CPI    5
  542.     JC    NOTHOU        ;GO IF LESS
  543.     MVI    A,'0'        ;PRINT EXTRA 0
  544.     CALL    TYPE  
  545. NOTHOU:    CALL    JMP$ILPRT
  546.     DB    '0 baud',CR,LF,0
  547.     RET
  548. ;
  549. ;  ON XEROX 820-II this can be replaced by doing a call to 0F00C instead
  550. ;    of the call to type
  551. ;
  552. TYPE    STA    TYPE1
  553.     CALL    JMP$ILPRT 
  554.     DB    ' ',0
  555.     RET
  556. ;
  557. BAUDSPD    DB    '11','30','45','60','71','12','24','48','96'
  558. ;
  559. ;Table of baud rate parameters
  560. BD300:    DW    0005H
  561. BD450:    DW    0000H        ;not used
  562. BD600:    DW    0006H
  563. BD710:    DW    0000H        ;not used
  564. BD1200:    DW    0007H
  565. BD2400:    DW    000AH
  566. BD4800:    DW    000CH
  567. BD9600:    DW    000EH
  568. RWDLEN:    DB    REIGHT
  569. TWDLEN:    DB    TEIGHT
  570. STPLN:    DB    ONE
  571. PARIT:    DB    NONE
  572. ;
  573. BAUDBUF:
  574.     DB    10,0
  575.     DS    10
  576. ;
  577. ;
  578. EOSMSG:      DB    11h,0,0,'$'              
  579. CLSMSG:      DB    1AH,0,0,'$'
  580. ;
  581. ;
  582. ;  This is a patch to look for 'DEL' characters which some systems
  583. ;    use instead of 'NULL' charaters for timing. The 'DEL' characters
  584. ;    don't look good on the screen, so the patch gets rid of them
  585. ;    just before they got to the screen.
  586. ;    
  587.     ORG    640H    ;this is the location I chose, but it can 
  588. ;             be anywhere as long as the call below is the same
  589.     CPI    7FH
  590.     RZ
  591.     PCHL  
  592. ;
  593.     ORG     43A9H    ;this changes the instruction just before the
  594.     CALL    0640H    ;"console out" routine
  595. ;
  596. ;
  597.       END
  598.