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 / M7OX-2.AQM / M7OX-2.ASM
Assembly Source File  |  2000-06-30  |  12KB  |  414 lines

  1.  
  2. ; M7OX-2.ASM -- Osborne Executive overlay file for MDM7xx - 03/16/85
  3. ;
  4. ; You will want to look this file over carefully. There are a number of
  5. ; options that you can use to configure the program to suit your taste.
  6. ; This file adapts the Osborne Executive computer to MDM7xx.
  7. ;
  8. ; Much of the information contained here is not in the MDM7xx.ASM file.
  9. ;
  10. ; Edit this file for your preferences then follow the "TO USE:" example
  11. ; shown    below.
  12. ;
  13. ; Use the "SET" command to change the baudrate when desired.  It starts
  14. ; out at 1200 baud when the program is first called up.
  15. ;
  16. ;    TO USE:    First edit this file filling in answers for your own
  17. ;        equipment.  Then assemble with MAC.COM or equivalent
  18. ;        assembler.  Then use 'DDT' or 'SID' to overlay the
  19. ;        results    of this program to the original .COM file:
  20. ;
  21. ; =   =      =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  22. ;
  23. ;
  24. ;=============================================================================
  25. ;
  26. ;    SPECIAL    NOTE:  The MDMLNK.COM utility, if available to you, will
  27. ;        overlay    the .HEX file on the .COM file in one simple step.
  28. ;        See MDMLNK instructions for further details.
  29. ;
  30. ;=============================================================================
  31. ;
  32. ; (IF USING DDT FOR CP/M 2.2)
  33. ;
  34. ;        A>DDT MDM7xx.COM
  35. ;        DDT VERS 2.2
  36. ;        NEXT PC
  37. ;        4A00 0100
  38. ;        -IM7OX-1.HEX        (note the "I" command)
  39. ;        -R            ("R" loads in the .HEX file)
  40. ;        NEXT PC
  41. ;        -G0
  42. ;        A>SAVE 73 MDM7xx.COM    (now have a modified .COM file)
  43. ;
  44. ; =   =      =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  45. ;
  46. ; (IF USING SID FOR CP/M+)
  47. ;
  48. ;        A>SID MDM7xx.COM
  49. ;        CP/M 3 SID - Version 3.0
  50. ;        NEXT MSZE  PC  END
  51. ;        4A00 4A00 0100 CFFF
  52. ;        #RM7OX-1.HEX        ("R" loads in the .HEX file)
  53. ;        NEXT MSZE  PC  END
  54. ;        ???? 4A00 0100 CFFF
  55. ;        #WMDM7xx.COM,100,42FF    (save the patched file)
  56. ;        #G0            (return    to CP/M)
  57. ;
  58. ; =   =      =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  59. ;
  60. ; 03/16/85 - Fixed SIO parameter error in
  61. ;         GOODBYE and SENDBRK routines.
  62. ;         Implimented all baud rates
  63. ;         supported by MDM7xx.         - Ted Quade
  64. ; 06/01/84 - Minor changes for MDM740        - Robert Flagg
  65. ; 11/11/83 - Renamed to M7OX-1.ASM, no changes    - Irv Hoff
  66. ; 07/27/83 - Renamed for use with MDM712    - Irv Hoff
  67. ; 07/17/83 - Combined George Peace Osborne
  68. ;         version with Roy Robinson Osborne
  69. ;         version then renamed MDM711OX    - Irv Hoff
  70. ;
  71. ; =   =      =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  72. ;
  73. BELL:        EQU    07H    ;Bell
  74. CR:        EQU    0DH    ;Carriage return
  75. ESC:        EQU    1BH    ;Escape
  76. LF:        EQU    0AH    ;Linefeed
  77. ;
  78. YES:        EQU    0FFH
  79. NO:        EQU    0
  80. ;
  81. ;
  82. PORT:        EQU    0CH    ;Osborne Executive serial output port
  83. MODCTL1:    EQU    PORT+1    ;Modem control port
  84. MODDATP:    EQU    PORT    ;Modem data port
  85. BAUDRP:        EQU    04H    ;Baud rate port
  86. MODRCVB:    EQU    01H    ;Your bit to test for receive
  87. MODRCVR:    EQU    01H    ;Your value when receive ready
  88. MODSNDB:    EQU    04H    ;Your bit to test for send
  89. MODSNDR:    EQU    04H    ;Your value when send ready        
  90. ;
  91. LSBAUD:        EQU    60H    ;default baud rate (least signif. byte)
  92. MSBAUD:        EQU    00H    ;default baud rate (most  signif. byte)
  93. ;
  94.         ORG    100H
  95. ;
  96. ;
  97. ; Change the clock speed to suit your system
  98. ;
  99.         DS    3    ;(for  "JMP   START" instruction)
  100. ;
  101. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  102. AUTODIAL:    DB    YES    ;yes=HAYES Smartmodem, no=non-Hayes    104H
  103. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  104. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  105.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  106. MSPEED:        DB    5    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  107.                 ;6=2400    7=4800 8=9600 9=19200 default
  108. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  109.                 ;default time to send character in ter-
  110.                 ;minal mode file transfer for slow BBS.
  111. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  112.                 ;default time for extra wait after CRLF
  113.                 ;in terminal mode file transfer
  114. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  115. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  116. SCRNTEST:    DB    YES    ;cursor control routine         10CH
  117. RETRY:        DB    YES    ;yes=reset the error limit to try again 10DH
  118.                 ;no=abort after 10 consecutive errors
  119. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  120. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  121. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  122. CONVRUB:    DB    YES    ;yes=convert rub to backspace        111H
  123. TOGGLEBK:    DB    YES    ;yes=allow toggling of rub to backspace 112H
  124. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  125.                 ;terminal mode (added by remote echo)
  126. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  127. TRANLOGON:    DB    NO    ;yes=allow transmission of logon    115H
  128.                 ;write logon sequence at location LOGON
  129. SAVCCP:        DB    YES    ;yes=do    not overwrite CCP        116H
  130. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  131.                 ;no=external command if EXTCHR precedes
  132. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  133. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  134. XOFFTST:    DB    NO    ;yes=check for XOFF from remote    while    11AH
  135.                 ;sending a file in terminal mode
  136. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  137.                 ;sending a file in terminal mode
  138. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  139. IGNORCTL:    DB    NO    ;yes=CTL-chars above ^M not displayed    11DH
  140. EXTRA1:        DB    0    ;for future expansion            11EH
  141. EXTRA2:        DB    0    ;for future expansion            11FH
  142. BRKCHR:        DB    '\'-40H    ;^\ = Send a 300 ms. break tone        120H
  143. 20H
  144. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  145. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  146. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  147. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  148. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  149. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  150. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  151. ;
  152. ;
  153.         DS    2        ;                128H
  154. IN$MODCTL1:    MVI    A,10H        ;channel 0, reset interrupts    12AH
  155.         OUT    MODCTL1
  156.         IN    MODCTL1        ;get the status bits
  157.         RET
  158.         DS    3
  159. ;
  160. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  161.         DS    7
  162. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  163.         DS    7
  164. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  165. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of receive bit when rdy    14BH
  166. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  167. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  168.         DS    6        ;                154H
  169. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port #1    15AH
  170. OUT$MODCTL2:    NOP  !    NOP    ! RET    ;out modem control port #2    15DH
  171. ;
  172. ;
  173. LOGONPTR:    DW    LOGON        ;for user message.        160H
  174.         DS    6        ;                162H
  175. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  176. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  177.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  178.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  179.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  180. JMP$SETUPR:    JMP    SETUPR        ;                177H
  181. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  182. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  183. JMP$BREAK:    JMP    SENDBRK        ;                180H
  184. ;
  185. ;
  186. ; Do not change the following six lines.
  187. ;
  188. JMP$ILPRT:    DS    3        ;                183H
  189. JMP$INBUF    DS    3        ;                186H
  190. JMP$INLNCOMP:    DS    3        ;                189H
  191. JMP$INMODEM    DS    3        ;                18CH
  192. JMP$NXTSCRN:    DS    3        ;                18FH
  193. JMP$TIMER:    DS    3        ;                192H
  194. ;
  195. ;
  196. ; Clear    sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  197. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  198. ;
  199. CLREOS:        CALL    JMP$ILPRT    ;                195H
  200.         DB    ESC,'Y',0,0,0    ;                198H
  201.         RET            ;                19DH
  202. ;
  203. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  204.         DB    ESC,'Z',0,0,0    ;                1A1H
  205.         RET            ;                1A6H
  206. ;
  207. ;
  208. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  209.         DB    'Version for Osborne Executive serial port 0CH'
  210.         DB    CR,LF,0
  211.         RET
  212. ;.....
  213. ;
  214. ;
  215. ;-----------------------------------------------------------------------
  216. ;
  217. ; NOTE:     You can change the SYSVER message to be longer or shorter.  The
  218. ;     end of    your last routine should terminate by 0400H (601 bytes
  219. ;     available after start of SYSVER) if using the Hayes Smartmodem
  220. ;     or by address 0C00H (2659 bytes) otherwise.
  221. ;
  222. ;-----------------------------------------------------------------------
  223. ;
  224. ; You can put in a message at this location which can be called up with
  225. ; CTL-O    if TRANLOGON has been set TRUE.  You can put in several lines if
  226. ; desired.  End with a 0.
  227. ;
  228. ;
  229. LOGON:        DB    'This is an Osborne Executive computer',CR,LF,0
  230. ;.....
  231. ;
  232. ;
  233. ; This routine allows a 300 ms. break tone to be sent to reset some
  234. ; time-shar computers.
  235. ;
  236. SENDBRK:  MVI    A,5
  237.       OUT    MODCTL1
  238.       MVI    A,0FAH        ;SEND A    BREAK TONE
  239.       JMP    GOODBYE1
  240. ;.....
  241. ;
  242. ;
  243. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  244. ; length of time to disconnect some modems such as the Bell 212A, etc.    
  245. ;
  246. GOODBYE:  MVI    A,5
  247.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  248.       MVI    A,7AH        ;SET BREAK, TURN OFF DTR
  249. ;
  250. GOODBYE1: OUT    MODCTL1
  251.       MVI    B,3        ;WAIT FOR 300 MS.
  252.       CALL    JMP$TIMER
  253.       MVI    A,5
  254.       OUT    MODCTL1
  255.       MVI    A,0EAH        ;RESTORE TO NORMAL, 8 BITS, DTR/RTS ON, ETC.
  256.       OUT    MODCTL1
  257.       RET
  258. ;.....
  259. ;
  260. ;    
  261. ; Osborne Executive initialization
  262. ;
  263. INITMOD:  MVI    A,0        ;SELECT REGISTER
  264.       OUT    MODCTL1
  265.       MVI    A,18H        ;THROW OUT OF MODE
  266.       OUT    MODCTL1
  267.       MVI    A,04H        ;SELECT    REGISTER
  268.       OUT    MODCTL1
  269.       MVI    A,44H        ;SET ASCII PARAMETERS
  270.       OUT    MODCTL1
  271.       MVI    A,03H        ;SELECT    REG.
  272.       OUT    MODCTL1
  273.       MVI    A,0C1H        ;ENABLE    RECEIVE
  274.       OUT    MODCTL1
  275.       MVI    A,05H        ;SELECT    REG.
  276.       OUT    MODCTL1
  277.       MVI    A,0EAH        ;ENABLE    SEND, 'DTR', 'RTS'
  278.       OUT    MODCTL1
  279. ;
  280. INITMOD1: MVI    A,5        ;DEFAULT TRANSFER TIME TO 1200 BAUD
  281.       STA    MSPEED
  282. ;
  283. INITMOD2: MVI    A,LSBAUD    ;SET "LSP" TO BAUD RATE
  284.       OUT    BAUDRP
  285. ;
  286. INITMOD3: MVI    A,MSBAUD    ;SET "MSP" TO BAUD RATE
  287.       OUT    BAUDRP
  288.       RET
  289. ;.....
  290. ;
  291. ;
  292. ; Setup    routine to allow changing modem speed with the SET command.
  293. ;
  294. SETUPR:
  295.       LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  296.       CALL    JMP$ILPRT
  297.       DB    'Input Baud Rate (110,300,450,600,710,1200,'
  298.       DB    '2400,4800,9600,19200): ',0
  299.       CALL    JMP$INBUF
  300.       LXI    D,BAUDBUF+2
  301.       CALL    JMP$INLNCOMP
  302.       DB    '110',0
  303.       JNC    OK110
  304.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  305.       DB    '300',0
  306.       JNC    OK300        ;GO IF GOT MATCH
  307.       CALL    JMP$INLNCOMP
  308.       DB    '450',0
  309.       JNC    OK450
  310.       CALL    JMP$INLNCOMP
  311.       DB    '600',0
  312.       JNC    OK600
  313.       CALL    JMP$INLNCOMP
  314.       DB    '710',0
  315.       JNC    OK710
  316.       CALL    JMP$INLNCOMP
  317.       DB    '1200',0
  318.       JNC    OK1200
  319.       CALL    JMP$INLNCOMP
  320.       DB    '2400',0
  321.       JNC    OK2400
  322.       CALL    JMP$INLNCOMP
  323.       DB    '4800',0
  324.       JNC    OK4800
  325.       CALL    JMP$INLNCOMP
  326.       DB    '9600',0
  327.       JNC    OK9600
  328.       CALL    JMP$INLNCOMP
  329.       DB    '19200',0
  330.       JNC    OK19200
  331.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  332.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  333.       JMP    SETUPR        ;TRY AGAIN
  334. ;
  335. OK110:      MVI    A,0        ;MSPEED    VALUE FOR FILE TRANFER TIME
  336.       LHLD    BD110
  337.       JMP    LOADBD
  338. ;
  339. OK300:      MVI    A,1        ;MSPEED    VALUE FOR FILE TRANFER TIME
  340.       LHLD    BD300
  341.       JMP    LOADBD
  342. ;
  343. OK450:      MVI    A,2        ;MSPEED    VALUE FOR FILE TRANFER TIME
  344.       LHLD    BD450
  345.       JMP    LOADBD
  346. ;
  347. OK600:      MVI    A,3
  348.       LHLD    BD600
  349.       JMP    LOADBD
  350. ;
  351. OK710:      MVI    A,4
  352.       LHLD    BD710
  353.       JMP    LOADBD
  354. ;
  355. OK1200:      MVI    A,5
  356.       LHLD    BD1200
  357.       JMP    LOADBD
  358. ;
  359. OK2400:      MVI    A,6
  360.       LHLD    BD2400
  361.       JMP    LOADBD
  362. ;
  363. OK4800:      MVI    A,7
  364.       LHLD    BD4800
  365.       JMP    LOADBD
  366. ;
  367. OK9600:      MVI    A,8
  368.       LHLD    BD9600
  369.       JMP    LOADBD
  370. ;
  371. OK19200:  MVI    A,9
  372.       LHLD    BD19200
  373. ;
  374. LOADBD:      STA    INITMOD1+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  375.       MOV    A,L        ;GET "LSP" BAUD RATE BYTE
  376.       STA    INITMOD2+1    ;SEND TO 8253 TIMER FOR NEW BAUDRATE
  377.       MOV    A,H        ;GET "MSP" BAUD RATE BYTE
  378.       STA    INITMOD3+1
  379.       JMP    INITMOD1    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  380. ;.....
  381. ;
  382. ;
  383. ; Table    of baud rate values
  384. ;
  385. BD110:    DW    0417H        ;110 baud
  386. BD300:      DW    0180H        ;300 baud
  387. BD450:    DW    0100H        ;450 baud 
  388. BD600:      DW    00C0H        ;600 baud
  389. BD710:    DW    00A2H           ;710 baud
  390. BD1200:      DW    0060H        ;1200 baud
  391. BD2400:      DW    0030H        ;2400 baud
  392. BD4800:      DW    0018H        ;4800 baud
  393. BD9600:      DW    000CH        ;9600 baud
  394. BD19200:  DW    0006H        ;19200 baud
  395. ;
  396. BAUDBUF:  DB    10,0
  397.       DS    10
  398. ;.....
  399. ;
  400. ;
  401. ; The following routine can be used as an auxiliary menu for notes of
  402. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  403. ; this is unavailable without a special address change.
  404. ;
  405. SPCLMENU: RET
  406. ;.....
  407. ;
  408. ;
  409. ; NOTE:      MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  410. ;                  0C00H    (without Smartmodem)
  411. ;
  412.       END
  413. ;
  414.