/*
 * Test thing that flashes stuff
 */

#include <16f627>

area PORTA.0, Led1, Led2;

struct {
  temp = bit.0`4,
  blah = bit.1,
  spif = byte
};

area R0x0c`0x20, temp;

def x;

enum qwert = 9;


code boot(base = P0)
{
  movlw	0xff;
  movwf	PORTA;			// turn off
  bsf	RP[0];			// bank 1
  movlw	~(*Led1 | *Led2);	// LEDs are outputs
  movwf	TRISA;
  bcf	RP[0];			// bank 0
  {
    movlw *Led1;		// get mask
    xorwf PORTA;		// toggle led1 (f is default)
    clrw;
    call delay;			// delay 256
    clrw;
    call delay;			// delay 256
    movlw *Led1 | *Led2;
    xorwf PORTA;		// toggle both leds
    clrw;
    call delay;			// delay 256
    goto begin;
  }
}

code delay
{
  alloc temp, { i=byte,j=byte };

  movwf i;
  clrf j;
  {
    nop;
    nop;
    incfsz j;
    goto begin;
    decfsz i;
    goto begin;
  }
  return;
}

