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

  1. ; M7AL8-1.ASM - ALTOS SERIES 8000 Modem7xx Overlay for Serial 
  2. ;               Port #2      Dennis Recla 02/27/84
  3. ;
  4. ;
  5. ; You will want to look this file over carefully. There are a number of
  6. ; options that you can use to configure the program to suit your taste.
  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' to overlay the  results of 
  19. ;               this program to the original .COM file:
  20. ;
  21. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  22. ;
  23. ;
  24. ;        A>DDT MDM7xx.COM
  25. ;        DDT VERS 2.2
  26. ;        NEXT PC
  27. ;        4300 0100               (May vary with Newer Versions)
  28. ;        -IM7AL8-1.HEX        (note the "I" command)
  29. ;        -R            ("R" loads in the .HEX file)
  30. ;        NEXT PC
  31. ;        -G0
  32. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  33. ;
  34. ;                      ^- May vary with new versions of MDM7xx.COM 
  35. ;
  36. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  37. ;
  38. ; 02/24/84 - New Version for ALTOS Series 8000 Computer  - Dennis Recla
  39. ;               Complete rewrite of original version 
  40. ;
  41. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  42. ;
  43. BELL:        EQU    07H    ;Bell
  44. CR:        EQU    0DH    ;Carriage return
  45. ESC:        EQU    1BH    ;Escape
  46. LF:        EQU    0AH    ;Linefeed
  47. ;
  48. YES:        EQU    0FFH
  49. NO:        EQU    0
  50. ;
  51. ;
  52. PORT:        EQU    28H    ;Altos Serial Port #2 Base Port Address
  53. MODCTL1:    EQU    PORT+1    ;Serial A Modem control port
  54. MODDATP:    EQU    PORT    ;Serial A Modem data port
  55. BAUDRP:        EQU    0EH    ;CTC Baud rate port
  56. MODRCVB:    EQU    01H    ;Your bit to test for receive
  57. MODRCVR:    EQU    01H    ;Your value when receive ready
  58. MODSNDB:    EQU    04H    ;Your bit to test for send
  59. MODSNDR:    EQU    04H    ;Your value when send ready        
  60. ;
  61. LSBAUD:        EQU    07    ;default baud rate (least signif. byte)
  62. MSBAUD:        EQU    52    ;default baud rate (most  signif. byte)
  63. ;
  64.         ORG    100H
  65. ;
  66. ;
  67. ; Change the clock speed to suit your system
  68. ;
  69.         DS    3    ;(for  "JMP   START" instruction)
  70. ;
  71. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  72. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  73. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  74. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  75.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  76. MSPEED:        DB    1    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  77.                 ;6=2400 7=4800 8=9600 9=19200 default
  78. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  79.                 ;default time to send character in ter-
  80.                 ;minal mode file transfer for slow BBS.
  81. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  82.                 ;default time for extra wait after CRLF
  83.                 ;in terminal mode file transfer
  84. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  85. SETUPTST:    DB    YES    ;yes=user-added Setup routine        10BH
  86. SCRNTEST:    DB    YES    ;cursor control routine         10CH
  87. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  88.                 ;no=resend a record after a valid NAK
  89. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  90. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  91. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  92. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  93. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  94. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  95.                 ;terminal mode (added by remote echo)
  96. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  97. TRANLOGON:    DB    NO    ;yes=allow transmission of logon    115H
  98.                 ;write logon sequence at location LOGON
  99. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  100. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  101.                 ;no=external command if EXTCHR precedes
  102. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  103. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  104. XOFFTST:    DB    NO    ;yes=check for XOFF from remote    while    11AH
  105.                 ;sending a file in terminal mode
  106. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  107.                 ;sending a file in terminal mode
  108. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  109. IGNORCTL:    DB    YES    ;yes=CTL-chars above ^M not displayed    11DH
  110. EXTRA1:        DB    0    ;for future expansion            11EH
  111. EXTRA2:        DB    0    ;for future expansion            11FH
  112. BRKCHR:        DB    '\'-40H    ;^\ = Send a 300 ms. break tone        120H
  113. 20H
  114. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  115. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  116. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  117. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  118. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  119. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  120. EXTCHR:        DB    '^'-40H    ;^^ = Send next character         127H
  121. ;
  122. ;
  123.         DS    2        ;                128H
  124. IN$MODCTL1:    MVI    A,10H        ;channel 0, reset interrupts    12AH
  125.         OUT    MODCTL1
  126.         IN    MODCTL1        ;get the status bits
  127.         RET
  128.         DS    3
  129. ;
  130. OUT$MODDATP:    OUT    MODDATP ! RET    ;out modem data port        134H
  131.         DS    7
  132. IN$MODDATP:    IN    MODDATP ! RET    ;in modem data port        13EH
  133.         DS    7
  134. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  135. CPI$MODRCVR:    CPI    MODRCVR ! RET    ;value of receive bit when rdy    14BH
  136. ANI$MODSNDB:    ANI    MODSNDB    ! RET    ;bit to test for send ready    14EH
  137. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  138.         DS    6        ;                154H
  139. OUT$MODCTL1:    OUT    MODCTL1    ! RET    ;out modem control port #1    15AH
  140. OUT$MODCTL2:    NOP  !    NOP    ! RET    ;out modem control port #2    15DH
  141. ;
  142. ;
  143. LOGONPTR:    DW    LOGON        ;for user message.        160H
  144.         DS    6        ;                162H
  145. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  146. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  147.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  148.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  149.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  150. JMP$SETUPR:    JMP    SETUPR        ;                177H
  151. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  152. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  153. JMP$BREAK:    JMP    SENDBRK        ;                180H
  154. ;
  155. ;
  156. ; Do not change the following six lines.
  157. ;
  158. JMP$ILPRT:    DS    3        ;                183H
  159. JMP$INBUF    DS    3        ;                186H
  160. JMP$INLNCOMP:    DS    3        ;                189H
  161. JMP$INMODEM    DS    3        ;                18CH
  162. JMP$NXTSCRN:    DS    3        ;                18FH
  163. JMP$TIMER:    DS    3        ;                192H
  164. ;
  165. ;
  166. ; Clear sequences -- CLREOS is clear to end of screen, CLRSCRN is clear
  167. ; entire screen.  Last entry must be 0.  Any other 0's act as NOP's.
  168. ;
  169. ; Set Up for ADDS 3A+ Terminal
  170. ;
  171. CLREOS:        CALL    JMP$ILPRT    ;                195H
  172.         DB    ESC,'Y',0,0,0    ;                198H
  173.         RET            ;                19DH
  174. ;
  175. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  176.         DB    ESC,'*',0,0,0    ;                1A1H
  177.         RET            ;                1A6H
  178. ;
  179. ;
  180. SYSVER:        CALL    JMP$ILPRT    ;                1A7H
  181.         DB    'Version for Altos Series 8000 Serial Port #2 '
  182.         DB    CR,LF,0
  183.         RET
  184. ;.....
  185. ;
  186. ;
  187. ;-----------------------------------------------------------------------
  188. ;
  189. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  190. ;     end of your last routine should terminate by 0400H (601 bytes
  191. ;     available after start of SYSVER) if using the Hayes Smartmodem
  192. ;     or by address 0C00H (2659 bytes) otherwise.
  193. ;
  194. ;-----------------------------------------------------------------------
  195. ;
  196. ; You can put in a message at this location which can be called up with
  197. ; CTL-O if TRANLOGON has been set TRUE.  You can put in several lines if
  198. ; desired.  End with a 0.
  199. ;
  200. ;
  201. LOGON:        DB    'Hello..  Hello.. Anyone Around  ??? ',CR,LF,0
  202. ;.....
  203. ;
  204. ;
  205. ; This routine allows a 300 ms. break tone to be sent to reset some
  206. ; time-shar computers.
  207. ;
  208. SENDBRK:  MVI    A,5
  209.       OUT    MODCTL1
  210.       MVI    A,0F8H        ;SEND A BREAK TONE
  211.       JMP    GOODBYE1
  212. ;.....
  213. ;
  214. ;
  215. ; This routine sends a 300 ms. break tone and sets DTR low for the same
  216. ; length of time to disconnect some modems such as the Bell 212A, etc.    
  217. ;
  218. GOODBYE:  MVI    A,5
  219.       OUT    MODCTL1        ;SEND TO THE STATUS PORT
  220.       MVI    A,68H        ;TURN OFF DTR
  221. ;
  222. GOODBYE1: OUT    MODCTL1
  223.       MVI    B,3        ;WAIT FOR 300 MS.
  224.       CALL    JMP$TIMER
  225.       MVI    A,5
  226.       OUT    MODCTL1
  227.       MVI    A,0E8H        ;RESTORE TO NORMAL, 8 BITS, DTR ON, ETC.
  228.       OUT    MODCTL1
  229.       RET
  230. ;.....
  231. ;
  232. ;    
  233. ; Altos Z80 SIO Serial Port initialization
  234. ;
  235. INITMOD:  MVI    A,0        ;SELECT REGISTER
  236.       OUT    MODCTL1
  237.       MVI    A,18H        ;THROW OUT OF MODE
  238.       OUT    MODCTL1
  239.       MVI    A,04H        ;SELECT REGISTER
  240.       OUT    MODCTL1
  241.       MVI    A,44H        ;SET ASCII PARAMETERS
  242.       OUT    MODCTL1
  243.       MVI    A,03H        ;SELECT REG.
  244.       OUT    MODCTL1
  245.       MVI    A,0C1H        ;ENABLE RECEIVE
  246.       OUT    MODCTL1
  247.       MVI    A,05H        ;SELECT REG.
  248.       OUT    MODCTL1
  249.       MVI    A,0EAH        ;ENABLE SEND, 'DTR', 'RTS'
  250.       OUT    MODCTL1
  251. ;
  252. INITMOD1: MVI    A,1        ;DEFAULT TRANSFER TIME TO 300 BAUD
  253.       STA    MSPEED
  254. ;
  255. INITMOD2: MVI    A,LSBAUD    ;SET "LSP" TO BAUD RATE
  256.       OUT    BAUDRP
  257. ;
  258. INITMOD3: MVI    A,MSBAUD    ;SET "MSP" TO BAUD RATE
  259.       OUT    BAUDRP
  260.       RET
  261. ;.....
  262. ;
  263. ;
  264. ; Setup routine to allow changing modem speed with the SET command.
  265. ;
  266. SETUPR:
  267.       LXI    D,BAUDBUF    ;POINT TO NEW INPUT BUFFER
  268.       CALL    JMP$ILPRT
  269.       DB    'Input Baud Rate (300,600,1200,2400,4800,9600): ',0
  270.       CALL    JMP$INBUF
  271.       LXI    D,BAUDBUF+2
  272.       CALL    JMP$INLNCOMP    ;COMPARE BAUDBUF+2 WITH CHARACTERS BELOW
  273.       DB    '300',0
  274.       JNC    OK300        ;GO IF GOT MATCH
  275.       CALL    JMP$INLNCOMP
  276.       DB    '600',0
  277.       JNC    OK600
  278.       CALL    JMP$INLNCOMP
  279.       DB    '1200',0
  280.       JNC    OK1200
  281.       CALL    JMP$INLNCOMP
  282.       DB    '2400',0
  283.       JNC    OK2400
  284.       CALL    JMP$INLNCOMP
  285.       DB    '4800',0
  286.       JNC    OK4800
  287.       CALL    JMP$INLNCOMP
  288.       DB    '9600',0
  289.       JNC    OK9600
  290.       CALL    JMP$ILPRT    ;ALL MATCHES FAILED, TELL OPERATOR
  291.       DB    '++ Incorrect entry ++',CR,LF,BELL,0
  292.       JMP    SETUPR        ;TRY AGAIN
  293. ;
  294. OK300:      MVI    A,1        ;MSPEED VALUE FOR FILE TRANFER TIME
  295.       LHLD    BD300
  296.       JMP    LOADBD
  297. ;
  298. OK600:      MVI    A,3
  299.       LHLD    BD600
  300.       JMP    LOADBD
  301. ;
  302. OK1200:      MVI    A,5
  303.       LHLD    BD1200
  304.       JMP    LOADBD
  305. ;
  306. OK2400:      MVI    A,6
  307.       LHLD    BD2400
  308.       JMP    LOADBD
  309. ;
  310. OK4800:      MVI    A,7
  311.       LHLD    BD4800
  312.       JMP    LOADBD
  313. ;
  314. OK9600:      MVI    A,8
  315.       LHLD    BD9600
  316.       JMP    LOADBD
  317. ;
  318. LOADBD:      STA    INITMOD1+1    ;CHANGE TIME-TO-SEND TO MATCH BAUDRATE
  319.       MOV    A,L        ;GET "LSP" BAUD RATE BYTE
  320.       STA    INITMOD2+1    ;SEND TO CTC-1 TIMER FOR NEW BAUDRATE
  321.       MOV    A,H        ;GET "MSP" BAUD RATE BYTE
  322.       STA    INITMOD3+1
  323.       JMP    INITMOD1    ;REINITIALIZE TO NEW BAUDRATE, THEN DONE
  324. ;.....
  325. ;
  326. ;
  327. ; Table of baud rate values
  328. ;
  329. BD300:      DW    3407H        ;300 baud
  330. BD600:      DW    1A07H        ;600 baud
  331. BD1200:      DW    0D07H        ;1200 baud
  332. BD2400:      DW    3447H        ;2400 baud
  333. BD4800:      DW    1A47H        ;4800 baud
  334. BD9600:      DW    0D47H        ;9600 baud
  335. ;
  336. BAUDBUF:  DB    10,0
  337.       DS    10
  338. ;.....
  339. ;
  340. ;
  341. ; The following routine can be used as an auxiliary menu for notes of
  342. ; interest to a particular computer, etc.  If using the Hayes Smartmodem
  343. ; this is unavailable without a special address change.
  344. ;
  345. SPCLMENU: RET
  346. ;.....
  347. ;
  348. ;
  349. ; NOTE:   MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  350. ;                  0C00H (without Smartmodem)
  351. ;
  352.       END
  353. ;
  354.