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-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  11KB  |  375 lines

  1.  
  2. ; M712-1.ASM -- Osborne Executive overlay file for MDM7xx - 11/11/83
  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 300 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. ; (IF USING DDT FOR CP/M 2.2)
  24. ;
  25. ;        A>DDT MDM7xx.COM
  26. ;        DDT VERS 2.2
  27. ;        NEXT PC
  28. ;        4300 0100
  29. ;        -IM7OX-1.HEX        (note the "I" command)
  30. ;        -R            ("R" loads in the .HEX file)
  31. ;        NEXT PC
  32. ;        -G0
  33. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  34. ;
  35. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  36. ;
  37. ; (IF USING SID FOR CP/M+)
  38. ;
  39. ;        A>SID MDM7xx.COM
  40. ;        CP/M 3 SID - Version 3.0
  41. ;        NEXT MSZE  PC  END
  42. ;        4300 4300 0100 CFFF
  43. ;        #RM7OX-1.HEX        ("R" loads in the .HEX file)
  44. ;        NEXT MSZE  PC  END
  45. ;        ???? 4300 0100 CFFF
  46. ;        #WMDM7xx.COM,100,42FF    (save the patched file)
  47. ;        #G0            (return to CP/M)
  48. ;
  49. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  50. ;
  51. ; 11/11/83 - Renamed to M7OX-1.ASM, no changes    - Irv Hoff
  52. ; 07/27/83 - Renamed for use with MDM712    - Irv Hoff
  53. ; 07/17/83 - Combined George Peace Osborne
  54. ;         version with Roy Robinson Osborne
  55. ;         version then renamed MDM711OX    - Irv Hoff
  56. ;
  57. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  58. ;
  59. BELL:        EQU    07H    ;Bell
  60. CR:        EQU    0DH    ;Carriage return
  61. ESC:        EQU    1BH    ;Escape
  62. LF:        EQU    0AH    ;Linefeed
  63. ;
  64. YES:        EQU    0FFH
  65. NO:        EQU    0
  66. ;
  67. ;
  68. PORT:        EQU    0CH    ;Osborne Executive serial output port
  69. MODCTL1:    EQU    PORT+1    ;Modem control port
  70. MODDATP:    EQU    PORT    ;Modem data port
  71. BAUDRP:        EQU    04H    ;Baud rate port
  72. MODRCVB:    EQU    01H    ;Your bit to test for receive
  73. MODRCVR:    EQU    01H    ;Your value when receive ready
  74. MODSNDB:    EQU    04H    ;Your bit to test for send
  75. MODSNDR:    EQU    04H    ;Your value when send ready        
  76. ;
  77. LSBAUD:        EQU    80H    ;default baud rate (least signif. byte)
  78. MSBAUD:        EQU    01H    ;default baud rate (most  signif. byte)
  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    1    ;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    YES    ;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    NO    ;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    NO    ;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    YES    ;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 #1    15AH
  156. OUT$MODCTL2:    NOP  !    NOP    ! RET    ;out modem control port #2    15DH
  157. ;
  158. ;
  159. LOGONPTR:    DW    LOGON        ;for user message.        160H
  160.         DS    6        ;                162H
  161. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  162. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  163.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    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. JMP$SPCLMENU:    JMP    SPCLMENU    ;                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.  Last entry must be 0.  Any other 0's act as NOP's.
  184. ;
  185. CLREOS:        CALL    JMP$ILPRT    ;                195H
  186.         DB    ESC,'Y',0,0,0    ;                198H
  187.         RET            ;                19DH
  188. ;
  189. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  190.         DB    ESC,'Z',0,0,0    ;                1A1H
  191.         RET            ;                1A6H
  192. ;
  193. ;
  194. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  195.         DB    'Version for Osborne Executive serial port 0CH'
  196.         DB    CR,LF,0
  197.         RET
  198. ;.....
  199. ;
  200. ;
  201. ;-----------------------------------------------------------------------
  202. ;
  203. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  204. ;     end of your last routine should terminate by 0400H (601 bytes
  205. ;     available after start of SYSVER) if using the Hayes Smartmodem
  206. ;     or by address 0C00H (2659 bytes) otherwise.
  207. ;
  208. ;-----------------------------------------------------------------------
  209. ;
  210. ; You can put in a message at this location which can be called up with
  211. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  212. ; desired.  End with a 0.
  213. ;
  214. ;
  215. LOGON:        DB    'This is an Osborne Executive computer',CR,LF,0
  216. ;.....
  217. ;
  218. ;
  219. ; This routine allows a 300 ms. break tone to be sent to reset some
  220. ; time-shar computers.
  221. ;
  222. SENDBRK:  MVI    A,5
  223.       OUT    MODCTL1
  224.       MVI    A,0F8H        ;SEND A BREAK TONE
  225.       JMP    GOODBYE1
  226. ;.....
  227. ;
  228. ;
  229. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  230. ; length of time to disconnect some modems such as the Bell 212A, etc.    
  231. ;
  232. GOODBYE:  MVI    A,5
  233.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  234.       MVI    A,68H        ;TURN OFF DTR
  235. ;
  236. GOODBYE1: OUT    MODCTL1
  237.       MVI    B,3        ;WAIT FOR 300 MS.
  238.       CALL    JMP$TIMER
  239.       MVI    A,5
  240.       OUT    MODCTL1
  241.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  242.       OUT    MODCTL1
  243.       RET
  244. ;.....
  245. ;
  246. ;    
  247. ; Osborne Executive initialization
  248. ;
  249. INITMOD:  MVI    A,0        ;SELECT REGISTER
  250.       OUT    MODCTL1
  251.       MVI    A,18H        ;THROW OUT OF MODE
  252.       OUT    MODCTL1
  253.       MVI    A,04H        ;SELECT REGISTER
  254.       OUT    MODCTL1
  255.       MVI    A,44H        ;SET ASCII PARAMETERS
  256.       OUT    MODCTL1
  257.       MVI    A,03H        ;SELECT REG.
  258.       OUT    MODCTL1
  259.       MVI    A,0C1H        ;ENABLE RECEIVE
  260.       OUT    MODCTL1
  261.       MVI    A,05H        ;SELECT REG.
  262.       OUT    MODCTL1
  263.       MVI    A,0EAH        ;ENABLE SEND, 'DTR', 'RTS'
  264.       OUT    MODCTL1
  265. ;
  266. INITMOD1: MVI    A,1        ;DEFAULT TRANSFER TIME TO 300 BAUD
  267.       STA    MSPEED
  268. ;
  269. INITMOD2: MVI    A,LSBAUD    ;SET "LSP" TO BAUD RATE
  270.       OUT    BAUDRP
  271. ;
  272. INITMOD3: MVI    A,MSBAUD    ;SET "MSP" TO BAUD RATE
  273.       OUT    BAUDRP
  274.       RET
  275. ;.....
  276. ;
  277. ;
  278. ; Setup routine to allow changing modem speed with the SET command.
  279. ;
  280. SETUPR:
  281.       LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  282.       CALL    JMP$ILPRT
  283.       DB    'Input Baud Rate (300,600,1200,2400,4800,9600,19200): ',0
  284.       CALL    JMP$INBUF
  285.       LXI    D,BAUDBUF+2
  286.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  287.       DB    '300',0
  288.       JNC    OK300        ;GO IF GOT MATCH
  289.       CALL    JMP$INLNCOMP
  290.       DB    '600',0
  291.       JNC    OK600
  292.       CALL    JMP$INLNCOMP
  293.       DB    '1200',0
  294.       JNC    OK1200
  295.       CALL    JMP$INLNCOMP
  296.       DB    '2400',0
  297.       JNC    OK2400
  298.       CALL    JMP$INLNCOMP
  299.       DB    '4800',0
  300.       JNC    OK4800
  301.       CALL    JMP$INLNCOMP
  302.       DB    '9600',0
  303.       JNC    OK9600
  304.       CALL    JMP$INLNCOMP
  305.       DB    '19200',0
  306.       JNC    OK19200
  307.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  308.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  309.       JMP    SETUPR        ;TRY AGAIN
  310. ;
  311. OK300:      MVI    A,1        ;MSPEED VALUE FOR FILE TRANFER TIME
  312.       LHLD    BD300
  313.       JMP    LOADBD
  314. ;
  315. OK600:      MVI    A,3
  316.       LHLD    BD600
  317.       JMP    LOADBD
  318. ;
  319. OK1200:      MVI    A,5
  320.       LHLD    BD1200
  321.       JMP    LOADBD
  322. ;
  323. OK2400:      MVI    A,6
  324.       LHLD    BD2400
  325.       JMP    LOADBD
  326. ;
  327. OK4800:      MVI    A,7
  328.       LHLD    BD4800
  329.       JMP    LOADBD
  330. ;
  331. OK9600:      MVI    A,8
  332.       LHLD    BD9600
  333.       JMP    LOADBD
  334. ;
  335. OK19200:  MVI    A,9
  336.       LHLD    BD19200
  337. ;
  338. LOADBD:      STA    INITMOD1+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  339.       MOV    A,L        ;GET "LSP" BAUD RATE BYTE
  340.       STA    INITMOD2+1    ;SEND TO 8253 TIMER FOR NEW BAUDRATE
  341.       MOV    A,H        ;GET "MSP" BAUD RATE BYTE
  342.       STA    INITMOD3+1
  343.       JMP    INITMOD1    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  344. ;.....
  345. ;
  346. ;
  347. ; Table of baud rate values
  348. ;
  349. BD300:      DW    0180H        ;300 baud
  350. BD600:      DW    00C0H        ;600 baud
  351. BD1200:      DW    0060H        ;1200 baud
  352. BD2400:      DW    0030H        ;2400 baud
  353. BD4800:      DW    0018H        ;4800 baud
  354. BD9600:      DW    000CH        ;9600 baud
  355. BD19200:  DW    0006H        ;19200 baud
  356. ;
  357. BAUDBUF:  DB    10,0
  358.       DS    10
  359. ;.....
  360. ;
  361. ;
  362. ; The following routine can be used as an auxiliary menu for notes of
  363. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  364. ; this is unavailable without a special address change.
  365. ;
  366. SPCLMENU: RET
  367. ;.....
  368. ;
  369. ;
  370. ; NOTE:   MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  371. ;                  0C00H (without Smartmodem)
  372. ;
  373.       END
  374. ;
  375.