the function, the floppy-disc interface would detect the termination
of the read, or write, and provide an interrupt to the Z-80, initiating
the expected interrupt action.
The parameters above could be passed to the floppy-disc I/O
driver in a variety of ways, but the most typical would probably be
to pass a pointer in the HL or index registers.
LD IY,IOBLK LOAD IOBLK POINTER
CALL DISCD READ DISC
LD A,(IY+8) GET TYPE OF COMPLETE
BIT 7,A TEST TOC
JP NZ,ERROR GO IF ERROR ON READ
IOBLK EQU $
SECTOR DEFS 1
TRACK DEFS 1
FUNC DEFS 1
BUFFER DEFS 2
NOBYTS DEFS 2
STATUS DEFS 1
TOFC DEFS 1
The preceding code shows a pointer to the I/O block being passed
in the IY index register and an IOBLK with the location of the
parameters defined. In many cases, the proper parameters will be
put in dynamically at run-time rather than being preassembled, as
many of them change depending on the type of I/O call.
The implementation of the I/O driver "DISCD" is not shown be-
cause it is strictly dependent on the type of floppy-disc drive and the
interface design. There will be quite a bit of latitude in how the
actual interface is implemented. Perhaps the 8080-type interrupt
mode 0 will be implemented instead of the mode 2 table-vectored
interrupts. Possibly I/O will be nonDMA instead of direct transfers
to memory. In any event, the I/O driver must translate the parame-
ters provided into proper I/O instructions to initiate and complete
the I/O actions required.
In many microcomputers, firmware in the device controller per-
forms the I/O driver functions, providing the user a more simple
interface than that described.
DMA ACTIONS
In the preceding interface, DMA, or direct-memory access, may
be required. In many cases, the performance of DMA will be the
responsibility of the hardware logic of the device controller. It will
automatically communicate with the CPU via the BUSRQ and
228
Need help?
Do you have a question about the Z80 and is the answer not in the manual?
Questions and answers