#include <time.h>

static void readt(void *,unsigned long)=
 "cloop:\n"
 "\tldz\t#0\n"
 "\tldq\t[btmp0],z\n"
 "\tcpq\t(r0)\n"
 "\tbeq\tdone\n"
 "\tstq\t(r0)\n"
 "\tjmp\tcloop\n"
 "done:\n"
 "\tldz\t#0";

clock_t clock(void)
{
  static char t1[4];
  clock_t time;

  readt(&t1,0xFFD3D08);

  time=t1[0];
  time+=(t1[1]&0xf)*10u;
  time+=(t1[1]>>4)*100u;
  time+=(t1[2]&0xf)*600u;
  time+=(t1[2]>>4)*6000u;

  return time;
}
