initial
[fpgammix.git] / workloads / fill.c
blob622c22c96ea3c81fd1166764c4a89d763f4dc808
1 #define set_s7_0(x) IOSPACE[9] = (x)
2 #define set_s7_1(x) IOSPACE[11] = (x)
3 #define set_fbaddr0(x) IOSPACE[21] = (x)
5 register volatile int *IOSPACE asm("$233");
7 void putch(int ch)
9 while (IOSPACE[1])
11 IOSPACE[0] = ch;
14 void puthex(unsigned v)
16 if (v >= 16) puthex(v >> 4);
17 putch("0123456789abcdef"[v & 15]);
20 int
21 main()
23 IOSPACE = (int*) 0x1000000000000ULL;
24 unsigned fbaddr0 = 0;
26 for (;;) {
27 puthex(fbaddr0);
28 putch('\r');
29 putch('\n');
30 set_fbaddr0(fbaddr0);
31 set_s7_0(fbaddr0);
32 set_s7_1(fbaddr0 >> 8);
33 fbaddr0 += 640 / 8;