Why don’t we make this GPIO thing a little more readable and easier on ourselves.  I put together a little library that takes care of most of the GPIO functions for us, in an more human readable way.

Just include gpio.c and gpio.h in your project and it has the following functions.

void pinMode(uint8_t pin, uint8_t direction)  //Set the direction of a pin – Example pinMode(0,OUTPUT) will set pin0 to output
vout digitalWrite (uint8_t pin, uint8_t value) //Write a value to a Pin        – Example digitalWrite(0,HIGH) will set pin0 to High (logic 1)
uint8_t  digitalRead (uint8_t pin)                   //Read a value from a Pin
void digitalToggle (uint8_t pin)                     //Toggles a Pin, if the pin is low, it will go high, high will go low. 

The code and include files can be found here in GitHub – https://github.com/JamieStarling/MCU_FUN/tree/master/Microchip/PIC10F322

Example blink_led_v2.c

#include "includes/10F322_deviceconfig.h"
#include "includes/gpio.h"


void main ()
{
       
    pinMode(0,OUTPUT);
    
    //The Forever Loop
    while (1)
    {
        
        //Set PortA.0 High (turn on LED)
        digitalWrite(0,ON);    
        
        //Wait 1 second
        __delay_ms(1000);
        
        //Set PortA.0 Low  (turn off LED)
        digitalWrite(0,OFF);
        
        //Wait 1 second
        __delay_ms(1000);
        
        //End of Loop
        
    }
}