Example .backdrop file
[AROS.git] / test / supertest.c
blob9754771cf67dc31719f6096754082a09af33ba33
1 /*
2 Copyright © 1995-2009, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/types.h>
7 #include <proto/exec.h>
8 #include <proto/dos.h>
10 extern UWORD a(void);
11 extern UWORD b(void);
13 #ifdef __GNUC__
14 #ifdef __mc68000
15 asm("
16 .globl _a
17 _a:
18 movew sr,d0
19 rts
20 .globl _b
21 _b:
22 movew sp@,d0
23 rte
24 ");
25 #else
26 #ifdef __i386__
27 __asm__(
28 " .globl a\n"
29 "a:\n"
30 " pushf\n"
31 " popl %eax\n"
32 " ret\n"
33 " .globl b\n"
34 "b:\n"
35 " movl %esp,%eax\n"
36 " iret\n"
38 #else
39 #define a(A) 0
40 #undef Supervisor
41 #define Supervisor(A) 0
42 #endif
43 #endif
44 #endif
46 int main(void)
48 APTR ssp;
49 UWORD ar;
51 Printf("GetCC(): %04x\n",GetCC());
52 Printf("SetSR(): %04lx\n",SetSR(0,0));
53 ssp = SuperState();
54 ar = a();
55 UserState(ssp);
56 Printf("Supervisor flags: %04x\n", ar);
57 Printf("User flags: %04x\n", a());
58 Printf("Supervisor stack pointer: %04lx\n",
59 (IPTR)Supervisor((ULONG_FUNC)&b));
61 return 0;