home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / sigm / vol117 / mdm705us.asm < prev    next >
Encoding:
Assembly Source File  |  1984-04-29  |  8.8 KB  |  297 lines

  1. ; MDM705us.ASM -- 8251 Usart overlay file MDM705.  830329:0755
  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. ;
  6. ; Edit this file for your preferences then follow the "TO USE:" example
  7. ; shown below.
  8. ;
  9. ;    TO USE: First edit this file filling in answers for your own
  10. ;        equipment.  Then assemble with ASM.COM or equivalent
  11. ;        assembler.  Then use DDT to overlay the the results
  12. ;        of this program to the original .COM file:
  13. ;
  14. ;        A>DDT MDM705.COM
  15. ;        DDT VERS 2.2
  16. ;        NEXT  PC
  17. ;        4180 0100
  18. ;        -IMDM705CF.HEX        (note the "I" command)
  19. ;        -R            ("R" loads in the .HEX file)
  20. ;        NEXT  PC
  21. ;        4180 0000
  22. ;        -G0            (return to CP/M)
  23. ;        A>SAVE 65 MDM705.COM    (now have a modified .COM file)
  24. ;
  25. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  26. ;
  27. ; 83/03/29 - Modified to work with MDM705P    - Greg Louis
  28. ; 10/03/82 - First version of this file        - Paul Kelley (author)
  29. ;
  30. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  31. ;
  32. TRUE:        EQU    0FFH
  33. FALSE:        EQU    0
  34. ;
  35. INITMODADR:    EQU    01F8H        ;**THESE TWO ADDRESSES SHOULD BE CHECKED
  36. SETUPRADR:    EQU    242FH        ;**BY ANY PROGRAMMER UPDATING SUBSEQUENT
  37. TOGLPAR        EQU    1A1AH        ;**RELEASES.  ADDRESSES CORRESPOND TO
  38. PARITY        EQU    3813H        ;**'INITMOD' AND 'SETUPR'.
  39. S6        EQU    383CH
  40. ;
  41. INIT:        EQU    TRUE        ;change to TRUE if you have written a
  42.                     ;routine at location INITMOD in this
  43.                     ;file to initialize your modem port.
  44.                     ;(normally such a routine is not needed
  45.                     ;as this is done using CP/M CONFIG.COM).
  46.                     ;PMMI users should use FALSE here.
  47. ;
  48. SETUP:        EQU    FALSE        ;change to TRUE if you have written a
  49.                     ;routine at location SETUPR to change
  50.                     ;MSPEED, baud rate, etc.  PMMI users
  51.                     ;should use FALSE here.
  52. ;
  53. EOSCLR:        EQU    FALSE        ;change to TRUE if you have defined the
  54.                     ;clear to end of screen sequence for
  55.                     ;your terminal. "Clear to end of screen"
  56.                     ;is used on returning from terminal mode
  57.                     ;to keep the screen from getting jumbled
  58.                     ;if the remote can positon your cursor.
  59. ;
  60. SCRNCLR:    EQU    TRUE         ;change to TRUE if you have defined the
  61.                     ;home cursor and clear-screen sequence
  62.                     ;for your terminal.
  63.  
  64. PMMI:        EQU    FALSE        ;change to TRUE for PMMI.
  65. ;
  66. ;
  67. ; THE FOLLOWING MUST BE CHANGED FOR YOUR MICRO IF YOU DON'T HAVE AN H89
  68. ; OR A PMMI MODEM BOARD
  69. ;
  70.          IF    NOT PMMI
  71. MODDATP:    EQU    0        ;modem data port
  72. MODCTLP:    EQU    MODDATP+1    ;modem status port
  73. MODRCVB:    EQU    2        ;bit to test for received data
  74. MODRCVR:    EQU    2        ;modem receive ready
  75. MODSNDB:    EQU    1        ;bit to test for ready to send
  76. MODSNDR:    EQU    1        ;modem send ready bit
  77.          ENDIF            ;NOT PMMI
  78. ;
  79. ;
  80. ; THE FOLLOWING VALUES ARE FOR 'CLEAR TO END OF SCREEN'.  CHANGE TO SUIT
  81. ; YOUR TERMINAL.  THOSE SHOWN ARE FOR THE HEATH UNITS.  PLACE 'EOSCLR'
  82. ; FALSE IF YOU DON'T KNOW YOUR VALUES.
  83. ;
  84.          IF    EOSCLR
  85. CLR1:        EQU    1BH        ;ESC-J is the H89 clear to end
  86. CLR2:        EQU    'J'        ;of screen sequence
  87. CLR3:        EQU    0        ;the unused bytes MUST be 0
  88. CLR4:        EQU    0
  89.          ENDIF            ;EOSCLR
  90. ;
  91. ; THE FOLLOWING VALUES ARE FOR 'CLEAR SCREEN, LEAVE CURSOR AT TOP LEFT'.
  92. ; CHANGE TO SUIT YOUR TERMINAL.  THOSE SHOWN ARE FOR THE HEATH UNITS.
  93. ; PLACE 'SCRNCLR' FALSE IF YOU DON'T KNOW YOUR VALUES.
  94. ;
  95.  
  96.          IF    SCRNCLR
  97. SCLR1:        EQU    0CH
  98. SCLR2:        EQU    0
  99. SCLR3:        EQU    0        ;the unused bytes MUST be 0
  100. SCLR4:        EQU    0
  101.          ENDIF            ;SCRNCLR
  102. ;
  103. ;
  104. ; CLOCK SHOULD BE CHANGED TO SUIT YOUR SYSTEM.
  105. ;
  106. ;
  107.         ORG    100H
  108. ;
  109.         DS    3    ;(for  "JMP   START" instruction)
  110. ;
  111. PMMIBYTE:    DB    PMMI    ;don't change this line            103H
  112. CLOCK:        DB    18    ;clock speed in MHz x10, 25.5 MHz maxm    104H
  113.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  114. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200   105H
  115.                 ;6=2400, 7=4800, 8=9600 default modem speed
  116.                 ;PMMI and H89 routines reset this value
  117. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms   106H
  118.                 ;default time to send character in ter-
  119.                 ;minal mode file transfer for slow BBS.
  120. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 107H
  121.                 ;default time for extra wait after CRLF
  122.                 ;in terminal mode file transfer
  123. NOOFCOL:    DB    5    ;number of DIR columns shown        108H
  124. SETUPTST:    DB    SETUP    ;this line set from EQU above        109H
  125. SCRNTEST:    DB    SCRNCLR    ;test for home cursor and clear screen    10AH
  126.                 ;routine at CLRSCRN, don't change this
  127. BAKUPBYTE:    DB    FALSE    ;true=make .BAK file            10BH
  128. CKSUMDFLT:    DB    FALSE    ;true=default to Checksum checking    10CH
  129.                 ;false=default to CRC checking
  130. TOGGLECRC:    DB    TRUE    ;true=allow toggling of Checksum to CRC    10DH
  131. CONVBKSP:    DB    FALSE    ;true=convert backspace to rub        10EH
  132. TOGGLEBK:    DB    TRUE    ;true=allow toggling of bksp to rub    10FH
  133. ADDLF:        DB    FALSE    ;true=add LF after CR            110H
  134. TOGGLELF:    DB    TRUE    ;true=allow toggling of LF after CR    111H
  135. TRANLOGON:    DB    FALSE    ;true=allow transmission of logon    112H
  136.                 ;write logon sequence at location LOGON
  137. SAVCCP:        DB    TRUE    ;true=do not overwrite CCP        113H
  138. LOCONEXTCHR:    DB    FALSE    ;true=local command if EXTCHR precedes    114H
  139.                 ;false=not local command if EXTCHR precedes
  140. TOGGLELOC:    DB    TRUE    ;true=allow toggling of LOCONEXTCHR    115H
  141. LSTTST:        DB    TRUE    ;true=allow toggling of printer on/off    116H
  142.                 ;in terminal mode, set to false if your
  143.                 ;printer can't keep up with the modem
  144. XOFFTST:    DB    FALSE    ;true=allow testing of XOFF from remote 117H
  145.                 ;while transmitting a file in term. mode
  146. XONWAIT:    DB    FALSE    ;true=wait for XON after sending CR    118H
  147.                 ;while transmitting a file in term. mode
  148. TOGXOFF:    DB    TRUE    ;true=allow toggling of XOFF testing    119H
  149. EXITCHR:    DB    'E'-40H    ;^E = Exit without disconnect        11AH
  150. LOGCHR:        DB    'O'-40H    ;^O = Send logon            11BH
  151. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            11CH
  152. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        11DH
  153. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        11EH
  154. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        11FH
  155. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        120H
  156. ;
  157. ;
  158. ; Equates used only by PMMI routines grouped together here
  159. ;
  160. PULSERATE:    DB    125    ;125 for 20pps, 250 for 10pps on PMMI    121H
  161.                 ;not used if PMMI FALSE
  162. CLDBOOT:    DW    0000H    ;currently set to warm boot with    122-123H
  163.                 ;BYE routine for PMMI, put your cold
  164.                 ;boot entry here if you have one and
  165.                 ;desire to do on BYE
  166. BRKCHR:        DB    '@'-40H ;^@ = Transmit "BREAK" with PMMI    124H
  167. CHGBAUD:    DB    'B'-40H    ;^B = Used with PMMI in terminal    125H
  168.                 ;mode to change baud rate on fly
  169. DISCCHR:    DB    'D'-40H    ;^D = PMMI Disconnect            126H
  170. ;
  171. ; (End of special PMMI routines)
  172. ;
  173. ;
  174. IN$MODCTLP:    IN    MODCTLP ! RET    ;in modem control port             127H
  175.         DB    0,0,0,0,0,0,0    ;spares if needed for non-PMMI    12AH
  176. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        131H
  177.         DB    0,0,0,0,0,0,0    ;spares if needed for non-PMMI    134H
  178. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13BH
  179.         DB    0,0,0,0,0,0,0    ;spares if needed for non-PMMI    13EH
  180. ;
  181.          IF    PMMI
  182.         DS    12    ;not changed                145H
  183. IN$BAUDRP:    IN    BAUDRP    ! RET    ;in baudrate port        151H
  184. OUT$BAUDRP:    OUT    BAUDRP    ! RET    ;out baudrate port        154H
  185. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem control port #2    157H
  186. OUT$MODCTLP:    OUT    MODCTLP        ;out modem control port        15AH
  187.         DS    9        ;line not changed        15CH
  188.          ENDIF            ;PMMI
  189. ;
  190.          IF    NOT PMMI
  191. ANI$MODSNDB:    ANI    MODSNDB ! RET    ;bit to test for send ready    145H
  192. CPI$MODSNDR:    CPI    MODSNDR ! RET    ;value of send bit when ready    148H
  193. ANI$MODRCVB:    ANI    MODRCVB ! RET    ;bit to test for receive ready    14BH
  194. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of rcv. bit when ready    14EH
  195.         DS    15        ;PMMI only calls        151H
  196. ;
  197. LOGONPTR:    DW    LOGON        ;for user message.        160H
  198. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    162H
  199.         ENDIF            ;non-PMMI
  200. ;
  201. ;
  202. JMP$SETUPR:                ;                165H
  203. ;
  204.          IF     SETUP    
  205.         JMP    SETUPR
  206.          ENDIF            ;SETUP
  207. ;
  208.          IF    NOT SETUP
  209.         DS    3
  210.          ENDIF            ;NOT SETUP
  211. ;
  212. PARTY:        DB    4EH
  213. PARTOG:        DB    4EH+7AH
  214. CLREOS:        CALL    JMP$ILPRT    ;                16AH
  215. ;
  216.          IF    EOSCLR
  217.         DB    CLR1,CLR2,CLR3,CLR4,0
  218.         RET
  219.          ENDIF            ;EOSCLR
  220. ;
  221.          IF    NOT EOSCLR
  222.         DB    0,0,0,0,0
  223.         RET
  224.          ENDIF            ;NOT EOSCLR
  225. ;
  226. CLRSCRN:    CALL    JMP$ILPRT    ;                173H
  227. ;
  228.          IF    SCRNCLR
  229.         DB    SCLR1,SCLR2,SCLR3,SCLR4,0
  230.         RET
  231.          ENDIF            ;SCRNCLR
  232. ;
  233.          IF    NOT SCRNCLR
  234.         DB    0,0,0,0,0
  235.         RET
  236.          ENDIF            ;NOT SCRNCLR
  237. ;
  238. JMP$ILPRT:    DS    3        ;                17CH
  239. JMP$INLNCOMP:    DS    3        ;                17FH
  240. JMP$INBUF    DS    3        ;                182H
  241. ;
  242. ;
  243.         ORG    INITMODADR
  244. ;
  245.         IF    (NOT INIT) AND (NOT PMMI)
  246. INITMOD:    RET
  247.          ENDIF            ;NOT INIT AND NOT PMMI
  248. ;
  249. ;
  250. ; *** WARNING - YOUR ROUTINE AT INITMOD CANNOT EXCEED 80 BYTES.   ***
  251. ; *** YOUR ROUTINE AT SETUPR CANNNOT EXCEED 900 BYTES.  THESE     ***
  252. ; *** OVERWRITE AREAS NORMALLY USED BY THE PMMI INITIALIZATION.   ***
  253. ;
  254. ; Control and status ports
  255. ;
  256.          IF    INIT
  257. ;
  258. BAUDRP      EQU    4
  259. INITMOD:  MVI    A,1            ;MSPEED 300 baud value
  260.       STA    MSPEED
  261. ;
  262.       MVI    A,36H
  263.       OUT     BAUDRP
  264.       MVI    A,0AAH
  265.       OUT    MODCTLP
  266.       MVI    A,40H
  267.       OUT    MODCTLP
  268.       LDA    PARTY
  269.       OUT    MODCTLP
  270.       MVI    A,27H
  271.       OUT    MODCTLP
  272.       RET
  273. ;
  274.       ORG    TOGLPAR
  275.       CALL    INITMOD
  276. ;
  277.        ENDIF            ;INIT
  278. ;
  279.       ORG    SETUPRADR
  280.       RET
  281. ;
  282. ; You can put in a message at this location which can be called up with
  283. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  284. ; desired.  End with a 0.  This area overwrite a PMMI dialing routine.
  285. ;
  286.        IF    NOT PMMI
  287. LOGON:      DB    0,0
  288.        ENDIF        ;not PMMI
  289. ;       
  290.       ORG    PARITY
  291.       NOP
  292.       NOP
  293.       NOP
  294.       DS    10
  295.       JMP    S6
  296.       END
  297.