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 / IMP / I2H8-5.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  12KB  |  407 lines

  1.  
  2. ; I2H8-5.ASM - Heath/Zenith H89 overlay file for IMP - 06/01/87
  3. ;
  4. ;           8250 with built-in baudrate generator
  5. ;
  6. ; You will want to look this file over carefully. There are a number of
  7. ; options that you can use to configure the program to suit your taste.
  8. ; This file adapts the Heath/Zenith 89/90 series computers to IMP.COM.
  9. ;
  10. ; Edit this file for your preferences then follow the "TO USE:" example
  11. ; shown below.
  12. ;
  13. ; Many terminals will clear the screen with a CTL-Z.  If yours does, put
  14. ; a 1AH at CLEAR: (010AH).  Many terminals use two characters, the first
  15. ; normally an ESC.  For example, ESC *.  In this case put '*' at CLEAR:
  16. ; (The ESC will automatically be typed with no CTL-character present.)
  17. ; If you don't know what your terminal uses, put a 0 at CLEAR: and IMP
  18. ; will scroll up 24 blank lines to clear the CRT for things like MENU,
  19. ; looking at the function key table, typing CTL-Z in command mode, etc.
  20. ;
  21. ; Use the "SET" command to change the baudrate when desired.  The value
  22. ; at MSPEED controls the baudrate when the program is first called up.
  23. ;
  24. ;    TO USE: First edit this file filling in answers for your own
  25. ;        equipment.  Then assemble with ASM.COM or equivalent
  26. ;        assembler.  Then use MLOAD to merge into the main file:
  27. ;
  28. ;        MLOAD IMP.COM=IMP.COM,I2H8-x.HEX
  29. ;
  30. ;----------------------------------------------------------------------
  31. ;
  32. ; USING 5-1/4" DRIVES?    You may experience problems with slow access
  33. ; times.  Symptoms of the problem are:    If you get a timeout when it
  34. ; stops each 128 records to dump to disk, this sometimes causes things
  35. ; to get out of synch and the program eventually aborts.
  36. ;
  37. ; SOLUTION:  Change byte 0BFFh from 80h (128 decimal for 16k disk dumps)
  38. ; to 40h (64 decimal for 8k disk dumps).  You can do this with either
  39. ; DDT or easier with the telephone overlay library which has this byte
  40. ; prominently displayed so it can be readily changed.  (Then use DDT or
  41. ; MLOAD to install the revised telephone library.)
  42. ;
  43. ; This allows the disk dump to terminate in less than 10 seconds and the
  44. ; file transfer can then proceed normally.
  45. ;
  46. ;     NOTE: do not use 19200 if you have the slow disk drives
  47. ;        like the SSSD hard-sectored (40 track) drives.
  48. ;
  49. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  50. ;
  51. ; 06/01/87  Improved the GOODBYE routine, added BREAK routine, needs
  52. ;        IMP245 to use it.            - Irv Hoff
  53. ;    
  54. ; 10/27/85  Restored baud rates to those normally used with this equip-
  55. ;        ment.  If others are needed, install those on an individual
  56. ;        basis, please.  Other incidental changes.
  57. ;                        - Irv Hoff
  58. ; 10/24/85  Added more baud rates        - Fred Townsend
  59. ; 09/08/85  Added 19200 Baud            - Fred Townsend
  60. ; 07/17/85  Written to work with IMP        - Irv Hoff
  61. ;
  62. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  63. ;
  64. ;
  65. YES    EQU    0FFH
  66. NO    EQU    0
  67. ;
  68. ;
  69. ; Values shown are for a 8250
  70. ;
  71. PORT    EQU    0D8H    ; Your base port (data or status)
  72. MDCTL1    EQU    PORT+5    ; Modem control port
  73. MDDATP    EQU    PORT    ; Modem data port
  74. MDRCV    EQU    01H    ; Modem receive ready
  75. MDSND    EQU    20H    ; Modem send ready bit
  76. MDTXE    EQU    60H    ; Modem send buffer empty, holding buffer empty
  77. ;
  78. ;
  79. ;-----------------------------------------------------------------------
  80. ;
  81. ESC    EQU    '['-40H    ; ^[ = Escape
  82. BELL    EQU    'G'-40H    ; ^G = Bell character
  83. LF    EQU    'J'-40H    ; ^J = Linefeed
  84. NEXTRY    EQU    'K'-40H    ; ^K = Try next phone number, abort this try
  85. CR    EQU    'M'-40H    ; ^M = Carriage return
  86. CLEARSC    EQU    'Z'-40H    ; ^Z = Clears screen, command mode only
  87. EOFCHAR    EQU    'Z'-40H    ; ^Z = End of file
  88. ;
  89. ;
  90. ;-----------------------------------------------------------------------
  91. ;
  92. ;
  93.     ORG    0100H
  94. ;
  95. ;
  96.     DS    3        ; Skip the data area below
  97. ;
  98. ;
  99. ; These routines and equates are at the beginning of the program so
  100. ; they can be patched by a monitor or overlay file without re-assembling
  101. ; the program.
  102. ;
  103. MSPEED:     DB    5    ; 0=110 1=300 2=450 3=600 4=710 5=1200        103H
  104.             ; 6=2400 7=4800 8=9600 9=19200
  105. HS2400:     DB    NO    ; Yes=2400 bps highest speed            104H
  106. HS1200:     DB    YES    ; Yes=1200 bps highest speed            105H
  107. RACAL:     DB    NO    ; Yes=Racal-Vadic 1200V or 2400V or 2400PA    106H
  108. PROMODM: DB    NO    ; Yes=Prometheus ProModem 1200 bps        107H
  109. RESVD1:     DB    NO    ; Reserved for special modems            108H
  110. RESVD2:     DB    NO    ; Reserved for special modems            109H
  111. ;
  112. ;
  113. CLEAR:     DB    'E'    ; Clear screen character (ESC not needed)    10AH
  114. CLOCK:     DB    20    ; Clock speed in MHz x10, 25.5 MHz max.     10BH
  115.             ; 20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  116. BYTDLY:     DB    2    ; 0=0 delay  1=10ms  5=50 ms - 9=90 ms        10CH
  117.             ;   default time to send character in ter-
  118.             ;   minal mode file transfer for slow BBS
  119. CRDLY:     DB    2    ; 0=0 delay 1=100 ms 5=500 ms - 9=900 ms    10DH
  120.             ;   default time for extra wait after CRLF
  121.             ;   in terminal mode file transfer
  122. NOFCOL:     DB    5    ; Number of directory columns shown        10EH
  123. TCHPUL:     DB    'T'    ; T=tone, P=Pulse (Hayes 2400 modems)        10FH
  124. ;.....
  125. ;
  126. ;
  127. ADDLFD:     DB    NO    ; Yes=add LF after CR to send file in terminal    110H
  128.             ;   mode (normally added by remote echo)
  129. CONVRUB: DB    YES    ; Yes=convert rub to backspace            111H
  130. CRCDFLT: DB    YES    ; Yes=default to CRC checking            112H
  131. IGNRCTL: DB    YES    ; Yes=CTL-chars above ^M not displayed        113H
  132. ;.....
  133. ;
  134. ;
  135. EXTCHR:     DB    '['-40H    ; ESC = precedes local control character    114H
  136. EXITCHR: DB    'E'    ; Exit character                115H
  137. FILESND: DB    'F'    ; Send file when in terminal mode        116H
  138. NOCONCT: DB    'N'    ; Disconnect from phone line            117H
  139. LOGCHR:     DB    'L'    ; Send logon                    118H
  140. LSTCHR:     DB    'P'    ; Toggle printer                119H
  141. UNSAVCH: DB    'R'    ; Close input text buffer            11AH
  142. SAVECHR: DB    'Y'    ; Open input text buffer            11BH
  143. CLEARS:     DB    'Z'    ; Clears screen, terminal mode            11CH
  144. BRKCHR:     DB    'Q'    ; Send a break tone                11DH
  145. NODTR:     DB    NO    ; Yes if no DTR and need +++ to disconnect    11EH
  146. ;.....
  147. ;
  148. ;
  149. ; Handles in/out ports for data and status
  150. ;
  151. I$MDCTL1: IN    MDCTL1        ; Modem control port            11FH
  152.       RET            ;                    121H
  153.       DB    0,0,0,0,0,0,0    ; Spares if needed            122H
  154. ;
  155. I$MDTXE:  IN    MDCTL1        ;                    129H
  156.       RET            ;                    12BH
  157.       DB    0,0,0,0,0,0,0    ;                    12CH
  158. ;
  159. I$MDDATP: IN    MDDATP        ;                    133H
  160.       RET            ;                    135H
  161.       DB    0,0,0,0,0,0,0    ;                    136H
  162. ;
  163. O$MDDATP: OUT    MDDATP        ;                    13DH
  164.       RET            ;                    13FH
  165.       DB    0,0,0,0,0,0,0    ; Spares if needed            140H
  166. ;.....
  167. ;
  168. ;
  169. A$MDRCV:  ANI    MDRCV        ;                    147H
  170.       RET            ;                    149H
  171. ;
  172. C$MDRCV:  CPI    MDRCV        ;                    14AH
  173.       RET            ;                    14CH
  174. ;
  175. A$MDSND:  ANI    MDSND        ;                    14DH
  176.       RET            ;                    14FH
  177. ;
  178. C$MDSND:  CPI    MDSND        ;                    150H
  179.       RET            ;                    152H
  180. ;
  181. A$MDTXE:  ANI    MDTXE        ;                    153H
  182.       RET            ;                    155H
  183. ;
  184. C$MDTXE:  CPI    MDTXE        ;                    156H
  185.       RET            ;                    158H
  186. ;.....
  187. ;
  188. ;
  189. ; Special exit vector, used by some computers to reset interrupt vectors
  190. ;
  191. J$EXITVEC:RET            ;                    159H
  192.       DB    0,0        ;                    15AH
  193. ;.....
  194. ;
  195. ;
  196. ; Jump vectors needed by each overlay
  197. ;
  198. J$GOODBYE:JMP    GOODBYE        ; Disconnects modem by dropping DTR    15CH
  199. J$INITMOD:JMP    INITMOD        ; Initializes modem, autosets baudrate    15FH
  200. J$STUPR:  JMP    STUPR        ; SET routine to change baudrate    162H
  201. J$SYSVR:  JMP    SYSVR        ; Signon message            165H
  202. ;.....
  203. ;
  204. ;
  205. ; "AT" command strings, can be replaced in individual overlay if needed
  206. ;
  207. J$STRNGA: DS    3        ; 1200 bps "AT" string            168H
  208. J$STRNG1: DS    3        ; 2400 bps "AT" string            16BH
  209. ;
  210. ;
  211. ; Next fourteen lines should not be changed by user overlay as these go
  212. ; to specific locations in the main program, not in the overlay.
  213. ;
  214. ;
  215. J$CMDSPL: DS    3        ; Allows entry of baudrate on CMD line    16EH
  216. J$CRLF:      DS    3        ; Turns up one new line on display    171H
  217. J$DIAL:      DS    3        ; Start of dialing routine        174H
  218. J$DSCONT: DS    3        ; Terminates modem use            177H
  219. J$GOLST:  DS    3        ; Printer routine, needed by Apple //e    17AH
  220. J$ILPRT:  DS    3        ; Prints an inline string, 0 to end    17DH
  221. J$INBUF:  DS    3        ; Stores a keybd string for comparison    180H
  222. J$INLNCP: DS    3        ; Inline "compare strings" routine    183H
  223. J$INMDM:  DS    3        ; Max .1 sec wait for modem character    186H
  224. J$RCVRSP: DS    3        ; For 3801 I/O use (TV-803)        189H
  225. J$SNDCHR: DS    3        ; Sends a character to the modem    18CH
  226. J$SNDSTR: DS    3        ; Sends a string to the modem, $ to end 18FH
  227. J$TIMER:  DS    3        ; .1 second timer (amount in 'B' reg.)    192H
  228. J$BREAK:  JMP    SENDBRK        ; Break routine                195H
  229. J$NEW2:      DB    0,0,0        ; For future needs            198H
  230. ;.....
  231. ;
  232. ;
  233. ; For 2400 bps auto-stepdown units
  234. ;
  235. MANUAL:      DB    0        ; For manual selection flag        19BH
  236. J$300:      JMP    OK300        ; Sets baudrate to 300 baud        19CH
  237. J$1200:      JMP    OK1200        ; Sets baudrate to 1200 bps        19FH
  238. J$2400:      JMP    OK2400        ; Sets baudrate to 2400 bps        1A2H
  239. ;.....
  240. ;
  241. ;
  242. LOGPTR:      DW    LOGON        ; Pointer to display LOGON message    1A5H
  243. ;
  244. SYSVR:      CALL    J$ILPRT        ; Display the following line        1A7H
  245.       DB    'Version for Heath H89 with HAYES or dumb modem, ' ;    1AAH
  246.       DB    'port 0D8H',CR,LF,0
  247.       RET
  248. ;.....
  249. ;
  250. ;
  251. ;-----------------------------------------------------------------------
  252. ;
  253. ; NOTE:  You can change the SYSVR message to be longer or shorter.  The
  254. ;     end of your last routine should terminate by 0400H (601 bytes
  255. ;     available after start of SYSVR).
  256. ;
  257. ;-----------------------------------------------------------------------
  258. ;
  259. ; You can put in a message at this location which can be called up with
  260. ; (special character-L).  You can put in several lines.  End with a 0.
  261. ;
  262. LOGON:    DB    'Hello from an Heath H89 user',CR,0
  263. ;
  264. ;-----------------------------------------------------------------------
  265. ;
  266. ; This routine sets a 300 ms break tone
  267. ;
  268. SENDBRK:
  269.     JMP    GOODBYE1
  270. ;.....
  271. ;
  272. ;
  273. ; This routine sets DTR low for 300 ms to disconnect the phone
  274. ;
  275. GOODBYE:
  276.     XRA    A
  277.     OUT    PORT+4        ; Set DTR and RTS low
  278. GOODBYE1:
  279.     MVI    A,40H        ; Set break tone
  280.     OUT    PORT+3
  281.     MVI    B,3        ; Wait 300 ms
  282.     CALL    J$TIMER
  283.     MVI    A,03H        ; Reset to normal 8 bits
  284.     OUT    PORT+3
  285.     MVI    A,01H
  286.     OUT    PORT+4        ; Reset DTR high
  287.     RET
  288. ;.....
  289. ;
  290. ;
  291. INITMOD:LDA    MSPEED        ; Get the selected value
  292.     CPI    1        ; 300 bps
  293.     JZ    OK300
  294.     CPI    5        ; 1200 bps
  295.     JZ    OK1200
  296.     CPI    6        ; 2400 bps
  297.     JZ    OK2400
  298.     CPI    8        ; 9600 bps
  299.     JZ    OK9600
  300.     CPI    9        ; 19200 bps
  301.     JZ    OK19200
  302.     JMP    STUPR1        ; Else ask what is wanted
  303. ;
  304. INITMOD1:
  305.     DI            ; Turn off interrupts for initialization
  306.     XRA    A
  307.     OUT    PORT+1        ; Interrupt enable register
  308.     MVI    A,80H        ; Insure out of mode to set baud rate
  309.     OUT    PORT+3        ; Line control register
  310.     OUT    PORT+3
  311. ;
  312. INITMOD2:
  313.     MVI    A,60H        ; Default 'LSP' speed for 1200 bps
  314.     OUT    PORT        ; Register for 'LSP' speed if enabled
  315. ;
  316. INITMOD3:
  317.     MVI    A,00H        ; Default 'MSP' speed for 1200 bps
  318.     OUT    PORT+1        ; Register for 'MSP' speed if enabled
  319.     MVI    A,03H        ; 8-level, 1 stop bit, no parity
  320.     OUT    PORT+3        ; Line control register (03=1, 07=2)
  321.     MVI    A,01H        ; Set 'DTR' normal
  322.     OUT    PORT+4        ; Modem control register
  323.     EI            ; Restore interrupts to normal
  324.     RET
  325. ;.....
  326. ;
  327. ;
  328. ; The following routine changes the baud rate for the H89 with the SET
  329. ; command.
  330. ;
  331. STUPR:    CALL    J$CMDSPL    ; Gives us CMDBUF+6
  332.     JNC    STUPR2
  333. ;
  334. STUPR1:    CALL    J$ILPRT
  335.     DB    'Input Baud Rate (300, 1200, 2400, 9600, 19200): ',0
  336.     LXI    D,BAUDBUF    ; Point to new input buffer
  337.     CALL    J$INBUF
  338.     CALL    J$CRLF
  339.     LXI    D,BAUDBUF+2
  340. ;
  341. STUPR2:    CALL    J$INLNCP    ; Compare BAUDBUF+2 with chars. below
  342.     DB    '300',0
  343.     JNC    OK300        ; Go if got match
  344.     CALL    J$INLNCP
  345.     DB    '1200',0
  346.     JNC    OK1200
  347.     CALL    J$INLNCP
  348.     DB    '2400',0
  349.     JNC    OK2400
  350.     CALL    J$INLNCP
  351.     DB    '9600',0
  352.     JNC    OK9600
  353.     CALL    J$INLNCP
  354.     DB    '19200',0
  355.     JNC    OK19200
  356.     CALL    J$ILPRT        ; All matches failed, tell operator
  357.     DB    '++ Incorrect entry ++',CR,LF,BELL,CR,LF,0
  358.     JMP    STUPR1        ; Try again
  359. ;
  360. OK300:    MVI    A,1        ; MSPEED 300 baud value
  361.     LXI    H,BD300        ; Get 300 baud parameters in HL
  362.     JMP    LOADBD        ; Go load them
  363. ;
  364. OK1200:    MVI    A,5
  365.     LXI    H,BD1200
  366.     JMP    LOADBD
  367. ;
  368. OK2400:    XRA    A
  369.     STA    MANUAL
  370.     MVI    A,6
  371.     LXI    H,BD2400
  372.     JMP    LOADBD
  373. ;
  374. OK9600:    MVI    A,8
  375.     LXI    H,BD9600
  376.     JMP    LOADBD
  377. ;
  378. OK19200:MVI    A,9
  379.     LXI    H,BD19200
  380. ;
  381. LOADBD:    STA    MSPEED        ; Store speed to show transfer time
  382.     MOV    A,L        ; Get least significant baud rate byte
  383.     STA    INITMOD2+1    ; Store in INITMOD
  384.     MOV    A,H        ; Get most significant baud rate byte
  385.     STA    INITMOD3+1    ; Store in INITMOD
  386.     JMP    INITMOD1    ; Reinitialize to new baudrate, done
  387. ;.....
  388. ;
  389. ;
  390. ; Table of baud rate parameters
  391. ;
  392. BD300    EQU    0180H
  393. BD1200    EQU    0060H
  394. BD2400    EQU    0030H
  395. BD9600    EQU    000CH
  396. BD19200    EQU    0006H
  397. ;
  398. BAUDBUF:DB    10,0,0,0,0,0
  399.     DB    0,0,0,0,0,0
  400. ;
  401. ;                   end
  402. ;-----------------------------------------------------------------------
  403. ;
  404. ; NOTE: Must terminate prior to 0400H
  405. ;
  406.     END
  407.