Skip to content

Commit 116dbbf

Browse files
committed
showattn: Tiny tool to check CPU attribute flags
1 parent 44cc82f commit 116dbbf

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/showattn.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* showattn.c - Display ExecBase->AttnFlags
3+
* Compile: m68k-amigaos-gcc -O2 -noixemul -o showattn showattn.c
4+
*/
5+
6+
#include <exec/execbase.h>
7+
#include <proto/exec.h>
8+
#include <stdio.h>
9+
10+
int main(void)
11+
{
12+
struct ExecBase *SysBase = *(struct ExecBase **)4;
13+
UWORD flags = SysBase->AttnFlags;
14+
15+
printf("AttnFlags: $%04x\n\n", flags);
16+
17+
printf("CPU:\n");
18+
printf(" AFB_68010 (0): %s\n", (flags & AFF_68010) ? "YES" : "no");
19+
printf(" AFB_68020 (1): %s\n", (flags & AFF_68020) ? "YES" : "no");
20+
printf(" AFB_68030 (3): %s\n", (flags & AFF_68030) ? "YES" : "no");
21+
printf(" AFB_68040 (7): %s\n", (flags & AFF_68040) ? "YES" : "no");
22+
printf(" AFB_68060 (10): %s\n", (flags & (1<<10)) ? "YES" : "no");
23+
24+
printf("\nFPU:\n");
25+
printf(" AFB_68881 (4): %s\n", (flags & AFF_68881) ? "YES" : "no");
26+
printf(" AFB_68882 (5): %s\n", (flags & AFF_68882) ? "YES" : "no");
27+
printf(" AFB_FPU40 (6): %s\n", (flags & AFF_FPU40) ? "YES" : "no");
28+
29+
printf("\nOther:\n");
30+
printf(" AFB_PRIVATE (8): %s\n", (flags & AFF_PRIVATE) ? "YES" : "no");
31+
printf(" Bit 9: %s\n", (flags & (1<<9)) ? "YES" : "no");
32+
printf(" Bit 11: %s\n", (flags & (1<<11)) ? "YES" : "no");
33+
printf(" Bit 12: %s\n", (flags & (1<<12)) ? "YES" : "no");
34+
printf(" Bit 13: %s\n", (flags & (1<<13)) ? "YES" : "no");
35+
printf(" Bit 14: %s\n", (flags & (1<<14)) ? "YES" : "no");
36+
printf(" Bit 15: %s\n", (flags & (1<<15)) ? "YES" : "no");
37+
38+
return 0;
39+
}

0 commit comments

Comments
 (0)