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
/
BEEHIVE
/
COMMS
/
ZMP-OV16.ARC
/
ZMO180F1.Z80
< prev
next >
Wrap
Text File
|
1991-02-02
|
25KB
|
908 lines
; ZMO180F1.Z80 -- SB180FX computer overlay file for ZMP 1.5 --
; September 24 1989 - by Simeon Cran
; This file adapts ZMP1.5 to the SB180-FX computer; HD64180 ASCI port 0
; This file has only been tested on a 9 MHz FX
; Based on Bill Biersdorf's ZMP180B1.Z80 of September 1988
; Assemble with ZAS.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; NOTES:
; Credit must be given to Bill Biersdorf who got the thing running
; in the first place. I have retained some of his original code.
; This version solves the problem of high speed transfers referred to
; by Ron Murray in ZMP.DOC. Two schemes have been implemented to make this
; possible. One: the unused programmable reload timer on the 64180 has been
; pressed into service to do all timing. This is not interrupt driven, but
; rather polled. Two: if the "modints" equate is set to true, the modem
; port is interrupt driven for receive. Be warned however if you are using
; a bios which executes out of the normal 64k CP/M bank. If an interrupt
; occurs during that time, it could end up anywhere. If possible, you
; should modify your bios to prevent this happening. If you need ideas, let
; me know.
; With "modints" set true, I can now run my modem faster that my
; terminal. This may not seem all that useful, but for use with a packet
; radio TNC or high speed buffered modem, it is worthwhile. Note that when
; the receive buffer gets full, it controls DTR and RTS to stop the sender.
; If the sender doesn't recognise these signals, buffer overrun will occur.
; Thankfully most high speed peripherals do respond as expected.
; Also, DTR and RTS are turned off on exit. That means that the
; sender will buffer it's data until ZMP is running again. Useful if
; you want to go and run some ordinary CP/M command and then return: the
; data should be there waiting for you. DTR and RTS are of course turned
; back on on entry.
; Everything appears to work properly. Don't forget to change the
; terminal routines to suit your own terminal or it will do some very strange
; things on the screen (mine is a little unusual).
; The break routine is of necessity, a bit of a kludge. It may
; sometimes throw up some garbage on the screen, but mostly it doesn't.
; The point is, it works.
; I have marked the parts that you will probably have to change, with
; "*****". This should make it easier to find your way around (use the
; find function of your word processor).
; This is my version 1.0
; Simeon Cran VK4ASJ/KF7QL Brisbane Australia
; (any queries via Z-NODE 62 or VK4ASJ@VK4KJB)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; System-dependent installation overlay for ZMP
; Author: Ron Murray
;
; Insert your own code as necessary in this file. Code contained herein
; has been written in HD64180 code for use with ZAS. Assemble with the h
; option to create a .HEX file, and use MLOAD to overlay it over the main
; ZMPX.COM file to produce your very own ZMP.COM.
;
; Notes on modifying this file:
; Hi-Tech C requires that functions do not change either index register
; (IX or IY). If your overlay requires either of these to be changed, ensure
; they are restored to their original values on return.
; Since collecting parameters from C functions can be tricky, only change
; the parts marked 'Insert your own code here'. Do NOT modify the jump
; table at the start. Do NOT modify the entry/exit sections of each
; function. Do NOT pass 'GO'. Do NOT collect $200.
; Apart from defining modem functions, this file also defines terminal
; characteristics. Most have been set up for ADM-3A (with a few of my own
; additions). Modify to suit your own terminal. An inline print routine
; is provided for printing strings in the usual way: usage is
;
; call print
; db 'required string',0
;
;
; If you find your overlay exceeds the maximum size (currently 0400h),
; you will have to re-compile the whole thing. Good luck. You might try
; informing us if you need to do this: if too many people need to do it, we
; haven't allowed enough room.
;
; Ron Murray 15/8/88
;
;=============================================================================
;Some fundamental truths
true equ 0ffh
false equ not true
;------------------------------------------------------------------------------
; OPTION CONFIGURATION SECTION
;
;Interrupt driven modem input option
;
modints equ true ; true=use interrupts for modem receive*****
;Select-a-speed ; NOTE: set only ONE of the following to true*****
;
cpu12 equ false ; 12.288 MHz HD64180
cpu9 equ true ; 9.216 MHz HD64180
cpu6 equ false ; 6.144 MHz HD64180
mspeed equ 003ch ; Current baud rate: as used by BYE etc
; This MUST be the same as Mspeed in
; ZMP.H
;Set the following two equates to the drive and user area which will contain
; ZMP's .OVR files, .CFG file, .FON file and .HLP file. Set both to zero
; (null) to locate them on the drive from which ZMP was invoked.
overdrive equ 'B' ; Drive to find overlay files on ('A'-'P')*****
overuser equ 0 ; User area to find files*****
;----------------------------------------------------------------------------
;User-set variables:
iport equ 08h ; MODEM data in port
oport equ 06h ; MODEM data out port
cport equ 00h ; MODEM control port
mstat equ 04h ; MODEM status port
bport equ 02h ; MODEM baudrate port
mdrcv equ 80h ; receive ready bit
mdsnd equ 02h ; send ready bit
TCR equ 010h ; timer control register
TMDR1L equ 014h ; timer data registers
TMDR1H equ 015h
RLDR1L equ 016h ; timer reload registers
RLDR1H equ 017h
userdef equ 00145h ; origin of this overlay: get this value
; from the .SYM file produced when ZMP.COM
; is linked
ovsize equ 0400h ; max size of this overlay
esc equ 1bh
ctrlq equ 11h
cr equ 0dh
lf equ 0ah
bdos equ 5
;=============================================================================
; CODE STARTS HERE
.hd64 ; use HD64180 code
;; aseg ; absolute
org userdef
;Jump table for the overlay: do NOT change this
jump_tab:
jp scrnpr ; screen print
jp mrd ; modem read with timeout
jp mchin ; get a character from modem
jp mchout ; send a character to the modem
jp mordy ; test for tx buffer empty
jp mirdy ; test for character received
jp sndbrk ; send break
jp cursadd ; cursor addressing
jp cls ; clear screen
jp invon ; highlight (inverse video) on
jp invoff ; highlight (inverse video) off
jp hide ; hide cursor
jp show ; show cursor
jp savecu ; save cursor position
jp rescu ; restore cursor position
jp mint ; service modem interrupt
jp invec ; initialise interrupt vectors
jp dinvec ; de-initialise interrupt vectors
jp mdmerr ; test uart flags for error
jp dtron ; turn DTR (and RTS) ON
jp dtroff ; turn DTR (and RTS) OFF
jp init ; initialise uart
jp wait ; wait seconds
jp mswait ; wait milliseconds
jp userin ; user-defined entry routine
jp userout ; user-defined exit routine
jp getvars ; get system variables
jp setport ; Set the modem port being used
;Spare jumps for compatibility with future versions
jp spare ; spares for later use
jp spare ; spares for later use
jp spare ; spares for later use
jp spare ; spares for later use
jp spare ; spares for later use
jp spare ; spares for later use
jp spare ; spares for later use
jp spare ; spares for later use
;=============================================================================;
; Main code starts here
;
codebgn equ $
;
;Screen print function
scrnpr:
; <== Insert your own code here
call print
db cr,lf
db 'Screen-print function not supported.',cr,lf,lf
db 0
; <== End of your own code
spare:
ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;User-defined entry routine: leave empty if not used
userin:
jp dtron
; ret
;User-defined exit routine: leave empty if not used
userout:
jp dtroff
; ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Get a character from the modem: return in HL
; It is not necessary to test for status
mchin:
if modints
push bc
xor a
ld hl,buffer ; Point to the buffer
out0 (mstat),a ; turn off the interrupts
dec (hl) ; Update the character count (this sets flags)
ld c,(hl) ; Start putting character count in BC
inc hl
ld a,(hl) ; Get the next character
jr z,mchin1 ; Exit if that was the last character
ld b,0 ; Now set up to update the buffer positions
ld d,h
ld e,l
inc hl
ldir ; Update the buffer
mchin1:
ld l,a
ld a,08h
out0 (mstat),a ; Turn interrupts on
pop bc
ld h,0
ld a,l
or a
ret
else
; push bc
; <== Insert your own code here
in0 a,(iport) ; to get the character in A
; <== End of your own code
ld l,a ; put in HL
ld h,0
or a ; set/clear Z
; pop bc
ret
endif ;modints
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Send a character to the modem
mchout:
ld hl,2 ; get the character
add hl,sp
ld a,(hl) ; in A
; <== Insert your own code here
out0 (oport),a
; <== End of your own code
ret ; done
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Test for output ready: return TRUE (1) in HL if ok
mordy:
; <== Insert your own code here
ld hl,00h ; assume not ready for now
in0 a,(mstat)
and mdsnd
jr z,mordy1 ; still not ready
inc hl ; ready, so set HL
mordy1: ; <== End of your own code
ld a,l ; set/clear Z
or a
ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Test for character at modem: return TRUE (1) in HL if so
mirdy:
if modints
ld hl,1 ; assume character there
ld a,(buffer)
or a
ret nz ; return showing character there
ld a,(dtrflg)
or a
call z,dtron ; turn on DTR if it's off
xor a
ld h,a
ld l,a
ret
else
; <== Insert your own code here
ld hl,00h ; assume not ready for now
in0 a,(mstat)
and mdrcv
jr z,mirdy1 ; still not ready
inc hl ; ready, so set HL
mirdy1: ; <== End of your own code
ld a,l ; set/clear Z
or a
ret
endif ;modints
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Send a break to the modem
sndbrk:
in0 a,(bport)
push af
ld a,02eh ; Slow port down to slowest speed to
out0 (bport),a ; force a framing error
xor a
out0 (oport),a ; send a 0
ld hl,100
call waithlms ; wait for a moment
pop af
if cpu9
or 020h
else
and 0d0h
endif ;cpu9
out0 (bport),a ; restore the baudrate
ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Test UART flags for error: return TRUE (1) in HL if error
mdmerr:
; <== Insert your own code here
xor a ; not yet implemented
; <== End of your own code
ld a,l ; set/clear Z
or a
ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Turn DTR (and RTS) ON. (reset)
dtron:
; <== Insert your own code here
ld a,1
ld (dtrflg),a ; Show other routines that DTR is on
in0 a,(cport)
and 0efh ; RTS on
out0 (cport),a
call dtrstat ; pull control latch
ld a,10111111b ; mask off DTR bit
and b ; and it out
jr dtrnxt
; <== End of your own code
;Turn DTR (and RTS) OFF. (set)
dtroff:
; <== Insert your own code here
xor a
ld (dtrflg),a ; Show other routines that DTR is off
in0 a,(cport)
or 10h ; RTS off
out0 (cport),a
call dtrstat ; pull control latch
ld a,01000000b ; mask off DTR bit
or b ; or it in
dtrnxt: ld b,a
ld a,0ffh ; set up for write
dtrnxt1:
ld hl,(1) ; get address of BIOS
ld l,3fh ; add offset for control latch
jp (hl) ; go to the latch routine and return from there
; <== End of your own code
;Needed to prevent changes to other control latch registers.
dtrstat:
xor a
jr dtrnxt1
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Initialise the UART
init:
ld hl,2 ; get parameters
add hl,sp
ex de,hl
call getparm ; in HL
ld (brate),hl ; baud rate
call getparm
ld (parity),hl ; parity
call getparm
ld (data),hl ; data bits
call getparm
ld (stop),hl ; stop bits
; <== Insert your own code here
call setprty ; set parity
call setbaud ; set baud
call setstop ; set stop bits
; set word length and return from there
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
wlength:
ld a,(data) ; get word length
cp 7
jr z,wlen7 ; 7
; assume 8
wlen8: in0 a,(cport)
or 04h ; set bit 2
jr wlnxt
wlen7: in0 a,(cport)
and 0fbh ; reset bit 2
wlnxt: out0 (cport),a
jr initsio ; and reset any errors
; <== End of your own code
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
; Set the port. ZMP supplies either 0 or 1 as a parameter. You're on your
; own here -- your system is bound to be different from any other! You may
; implement a software switch on all the modem-dependent routines, or perhaps
; you can have one or two centralised routines for accessing the UARTs and
; modify the code from this routine to select one or the other. (Who said
; there was anything wrong with self-modifying code?). If you have only one
; UART port, or if you don't want to go through all the hassles, just have
; this routine returning with no changes made. Note that ZMP calls this
; routine twice -- once for each port value -- on initialisation.
;
setport:
ld hl,2 ; get port number
add hl,sp
ex de,hl
call getparm ; in HL (values are 0 and 1)
; <== Insert your own code here
; <== End of your own code
ret
setbaud:
ld a,(brate) ; get BRATE into A
ld (mspeed),a ; store the value in low memory for reentry
ld e,a ; and DE
ld d,0
ld hl,divisors ; get offset into baudrate divisor table
add hl,de
ld a,(hl) ; fetch code
inc a ; 0FFh means upsupported code
ret z ; exit if bad
in0 a,(bport) ; get the current BPORT setting
and 0d0h ; clear out the current baudrate
or (hl) ; get the new baudrate
out0 (bport),a ; and set the port
initsio: ; using values below
in0 a,(cport)
and 0f7h ; reset errors
or 60h ; enable xmit, receive; clear errors
out0 (cport),a
ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
setprty:
ld a,(parity) ; get parity into A
cp 'E'
jr z,prevn ; even
cp 'O'
jr z,prodd ; odd
; else assume none
proff: in0 a,(cport)
and 0fdh ; reset bit 1
out0 (cport),a
jr initsio ; to reset errors
prevn: in0 a,(cport)
or 02h ; set bit 1
out0 (cport),a ; send it to the port
in0 a,(bport) ; get the current BPORT
and 0cfh ; clear PEO
if cpu9
or 020h
endif ;cpu9
jr prnxt
prodd: in0 a,(cport)
or 02h ; set bit 1
out0 (cport),a
in0 a,(bport) ; get current BPORT
if cpu9
or 030h ; set PEO
else
and 0d0h
or 010h ; set PEO
endif ;cpu9
prnxt: out0 (bport),a
jr initsio ; reset errors
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
setstop:
ld a,(stop) ; get stopbits into A
cp 2
jr z,stop2 ; two
; assume one
stop1: in0 a,(cport)
and 0feh ; reset bit 0
jr ssnxt
stop2: in0 a,(cport)
or 01h ; set bit 0
ssnxt: out0 (cport),a
jr initsio ; and reset errors
;****************************************************************************
; Video terminal sequences: these are for FALCO TS-1 -- Modify as you wish
;Cursor addressing:
cursadd:
ld hl,2 ; get parameters
add hl,sp
ex de,hl
call getparm ; in HL
ld a,020h
add a,l
ld (cursr),a ; put row value in
call getparm
ld a,020h
add a,l
ld (cursc),a ; put column value in
call print
db esc,'=' ; Cursor address: leadin
cursr: db 0 ; row
cursc: db 0 ; column
db 0
ret
;Clear screen:
cls:
call print
db 01ah,0
ret
;Highlight on:
invon:
call print
db esc,')',0
ret
;Highlight off:
invoff:
call print
db esc,'(',0
ret
;Turn off cursor:
hide:
call print
db esc,'d0',0
ret
;Turn on cursor:
show:
call print
db esc,'d4',0
ret
;Save cursor position:
savecu:
; ret
;Restore cursor position:
rescu:
ret
;****************************************************************************
;Service modem interrupt:
mint:
if modints
ld (locstk),sp
ld sp,locstk
push hl
push de
push bc
push af ; Save the registers
in0 a,(mstat)
tst 070h ; See if it was a receive error
jr nz,minterr ; It was a receive error, so go fix it
in0 c,(iport) ; Get the character in C
ld hl,buffer ; Point to character count
inc (hl) ; Update it
ld a,(hl)
cp buflen
jr nc,minterr ; If buffer is full, then we won't put it in
ld e,a ; Get the new character count
ld d,0 ; Character count in DE
add hl,de ; Point to character position
ld (hl),c ; Stick it in
cp buflen-2 ; a still has the buffer length in it
call nc,dtroff ; Turn off DTR if buffer almost full
jr mintex
minterr:
in0 a,(cport) ; Control register A
and 0f7h ; Ensure EFR=0
out0 (cport),a ; Reset EFR
in0 a,(iport) ; Throw the character away
mintex:
pop af
pop bc
pop de
pop hl ; Restore the registers
ld sp,(locstk)
ei ; Enable interrupts for the ASCI
endif ;modints
ret
;Initialise interrupt vectors:
invec:
if modints
in0 a,(033h) ; get low byte of interrupt vector
or 0eh ; add the bits for ASCI0
ld (vecstore),a ; put in buffer
ld a,i
ld (vecstore+1),a
ld hl,(vecstore)
ld e,(hl) ; get old vector address
inc hl
ld d,(hl)
ld (vecstore+2),de ; save it
ld de,mint
ld (hl),d
dec hl
ld (hl),e
ld a,08h
out0 (mstat),a ; turn on the interrupts
ei
endif ;modints
ret
;De-initialise interrupt vectors:
dinvec:
if modints
xor a
out0 (mstat),a ; turn off interrupts
ld hl,(vecstore)
ld de,(vecstore+2)
ld (hl),e
inc hl
ld (hl),d ; and restore the vector
endif ;modints
ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; GENERAL DATA AREA
dtrflg: db 0 ; NZ if DTR is on
port: db 1 ; Holds the currently selected port number
brate: ds 2 ; baud rate:
; 0 = 110 baud 1 = 300 baud 2 = 450 baud
; 3 = 600 baud 4 = 710 baud 5 = 1200 baud
; 6 = 2400 baud 7 = 4800 baud 8 = 9600 baud
; 9 = 19200 baud
parity: ds 2 ; parity (will be 'N', 'E' or 'O')
data: ds 2 ; data bits (will be 7 or 8)
stop: ds 2 ; stop bits (will be 1 or 2)
divisors:
if cpu12 ; 12.288 MHz clock
PRTrl equ 61440
db 0ffh,0eh,0ffh ; 0 = 110 baud 1 = 300 baud 2 = 450 baud
db 0dh, 0ffh,06h ; 3 = 600 baud 4 = 710 baud 5 = 1200 baud
db 05h, 04h, 03h ; 6 = 2400 baud 7 = 4800 baud 8 = 9600 baud
db 02h,01h,0ffh,0h ; 9 = 19200 baud 10 = 38400 baud
; 11 = 57600 baud 12 = 76800 baud
endif
if cpu9 ; 9.216 MHz clock
PRTrl equ 46080 ; PRT reload value for 100ms clock
db 0ffh,26h,0ffh ; 0 = 110 baud 1 = 300 baud 2 = 450 baud
db 25h, 0ffh,24h ; 3 = 600 baud 4 = 710 baud 5 = 1200 baud
db 23h, 22h, 21h ; 6 = 2400 baud 7 = 4800 baud 8 = 9600 baud
db 20h,0ffh,0ffh ; 9 = 19200 baud 10 = 38400 baud
db 0ffh ; 11 = 57600 baud 12 = 76800 baud
endif
if cpu6 ; 6.144 MHz clock
PRTrl equ 30720
db 0ffh,0dh,0ffh ; 0 = 110 baud 1 = 300 baud 2 = 450 baud
db 06h, 0ffh,05h ; 3 = 600 baud 4 = 710 baud 5 = 1200 baud
db 04h, 03h, 02h ; 6 = 2400 baud 7 = 4800 baud 8 = 9600 baud
db 01h,0ffh,0ffh ; 9 = 19200 baud 10 = 38400 baud
db 0ffh ; 11 = 57600 baud 12 = 76800 baud
endif
if modints
vecstore: ; storage for interrupt vector
dw 0 ; this is where it goes,
vecs1: dw 0 ; this is what it is
ds 16
locstk: ds 2 ; Interrupt stack
endif ;modints
;= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;****************** End of user-defined code ********************************
; Don't change anything below this point. We needed some assembly language
; stuff for speed, and this seemed like a good place to put it.
; Note by Simeon.... I have indeed changed this code... It has been done
; to allow high speed transfers, and uses the 64180 PRT1 as a timer. Will
; definitely not work on a Z80 computer.
;Modem character test for 100 ms
mrd:
ld de,PRTrl ; 100 ms time constant
call PRTset ; Set up the timer
ld l,c ; Save c
ld c,TCR ; Point to timer control register
mrd1: call mirdy ; See if there is a character at the modem
jr nz,mrd2 ; Exit if there is
TSTIO 080h ; See if timer has overflowed yet
jr z,mrd1 ; Keep checking modem if not
ld hl,0
xor a ; Show no character
mrd2: ld c,l ; Restore C
ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
; Inline print routine: destroys A and HL
print:
ex (sp),hl ; get address of string
ploop:
ld a,(hl) ; get next
inc hl ; bump pointer
or a ; done if zero
jr z,pdone
call cout ; else print
jr ploop ; and loop
pdone:
ex (sp),hl ; restore return address
ret ; and quit
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;
;Output a character in A to the console
;
cout:
push bc ; save regs
push de
push hl
ld e,a ; character to E
ld c,2
call bdos ; print it
pop hl
pop de
pop bc
ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Wait(seconds)
wait:
ld hl,2
add hl,sp
ex de,hl ; get delay size
call getparm
; fall thru to..
;Wait seconds in HL
waithls:
push bc
ld b,10 ; Do ten times
ld de,PRTrl ; time constant for 100ms
call PRTset ; Set up the registers
ws3: push hl
ws1: in0 a,(TCR)
and 080h ; See if timer has overflowed yet
jr z,ws1
dec hl
ld a,l
or h
jr z,ws2
in0 a,(TMDR1L) ; Read the timer data register to reset flag
jr ws1 ; And loop around again
ws2:
pop hl
dec b
jr nz,ws3
pop bc
ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Wait milliseconds
mswait:
ld hl,2
add hl,sp
ex de,hl ; get delay size
call getparm
; fall thru to..
;Wait milliseconds in HL
waithlms:
ld de,[PRTrl]/100 ; time constant for 1ms
call PRTset ; Set up the registers
wms1: in0 a,(TCR)
and 080h ; See if timer has overflowed yet
jr z,wms1 ; Keep waiting until it does
dec hl
ld a,l
or h
ret z
in0 a,(TMDR1L) ; Read the timer data register to reset flag
jr wms1 ; And loop around again
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PRTset: ; Set up PRT1 with the time constant in DE (including reload registers)
; Clear the interrupt flag, and start the counter
in0 a,(TCR)
and 0ddh
out0 (TCR),a ; Inhibit down counting for PRT1
ld a,e
out0 (TMDR1L),a
out0 (RLDR1L),a
ld a,d
out0 (TMDR1H),a
out0 (RLDR1H),a ; Set up the data and reload registers
in0 a,(TCR)
or 02h
out0 (TCR),a ; Start the counter
in0 a,(TMDR1L) ; Reset the interrupt flag
ret ; And return
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Get next parameter from (de) into hl
getparm:
ex de,hl ; get address into hl
ld e,(hl) ; get lo
inc hl
ld d,(hl) ; then hi
inc hl ; bump for next
ex de,hl ; result in hl, address still in de
ret
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;Get address of user-defined variables
getvars:
ld hl,uservars
ret
uservars:
dw overdrive ; .OVR etc. drive/user
dw overuser
;------------------------------------------------------------------------------
if modints
; This is the buffer for the interrupt driven modem routines. It will take
; up all the space to the end of the overlay if possible
if [(ovsize + codebgn) - $] gt 0ffh
buflen equ 0ffh ; Buffer length must be eight bits only
else
buflen equ (ovsize + codebgn) - $
endif
buffer: ; Interrupt driven ASCI input buffer
db 0
ds buflen-1
endif ;modints
;------------------------------------------------------------------------------
if ($ - codebgn) gt ovsize
toobig: jp errval ; Overlay too large!
endif
end