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
/
ENTERPRS
/
CPM
/
TERMS
/
QTPATCH.ARC
/
QT-HP125.Z
< prev
next >
Wrap
Text File
|
1989-09-08
|
8KB
|
275 lines
; QT-HP125.Z - QTERM Overlay for Hewlett-Packard HP-125 Computer
;
; Author: Mike Freeman 17-Apr-89
; 301 N.E. 107th Street; Vancouver, Wa 98685; (206)574-8221
;
: Modified 6/24/89 by D. Goodenough to use ZSM style
;
; See QTERM.PAT for documentation of QTERM's patch area
;
; I claim no copyright on this overlay; as a road-sign in Oklahoma
; once said: "No Speed Limit -- Do Your Damnedest"
;
; The program QTERM is Copyright 1989 by DPG (David Goodenough)
;
; Revised 04/19-89 to save/restore all Z80 registers (including IX and IY)
; during BDOS calls; Ymodem Batch transfers now work -- Mike Freeman
;
; Re-revised for V4.2, - new entries in patch added, and IX / IY stuff
; deleted since it got fixed in V4.1e -- DPG 7-31-89
;
;This overlay adapts QTERM.COM from QTERMxxx.LBR to run on the Hewlett-Packard
;HP-125 Series 100 Business Computer running a HP-modified CP/M Version 2.2
;operating system. This overlay is a full QTERM implementation except that:
;(1) Break is not implemented (a Break can be sent from the Keyboard only);
;(2) The DTR-manipulation/modem hangup routines are not implemented; (3) The
;routine to change Baud-rate is not implemented (this is changed from the
;Keyboard's Configuration Menu); (4) Stop-bit manipulation is not implemented
;(HP gives the user no way to do this) and (5) changing of parity is not
;implemented (this is also changed from the Configuration Menu). The Hp-125
;consists of 2 Z80 processors: one is the CPU and the other handles terminal
;I/O. HP does not allow the user to access the Z80 I/O ports directly.
;However, HP does provide the CP/M Reader and Punch BDOS calls along with
;a "subfunction" call (passed in BC) to get Reader status. When properly
;mapped, the Reader takes input from Datacomm Port 1 and the Punch sends
;output to Datacomm Port 1. All data is in the form 8N1 and special
;provisions must be made to insure that all 8 bits of data are sent/received
;by DAtacomm 1. (Datacomm 2, the Printer Port, can only accommodate 7-bit
;data). Device mapping of Reader/Punch to Datacomm Port 1 is accomplished
;by sending a series of escape sequences to the HP-125's Console (rather than
;using the IO byte).
;
;To assemble QT-HP125.Z using ZSM, and overlay with ZPATCH
;A>ZSM QT-HP125
;A>ZPATCH QTERM.COM QT-HP125
.var no 0
.var yes ! no
; Parameters
;
.var hayes no ;'yes' means HAYES-style hang-up string
;
;BDOS equates
;
.var boot 0 ;CP/M Warm-start
.var rdr 3 ; Reader input
.var pun 4 ; Punch output
.var bdos 5 ; BDOS entry
.var prt 9 ; Print "$"-terminated string to Console
;
;Special HP subfunctions
;
.var rdrsts 0x70ff ; Get Reader status (A nonzero if char ready)
.var bits8 0x73ff ; Set Datacomm 1 to pass 8-bit data
.var bits7 0x74ff ; Set Datacomm 1 to allow only 7-bit data
.var jvt 0x7eff ; Jump-vector (BIOS routine address) transfer
;
;Ascii equates
;
.var escchr '\\' & 0x1f ; QTERM's local escape character
;
;Routine addresses
;
.var scrout 0x0109 ; Character in C to Console
.var decout 0x010C ; Number in HL to Console in decimal
;
;
;Get modem (Reader) status
;
.org 0x0110 ; Overlay starts here
ld bc,rdrsts ; Set subfunction call to
jp bdos ; Get Reader status
;
;Get modem character into A
;
.org 0x0120
ld c,rdr ; Set function call to
jp bdos ;Get character
;
;Get Punch status (always true)
; DPG - This strikes me as a trifle dangerous, but I am assured by Mike F.
; that it works. So if it ain't broke, don't fix it
;
.org 0x0130
xor a ;Set Z
inc a ;Clear Z
ret ; And return
;
;Send character in A to Punch
;
.org 0x0140
ld e,a ; Put character in E
ld c,pun ; Set function call to
jp bdos ;Send character
;
;Set Break (not implemented)
;
.org 0x0150
ret
;
;Clear break (not implemented)
;
.org 0x0160
ret
;
;Kill DTR routines/modem hang-up string (not implemented)
.org 0x0170
.if ! hayes
nop ; move the return
.endif
ret ;Modem hangup string follows
.if hayes
db 10,0xfe,'+++',0xfe,'ATH0\r',
.endif
;
;Restore DTR (not implemented)
;
.org 0x0180
ret
;
;Baud-rate setting routine (not implemented
;
.org 0x0190
ret
;
;Baud rate table is empty
;
.org 0x01a0
db 0,no
db 0,no
db 0,no
db 0,no
db 0,no
db 0,no
db 0,no
db 0,no
;
;Set Parity/Stop-bits (not implemented)
;
;.org 0x01b0
ret
;
.org 0x01c0
db 0,0,0,0,0,0,0,0,0,0,0,0
;.org 0x01cc
db 0 ;Reserved for future use
;
;.org 0x01cd
db 8 ; Transfer size
;
;.org 0x01ce
db 4 ; Processor speed in mHz
;
;.org 0x01cf
db '\\' & 0x1f ; Escape character
;
;.org 0x01d0
db 'HP-125 Series 100\0' ; Sign-on id
;
;.org 0x01f0
db '\eH\eJ\0 ; Home cursor/clear screen
;
;MOVETO - Place cursor in row/column H/L
;
.org 0x0200
moveto: push hl ; Save row/column
ld c,'\e' ; Send cursor leadin
call conout
ld c,'&'
call conout
ld c,'a'
call conout
pop hl ; Get row/column
push hl ; Save again
ld l,h ; Get row
ld h,0 ; Make 16-bit integer
call decout ; Type in decimal to Console
ld c,'r' ; Say it was a row
call conout
pop hl ; Get row/column
ld h,0 ; Isolate column as 16-bit integer
call decout ; Type in decimal
ld c,'C' ; Terminate sequence - column
jp conout ; And return
;
.org 0x022f
db 0b11111111 ; Terminal capabilities (all)
;
;.org 0x0230
db '\e&@\0' ; Enhancement off
.org 0x0238
db '\e&F\0' ; Enhancement on
.org 0x0240
db '\eM\0' ; Delete line
.org 0x0248
db '\eL\0' ; Insert line
.org 0x0250
db '\eP\0' ; Delete character
.org 0x0258
db '\eR \eQ\b\0' ; Insert character
.org 0x0260
db '\eK\0' ; Clear to end-of-line
.org 0x0268
db '\eJ\0' ; Clear to end-of-screen
;
;
.org 0x0270
jp init ; Initialization
;.org 0x0273
jp finish ; Termination
;.org 0x0276
ret ; user code - ^\ U
.org 0x0279
ret ; keyboard window
;
;Initialization code
;
.org 0x0280
init: ld de,jbuf ; Point to dispatch vector address arg block
ld bc,jvt ; Set subfunction call to
call bdos ; Get Reader input routine address
ld hl,(jbuf + 3) ; Remember this address
ld (read8 + 1),hl ; For 8-bit Reader routine
ld hl,read8 ; Put this address in BIOS dispatch table
ld bc,bits8 ; Set up to set 8-bit passthru
jr comcod ; And branch to common code
;
;Final (exit) code
;
finish: ld hl,(read8 + 1) ; Point to real Reader input address
ld bc,bits7 ; Set for 7-bit terminal passthru
ld a,'9' ; Set to turn off Datacomm mappings
ld (mapseq + 8),a
ld (mapseq + 19),a ; And fall into common code
;
comcod: push bc ; Save passthru function code
ld (jbuf + 3),hl ; Put BIOS dispatch address in arg block
ld a,1 ; Say we want to write into dispatch table
ld (jbuf + 1),a
ld de,jbuf ; Point to jump vector argument block
ld bc,jvt ; Set subfunction call to
call bdos ; Write routine address into dispatch table
ld de,mapseq ; Send mapping escape sequences
ld c,prt ; To the Console
call bdos ; To do/undo Reader/Datacomm Port 1 mappings
pop bc ; Get passthru code
jp bdos ; Set passthru and return
;
;Routine to read 8-bit data from Datacomm Port 1
;
read8: call 0 ; Read data
ld a,b ; Get 8-bit data
ret ; And return
;
;Put BIOS routine address vector block here
;
jbuf: db 7,0,0xc3,0,0 ; ...
;
;Escape sequence string to map Reader/Punch to Datacomm Port 1
;
mapseq: db '\e&i0s25d2M' ; Map Datacomm 1 to Reader
db '\e&i10s16d2M$' ; And Punch to Datacomm 1