// more testing
chip "16f84";


area R4`20, temp;

area R0.0, a,b,,,c,d,e;

enum q0,q1,q2,,q4,q5;

//option\print = 0;

area R5.3, gygy;

code blah() {
  def foo = 8;
  def ?bar = 3;
  alloc temp, { x=byte };

  print foo;
//  print ?foo;
//  ?foo = 7;
  goto ?fallback;

  clrf baseof(gygy);
  print "baseof=", baseof(gygy);

  def @("swop"+str(47)) = "qwop";

  print swop47;

  def @(swop47) = 7;
}

func baseof(a) {
  return R0+$a;
}


{
  def x;

  for (x=1; x<5; x++) {
    code ?fallback(optional) {
      movlw x;
      code inside {
        nop;
        uses "hfeh";
      }
    }
  }
}

def abc = "foo"+chip\name;
def flap;

code hfeh(base=P1, optional) {
  alloc ?temp, { i=byte };
  alloc ?temp, { j=byte };

  def qwe = 3;

  def option\warning\ss = true;
  thing(1);

  {
    def qwe = 7;

    def option\warning\ss = false;
    print "flap:", def("flap");
    print "flop:", def("flop");
    thing();
    thing(, 2);
    @("thing")("foo", 2);
    movlw "1";
  }

  movlw $"1";
  ?gah:
//  print i,j;

}

macro thing(a) {
  print qwe;
  if (type("a") != "") {
    print "a is ", type("a"), " (", a, ")";
  } else {
    print "a is not defined";
  }
}

area R12, Bsy\A,Bsy\B,Bsy\C;

code foo
{
  def bsy;

  foreach (bsy="Bsy\\*") {
    movlw $@bsy;
  }
}

area R40`10, RAM;

alloc RAM, { tst0=byte };  // RAM kommer normal fra min include'ed 16F84

code @(abc)
{
  alloc ?RAM, { tst1=byte };

  clrf tst0;
  clrf tst1;
  clrf tst2;
}


alloc RAM, { tst2=byte };

// def, area, alloc med expression navne
