     
    1-PC.
-------------------------------------------------

   1.
----------------------

     , ""
      
 -    .
,     
   ,   ,
      ,
    , 
   ..

 .
--------------------

       :

struct {
	/* ,   */

	void (*init) ();        /*   */
	void (*reset) ();       /*      */
	void (*outb) ();        /*     */

	/*    */

	int channel;            /*    */
	void (*inb) ();         /*       */
	void (*error) ();       /*      */
	...
} uc;

uc.init (channel, inproc, errproc)
int channel;            /*  , 0-3 */
void (*inproc) ();      /*     */
void (*errproc) ();     /*      */

 .    channel.
       
uc.inb = inproc, uc.error = errproc.
   .

uc.outb (byte)
int byte;               /* 10-      */

  (10 )  .    PC,
  - .     
(, 100)    ,   
(, 30 )  ,  uc.error.

uc.reset ()

 ,    .
  uc.error    .

uc.inb (byte)
int byte;               /* 10- ,    */

        .
,      ,
      
(,      ).

uc.error (errval)
int errval;             /*   */

      
 (,  ).
,  uc.error   uc.reset  
.

  :
1)    PC. PC      .
2)    .  PC   
 .
3)    .  PC   
  .

 .
---------------

       :

struct {
	/* ,   */

	void (*init) ();        /*   */
	void (*reset) ();       /*      */
	void (*send) ();        /*   */
	void (*recv) ();        /*   */

	/*    */

	int channel;            /*    */
	void (*error) ();       /*      */
	...
} bc;

bc.init (channel, errproc)
int channel;            /*  , 0-3 */
void (*errproc) ();     /*      */

 .    channel.
     bc.error = errproc.
   .

bc.send (length, physaddr)
int length;             /*    */
int physaddr;           /*   */

   .

bc.reset ()

 ,    .
  bc.error    .

bc.error (errval)
int errval;             /*   */

      
 (,  ).
,  bc.error   bc.reset  
.
