3f3afece9352fcee5620db84f71c0763913f8193
[megadrive.git] / testsram / sega_gcc.s
1 exc_tab:\r
2     dc.l     0, 0x200, exc02, exc03, exc04, exc05, exc06, exc07\r
3     dc.l exc08, exc09, exc0a, exc0b, exc0c, exc0d, exc0e, exc0f\r
4     dc.l exc10, exc11, exc12, exc13, exc14, exc15, exc16, exc17\r
5     dc.l exc18, exc19, exc1a, exc1b, HBL,   exc1d, VBL,   exc1f\r
6     dc.l exc20, exc21, exc22, exc23, exc24, exc25, exc26, exc27\r
7     dc.l exc28, exc29, exc2a, exc2b, exc2c, exc2d, exc2e, exc2f\r
8     dc.l exc30, exc31, exc32, exc33, exc34, exc35, exc3e, exc37\r
9     dc.l exc38, exc39, exc3a, exc3b, exc3c, exc3d, exc3e, exc3f\r
10 \r
11     .ascii "SEGA GENESIS                    "\r
12     .ascii "SRAM test                                       "\r
13     .ascii "SRAM test                                       "\r
14     .ascii "GM 00000000-00"\r
15     .byte 0x00,0x00\r
16     .ascii "J               "\r
17     .byte 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00\r
18     .byte 0x00,0xff,0x00,0x00,0xff,0xff,0xff,0xff\r
19     .ascii "RA"; .byte 0xf8,0x20                     /* 1b0 */\r
20     .byte 0x00,0x02,0x00,0x00,0x00,0x3f,0xff,0xff    /* 1b4 */\r
21     .ascii "    "                                    /* 1bc */\r
22     .ascii "                        "                /* 1c0 */\r
23     .ascii "                        "\r
24     .ascii "JUE             "                        /* 1f0 */\r
25 \r
26 RST:\r
27     move.w  #0x2700, %sr\r
28 \r
29     move.b (0xA10001), %d0\r
30     andi.b #0x0F, %d0\r
31     beq.s 0f\r
32     move.l  #0x53454741, (0xA14000) /* 'SEGA' */\r
33 0:\r
34         tst.w   (0xc00004).l\r
35 \r
36     moveq   #0, %d0\r
37     movea.l %d0, %a7\r
38     move    %a7, %usp\r
39 #    move.w  #0x2000, %sr\r
40     jsr     main\r
41 0:\r
42     bra     0b\r
43 \r
44 #HBL:\r
45 #VBL:\r
46 #    rte\r
47 \r
48 pre_exception:\r
49     move.w  #0x2700, %sr\r
50     movem.l %d0-%d7/%a0-%a7,-(%sp)\r
51     move.l %sp, %d0\r
52     move.l %d0,-(%sp)\r
53     jsr exception\r
54 0:\r
55     bra 0b\r
56 \r
57 .macro exc_stub num\r
58 exc\num:\r
59     move.w #0x\num, -(%sp)\r
60     jmp pre_exception\r
61 .endm\r
62 \r
63 exc_stub 02\r
64 exc_stub 03\r
65 exc_stub 04\r
66 exc_stub 05\r
67 exc_stub 06\r
68 exc_stub 07\r
69 exc_stub 08\r
70 exc_stub 09\r
71 exc_stub 0a\r
72 exc_stub 0b\r
73 exc_stub 0c\r
74 exc_stub 0d\r
75 exc_stub 0e\r
76 exc_stub 0f\r
77 exc_stub 10\r
78 exc_stub 11\r
79 exc_stub 12\r
80 exc_stub 13\r
81 exc_stub 14\r
82 exc_stub 15\r
83 exc_stub 16\r
84 exc_stub 17\r
85 exc_stub 18\r
86 exc_stub 19\r
87 exc_stub 1a\r
88 exc_stub 1b\r
89 HBL:\r
90 exc_stub 1c\r
91 exc_stub 1d\r
92 VBL:\r
93 exc_stub 1e\r
94 exc_stub 1f\r
95 exc_stub 20\r
96 exc_stub 21\r
97 exc_stub 22\r
98 exc_stub 23\r
99 exc_stub 24\r
100 exc_stub 25\r
101 exc_stub 26\r
102 exc_stub 27\r
103 exc_stub 28\r
104 exc_stub 29\r
105 exc_stub 2a\r
106 exc_stub 2b\r
107 exc_stub 2c\r
108 exc_stub 2d\r
109 exc_stub 2e\r
110 exc_stub 2f\r
111 exc_stub 30\r
112 exc_stub 31\r
113 exc_stub 32\r
114 exc_stub 33\r
115 exc_stub 34\r
116 exc_stub 35\r
117 exc_stub 36\r
118 exc_stub 37\r
119 exc_stub 38\r
120 exc_stub 39\r
121 exc_stub 3a\r
122 exc_stub 3b\r
123 exc_stub 3c\r
124 exc_stub 3d\r
125 exc_stub 3e\r
126 exc_stub 3f\r
127 \r
128 # vim:filetype=asmM68k:ts=4:sw=4:expandtab\r