Upload ABIv1 packages into the nightly2 directory during the transition
[AROS.git] / test / exec / supertest.c
blob183a0809e96ee8dce3e028def480a1d294e6209f
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 " .text\n"
17 " .balign 2\n"
18 " .globl a\n"
19 "a:\n"
20 " movew %sr,%d0\n"
21 " rts\n"
22 " .globl b\n"
23 "b:\n"
24 " movew %sp@,%d0\n"
25 " rte\n"
27 #else
28 #ifdef __i386__
29 __asm__(
30 " .globl a\n"
31 "a:\n"
32 " pushf\n"
33 " popl %eax\n"
34 " ret\n"
35 " .globl b\n"
36 "b:\n"
37 " movl %esp,%eax\n"
38 " iret\n"
40 #else
41 #define a(A) 0
42 #undef Supervisor
43 #define Supervisor(A) 0
44 #endif
45 #endif
46 #endif
48 int main(void)
50 APTR ssp;
51 UWORD ar;
53 Printf("GetCC(): %04x\n",GetCC());
54 Printf("SetSR(): %04lx\n",SetSR(0,0));
55 ssp = SuperState();
56 ar = a();
57 UserState(ssp);
58 Printf("Supervisor flags: %04x\n", ar);
59 Printf("User flags: %04x\n", a());
60 Printf("Supervisor stack pointer: %04lx\n",
61 (IPTR)Supervisor((ULONG_FUNC)&b));
63 return 0;