352
|
1 module arch;
|
367
|
2 import io;
|
352
|
3
|
362
|
4
|
352
|
5 function void init()
|
|
6 {
|
354
|
7 // putc(65)
|
381
|
8 io.print2("PFR0 = ", pfr0());
|
|
9 io.print2("PFR1 = ", pfr1());
|
|
10 io.print2("MMFR0 = ", mmfr0());
|
|
11
|
|
12 // This below is not compatible with all qemu versions:
|
|
13 // io.print2("MPUIR = ", arch.mpuir());
|
353
|
14 }
|
|
15
|
|
16 function void putc(int c)
|
|
17 {
|
352
|
18 var int *UART0DR;
|
388
|
19 UART0DR = cast<int*>(0x109000); // UART0 DR register when remapped at 1MB
|
353
|
20 *UART0DR = c;
|
352
|
21 }
|
|
22
|
|
23 function void halt()
|
|
24 {
|
402
|
25 while(true)
|
|
26 {
|
|
27 }
|
352
|
28 }
|
|
29
|
381
|
30 function int pfr0();
|
|
31 function int pfr1();
|
|
32 function int mmfr0();
|
|
33 // function int mpuir();
|
|
34
|