// experi6e.c

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

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

// include header with external prototypes
#include "extern6a.h"

void main(void)
{
  int x,p,y;

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

  // make everything an output
  set_up_ppi(Aout_CUout_Bout_CLout);

  for(x=-1,p=PC7; p>=PA0; x++,p--)
  {
    if(!ConfigureOutput(x,p))
      printf("Error for arraynum = %d port select = %d\n",x,p);
  }

  for(x=0,p=PA0-1; p<=PC7+1; x++,p++)
  {
    if(!ConfigureOutput(x,p))
      printf("Error for arraynum = %d port select = %d\n",x,p);
  }

  // don't forget to free memory!
  FreeOutputControl();

} // end experi6e.c

