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 / MODEMS / MODEM7 / M7KP-2.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  18KB  |  466 lines

  1. ; M7KP-2.ASM --    Kaypro II overlay file for MDM722.    2/18/84
  2. ;
  3. ; This overlay was to written to handle a specific problem, to
  4. ; communicate with certain time sharing systems.  It should not be
  5. ; considered a replacement for M7KP-1.ASM.  It has been written not to
  6. ; exceed 896 bytes, a constraint documented in M7KP-1.ASM.  Because of
  7. ; this, some code was taken out, (SET baudrate other than 300 or 1200).
  8. ;
  9. ; You will want to look this file over carefully.  There are a number of
  10. ; options that you can use to configure the program to suit your taste.
  11. ; This file adapts the Kaypro II computer to the modem program.  Much of
  12. ; the information contained here is not in the MDM722.ASM file.
  13. ;
  14. ; Edit this file for your preferences then follow the "TO USE:", example
  15. ; shown below.
  16. ;
  17. ; Use the "SET" command to change the baudrate, word length, number of
  18. ; stop bits, and parity when desired.  It starts out at 300 baud, 8 bit
  19. ; word length 1 stop bit, and no parity when the program is first invoked.
  20. ;
  21. ; TO USE: First edit this file filling in answers for your own
  22. ;        equipment.  Then assemble with ASM.COM or equivalent
  23. ;        assembler.   Use DDT to overlay the results of this
  24. ;        program to the original .COM file:
  25. ;
  26. ;        A>DDT MDM724.COM
  27. ;        DDT VERS 2.2
  28. ;        NEXT  PC
  29. ;        4900 0100
  30. ;        -IM7KP-2.HEX        (note the "I" command)
  31. ;        -R            ("R" loads in the .HEX file)
  32. ;        NEXT  PC
  33. ;        4900 0000
  34. ;        -G0            (return    to CP/M)
  35. ;        A>SAVE 72 MDM.COM    (now have a modified .COM file
  36. ;                     saved in MDM.COM)
  37. ;  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =
  38. ;
  39. ; 02/18/84 - Changed SET routine to change baudrate, word length,
  40. ; M7KP-2     number of stop bits, and parity.    - Bill Duerr
  41. ;
  42. ; 02/17/83 - Modified MDM703CF for Kaypro II
  43. ; M7KP-1     computers with external modems.    - Irv Hoff
  44. ;
  45. ;  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =  =
  46. ;
  47. BELL:        EQU    07H        ;bell
  48. CR:        EQU    0DH        ;carriage return
  49. ESC:        EQU    1BH        ;escape
  50. LF:        EQU    0AH        ;linefeed
  51. ;
  52. YES:        EQU    0FFH
  53. NO:        EQU    0
  54. ;
  55. PORT:        EQU    04H        ;Kaypro    II serial output port
  56. MODCTL1:    EQU    PORT+2        ;Modem control port
  57. MODDATP:    EQU    PORT        ;Modem data port
  58. MODCTL2:    EQU    PORT+2        ;Modem control port
  59. ;
  60. MODRCVB:EQU    01H    ;Your bit to test for receive   .... ...1
  61. MODRCVR:EQU    01H    ;Your value when receive ready  .... ...1
  62. ;                       ;Int pending                    .... ..1.
  63. MODSNDB:EQU    04H    ;Your bit to test for send      .... .1..
  64. MODSNDR:EQU    04H    ;Your value when send ready     .... .1..
  65. ;DCT:   EQU     80H     ;data carier detect             .... 1...
  66. ;                       ;sync hunt                      ...1 ....
  67. ;                       ;Clear to Send                  ..1. ....
  68. ;                       ;Tx underrun                    .1.. ....
  69. ;                       ;Break/Abort                    1... ....
  70. ;
  71. ; The following are used in setting up the Z80 SIO.
  72. ;
  73. ;                       ;all sent                       .... ...1
  74. ;                       ;parity error                   ...1 ....
  75. ;                       ;overrun error                  ..10 ....
  76. ;                       ;framing error                  .1.. ....
  77. ;                       ;end of frame (SDLC)            1... ....
  78. ;WRREG0
  79. ;                       ;write to register              .... .xxx
  80. ;                       ;reset flags                    ..xx x...
  81. RSTERR:    EQU    30H    ;reset parity and overrun flags    ..11 0...
  82. RSTINS:    EQU    18H    ;reset SIO - register 0         ..01 1...
  83. WRREG1:    EQU    0    ;no interrupts - register 1
  84. ;                       ;ext int enable                 .... ...1
  85. ;                       ;tx int enable                  .... ..1.
  86. ;                       ;rx int disable                 ...0 0...
  87. ;                       ;rx int on first character      ...0 1...
  88. ;                       ;int on all rx char/parity eff  ...1 0...
  89. ;                       ;int on all rx char             ...1 1...
  90. ;                       ;wait/ready on r/t              ..1. ....
  91. ;                       ;wait/ready function            .1.. ....
  92. ;                       ;wait/ready enable              1... ....
  93. ;
  94. ;            ;register 3 equates
  95. WRREG3:    EQU    0C1H    ;8 Rx bits, Rx enable
  96. RENABLE    EQU    1    ;Rx enable -            .... ...1
  97. ;                       ;sync character load inhibit -  .... ..1.
  98. ;                       ;address serch mode (SDLC) -    .... .1..
  99. ;                       ;Rx CRC enabel -                .... 1...
  100. ;                       ;Enter hunt phase               ...1 ....
  101. ;                       ;Auto enables                   ..1. ....
  102. MSKWD:    EQU    0C0H    ;word length mask -        xx.. ....
  103. ;                       ;receive five bit work -        00.. ....
  104. RSEVEN:    EQU    040H    ;receive seven bit word    -    01.. ....
  105. ;                       ;receive six bit word -         10.. ....
  106. REIGHT:    EQU    0C0H    ;receive eight bit word    -    11.. ....
  107. ;
  108. ;            ;register 4 equates
  109. WRREG4:    EQU    44H    ;16X baud rate,    1 stop bit, no parity
  110. MSKPA:    EQU    03H    ;mask for parity bits -        .... ..xx
  111. NONE:    EQU    00H    ;no parity -            .... ..00
  112. ODD:    EQU    01H    ;odd parity -            .... ..01
  113. EVEN:    EQU    03H    ;even parity -            .... ..11
  114. MSKST:    EQU    0CH    ;stop bit mask -        .... xx..
  115. ;                       ;sync modes enable -            .... 00..
  116. ONE:    EQU    04H    ;one stop bit  -        .... 01..
  117. ;                                ;1.5 STOP BITS -        .... 10..
  118. TWO:    EQU    0CH    ;two stop bits -        .... 11..
  119. ;                       ;sync modes -                   ..xx ....
  120. ;CLK01: EQU     00H     ;1X clock mode -                00.. ....
  121. CLK16:    EQU    40H    ;16X clock mode -               01.. ....
  122. ;CLK32: EQU     80H     ;32X clock mode -               10.. ....
  123. ;CLK64: EQU     c0H     ;64X clock mode -               11.. ....
  124. ;            ;register 5 equates
  125. WRREG5:    EQU    0EAH    ;8 Tx bits, Tx enable, RTS, DTR
  126. ;TXCRC  EQU     001H    ;Tx CRC enable                  .... ...1
  127. ;RTS    EQU     002H    ;Request to send                .... ..1.
  128. ;SLDC   EQU     004H    ;SDLC/CRC-16                    .... .1..
  129. TENABLE:EQU    008H    ;Tx enable            .... 1...
  130. ;BREAK  EQU     010H    ;Send break                     ...1 ....
  131. ;                       ;Transmit five bit word -       .00. ....
  132. TSEVEN:    EQU    020H    ;Transmit seven    bit word -    .01. ....
  133. ;                       ;Transmit six bit word -        .10. ....
  134. TEIGHT:    EQU    060H    ;Transmit eight    bit word -    .11. ....
  135. ;DTR    EQU     080H    ;Data terminal ready            1... ....
  136. DTRON:    EQU    08AH    ;Tx enable, RTS, DTR -        1... 1.1.
  137. DTROFF:    EQU    000H    ;DTR off, RTS off -        0... ..0.
  138. ;
  139.         ORG    100H
  140. ;
  141. ; Change the clock speed as needed for your system.
  142. ;
  143.         DS    3    ;(for  "JMP   START" instruction)
  144. ;
  145. PMMIMODEM:    DB    NO    ;yes=PMMI S-100    Modem            103H
  146. SMARTMODEM:    DB    YES    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  147. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  148. CLOCK:        DB    40    ;clock speed in    MHz x10, 25.5 MHz max.    106H
  149.                 ;20=2 MHh, 37=3.68 MHz,    40=4 MHz, etc.
  150. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  151.                 ;6=2400    7=4800 8=9600 9=19200 default
  152. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  153.                 ;default time to send character    in ter-
  154.                 ;minal mode file transfer for slow BBS.
  155. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms    109H
  156.                 ;default time for extra    wait after CRLF
  157.                 ;in terminal mode file transfer
  158. NOOFCOL:    DB    5    ;number    of DIR columns shown        10AH
  159. SETUPTST:    DB    YES    ;yes=user-added    Setup routine        10BH
  160. SCRNTEST:    DB    YES    ;Cursor    control    routine            10CH
  161. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  162.                 ;no=resend a record after a valid NAK
  163. BAKUPBYTE:    DB    NO    ;yes=change any    file same name to .BAK    10EH
  164. CRCDFLT:    DB    YES    ;yes=default to    CRC checking        10FH
  165. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  166. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  167. TOGGLEBK:    DB    NO    ;yes=allow toggling of bksp to rub    112H
  168. ADDLF:        DB    NO    ;no=no LF after    CR to send file    in    113H
  169.                 ;terminal mode (added by remote    echo)
  170. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after    CR    114H
  171. TRANLOGON:    DB    YES    ;yes=allow transmission    of logon    115H
  172.                 ;write logon sequence at location LOGON
  173. SAVCCP:        DB    YES    ;yes=do    not overwrite CCP        116H
  174. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  175.                 ;no=external command if    EXTCHR precedes
  176. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  177. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  178. XOFFTST:    DB    NO    ;yes=chcks for XOFF from remote    while    11AH
  179.                 ;sending a file    in terminal mode
  180. XONWAIT:    DB    NO    ;yes=wait for XON after    CR while    11BH
  181.                 ;sending a file    in terminal mode
  182. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  183. IGNORCTL:    DB    NO    ;yes=CTL-chars above ^M    not displayed    11DH
  184. EXTRA1:        DB    0    ;for future expansion            11EH
  185. EXTRA2:        DB    0    ;for future expansion            11FH
  186. BRKCHR:        DB    '@'-40H    ;^@ = Send a 300 ms. break tone        120H
  187. NOCXNNCT:    DB    'N'-40H    ;^N = Disconnect from the phone    line    121H
  188. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  189. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  190. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  191. TRANCHR:    DB    'T'-40H    ;^T = Transmit file to remote        125H
  192. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  193. EXTCHR:        DB    '^'-40H    ;^^ = Send next    character        127H
  194. PULSERATE:    DS    1    ;                                       128H
  195. CHGBAUD        DS    1    ;                        129H
  196. ;
  197. IN$MODCTL1:    MVI    A,10H        ;channel 0, reset interrupts.    12AH
  198.         OUT    MODCTL1
  199.         IN    MODCTL1        ;get the status    bits
  200.         RET
  201.         DB    0,0,0
  202. ;
  203. OUT$MODDATP:    OUT    MODDATP    ! RET    ;out modem data    port        134H
  204.         DB    0,0,0,0,0,0,0
  205. IN$MODDATP:    IN    MODDATP    ! RET    ;in modem data port        13EH
  206.         DB    0,0,0,0,0,0,0
  207. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to    test for receive ready    148H
  208. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of receive bit when rdy    14BH
  209. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to    test for send ready    14EH
  210. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when    ready    151H
  211. IN$BAUDRP:    DS    3        ;IN baudrate port               154H
  212. OUT$BAUDRP:    DS    3        ;OUT baudrate port              157H
  213. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port        15AH
  214. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem status port        15DH
  215. ;
  216. LOGONPTR:    DW    LOGON        ;for user message.        160H
  217. JMP$DAIL:    DS    3        ;Use routine in    main program    162H
  218. JMP$DISCONNT:    DS    3        ;Use routine in    main program    165H
  219. JMP$GOODBYE:    JMP    GOODBYE        ;Routine in this overlay    168H
  220. JMP$INITMOD:    JMP    INITMOD        ;Initialization    in this    overlay    16BH
  221. JMP$NEWBAUD:    RET  !    NOP  !    NOP    ;Bypass    PMMI routine        16EH
  222. JMP$NOPARITY:    RET  !    NOP  !    NOP    ;Bypass    PMMI routine        171H
  223. JMP$PARITY:    RET  !    NOP  !    NOP    ;Bypass    PMMI routine        174H
  224. JMP$SETUPR:    JMP    SETUPR        ;Set command in    this overlay    177H
  225. JMP$SPCLMENU:    RET  !    NOP  !    NOP    ;Bypass    special    menu routine    17AH
  226. JMP$SYSVER:    JMP    SYSVER        ;Version message in this overlay17DH
  227. JMP$BREAK:    JMP    SENDBRK        ;Break    routine    in this    overlay    180H
  228. ;
  229. ;
  230. ; Do not change    the following six lines, the routine are in main program.
  231. ;
  232. JMP$ILPRT:    DS    3        ;Inline    print routine        183H
  233. JMP$INBUF    DS    3        ;Input buffer routine        186H
  234. JMP$INLNCOMP:    DS    3        ;Inline    compare    routine        189H
  235. JMP$INMODEM    DS    3        ;                18CH
  236. JMP$NXTSCRN:    DS    3        ;                18FH
  237. JMP$TIMER:    DS    3        ;Timer routine            192H
  238. ;
  239. ; Clear    sequences -- CLREOS is clear to    end of screen, CLRSCRN is clear
  240. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  241. ;
  242. CLREOS:        CALL    JMP$ILPRT    ;                195H
  243.         DB    017H,0,0,0,0    ;                198H
  244.         RET            ;                19DH
  245. ;
  246. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  247.         DB    01AH,0,0,0,0    ;                1A1H
  248.         RET            ;                1A6H
  249. ;
  250. ;
  251. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  252.         DB    'M7KP-2, Version for Kaypro',0        ;    1AAH
  253.         RET
  254. ;
  255. ; NOTE:     You can change    the SYSVER message to be longer    or shorter.  The
  256. ;     end of    your last routine should terminate by 0380H (390 bytes
  257. ;     available after start of SYSVER) if using the Hayes Smartmodem
  258. ;     or by address 0B80H (2521 bytes) otherwise.
  259. ;
  260. ; You can put in a message at this location which can be called    up with
  261. ; CTL-L    if TRANLOGON has been set YES.    You can    put in several lines if
  262. ; desired.  End    with a 0.
  263. ;
  264. LOGON:      DB    'LOGON',CR,LF,0
  265. ;
  266. ;
  267. ; This routine allows a    300 ms.    break tone to be sent to reset some
  268. ; time-share computers.
  269. ;
  270. SENDBRK:  MVI    A,5        ;select    register 5
  271.       OUT    MODCTL1
  272.       MVI    A,0F8H        ;send a    break tone
  273.       JMP    GOODBYE1
  274. ;
  275. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  276. ; length of time to disconnect some modems such    as the Bell 212A, etc.
  277. ;
  278. GOODBYE:  MVI    A,5        ;select    register 5
  279.       OUT    MODCTL1        ;send to the status port
  280.       MVI    A,DTROFF    ;turn off dtr
  281. ;
  282. GOODBYE1: OUT    MODCTL1
  283.       MVI    B,3        ;delay 300 ms.
  284.       CALL    JMP$TIMER
  285.       MVI    A,5        ;select    register 5
  286.       OUT    MODCTL1
  287.       LDA    REG5+1        ;has been set to word length, etc.
  288.       OUT    MODCTL1
  289.       RET
  290. ;
  291. ; Kaypro II initialization -- resets the SIO, sets the interrupt
  292. ; mode, the receive and transmit mode.
  293. ; Sets the baud rate to port 00.
  294. ;
  295. INITMOD:MVI    A,0        ;select    register 0
  296.     OUT    MODCTL1
  297.     MVI    A,RSTINS    ;reset SIO - 18h
  298.     OUT    MODCTL1
  299. ;
  300.     MVI    A,1        ;select    register 1
  301.     OUT    MODCTL1
  302.     MVI    A,WRREG1    ;no interrupts
  303.     OUT    MODCTL1
  304. ;
  305.     MVI    A,3        ;select    register 3 - receive
  306.     OUT    MODCTL1
  307. REG3:    MVI    A,WRREG3    ;8 Rx bits, Rx enable
  308.     OUT    MODCTL1
  309. ;
  310.     MVI    A,4        ;select    register 4
  311.     OUT    MODCTL1
  312.     MVI    A,CLK16        ;16X baud rate
  313. PARIT:    ORI    NONE        ;type of parity
  314. STPLN:    ORI    ONE        ;number of stop bits
  315.     OUT    MODCTL1
  316. ;
  317.     MVI    A,5        ;select    register 5 - transmit
  318.     OUT    MODCTL1
  319. REG5:    MVI    A,WRREG5    ;8 Tx bits, Tx enable, no RTS, no DTR
  320.     OUT    MODCTL1
  321. ;
  322. SETBD:    MVI    A,05H        ;set baudrate to 300 bps
  323.     OUT    00
  324.     RET
  325. ;
  326. ; The following routine changes the baud rate, word length, stop bits
  327. ; and parity on the Z80 SIO from the command level.  Note the routine
  328. ; MUST modify the parameters used by the INITMOD routine.
  329. ;
  330. SETUPR:    PUSH    H
  331. AGAIN:    LXI    D,BAUDBUF    ;point to input    buffer for JMP$INLNCOMP
  332.     CALL    JMP$ILPRT
  333.     DB    1AH,'Baud Rate (300, 1200): ',0
  334.     CALL    JMP$INBUF
  335.     LXI    H,BAUDTB
  336. BAUDLP:    MOV    A,M        ;first character to check
  337.     ORA    A        ;is it null
  338.     JZ    NOTOK        ;no matches found
  339.     STA    BAUDCP        ;store in compare area
  340.     INX    H        ;point to next character
  341.     MOV    A,M        ;second character to check or null
  342.     STA    BAUDCP+1    ;store in comparea area
  343.     INX    H        ;point to MSPEED constant
  344.     LXI    D,BAUDBUF+2    ;compare baudbuf and baudcp
  345.     CALL    JMP$INLNCOMP    ;was valid baud specified
  346. BAUDCP:    DB    0,0,0        ;baudrate from table gets stored here
  347.     JNC    OK        ;match, go save it
  348.     INX    H        ;skip MSPEED
  349.     INX    H        ;and CTC constant
  350.     JMP    BAUDLP        ;and check next entry
  351. NOTOK:    CALL    WRONG        ;tell messed up
  352.     JNC    AGAIN2        ;null line entered bypass baud change
  353.     JMP    AGAIN        ;try again
  354. ;
  355. OK:    MOV    A,M        ;get MSPEED
  356.     STA    MSPEED        ;change    time-to-send to    match baudrate
  357.     INX    H        ;point to CTC constant
  358.     MOV    A,M        ;and get it
  359.     STA    SETBD+1        ;store in INITMOD routine
  360. ;
  361. AGAIN2:    LXI    D,BAUDBUF    ;point to input    buffer
  362.     CALL    JMP$ILPRT
  363.     DB    'Word Length (7, 8): ',0
  364.     CALL    JMP$INBUF
  365.     LXI    D,BAUDBUF+2
  366.     CALL    JMP$INLNCOMP    ;was eight bits    requested
  367.     DB    '8',0
  368.     MVI    A,REIGHT+RENABLE;receive eight bits  -  C1h
  369.     MVI    B,TEIGHT+DTRON    ;transmit eight    bits -  EAh
  370.     JNC    OK2
  371.     CALL    JMP$INLNCOMP    ;was seven bits requested
  372.     DB    '7',0
  373.     MVI    A,RSEVEN+RENABLE;receive seven bits  - 41h
  374.     MVI    B,TSEVEN+DTRON    ;transmit seven    bits - AAh
  375.     JNC    OK2
  376.     CALL    WRONG
  377.     JNC    AGAIN3        ;bypass word length change
  378.     JMP    AGAIN2
  379. ;
  380. OK2:    STA    REG3+1        ;store in MVI instruction
  381.     MOV    A,B        ;get transmit word length
  382.     STA    REG5+1        ;store in MVI instruction
  383. ;
  384. AGAIN3:    LXI    D,BAUDBUF    ;point to input    buffer for JMP$INLNCOMP
  385.     CALL    JMP$ILPRT
  386.     DB    'Stop Bits (1, 2): ',0
  387.     CALL    JMP$INBUF
  388.     LXI    D,BAUDBUF+2
  389.     CALL    JMP$INLNCOMP    ;was 1 stop bit    requested
  390.     DB    '1',0
  391.     MVI    A,ONE        ;1 stop    bit - 04h
  392.     JNC    OK3
  393.     CALL    JMP$INLNCOMP    ;was 2 stop bits requested
  394.     DB    '2',0
  395.     MVI    A,TWO        ;2 stop    bits - 0Ch
  396.     JNC    OK3
  397.     CALL    WRONG
  398.     JNC    AGAIN4        ;bypass stop bit mod
  399.     JMP    AGAIN3        ;go ask again
  400. ;
  401. OK3:    STA    STPLN+1        ;save stop bits    in MVI
  402. ;
  403. AGAIN4:    LXI    D,BAUDBUF    ;point to input    buffer for JMP$INLNCOMP
  404.     CALL    JMP$ILPRT
  405.     DB    'Parity (None, Even, Odd): ',0
  406.     CALL    JMP$INBUF
  407.     LXI    D,BAUDBUF+2
  408.     CALL    JMP$INLNCOMP    ;was no    parity requested
  409.     DB    'N',0        ;just check first character
  410.     MVI    A,NONE        ;no parity - 00h
  411.     JNC    OK4        ;go if got match
  412.     CALL    JMP$INLNCOMP    ;was even parity requested
  413.     DB    'E',0
  414.     MVI    A,EVEN        ;even parity - 03h
  415.     JNC    OK4
  416.     CALL    JMP$INLNCOMP    ;was odd parity    requested
  417.     DB    'O',0
  418.     MVI    A,ODD        ;odd parity - 01h
  419.     JNC    OK4
  420.     CALL    WRONG        ;no matches
  421.     JNC    GOSET        ;bypass parity changes
  422.     JMP    AGAIN4        ;try again
  423. ;
  424. OK4:    STA    PARIT+1        ;save in MVI
  425. ;
  426. ; now go modify the init routine to initialize the Kaypro to the values
  427. ; requested.
  428. ;
  429. GOSET:    POP    H        ;restore HL register
  430.     JMP    INITMOD        ;reset Z80 SIO (and return)
  431. ;
  432. WRONG:    CALL    JMP$INLNCOMP    ;was null string entered
  433.     DB    ' ',0
  434.     RNC            ;all is ok
  435.     CALL    JMP$ILPRT    ;all matches failed - tell operator
  436.     DB    ' Wrong!',CR,LF,BELL,0
  437.     STC            ;Set carry flag
  438.     RET
  439. ;
  440. ; Due to space constraints some baud rates have been commented out
  441. ;
  442. BAUDTB:    EQU    $        ;Valid baud rates
  443. ;                               ;BAUD  MSPEED   CTC
  444. ;BD110:    DB    '11',0,2    ; 110    0      02
  445. BD300:    DB    '3',0,1,5    ; 300    1      05
  446. ;BD600:    DB    '6',0,3,6    ; 600    3      06
  447. BD1200:    DB    '12',5,7    ;1200    5      07
  448. ;BD2400:DB    '24',6,10    ;2400    6      0A
  449. ;BD4800:DB    '48',7,12    ;4800    7      0C
  450. ;BD9600:DB    '96',8,14    ;9600    8      0E
  451. ;BD192:    DB    '19',8,15    ;19.2    9      0F
  452.     DB    0
  453. ;
  454. BAUDBUF:
  455.     DB    10,0
  456.     DS    10
  457. ;
  458. ;---------------------------------------------------------------------
  459. ;
  460. ;
  461. ; NOTE:  MUST TERMINATE PRIOR TO 0380H (with Smartmodem)
  462. ;                 0B80H (without Smartmodem)
  463. ;
  464. ;---------------------------------------------------------------------
  465.     END
  466.