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 / M7HP-1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  10KB  |  336 lines

  1.  
  2. ; M7-1HP.ASM -- Hewlett Packard overlay file for MDM7xx.  11/11/83
  3. ;
  4. ; This overlay adapts the MDM7xx program to the HP125 Series 100.
  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. ; You use the AIDS and SOFT KEYS to configure baud rate and other para-
  9. ; meters.
  10. ;
  11. ; The HP125 uses two Z80's one for I/O and the other for crunching.
  12. ; Needless to say HP doesn't let the number crunching Z80 talk directly
  13. ; to the I/O ports, so direct communication with the ports is out.  As
  14. ; luck would have it HP did include RDR: and PUN: routines, these rou-
  15. ; tines have been used in this implementation.    NOTE:  Special routines
  16. ; were required to device map the PUN: and RDR: to PORT 1 and to get all
  17. ; 8 bits of data in and out of the port.
  18. ;
  19. ;***********************************************************************
  20. ;
  21. ;              W A R N I N G
  22. ;              - - - - - - -
  23. ;
  24. ; ALWAYS DEPART THIS PROGRAM FROM THE COMMAND LEVEL,  USING THE 'BYE'
  25. ; COMMAND SO THAT YOUR HP125 GETS RECONFIGURED TO IT'S NORMAL STATE.
  26. ;
  27. ;***********************************************************************
  28. ;
  29. ; Edit this file for your preferences then follow the "TO USE:" example
  30. ; shown below.
  31. ;
  32. ;    TO USE: First edit this file filling in answers for your own
  33. ;        equipment.  Then assemble with ASM.COM or equivalent
  34. ;        assembler.  Then use DDT to overlay the the results
  35. ;        of this program to the original .COM file:
  36. ;
  37. ;        A>DDT MDM7xx.COM
  38. ;        DDT VERS 2.2
  39. ;        NEXT  PC
  40. ;        4300 0100
  41. ;        -IM7HP-1.HEX        (note the "I" command)
  42. ;        -R            ("R" loads in the .HEX file)
  43. ;        NEXT  PC
  44. ;        4300 0000
  45. ;        -G0            (return to CP/M)
  46. ;        A>SAVE 66 MDM7xx.COM    (now have a modified .COM file)
  47. ;
  48. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  49. ;
  50. ; 11/11/83 - Renamed to M7HP-1.ASM, no changes    - Irv Hoff
  51. ; 07/20/83 - Renamed to work with MDM712    - Irv Hoff
  52. ; 07/20/83 - Revised to work with HP125        - John Bingel
  53. ; 07/01/83 - Revised to work with MDM711    - Irv Hoff
  54. ; 07/01/83 - Revised to work with MDM710    - Irv Hoff
  55. ; 05/27/83 - Updated to work with MDM709    - Irv Hoff
  56. ; 05/15/83 - Revised to work with MDM708    - Irv Hoff
  57. ; 04/11/83 - Updated to work with MDM707    - Irv Hoff
  58. ; 04/04/83 - First version of this file        - Irv Hoff
  59. ;
  60. ; =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =   =
  61. ;
  62. BDOS:        EQU    05H
  63. BELL:        EQU    07H        ;bell
  64. CR:        EQU    0DH        ;carriage return
  65. ESC:        EQU    1BH        ;escape
  66. LF:        EQU    0AH        ;linefeed
  67. ;
  68. YES:        EQU    0FFH
  69. NO:        EQU    0
  70. ;
  71. ;
  72. ; Change the following information to match your equipment
  73. ;
  74. RDRST:        EQU    70FFH        ;READER STATUS SFC
  75. RDRIN:        EQU    03H        ;READER INPUT SFC
  76. PUNOUT:        EQU    04H        ;PUNCH OUTPUT SFC
  77. BITS8:        EQU    73FFH        ;8 BIT SFC
  78. BITS7:        EQU    74FFH        ;RESET TO NORMAL 7 BIT SFC
  79. JVT:        EQU    7EFFH        ;JUMP VECTOR TABLE SFC
  80. MODRCVB:    EQU    1        ;BIT TO TEST FOR RECEIVE
  81. MODRCVR:    EQU    1        ;VALUE WHEN READY
  82. MODSNDB:    EQU    0        ;BIT TO TEST FOR SEND
  83. MODSNDR:    EQU    0        ;VALUE WHEN READY
  84. ;
  85.         ORG    100H
  86. ;
  87. ;
  88. ; Change the clock speed to suit your system
  89. ;
  90.         DS    3    ;(for  "JMP   START" instruction)
  91. ;
  92. PMMIMODEM:    DB    NO    ;yes=PMMI S-100 Modem            103H
  93. SMARTMODEM:    DB    NO    ;yes=HAYES Smartmodem, no=non-PMMI    104H
  94. TOUCHPULSE:    DB    'T'    ;T=touch, P=pulse (Smartmodem-only)    105H
  95. CLOCK:        DB    40    ;clock speed in MHz x10, 25.5 MHz max.    106H
  96.                 ;20=2 MHh, 37=3.68 MHz, 40=4 MHz, etc.
  97. MSPEED:        DB    5    ;0=110 1=300 2=450 3=600 4=710 5=1200    107H
  98.                 ;6=2400 7=4800 8=9600 9=19200 default
  99. BYTDLY:        DB    5    ;0=0 delay  1=10ms  5=50 ms - 9=90 ms    108H
  100.                 ;default time to send character in ter-
  101.                 ;minal mode file transfer for slow BBS.
  102. CRDLY:        DB    5    ;0=0 delay 1=100 ms 5=500 ms - 9=900 ms 109H
  103.                 ;default time for extra wait after CRLF
  104.                 ;in terminal mode file transfer
  105. NOOFCOL:    DB    5    ;number of DIR columns shown        10AH
  106. SETUPTST:    DB    NO    ;yes=user-added Setup routine        10BH
  107. SCRNTEST:    DB    NO    ;Cursor control routine         10CH
  108. ACKNAK:        DB    YES    ;yes=resend a record after any non-ACK    10DH
  109.                 ;no=resend a record after a valid-NAK
  110. BAKUPBYTE:    DB    NO    ;yes=change any file same name to .BAK    10EH
  111. CRCDFLT:    DB    YES    ;yes=default to CRC checking        10FH
  112. TOGGLECRC:    DB    YES    ;yes=allow toggling of CRC to Checksum    110H
  113. CONVBKSP:    DB    NO    ;yes=convert backspace to rub        111H
  114. TOGGLEBK:    DB    YES    ;yes=allow toggling of bksp to rub    112H
  115. ADDLF:        DB    NO    ;no=no LF after CR to send file in    113H
  116.                 ;terminal mode (added by remote echo)
  117. TOGGLELF:    DB    YES    ;yes=allow toggling of LF after CR    114H
  118. TRANLOGON:    DB    YES    ;yes=allow transmission of logon    115H
  119.                 ;write logon sequence at location LOGON
  120. SAVCCP:        DB    YES    ;yes=do not overwrite CCP        116H
  121. LOCONEXTCHR:    DB    NO    ;yes=local command if EXTCHR precedes    117H
  122.                 ;no=external command if EXTCHR precedes
  123. TOGGLELOC:    DB    YES    ;yes=allow toggling of LOCONEXTCHR    118H
  124. LSTTST:        DB    YES    ;yes=printer available on printer port    119H
  125. XOFFTST:    DB    NO    ;yes=checks for XOFF from remote while    11AH
  126.                 ;sending a file in terminal mode
  127. XONWAIT:    DB    NO    ;yes=wait for XON after CR while    11BH
  128.                 ;sending a file in terminal mode
  129. TOGXOFF:    DB    YES    ;yes=allow toggling of XOFF checking    11CH
  130. IGNORCTL:    DB    NO    ;yes=CTL-chars above ^M not displayed    11DH
  131. EXTRA1:        DB    0    ;for future expansion            11EH
  132. EXTRA2:        DB    0    ;for future expansion            11FH
  133. BRKCHR:        DB    '@'-40H    ;^@ = Send 300 ms. break tone        120H
  134. NOCONNCT:    DB    'N'-40H    ;^N = Disconnect from the phone line    121H
  135. LOGCHR:        DB    'L'-40H    ;^L = Send logon            122H
  136. LSTCHR:        DB    'P'-40H    ;^P = Toggle printer            123H
  137. UNSAVE:        DB    'R'-40H    ;^R = Close input text buffer        124H
  138. TRANCHR:    DB    'T'-40H ;^T = Transmit file to remote        125H
  139. SAVECHR:    DB    'Y'-40H    ;^Y = Open input text buffer        126H
  140. EXTCHR:        DB    '^'-40H    ;^^ = Send next character        127H
  141. ;
  142. ;
  143.         DS    2        ;                128H
  144. ;
  145. IN$MODCTL1:    JMP    INCTL        ;in modem control port        12AH
  146.         DS    7
  147. OUT$MODDATP:    JMP    OUTDATA        ;out modem data port        134H
  148.         DS    7
  149. IN$MODDATP:    JMP    INDATA        ;in modem data port        13EH
  150.         DS    7
  151. ANI$MODRCVB:    ANI    MODRCVB    ! RET    ;bit to test for receive ready    148H
  152.  
  153. CPI$MODRCVR:    CPI    MODRCVR    ! RET    ;value of rcv. bit when ready    14BH
  154. ANI$MODSNDB:    MVI    A,MODSNDB ! RET    ;bit to test for send ready    14EH
  155. CPI$MODSNDR:    CPI    MODSNDR    ! RET    ;value of send bit when ready    151H
  156.         DS    6        ;                156H
  157. ;
  158. OUT$MODCTL1:    NOP !    NOP    ! RET    ;out modem control port #2    15AH
  159. OUT$MODCTL2:    NOP !    NOP    ! RET    ;out modem control port #1    15DH
  160. ;
  161. LOGONPTR:    DW    LOGON        ;for user message.        160H
  162.         DS    6        ;                162H
  163. JMP$GOODBYE:    JMP    GOODBYE        ;                168H
  164. JMP$INITMOD:    JMP    INITMOD        ;go to user written routine    16BH
  165.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    16EH
  166.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    171H
  167.         RET  !    NOP  !    NOP    ;(by-passes PMMI routine)    174H
  168. JMP$SETUPR:    JMP    SETUPR        ;                177H
  169. JMP$SPCLMENU:    JMP    SPCLMENU    ;                17AH
  170. JMP$SYSVER:    JMP    SYSVER        ;                17DH
  171. JMP$BREAK:    JMP    SENDBRK        ;                180H
  172. ;
  173. ;
  174. ; Do not change the following six lines.
  175. ;
  176. JMP$ILPRT:    DS    3        ;                183H
  177. JMP$INBUF    DS    3        ;                186H
  178. JMP$INLNCOMP:    DS    3        ;                189H
  179. JMP$INMODEM    DS    3        ;                18CH
  180. JMP$NXTSCRN:    DS    3        ;                18FH
  181. JMP$TIMER    DS    3        ;                192H
  182. ;
  183. ;
  184. ; Routine to clear to end of screen.  If using CLREOS and CLRSCRN, set
  185. ; SCRNTEST to YES at 010AH (above).
  186. ;
  187. CLREOS:        CALL    JMP$ILPRT    ;                195H
  188.         DB    0,0,0,0,0    ;                198H
  189.         RET            ;                19DH
  190. ;
  191. CLRSCRN:    CALL    JMP$ILPRT    ;                19EH
  192.         DB    0,0,0,0,0    ;                1A1H
  193.         RET            ;                1A6H
  194.     
  195. ;
  196. SYSVER:        LXI    B,BITS8        ;SFC 115 SET PORT 1 TO 8 BITS
  197.         CALL    BDOS    
  198.         CALL    JMP$ILPRT    ;                1A7H
  199. ;
  200. ;
  201. ; DEVICE MAP RDR: & PUN: TO USE PORT 1
  202. ;
  203.         DB    1BH,'&i0s25d4M',1BH,'&i10s16d4M',CR,LF
  204. ;
  205. ;
  206. ; NOW PRINT LOGON
  207. ;
  208.         DB    'Version for the HP125 Series 100'
  209.         DB    CR,LF,LF,LF,'ALWAYS SIGN OFF USING ''BYE'' FROM'
  210.         DB    ' THE COMMAND MODE',CR,LF,0
  211. ;
  212. ; NOW SET UP READER ROUTINE SO WE REALLY GET 8 BITS
  213. ;
  214.         LXI    B,JVT        ;SFC 126
  215.         LXI    D,JBUF        ;ADDRESS OF JUMP BUFFER
  216.         CALL    BDOS        ;READ JUMP TABLE INTO JBUF
  217.         LHLD    JUMP        ;GET ADDRESS RETURNED IN JBUF
  218.         SHLD    REAL        ;AND STORE AS REAL RDRIN
  219.         LXI    H,INEIGHT    ;GET ADDRESS OF 8 BIT INPUT
  220.         SHLD    JUMP        ;AND STORE IN JBUF
  221.         MVI    A,1        ;MOVE A WRITE CODE INTO A
  222.         STA    FLAG        ;STORE IT IN JBUF
  223.         LXI    B,JVT        ;SFC 126
  224.         LXI    D,JBUF        ;ADRESS OF JUMP BUFFER
  225.         CALL    BDOS        ;WRITE JUMP TABLE FROM JBUF
  226.         RET
  227. ;
  228. ;
  229. ; MODEM I/O PRIMITIVES
  230. ;
  231. OUTDATA:    PUSH    B
  232.         PUSH    D
  233.         PUSH    H
  234.         MOV    E,A        ;MOVE OUTPUT BYTE FROM A TO E
  235.         MVI    C,PUNOUT    ;GET PUN: SFC
  236.         CALL    BDOS        ;OUTPUT BYTE
  237.         POP    H
  238.         POP    D
  239.         POP    B
  240.         RET
  241. ;
  242. INDATA:        PUSH    B
  243.         PUSH    D
  244.         PUSH    H
  245.         MVI    C,RDRIN        ;GET RDR: SFC
  246.         CALL    BDOS        ;GET BYTE FROM RDR:
  247.         POP    H
  248.         POP    D
  249.         POP    B
  250.         RET
  251. ;
  252. INEIGHT:    CALL    READIN        ;BYPASS BIT 8 STRIP IN
  253.         MOV    A,B        ;RDR: ROUTINE
  254.         RET
  255. ;
  256. INCTL:        PUSH    B
  257.         PUSH    D
  258.         PUSH    H
  259.         LXI    B,RDRST        ;GET RDR: STATUS SFC
  260.         CALL    BDOS        ;GET RDR: STATUS
  261.         POP    H
  262.         POP    D
  263.         POP    B
  264.         RET
  265.  
  266. ;.....
  267. ;
  268. ;
  269. ;-----------------------------------------------------------------------
  270. ;
  271. ; NOTE:  You can change the SYSVER message to be longer or shorter.  The
  272. ;     end of your last routine should terminate by 0400H (601 bytes
  273. ;     available after start of SYSVER) if using the Hayes Smartmodem
  274. ;     or by address 0C00H (2659 bytes) otherwise.
  275. ;
  276. ;-----------------------------------------------------------------------
  277. ;
  278. ; You can put in a message at this location which can be called up with
  279. ; CTL-O if TRANLOGON has been set TRUE.  You can use several lines if
  280. ; desired.  End with a 0.
  281. ;
  282. LOGON:        DB    'How are you today?',CR,LF,0
  283. ;.....
  284. ;
  285. ;
  286. ; Routine to send a break tone to reset some time-share computers, if
  287. ; desired.
  288. ;
  289. SENDBRK:    MVI    A,02H
  290.         CALL    OUTDATA
  291.         RET
  292. ;.....
  293. ;
  294. ;
  295. ; Routine to put DTR low (to disconnect) and/or send a break tone.
  296. ;
  297. GOODBYE:    CALL    JMP$ILPRT
  298.         DB    1BH,'E',0    ;COLD BOOT SYSTEM
  299.         RET
  300. ;.....
  301. ;
  302. ;
  303. READIN:        DB    0C3H    ;JUMP OPCODE
  304. REAL:        DS    2    ;SAVE 2 BYTES FOR ADDRESS
  305. JVN:        DB    7    ;READER BIOS CODE
  306. FLAG:        DB    0    ;READ/WRITE CODE
  307. OPCODE:        DS    1    ;RESERVE 1 BYTE FOR JMP CODE
  308. JUMP:        DS    2    ;AND 2 BYTES FOR ADDRESS
  309. JBUF:        EQU    JVN    ;NAME ENTIRE BUFFER JBUF
  310. ;
  311. ;.....
  312. ;
  313. ;
  314. ; You can use this area for any special initialization or setup you may
  315. ; wish to include.  Each must stop with a RET.    You can check the other
  316. ; available overlays for ideas how to write your own routines if that
  317. ; may be of some help.
  318. ;
  319. INITMOD:  RET
  320. ;
  321. SETUPR:      RET
  322. ;
  323. ;
  324. ; If using the Hayes Smartmodem this is unavailable without a special
  325. ; change.
  326. ;
  327. SPCLMENU:  RET
  328. ;
  329. ;
  330. ; NOTE:  MUST TERMINATE PRIOR TO 0400H (with Smartmodem)
  331. ;                 0C00H (without Smartmodem)
  332. ;.....
  333. ;
  334.       END
  335. ;
  336.