#include <pic12f629.h>
#include <12F629.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES INTRC_IO                 //Internal RC Osc, no CLKOUT
#FUSES NOCPD                    //No EE protection
#FUSES NOPROTECT                //Code not protected from reading
#FUSES MCLR                     //Master Clear pin enabled
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOBROWNOUT               //No brownout reset
#FUSES BANDGAP_HIGH
#FUSES RESERVED                 //Used to set the reserved FUSE bits

#use delay(clock=4000000)

int main()
{
    TRISIO = 56;
    int i = 0;
    int sz;

    GPIO = (i);

    for(sz = 0; sz <= 100; sz)
    {
        if (GP4 == 0 && i <= 7)
        {
            GPIO = (i);
            if (i < 7) i++;
            sz++;
        }
        if (GP3 == 0 && i >= 0)
        {
            GPIO = (i);
            if (i > 0) i--;
            sz++;
        }
    }
    return 0;
}