multicard from pisyuk to spec

ZXNet echo conference «real.speccy»

From Kirill Frolov To All 15 March 2001

Immediately click on RESET, All!


I was thinking about how to connect a multicard from a PC with ports and a HDD to the spec.
And the HDD should be 16-bit. The hardware part does not cause problems: you can
introduce
an additional register to save the high/low half of the data bus and
read
from the ports twice. But here it all comes down to the fact that it is impossible to interrupt the process
reading-writing
of one 16-bit word by another program accessing 16-bit ports
!

Let, for example, there is a hard drive in the system (16-bit) and some other 16-bit
device
with a higher interrupt priority. The system suddenly receives
an interrupt from
the hard drive and begins to read data:

LDI
LDI
LDI
....
LDI


And suddenly an interrupt appears between two LDI commands. Moreover, it appears
at such
a point in time that the processor has managed to read only half of the
16-bit
word from the registers. The processor goes into the interrupt and starts working with another 16-bit
device
and corrupts the contents of the register containing half a word of data from the hard drive.
Then the processor
comes out of the interrupt and finishes reading the SPOILED block of data from the hard drive.

And what should we do? It is clear that interruptions between two
neighboring
LDIs must be disabled and interrupts must be allowed between the other two,like this:

DI
LDI
LDI
EI
NOP
DI
LDI LDI
EI
NOP
DI
LDI
LDI
....

But the software method is very slow. It is possible in hardware to suppress interrupts for some time after
reading half of a 16-bit word.
I don’t like it that way.

You can provide in the interrupt handling program for reading the un
read half
of a word into memory and then writing it back, and for 8-bit ones you can provide reading by
bypassing the storage register.

What other ones will be ideas?