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-SB180.Z80
< prev
next >
Wrap
Text File
|
1989-09-08
|
4KB
|
210 lines
; Title 'QTERM Overlay for the SB180'
;
; Author: W. Gonnason (U. of Calgary Electrical Engineering)
;
; - Based on the MEX Overlay for the Micromint SB180, external modem.
;
; Date: January 04, 1989
;
; Assembler: Echelon (R.I.P.) ZAS 2.0 or later
;
; - assemble to a hex file, then use mload to lay the
; resulting hex file over qterm.com.
;
; >>>>> NOTE This overlay assumes a 9 MHZ clock - if you're running 6 MHZ or
; 12, you'll have to change the Baud rate table, and the cpu speed
;
.HD64 ; needed for HD64180 op-codes
;
;
; Original MEX Overlay Credits:
;
; M7KP-1 overlay structure by Irv Hoff
; Adapted for the SB180 by Ken Davidson
;
;----------------------------------------------------------------------
;
PRTCHR EQU 109H ; print character in 'C'
;
;
; HD64180 port definitions
;
EXPORT EQU 00H ;base external port
EXTCTL EQU EXPORT ;external modem control port
EXSTAT EQU EXPORT+4 ;external modem status port
EXDATO EQU EXPORT+6 ;external modem data out port
EXDATI EQU EXPORT+8 ;external modem data in port
BAUDRP EQU EXPORT+2 ;external modem baud rate port
;
;
ORG 110H
MDMINST: ; get modem input status
IN0 A,(EXSTAT) ; return Z clear if character ready
BIT 7,A
RET
ORG 120H
RDMODEM: ; Read a modem character
IN0 A,(EXDATI)
RET
ORG 130H
MDMOTST: ; get modem output status
IN0 A,(EXSTAT) ; return Z clear if OK to send character
BIT 1,A
RET
ORG 140H
WRMODEM: ; Write a character to modem
OUT0 (EXDATO),A
RET
ORG 150H ; Start a break condition
STRTBK: ; not supported...
RET
ORG 160H ; End a break condition
ENDBRK: ; nor supported...
RET
ORG 170H ; Drop the DTR line
DROPDTR:
IN0 A,(EXTCTL) ;Get current setting
OR 10H ;Turn off DTR/RTS
OUT0 (EXTCTL),A
RET
ORG 180H ; Raise the DTR line
RASEDTR:
IN0 A,(EXTCTL)
AND 0EFH ;Turn 'em back on again
OUT0 (EXTCTL),A
RET
ORG 190H ; set serial port baud rate
BAUDSET:
PUSH AF
LD A,(BAUDSTOR)
AND 11111000B
POP BC
OR A,B
OUT0 (BAUDRP),A ; set it...
LD (BAUDSTOR),A
RET
ORG 1A0H
BAUDTBL:
DB 0,0 ; No 38400 on 9 MHz system...
DB 20H,0ffH ; 19200 baud
DB 21H,0ffH ; 9600 baud
DB 22H,0ffH ; 4800 baud
DB 23H,0ffH ; 2400 baud
DB 24H,0ffH ; 1200 baud
DB 25H,0ffH ; 600 baud
DB 26H,0ffH ; 300 baud
ORG 1B0H
MODESET: ; set communication mode
JP SETBAUDS ; not enough room here...
ORG 1C0H ; communication mode table
MODETBL:
DB 60H ; 7 N 1
DB 64H ; 8 N 1
DB 61H ; 7 N 2
DB 65H ; 8 N 2
DB 62H ; 7 E 1
DB 66H ; 8 E 1
DB 63H ; 7 E 2
DB 67H ; 8 E 2
DB 72H ; 7 O 1
DB 76H ; 8 O 1
DB 73H ; 7 O 2
DB 77H ; 8 O 2
ORG 01CEH
SPEED: DB 09
ORG 01CFH
ESCCHR: DB 0BH
ORG 01D0H
SIGNON: DB 'SB-180 with H-19 Terminal',0
ORG 1F0H ; clear screen sequence
CLRSCR:
DB 1BH, 45H, 0
ORG 0200H ; move cursor to X,Y
MOVETO:
PUSH HL
LD C, 1BH
CALL PRTCHR
LD C, 59H
CALL PRTCHR
POP HL
PUSH HL
LD A,H
ADD 20H
LD C,A
CALL PRTCHR
POP HL
LD A,L
ADD 20H
LD C,A
CALL PRTCHR
RET
ORG 022FH
TERMCAP:
DB 0FFH
TSTRINGS: ; terminal control codes
ORG 230H
DB 1BH, 71H, 0
ORG 238H
DB 1BH, 70H,0
ORG 240H
DB 1BH, 4DH, 0
ORG 248H
DB 1BH, 4CH, 0
ORG 250H
DB 1BH, 4EH, 0
ORG 258H
DB 1BH,40H,20H,1BH,4FH,1BH,44H,0
ORG 260H
DB 1BH, 4BH, 0
ORG 268H
DB 1BH, 4AH, 0
ORG 270H ; Extra Patch Area
SETBAUDS:
PUSH AF
LD A,(BAUDSTOR)
POP BC
PUSH BC
BIT 4,B
SET 4,A
JR NZ,NORST
RES 4,A
NORST:
OUT0 (BAUDRP),A ;set even/odd
LD (BAUDSTOR),A
POP AF
RES 4,A ;bring up DTR
OUT0 (EXTCTL),A ;set parity/noparity
RET
BAUDSTOR:
DB 0 ; storage for current baud rate.
END