/* Transfer data through an I/O channel -- in this */ /* particular case the quasi fifo on the Zilog Z8000 */ /* Zoom board. This module should be replacable by */ /* others which utitilize a different I/O channel */ /* (i.e. RS-232), and different protocols. */ /* ************************************************* * * * Author: David Heintz * * Module: Channelc.c * * Creation Date: 10/26/82 * * Language: Standard C * * Version: 0.0 * * Last Mod: 01/17/83 P.S.W. * * * ************************************************* */ /* ************************************************* * * * STANDARD HEADERS * * * ************************************************* */ #include "unstdsys.h" #include "fioequ.h" #include "chnequ.h" /* ************************************************* * * * EXTERNAL DECLARATIONS * * * ************************************************* */ /* ************************************************* * * * I/O Channel Related Externals * * and Globals * * * ************************************************* */ /* Routines defined other modules */ extern BYTE input(); extern output(); extern BYTE gb_word(); extern BYTE gb_long(); extern pb_word(); extern pb_long(); /* Varibles defined in other modules */ extern WORD bytlen; extern WORD wrdlen; extern WORD lnglen; /* External port addresses */ extern WORD fiocr1; extern WORD fioir0; extern WORD fiomsi; extern WORD fiomso; /* Routines defined within this module */ extern BYTE snd_pkt(); extern BYTE rcv_pkt(); extern BYTE snd_sys(); extern chn_err(); /* Static definitions for use within module */ /* ***************************************** * * * snd_sys(): * * Transmit a load buffer * * over I/O channel * * * ***************************************** / / Inputs: buffer type, segment, offset, data address, length / Outputs: I/O channel status (byte) / Assumptions: Data length is always less than FIO size */ BYTE snd_sys(buftyp, basseg, basoff, buffer, ldlen) BYTE buftyp, basseg, *buffer; WORD basoff, ldlen; { BYTE code, fio_put(), fio_gack(); int i; if (code == chsuc) { fio_put(buftyp); fio_put(basseg); for (i=(wrdlen-1); i>=0; i--) fio_put(gb_word(&basoff, i)); /* Send high-order byte first */ for (i=(wrdlen-1); i>=0; i--) fio_put(gb_word(&ldlen, i)); /* Send high-order byte first */ for (i=0; i