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 / M7OA-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  13KB  |  443 lines

  1. ; M7OA-1.ASM -- Otrona Attache overlay file for MDM7xx - 11/11/83
  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. ; This file adapts the Otrona Attache computer to MDM7xx.
  6. ;
  7. ; Much of the information contained here is not in the MDM7xx.ASM file.
  8. ;
  9. ; Edit this file for your preferences then follow the "TO USE:" example
  10. ; shown below.
  11. ;
  12. ; Use the SET command to change baud rate if needed.  This updates the
  13. ; CMOS RAM value.  When the program is first called used, the baud rate
  14. ; is the same as currently set by the Valet function.
  15. ;
  16. ;    TO USE: First edit this file filling in answers for your own
  17. ;        equipment.  Then assemble with ASM.COM or equivalent
  18. ;        assembler.  Then use DDT to overlay the the results
  19. ;        of this program to the original .COM file:
  20. ;
  21. ;        A>DDT MDM7xx.COM
  22. ;        DDT VERS 2.2
  23. ;        NEXT  PC
  24. ;        4300 0100
  25. ;        -IM7OA-1.HEX        (note the "I" command)
  26. ;        -R            ("R" loads in the .HEX file)
  27. ;        NEXT  PC
  28. ;        4300 0000
  29. ;        -G0            (return to CP/M)
  30. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  31. ;
  32. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  33. ;
  34. ; 11/11/83 - Renamed to M7OA-1.ASM, no changes    - Irv Hoff
  35. ; 09/01/83 - Updated to work with MDM712    - Irv Hoff
  36. ; 08/27/83 - Added optional BIOS patch        - Arley Dealey
  37. ; 06/30/83 - Revised to work with Otrona    - Arley Dealey
  38. ; 06/22/83 - Revised to work with MDM710    - Irv Hoff
  39. ; 05/27/83 - Updated to work with MDM709    - Irv Hoff
  40. ; 05/15/83 - Revised to work with MDM708    - Irv Hoff
  41. ; 04/11/83 - Updated to work with MDM707    - Irv Hoff
  42. ; 04/04/83 - Updated to work with MDM706    - Irv Hoff
  43. ; 03/03/83 - Modified MDM705KP for XEROX
  44. ;         820-II computers with external
  45. ;         modems                - David Wurz    
  46. ;
  47. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  48. ;
  49. ;
  50. YES:        EQU    0FFH
  51. NO:        EQU    0
  52. ;
  53. ;
  54. BDOS        EQU    005H
  55. BELL:        EQU    07H        ;bell
  56. CR:        EQU    0DH        ;carriage return
  57. ESC:        EQU    1BH        ;escape
  58. LF:        EQU    0AH        ;linefeed
  59. WARMSTART:    EQU    0000H
  60. ;
  61. ;
  62. PORT:        EQU    0F0H        ;Otrona Attache modem port
  63. MODCTL1:    EQU    PORT+1        ;Modem control port
  64. MODDATP:    EQU    PORT        ;Modem data port
  65. MODCTL2:    EQU    PORT+1        ;Modem status port
  66. MODRCVB:    EQU    01H        ;Your bit to test for receive
  67. MODRCVR:    EQU    01H        ;Your value when receive ready
  68. MODSNDB:    EQU    04H        ;Your bit to test for send
  69. MODSNDR:    EQU    04H        ;Your value when send ready
  70. ;
  71. ;
  72.         ORG    100H
  73. ;
  74. ;
  75. ; Change the clock speed to suit your system
  76. ;
  77.         DS    3    ;(for  "JMP   START" instruction)
  78. ;
  79. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  80. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  81. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  82. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  83.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  84. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  85.                 ;6=2400 7=4800 8=9600 9=19200 default
  86. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  87.                 ;default time to send character in ter-
  88.                 ;minal mode file transfer for slow BBS.
  89. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  90.                 ;default time for extra wait after CRLF
  91.                 ;in terminal mode file transfer
  92. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  93. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  94. SCRNTEST:    DB    YES    ;Cursor control routine         10CH
  95. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  96.                 ;no=resend a record after a valid NAK
  97. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  98. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  99. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  100. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  101. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  102. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  103.                 ;terminal mode (added by remote echo)
  104. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  105. TRANLOGON:    DB    YES    ;yes=allow transmission of LOGON    115H
  106.                 ;write logon sequence at location LOGON
  107. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  108. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  109.                 ;no=external command if EXTCHR precedes
  110. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  111. LSTTST:        DB    YES    ;yes=allow toggling of printer on/off    119H
  112. XOFFTST:    DB    NO    ;yes=check for XOFF from remote    while    11AH
  113.                 ;sending a file in terminal mode
  114. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  115.                 ;sending a file in terminal mode
  116. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  117. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  118. EXTRA1:        DB    0    ;for future expansion            11EH
  119. EXTRA2:        DB    0    ;for future expansion            11FH
  120. BRKCHR:        DB    '\'-40H    ;\ = Send a 300 ms. break tone        120H
  121. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  122. LOGCHR:        DB    'L'-40H    ;^J = Send logon        (LF)    122H
  123. LSTCHR:        DB    'P'-40H    ;^L = Toggle printer            123H
  124. UNSAVE:        DB    'R'-40H    ;^T = Close input text buffer    (DC4)    124H
  125. TRANCHR:    DB    'T'-40H ;^F = Transmit file to remote        125H
  126. SAVECHR:    DB    'Y'-40H    ;^R = Open input text buffer    (DC2)    126H
  127. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  128. ;
  129. ;
  130.         DS    2        ;                128H
  131. IN$MODCTL1:    MVI    A,010H        ;                12AH
  132.         OUT    MODCTL1
  133.         IN    MODCTL1        ;get the status bits
  134.         RET
  135.         DS    3
  136. ;
  137. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  138.         DS    7
  139. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  140.         DS    7
  141. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  142. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of receive bit when rdy    14BH
  143. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  144. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  145.         DS    6        ;                154H
  146. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port     15AH
  147. OUT$MODCTL2:    OUT    MODCTL2    ! RET    ;out modem status port        15DH
  148. ;
  149. ;
  150. LOGONPTR:    DW    LOGON        ;for user message.        160H
  151.         DS    6        ;                162H
  152. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  153. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  154.         RET  !    NOP  !    NOP    ;by-passes PMMI routine        16EH
  155.         RET  !    NOP  !    NOP    ;by-passes PMMI routine        171H
  156.         RET  !    NOP  !    NOP    ;by-passes PMMI routine        174H
  157. JMP$SETUPR:    JMP    SETUPR        ;                177H
  158. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  159. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  160. JMP$BREAK:    JMP    SENDBRK        ;                180H
  161. ;
  162. ;
  163. ; Do not change the following six lines.
  164. ;
  165. JMP$ILPRT:    DS    3        ;                183H
  166. JMP$INBUF    DS    3        ;                186H
  167. JMP$INLNCOMP:    DS    3        ;                189H
  168. JMP$INMODEM    DS    3        ;                18CH
  169. JMP$NXTSCRN:    DS    3        ;                18FH
  170. JMP$TIMER:    DS    3        ;                192H
  171. ;
  172. ;
  173. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  174. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  175. ;
  176. CLREOS:        CALL    JMP$ILPRT    ;                195H
  177.         DB    ESC,'J',0,0,0    ;                198H
  178.         RET            ;                19DH
  179. ;
  180. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  181.         DB    ESC,'K',0,0,0    ;                1A1H
  182.         RET            ;                1A6H
  183. ;
  184. ;
  185. SYSVER:      CALL    JMP$ILPRT        ;                1A7H
  186.         DB    'Version for Otrona Attache, comm. port 0F0H'
  187.         DB    CR,LF,0
  188.         RET
  189. ;.....
  190. ;
  191. ;
  192. ;-----------------------------------------------------------------------
  193. ;
  194. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  195. ;     end of your last routine should terminate by 0400H if using the
  196. ;     Hayes Smartmodem or by address 0C00H otherwise.
  197. ;
  198. ;-----------------------------------------------------------------------
  199. ;
  200. ; You can put in a message at this location which can be called up with
  201. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  202. ; desired.  End with a 0.
  203. ;
  204. ;
  205. LOGON:      DB    'This is an Otrona Attache computer',CR,LF
  206.       DB    0
  207. ;.....
  208. ;
  209. ;
  210. ; This routine allows a 300 ms. break tone to be sent to reset some
  211. ; time-shar computers.
  212. ;
  213. SENDBRK:  MVI    A,5
  214.       OUT    MODCTL1
  215.       MVI    A,0F8H        ;SEND A BREAK TONE
  216.       JMP    GOODBYE1
  217. ;.....
  218. ;
  219. ;
  220. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  221. ; length of time to disconnect some modems such as the Bell 212A, etc.    
  222. ;
  223. GOODBYE:  MVI    A,5
  224.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  225.       MVI    A,68H        ;TURN OFF DRT, SEND BREAK
  226. ;
  227. GOODBYE1: OUT    MODCTL1
  228.       MVI    B,3        ;WAIT FOR 300 MS.
  229.       CALL    JMP$TIMER
  230.       MVI    A,5
  231.       OUT    MODCTL1
  232.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  233.       OUT    MODCTL1
  234.       RET
  235. ;.....
  236. ;
  237. ;    
  238. ; Otrona Attache initialization
  239. ;
  240. ; The following is an Otrona BIOS patch written by Allen Edwards.  The
  241. ; LISTST routine in the standard BIOS has two errors which prevent it
  242. ; from it from working correctly.  This patch does not support printer
  243. ; redirection via the IOBYTE.
  244. ;
  245. INITMOD:  LHLD    00000H+1    ;get BIOS warm boot vector
  246.       LXI    D,02AH+1    ;offset to LISTST
  247.       DAD    D        ;add offset to vector
  248.       SHLD    HACK1+1        ;*** MODIFY THE CODE ***
  249. ;
  250. HACK1:      LHLD    0D000H        ;'HL' now has pointer to LISTST
  251.       XCHG            ;move it to 'DE'
  252.       LXI    B,NEWCODE    ;point to new code with 'BC'
  253. ;
  254. PTCHLP:      LDAX    B        ;get next byte of new code
  255.       ORA    A        ;done?
  256.       JZ    INITMOD1    ;yes, go finish init...
  257.       STAX    D        ;no, so put in the byte
  258.       INX    B        ;update the pointers
  259.       INX    D
  260.       JMP    PTCHLP        ;and go do next byte
  261. ;
  262. ;
  263. ; New code for LISTST
  264. ;
  265. NEWCODE:  MVI    A,010H
  266.       OUT    0F3H
  267.       IN    0F3H
  268.       ORI    0DBH        ;turn on all bits except CTS & TxRE
  269.       CPI    0FFH        ;check for both CTS & TxRE true
  270.       RZ            ;if so, printer ready, return A=0FFH
  271.       XRA    A        ;else not ready so return with A=0
  272.       RET
  273. ;
  274.       DB    0        ;sentinel for end of patch
  275.        ENDIF
  276. ;
  277. ;
  278. ; Read current communications baud & set MDM7xx variable
  279. ;
  280. INITMOD1: MVI    C,9        ;BDOS string output request
  281.       LXI    D,INITMSG0
  282.       CALL    BDOS
  283. ;
  284. BDRQST:      MVI    C,6        ;BDOS direct console i/o request
  285.       MVI    E,0FFH        ;direct console input request
  286.       CALL    BDOS        ;get communication port baud
  287.       ORA    A        ;anything in the buffer yet?
  288.       JZ    BDRQST        ;no, wait until there is...
  289.       ANI    00FH        ;mask off high nybble
  290.       CPI    0        ;75 baud?
  291.       JZ    BADBAUD        ;yes, its bogus...
  292.       CPI    2        ;134.5 baud?
  293.       JZ    BADBAUD        ;yes, thats bogus too...
  294.       CPI    3        ;150 baud?
  295.       JZ    BADBAUD        ;and so is this one...
  296.       CPI    4        ;300 baud?
  297.       JNZ    CHK600        ;no, skip ahead...
  298.       MVI    A,1        ;special case, set it for 300 baud
  299.       JMP    INITEXIT
  300. ;
  301. CHK600:      CPI    5        ;600 baud?
  302.       JNZ    ADJUST        ;no, skip ahead...
  303.       MVI    A,3        ;special case, set it
  304.       JMP    INITEXIT    ;and get out...
  305. ;
  306. ADJUST:      DCR    A        ;adjust it to MDM712 value
  307. ;
  308. INITEXIT: STA    MSPEED        ;save the baud value
  309.       RET
  310. ;.....
  311. ;
  312. ;
  313. INITMSG0: DB    018H        ;clear keyboard buffer
  314.       DB    ESC,'?',8    ;read communications baud
  315.       DB    '$'
  316. ;
  317. BADBAUD:  CALL    JMP$ILPRT
  318.       DB    CR,LF
  319.       DB    ESC,'U"'    ;set highlight attribute
  320.       DB    '++ Invalid baud ++'
  321.       DB    ESC,'U '    ;clear all attributes
  322.       DB    CR,LF,LF,BELL
  323.       DB    0
  324. ;
  325. ;
  326. ; Setup routine to allow changing modem speed with the SET command.
  327. ;
  328. SETUPR:      LXI    D,BAUDBUF    ;point to new input buffer
  329.       CALL    JMP$ILPRT
  330.       DB    'Input Baud Rate (300, 600, 1200, 9600, 19200): ',0
  331.       CALL    JMP$INBUF
  332.       LXI    D,BAUDBUF+2
  333.       CALL    JMP$INLNCOMP    ;compare BAUDBUF+2 with characters below
  334.       DB    '300',0
  335.       JNC    OK300        ;go if got match
  336.       CALL    JMP$INLNCOMP
  337.       DB    '600',0
  338.       JNC    OK600
  339.       CALL    JMP$INLNCOMP
  340.       DB    '1200',0
  341.       JNC    OK1200
  342.       CALL    JMP$INLNCOMP
  343.       DB    '9600',0
  344.       JNC    OK9600
  345.       CALL    JMP$INLNCOMP
  346.       DB    '19200',0
  347.       JNC    OK19200
  348.       CALL    JMP$ILPRT    ;all matches failed, tell operator
  349.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  350.       JMP    SETUPR        ;try again
  351. ;
  352. OK300:      MVI    A,1
  353.       CALL    PREAMBLE
  354.       LDA    BD300
  355.       JMP    SETBDEXIT
  356. ;
  357. OK600:      MVI    A,3
  358.       CALL    PREAMBLE
  359.       LDA    BD600
  360.       JMP    SETBDEXIT
  361. ;
  362. OK1200:      MVI    A,5
  363.       CALL    PREAMBLE
  364.       LDA    BD1200
  365.       JMP    SETBDEXIT
  366. ;
  367. OK9600:      MVI    A,8
  368.       CALL    PREAMBLE
  369.       LDA    BD9600
  370.       JMP    SETBDEXIT
  371. ;
  372. OK19200:  MVI    A,9
  373.       CALL    PREAMBLE
  374.       LDA    BD19200
  375. ;
  376. ;
  377. ; Fall into SETBDEXIT
  378. ;
  379. SETBDEXIT:MVI    C,6        ;BDOS direct console i/o request
  380.       MOV    E,A        ;move char to 'E' reg. for output
  381.       CALL    BDOS        ;direct I/O to prevent tab expansion
  382.       CALL    JMP$ILPRT    ;set new baud from COMOS RAM parameter
  383.       DB    ESC,'<'
  384.       DB    0
  385.       RET
  386. ;.....
  387. ;
  388. ;
  389. PREAMBLE: STA    MSPEED        ;set the appropriate file transfer speed
  390.       MVI    C,9        ;BDOS string output request
  391.       LXI    D,SETBDMSG
  392.       PUSH    B
  393.       CALL    BDOS
  394.       POP    B
  395.       RET
  396. ;.....
  397. ;
  398. ;
  399. ; Table of Otrona baud parameters
  400. ;
  401. BD110:      DB    001H
  402. BD300:      DB    004H
  403. BD600:      DB    005H    
  404. BD1200:      DB    006H
  405. BD9600:      DB    009H
  406. BD19200:  DB    00AH
  407. ;.....
  408. ;
  409. ;
  410. ; Control message to set new baud
  411. ;
  412. SETBDMSG: DB    ESC,'@',8    ;write communications baud
  413.       DB    '$'
  414. ;
  415. ;
  416. ; Control message to enable new baud
  417. ;
  418. NEWBDMSG: DB    ESC,'<'        ;set communications baud from CMOS RAM
  419.       DB    '$'
  420. ;
  421. ;
  422. ; Input buffer for baud specification
  423. ;
  424. BAUDBUF:  DB    10,0
  425.       DS    10
  426. ;
  427. ;-----------------------------------------------------------------------
  428. ;
  429. ; The following routine can be used as an auxiliary menu for notes of
  430. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  431. ; this is unavailable without a special address change.
  432. ;
  433. SPCLMENU: RET
  434. ;
  435. ;-----------------------------------------------------------------------
  436. ;
  437. ;
  438. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  439. ;                 0C00H (without Smartmodem)
  440. ;
  441. ;
  442.       END
  443.