1 extern void putc(unsigned char c);
7 asm volatile("mrc 5, 0, %0, c1, c1, 1" : "=r"(c));
12 void puts(unsigned char *s)
18 void puthex(unsigned int x)
20 unsigned char *hex = "0123456789ABCDEF";
23 for (i = 7; i >= 0; i--)
24 putc(hex[(x >> (i * 4)) & 0xF]);
30 #include "corecurse.c"
31 #include "miniblarg.c"
43 if (fact(10) != 3628800)
54 extern int ldm_bonehead();
60 ".globl ldm_bonehead\n"
75 "mov r2, #0x00002F00;"
76 "orr r2, r2, #0x000000E0;"
77 "mov r1, #0x0000004C;"
79 "stmdb sp!, {fp, ip, lr, pc};"
80 "mov r0, #0x00880000;"
81 "ldmia sp, {fp, sp, pc};"
94 int x = ldm_bonehead();
98 puts("FAIL: result was ");
105 struct tests tlist[] = {
106 {"ldm pc/mul", ldm_tester},
110 {"miniblarg", testmain},
111 {"corecurse", corecurse},
118 puts("Testbench running\n");
120 for (t = tlist; t->name; t++)
127 puts("Done! Echoing characters.\n");