
// simple interrupt

// dummpy header
readport(n)
doze()
settimer0()
settimer1()
ei()
di()


cnt		// global counter

int0()
  x = readport(13)
//  y = x - ((x / 256) * 256)
  print(x)

int1()
  cnt = cnt + 1
  print(cnt)

// empty ISR (must be present)
int2()
int3()


delay()
  i = 0
  while( i < 30 )
    i = i + 1

// trick to do modulo
//   y = x - ((x / 256) * 256)   assume modulo 256

main()
  settimer0(200)
  settimer1(250)
  ei(1)
  cnt = 0
  while( 1 )
    doze()	// sleep and wait for int
