CMOS+ISDOS
ZXNet echo conference «real.speccy»
From Kirill Frolov → To All 16 July 1998
*** SENT TO REAL.SPECCY
*** SENT TO CODE.ZX
├┤i, All !
The watch has already been successfully connected to the Spectrum :-) But at the same time there were
5 connection options :-( The wealth of choice is good, but
their programming suffers. Especially iS-DOS does not want the appearance of crooked programs that use only one type of clock known only to them. Therefore, there is an idea to develop a unified standard for working with non-volatile clocks or their emulators on interrupts. Because any solutions such as setting counters or clocks without interruptions are extremely
frivolous, that is, it makes sense to rely mainly on clocks based
on a 512VI1 or chip. analogues. However, among the good solutions
there may be implementations of clocks on specialized 176
series microcircuits, as in the "pulsar" aon, so I immediately ask if there are any -
answer me immediately! 512VI1 is not compatible with them in any way.
If you count on a clock compatible with 512VI1, then the best way
would be some kind of driver that provides interaction with all registers
of the microcircuit. depending on the method of its connection or prohibiting
access to some registers, if this is not possible. In the iS-DOS
system, 3 types of devices are reserved: block, character outputs,
character inputs. There can be 8 of each for them.support
and for other purposes, there are 5 types of channels: device drivers
3 types (24 channels), driver channels for these devices (24 channels),
resident tasks (16 channels) and program channels (192 channels).
The driver of the 512VI1 chip requires a separate channel. Drivers
for block and character input/output devices are no longer required, if only
for the reason that some programs may want to use them
for their intended purpose. You cannot use channels intended for use by programs - they can be deleted. The simplest
would be to use channels of resident tasks. Those. The chip driver
will simply become a resident task. But not everything is so simple - there is a problem
of finding and successfully identifying such a driver among the other
residents. The only reliable way from my point of view
is to search for the resident by the part of the name reserved only
for chip drivers. Identification by channel number cannot
be used due to driver relocation and the fact that the desired
channel may already be occupied. The only drawback is that only 16 channels are allocated for resident
tasks, and therefore
more than 16 tasks cannot be installed. However, during all the time I used
iS-DOS, the case of a lack of channels occurred only once.
When using the driver by the programparameters can be passed
through registers or memory. In the case of working through a pointer, either the calling program or the driver itself must pass
.
There remains an important question - what type of data
will the program work with through the driver. It seems to me advisable to use microcircuit registers as such. Those. There is
a read/write operating mode flag and a register number. In the case of recording
, the data being written is also needed. The driver must return 2 errors:
1. inability to read data at the moment - a repeated
call is required after some time. 2. inability to read or write
the data of this register at any time (write protection, for example).
If the driver does not provide all programs with access to all
registers (to protect against unacceptable actions of these programs), then
in order to be able to use these registers for programs that
need it, you can provide for the transfer of some identification
code from the program to the driver before working with it.
I clearly suggest everyone decide on the above question and
write an answer. At the moment I assume the use of the
driver as described. The driver is called at the load address +4
or at the address located in memory with an offset +2 relative to the load address
, if it is not zero (see descriptionresident task).
A call to an address located in a memory cell with an offset of +0 relative to
the load address is made when the driver is removed or moved.
When calling a driver to work with a microcircuit, register B must
contain register number 00...3Fhex. If recording is being carried out,
then the value is transferred in register A. In case of reading there, the
result is returned. The write/read operating mode is determined by flag C. 1-write,
0-read. If the driver cannot write or read this
register at any time, then it sets the C flag, and if
the clock is not ready, then resets the Z flag. When calling the driver, it is necessary
to set the register C=#FF - this will be a sign that it is not called
from the command line, for example, to manually set some modes
of its operation.
To reduce the time for calling the driver and not to lose the AF and B registers when calling
it is necessary at the beginning the program once determines
in memory the presence of a driver and the address at which it should be called.
; Determining the presence of a driver and address. The program returns
; flag C with error 37 ("no resident task") if driver
; not installed on the system. The driver must have a fixed
; name - however, if necessary, you can search not only by
; fixed name .
; If the search is successful, the launch address is returneddrivers.
DEFCDA LD HL,NAME ; driver name
LD BC,#1651 ; search for a channel by driver name
LD A,#D8 ; starting from channel A
RST 16 ; B channels will be viewed.
RET C ; not found A=Error:37
EXX
INC HL ; at the address in the channel
INC HL ; with offset +4
INC HL ; is the download address
INC HL ; resident task.
LD E,(HL)
INC HL
LD D,(HL) ; at address with offset +2
INC DE ; relative to load address
INC DE ; resident task is located
EX DE,HL ; its launch address.
LD E,(HL)
INC HL ; if instead of the start address there
LD D,(HL) ; is 0, then the start address
LD A,D ; considered loading address
OR A ; resident task +4.
EX DE,HL
RET NZ ; not 0. this is the start address.
INC DE
EX DE,HL ; if zero, then the start address is +4.
RET
NAME DEFM "realtime" ; 8 characters.
Driver name realtime.res
NotIt would be superfluous to set the driver to interrupts and adjust
the system date at the command line address -3.
W!z Be$7 W!$heZ, FK0.
Reply to: Kirill_Fro...@zxnet.spb.ru