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 / MEX / MXO-HP1.ASM < prev    next >
Assembly Source File  |  2000-06-30  |  11KB  |  333 lines

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