// experi4c.c

#include <conio.h>
#include <stdio.h>
#include <bios.h>

// include header with constants
#include "const4b.h"

// external prototypes
extern void set_up_ppi(int mode);
extern void get_port(void);
void btoa(void);

void main(void)
{
  int x,y,r,c;

  get_port(); // get the port number and establish register locations

  // make A an output and B an input
  set_up_ppi(Aout_CUin_Bin_CLin);

  while(1) // stay in loop forever
  { 
    // "keyboard hit" is a function that checks
    // to see if a key has been pressed.
    if(kbhit())
      break;// A key was pressed -- break out of the while(1) loop

    btoa(); // get Port B, invert it and put it in Port A

  } // end while(1)

} // end experi4c.c


