summaryrefslogtreecommitdiff
path: root/util/romcc/tests/simple_test32.c
blob: bd6947a2ba74244f1c53b92419c6b3a0ff6c518d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
void main(void)
{
	unsigned long addr, start, stop;
	start = 0x00100000;
	stop = 0x00180000;
	

	for(addr = start; addr < stop ;) {
		unsigned char ch;
		const char *str = "\r";
		while((ch = *str++) != '\0') {
			while(__builtin_inb(0x3f))
				;
			__builtin_outb(ch, 0x3f8);
			
			while(__builtin_inb(0x3f))
				;
		}
		asm (
			"jmp 2f\n\t"
			"1:\n\t"
			"testl  $0xffff, %0\n\t"
			"jz	3f\n\t"
			"movnti %0, (%0)\n\t"
			"add $4, %0\n\t"
			"2:\n\t"
			"cmp %2, %0\n\t"
			"jl 1b\n\t"
			"3:\n\t"
			: "=b" (addr)		   /* outputs */
			: "0" (addr), "r" (stop)   /* intputs */
			: /* clobbers */
			);
	};
}