home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol093 / mcnfg798.asm < prev    next >
Assembly Source File  |  1984-04-29  |  13KB  |  444 lines

  1. ;
  2. ;              MCNFG797.ASM
  3. ;
  4. ;    Patches for overlaying distribution version of MODEM797.
  5. ;
  6. ;You will want to look this file over carefully, there are a number
  7. ;of options that you can use to configure MODEM797 to suit your taste.
  8. ;
  9. ;After you have finished editing this file use DDT to overlay the HEX
  10. ;file onto MODEM797 and SAVE 64 MODEM797.COM.
  11. ;
  12. ;All users should set CLOCK to the right value for their system.
  13. ;
  14. ;PMMI users should set PUSERATE and CLDBOOT to their proper values.
  15. ;
  16. ;Non-PMMI, non-H89 users who want to get MODM797 working quickly
  17. ;and who do not need to set their modem parameters using this program
  18. ;should change VERMSG, INIT, SETUP, CLEAR and PMMI to FALSE and
  19. ;change the equates for MODDATP, MODCTLP, MODSNDB, MODSNDR, MODRCVB
  20. ;and MODRCVR before assembly.
  21. ;
  22. ;
  23. ;    TO USE: First edit this file filling in answers for your own
  24. ;        equipment.  Then assemble with ASM.COM or equivalent
  25. ;        assembler.  Then use DDT to overlay the the results
  26. ;        of this program to the original MODEM797.COM file:
  27. ;
  28. ;        A>DDT MODEM797.COM
  29. ;        DDT VERS 2.2
  30. ;        NEXT  PC
  31. ;        4080 0100
  32. ;        -IMCNFG797.HEX        (note the "I" command)
  33. ;        -R            (loads in the .HEX file)
  34. ;        NEXT  PC
  35. ;        4080 0000
  36. ;        -G0            (return to CP/M)
  37. ;        A>SAVE 64 MODEM797.COM  (now have modified .COM file)
  38. ;
  39. ;12/15/82 - Modified to work with version 7.96 of MODEM7    ;PLK
  40. ;
  41. ;11/26/82 - Modified to work with version 7.94 of MODEM7    ;PLK
  42. ;
  43. ;11/19/82 - Modified to work with version 7.92 of MODEM7    ;PLK
  44. ;
  45. ;11/02/82 - Modified to work with version 7.90 of MODEM7.
  46. ;        Included "how to use" instructions at start of file. ;IMH
  47. ;
  48. ;10/20/82 - Modified to work with version 7.89 of MODEM7.    ;IMH
  49. ;
  50. ;10/16/82 - Modified to work with version 7.71 of MODEM7.    ;PLK
  51. ;
  52. ;10/15/82 - Fixed lack of ENDIF after IF VERMSG AND (NOT PMMI)    ;PLK
  53. ;
  54. ;10/12/82 - Modified to give version message.            ;PLK
  55. ;
  56. ;10/09/82 - Modified to work with version 7.70 of MODEM7.    ;PLK
  57. ;
  58. ;10/04/82 - Fixed so can also be easily used for making optional
  59. ;        changes with PMMI modem.                ;PLK
  60. ;
  61. ;10/03/82 - First version of this file.                ;PLK
  62. ;
  63. TRUE    EQU    0FFH
  64. FALSE    EQU    0
  65. ;
  66. BELL    EQU    07H    ;bell
  67. CR    EQU    0DH    ;carriage return
  68. LF    EQU    0AH    ;linefeed
  69. ESC    EQU    1BH    ;escape
  70. ;
  71. VERMSG    EQU    FALSE        ;change to TRUE if you have given at
  72.                 ;location SYSVERMSG the name of the
  73.                 ;system for which MODEM7 has been
  74.                 ;configured.
  75. ;
  76. INIT    EQU    FALSE        ;change to TRUE if you have written a
  77.                 ;routine at location INITMOD in this
  78.                 ;file to initialize your modem port
  79.                 ;on MODEM7 execution. PMMI users should
  80.                 ;use FALSE here.
  81. ;
  82. SETUP    EQU    FALSE        ;change to TRUE if you have written a
  83.                 ;routine at location SETUPR to change
  84.                 ;baud rate, etc and MSPEED. PMMI users
  85.                 ;should use FALSE here.
  86. ;
  87. EOSCLR    EQU    true         ;change to TRUE if you have defined the
  88.                 ;clear to end of screen sequence for
  89.                 ;your terminal. Clear to end of screen is
  90.                 ;used on returning from terminal mode to
  91.                 ;keep the screen from becoming jumbled if
  92.                 ;the remote can positon your cursor.
  93. ;
  94. SCRNCLR    EQU    true         ;change to TRUE if you have defined the
  95.                 ;home cursor and clear screen sequence
  96.                 ;for you terminal.
  97.  
  98. PMMI    EQU    true         ;change to TRUE for PMMI.
  99. ;
  100.     IF    NOT PMMI
  101. ;THE FOLLOWING MUST BE CHANGED FOR YOUR MICRO IF YOU DON'T HAVE AN H89
  102. ;OR A PMMI MODEM BOARD.
  103. MODDATP    EQU    0D8H        ;data port for H89
  104. MODCTLP    EQU    MODDATP+5    ;modem status port for H89
  105. MODSNDB    EQU    20H        ;bit to test for ready to send
  106. MODSNDR    EQU    MODSNDB        ;change to 0 if bit is 0 when
  107.                 ;ready to send
  108. MODRCVB    EQU    1        ;bit to test for received data
  109. MODRCVR    EQU    MODRCVB        ;change to 0 if bit is 0 when
  110.                 ;data received
  111.     ENDIF    ;NOT PMMI
  112. ;
  113. ;CHANGE CLR1, CLR2, CLR3, AND CLR4 TO THE APPROPRIATE VALUES FOR
  114. ;YOUR TERMINAL IF YOU DO NOT HAVE AN H19 OR H89 AND EOSCLR IS TRUE
  115.     IF    EOSCLR
  116. CLR1    EQU    7eh        ;tilde ctl-X is the Visual 200 clear
  117. CLR2    EQU    'X'-40h        ;to end of screen sequence
  118. CLR3    EQU    0        ;the unused bytes MUST be 0
  119. CLR4    EQU    0
  120.     ENDIF    ;EOSCLR
  121. ;
  122. ;CHANGE SCLR1, SCLR2, SCLR3, AND SCLR4 TO THE APPROPRIATE VALUES FOR
  123. ;YOUR TERMINAL IF YOU DO NOT HAVE AN H19 OR H89 AND SCRNCLR IS TRUE
  124.     IF    SCRNCLR
  125. SCLR1    EQU    7eh        ;tilde ctl-\ is the Visual 200 home
  126. SCLR2    EQU    '\'-40h        ;cursor and clear screen sequence
  127. SCLR3    EQU    0        ;the unused bytes MUST be 0
  128. SCLR4    EQU    0
  129.     ENDIF    ;SCRNCLR
  130. ;
  131. ;IF YOU HAVE A PMMI YOU MAY NEED TO CHANGE THE BASE ADDRESS.
  132. ;ALSO, CHANGE PORT NUMBER IN THE PMMI MESSAGE BELOW SYSVERMSG.
  133.      IF    PMMI
  134. PORT     EQU    0C0H    ;PMMI BASE ADDRESS
  135. MODCTLP     EQU    PORT    ;MODEM CONTROL PORT
  136. MODDATP     EQU    PORT+1    ;MODEM DATA PORT
  137. BAUDRP     EQU    PORT+2    ;BAUD RATE PORT
  138. MODCTL2     EQU    PORT+3    ;2ND MODEM CONTROL PORT
  139.      ENDIF    ;PMMI
  140. ;
  141. ;
  142. ;CLOCK SHOULD BE CHANGED TO SUIT YOUR SYSTEM.
  143. ;PMMI USERS SHOULD ALSO CHANGE PULSERATE AND CLDBOOT AS NECESSARY.
  144. ;
  145. ;You can change locations 107H to 120H, and 123H to 125H
  146. ;to suit your taste.
  147. ;
  148. ;*** WARNING - DO NOT INSERT OR DELETE LINES BEFORE SYSVERMSG ***
  149. ;      THE DEFINED LOCATIONS ARE GIVEN ON THE RIGHT MARGIN.
  150. ;
  151. ;
  152.         ORG    100H
  153. ;
  154.         DS    3    ;(for  JMP  START)
  155. PMMIBYTE:    DB    PMMI    ;don't change this line            103H
  156. SETUPTST:    DB    SETUP    ;don't change this line            104H
  157. SCRNTEST:    DB    SCRNCLR    ;test for home cursor and clear screen    105H
  158.                 ;routine at CLRSCRN, don't change this
  159. CLOCK:        DB    4    ;clock speed in MHz, 8 MHz maximum    106H
  160. BAKUPBYTE:    DB    FALSE    ;true=make .BAK file            107H
  161. CKSUMDFLT:    DB    FALSE    ;true=default to Checksum checking    108H
  162.                 ;false=default to CRC checking
  163. TOGGLECRC:    DB    TRUE    ;true=allow toggling of Checksum to CRC    109H
  164. CONVBKSP:    DB    FALSE    ;true=convert backspace to rub        10AH
  165. TOGGLEBK:    DB    TRUE    ;true=allow toggling of bksp to rub    10BH
  166. ADDLF:        DB    FALSE    ;true=add LF after CR            10CH
  167. TOGGLELF:    DB    TRUE    ;true=allow toggling of LF after CR    10DH
  168. TRANLOGON:    DB    FALSE    ;true=allow transmission of logon    10EH
  169.                 ;write logon sequence at location LOGON
  170. SAVCCP:        DB    TRUE    ;true=do not overwrite CCP        10FH
  171. LOCONEXTCHR:    DB    FALSE    ;true=local command if EXTCHR precedes    110H
  172.                 ;false=not local command if EXTCHR precedes
  173. TOGGLELOC:    DB    TRUE    ;true=allow toggling of LOCONEXTCHR    111H
  174. LSTTST:        DB    TRUE    ;true=allow toggling of printer on/off    112H
  175.                 ;in terminal mode, set to false if your
  176.                 ;printer can't keep up with the modem
  177. XOFFTST:    DB    true     ;true=allow testing of XOFF from remote 113H
  178.                 ;while transmitting a file in terminal mode
  179. XONWAIT:    DB    FALSE    ;true=wait for XON after sending CR    114H
  180.                 ;while transmitting a file in terminal mode
  181. TOGXOFF:    DB    TRUE    ;true=allow toggling of XOFF testing    115H
  182. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200   116H
  183.                 ;default modem speed, PMMI and H89 routines
  184.                 ;reset this value and so should your own
  185.                 ;modem routines
  186. BYTDLY:        DB    0    ;0=0 delay, 1=0.02 sec, -- ,9=0.18 sec  117H
  187.                 ;default time to send character in
  188.                 ;terminal mode file transfer
  189. CRDLY:        DB    0    ;0=0 delay, 1=0.08 sec, -- ,9=0.72 sec    118H
  190.                 ;default time for extra wait after CR
  191.                 ;in terminal mode file transfer
  192. BELRPT:        DB    30    ;bell repeat time = value*0.03 sec    119H
  193. EXITCHR:    DB    'E'-40H    ; ^E = Exit without disconnect        11AH
  194. LOGCHR:        DB    'O'-40H    ; ^O = Send logon            11BH
  195. LSTCHR:        DB    'P'-40H    ; ^P = Toggle printer            11CH
  196. UNSAVE:        DB    'R'-40H    ; ^R = Close input text buffer        11DH
  197. TRANCHR:    DB    'T'-40H ; ^T = Transmit file to remote        11EH
  198. SAVECHR:    DB    'Y'-40H    ; ^Y = Open input text buffer        11FH
  199. EXTCHR:        DB    '^'-40H    ; ^^ = Send next character        120H
  200. ;
  201. ;Equates used only by PMMI routines grouped together here.
  202. PULSERATE:    DB    125    ;125 for 20pps, 250 for 10pps on PMMI    121H
  203.                 ;not used if PMMI FALSE
  204. CLDBOOT:    DW    00000H    ;currently set to warm boot with    122H
  205.                 ;BYE routine for PMMI, put your cold
  206.                 ;boot entry here if you have one and
  207.                 ;desire to do on BYE
  208. BRKCHR:        DB    '@'-40H ; ^@ = Transmit "BREAK" with PMMI    124H
  209. CHGBAUD:    DB    'B'-40H    ; ^B = Used with PMMI in terminal    125H
  210.                 ;  mode to change baud rate on fly
  211. DISCCHR:    DB    'D'-40H    ; ^D = PMMI Disconnect            126H
  212. ;
  213. IN$MODCTLP:    IN    MODCTLP ! RET    ;in modem control port             127H
  214. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        12AH
  215. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        12DH
  216. ;
  217.     IF    NOT PMMI
  218. ANI$MODSNDB:    ANI    MODSNDB ! RET    ;bit to test for send ready    130H
  219. CPI$MODSNDR:    CPI    MODSNDR ! RET    ;value of send bit when ready    133H
  220. ANI$MODRCVB:    ANI    MODRCVB ! RET    ;bit to test for receive ready    136H
  221. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of rcv. bit when ready    139H
  222.         DS    15        ;PMMI only calls        13CH
  223. LOGONPTR:    DW    LOGON        ;                14BH
  224. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    14DH
  225.     ENDIF    ;NOT PMMI
  226. ;
  227.     IF    PMMI
  228.         DS    12        ;not changed            130H
  229. IN$BAUDRP:    IN    BAUDRP    ! RET    ;in baudrate port        13CH
  230. OUT$BAUDRP:    OUT    BAUDRP    ! RET    ;out baudrate port        13FH
  231. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem control port #2    142H
  232. OUT$MODCTLP:    OUT    MODCTLP        ;out modem control port        145H
  233.         DS    9        ;not changed            147H
  234.         ENDIF    ;PMMI
  235. ;
  236. JMP$SETUPR:            ;                    150H
  237. ;
  238.     IF     SETUP    
  239.         JMP    SETUPR
  240.     ENDIF    ;SETUP
  241. ;
  242.     IF    NOT SETUP
  243.         RET
  244.         NOP
  245.         NOP
  246.     ENDIF    ;NOT SETUP
  247. ;
  248. CLREOS:        CALL    JMP$ILPRT    ;                153H
  249. ;
  250.     IF    EOSCLR
  251.         DB    CLR1,CLR2,CLR3,CLR4,0
  252.     ENDIF    ;EOSCLR
  253. ;
  254.     IF    NOT EOSCLR
  255.         DB    0,0,0,0,0
  256.     ENDIF    ;NOT EOSCLR
  257. ;
  258.         RET
  259. ;
  260. CLRSCRN:    CALL    JMP$ILPRT    ;                15CH
  261. ;
  262.     IF    SCRNCLR
  263.         DB    SCLR1,SCLR2,SCLR3,SCLR4,0
  264.     ENDIF    ;SCRNCLR
  265. ;
  266.     IF    NOT    SCRNCLR
  267.         DB    0,0,0,0,0
  268.     ENDIF    ;NOT SCRNCLR
  269. ;
  270.         RET
  271. ;
  272. JMP$ILPRT:    DS    3    ;                    165H
  273. JMP$ILCOMP:    DS    3    ;                    168H
  274. JMP$INBUFF:    DS    3    ;                    16BH
  275. JMP$SYSVERMSG:
  276.         IF    PMMI
  277.         DS    3    ;                    16EH
  278.         ELSE
  279.         JMP    SYSVERMSG                    16EH
  280.         ENDIF
  281. JMP$DIALPL:    DS    3    ;                    171H
  282. JMP$DISCONNT:    DS    3    ;                    174H
  283. ;
  284. SYSVERMSG:
  285. ;
  286.     IF    (NOT VERMSG) AND (NOT PMMI)
  287.     CALL    JMP$ILPRT
  288.     DB    'Version for: UNSPECIFIED SYSTEM',CR,LF,0
  289.             ;NOTE: 0 MUST BE AT END OF ALL ILPRT MESSAGES
  290.     RET
  291.     ENDIF    ;NOT VERMSG AND NOT PMMI
  292. ;
  293. ;This is where the message goes giving the system for
  294. ;which MODEM7 has been customized.
  295.     IF    VERMSG AND (NOT PMMI)
  296.     CALL    JMP$ILPRT
  297.     DB    'Version for: HEATH H89',CR,LF,0
  298.     RET
  299.     ENDIF    ;VERMSG AND NOT PMMI
  300. ;
  301.     IF    NOT PMMI
  302.         ;INSERT YOUR LOGON HERE, MUST END IN 0.
  303.         ;FOR A LOGON, PMMI USERS MUST MODIFY MODM797.ASM
  304. LOGON:    DB    0
  305.     ENDIF    ;NOT PMMI
  306. ;
  307.     IF    (NOT INIT) AND (NOT PMMI)
  308. INITMOD:
  309.     RET
  310.     ENDIF    ;NOT INIT AND NOT PMMI
  311. ;
  312. ;*** WARNING - IF YOU MAKE INITMOD AND SETUPR TOO LONG YOU MAY      ***
  313. ;*** GO BEYOND THE LENGTH OF THE PMMI INITMOD ROUTINE.          ***
  314. ;*** YOU CAN MODIFY UP TO THE BYTE BEFORE NUMBLIB          ***
  315. ;*** NUMBLIB CURRENTLY IS AT 0617H.                  ***
  316. ;*** IF YOU NEED MORE SPACE USE AN APPROPRIATE DS BEFORE NUMBLIB  ***
  317. ;
  318.     IF    INIT
  319. ;
  320. ;The following are used in setting up the 8250 ACE on the H89.
  321. ;No need to change for another micro if INIT and SETUP are FALSE.
  322. ;
  323. ;control and status ports
  324. MODIER    EQU    MODDATP+1    ;interrupt enable
  325. MODIIR    EQU    MODDATP+2    ;interrupt ident.
  326. MODLCR    EQU    MODDATP+3    ;line control
  327. MODMCR    EQU    MODDATP+4    ;modem control
  328. MODLSR    EQU    MODDATP+5    ;line status, same as MODCTLP above
  329. MODMSR    EQU    MODDATP+6    ;modem status
  330. ;
  331. ;baud rate latches
  332. MODDLL    EQU    MODDATP        ;divisor latch low
  333. MODDLH    EQU    MODDATP+1    ;divisor latch high
  334. ;
  335. ;control bytes
  336. DISABL        EQU    0        ;disable interrupts
  337. LOOP$NODTR    EQU    10H        ;set loop back, turn off DTR
  338. ACCBAUD        EQU    80H        ;access baud rate divisor latches
  339. LSD1200        EQU    60H        ;LSD for 1200 baud
  340. MSD1200        EQU    0        ;MSD for 1200 baud
  341. WORDLEN        EQU    3        ;8 bit word, no parity, no break
  342.                     ;deaccess baud rate divisor latches
  343. DTR        EQU    1        ;turn on DTR
  344. ;End of H89 specific equates for initialization.
  345. ;
  346. ;
  347. ;The following is used to initialize the H89 on execution
  348. ;of MODEM7. Change it to initialize the modem port on
  349. ;your micro if you wish.
  350. ;
  351. ;
  352. INITMOD:
  353.     MVI    A,5        ;MSPEED 1200 baud value
  354.     STA    MSPEED
  355. INITMOD2:
  356.     MVI    A,DISABL
  357.     OUT    MODIER
  358.     MVI    A,LOOP$NODTR
  359.     OUT    MODMCR
  360.     MVI    A,ACCBAUD
  361.     OUT    MODLCR
  362. LSBD:    MVI    A,LSD1200
  363.     OUT    MODDLL
  364. MSBD:    MVI    A,MSD1200
  365.     OUT    MODDLH
  366.     MVI    A,WORDLEN
  367.     OUT    MODLCR
  368.     MVI    A,DTR
  369.     OUT    MODMCR
  370.     RET
  371. ;
  372.     ENDIF    ;INIT
  373. ;
  374. ;
  375. ;The following routine changes the baud rate for the H89 from
  376. ;the command level. Write your own routine here to change your
  377. ;modem parameters.
  378. ;
  379. ;
  380.     IF    SETUP
  381. ;
  382. SETUPR:
  383.     PUSH    H
  384. AGAIN:    LXI    D,BAUDBUF    ;point to input buffer for ILCOMP
  385.     CALL    JMP$ILPRT
  386.     DB    'Input Baud Rate (300, 450, 600, 1200): ',0
  387.     CALL    JMP$INBUFF
  388.     LXI    D,BAUDBUF+2
  389.     CALL    JMP$ILCOMP    ;compare BAUDBUF+2 with characters below
  390.     DB    '300',0
  391.     JNC    OK300        ;go if got match
  392.     CALL    JMP$ILCOMP
  393.     DB    '450',0
  394.     JNC    OK450
  395.     CALL    JMP$ILCOMP
  396.     DB    '600',0
  397.     JNC    OK600
  398.     CALL    JMP$ILCOMP
  399.     DB    '1200',0
  400.     JNC    OK1200
  401.     CALL    JMP$ILPRT    ;all matches failed - tell operator
  402.     DB    '++ Incorrect entry ++',CR,LF,BELL,0
  403.     JMP    AGAIN        ;try again
  404. ;
  405. OK300:    MVI    A,1        ;MSPEED 300 baud value
  406.     LHLD    BD300        ;get 300 baud parameters in HL
  407.     JMP    LOADBD        ;go load them
  408. ;
  409. OK450:    MVI    A,2
  410.     LHLD    BD450
  411.     JMP    LOADBD
  412.  
  413. OK600:    MVI    A,3
  414.     LHLD    BD600
  415.     JMP    LOADBD
  416. ;
  417. OK1200:    MVI    A,5
  418.     LHLD    BD1200
  419.     JMP    LOADBD
  420. ;
  421. LOADBD:    STA    MSPEED
  422.     MOV    A,L        ;get least significant baud rate byte
  423.     STA    LSBD+1        ;store in INITMOD
  424.     MOV    A,H        ;get most signifcant baud rate byte
  425.     STA    MSBD+1        ;store in INITMOD
  426.     POP    H
  427.     JMP    INITMOD2    ;reset H89 8250
  428. ;
  429. ;Table of baud rate parameters
  430. BD300:    DW    0180H
  431. BD450:    DW    0100H
  432. BD600:    DW    00C0H
  433. BD1200:    DW    0060H
  434. ;
  435. BAUDBUF:
  436.     DB    10,0
  437.     DS    10
  438. ;
  439.     ENDIF    ;SETUP
  440. ;
  441. ;
  442.     END
  443. ;
  444.