sim: bfin: import testsuite
[deliverable/binutils-gdb.git] / sim / testsuite / sim / bfin / c_except_illopcode.S
1 //Original:/proj/frio/dv/testcases/core/c_except_illopcode/c_except_illopcode.dsp
2 // Spec Reference: c_exception illegal opcode
3 # mach: bfin
4 # sim: --environment operating
5
6 #include "test.h"
7 .include "testutils.inc"
8 start
9
10 include(std.inc)
11 include(selfcheck.inc)
12 INIT_R_REGS(0);
13 INIT_P_REGS(0);
14 //CHECK_INIT(p5, 0xe0000000);
15 include(symtable.inc)
16 CHECK_INIT_DEF(p5);
17
18 // load address of exception handler
19
20 P0 = 0x200C (Z); // 0xFFE0200C EVT3 EXCEPTION
21 P0.H = 0xFFE0;
22 R0 = exception_handler (Z); // wr address of exception handler to MMR EVT3
23 R0.H = exception_handler;
24 [ P0 ] = R0;
25
26 // Jump to User mode and enable exceptions
27
28 R0 = MidUserCode (Z);
29 R0.H = MidUserCode;
30 RETI = R0;
31 RTI; // cause it to go to Midusercode, .dd cause exception
32
33 BeginUserCode:
34 P1 = 1;
35 P2 = 2;
36 P3 = 3;
37 P4 = 4;
38
39 CHECKREG(r0, 0x00000000);
40 CHECKREG(r1, 0x00000001);
41 CHECKREG(r2, 0x00000002);
42 CHECKREG(r3, 0x00000003);
43 // CHECKREG(r4, 0x00000098);
44 CHECKREG(r5, 0x00000005);
45 CHECKREG(r6, 0x00000006);
46 CHECKREG(r7, 0x00000007);
47 CHECKREG(p1, 0x00000001);
48 CHECKREG(p2, 0x00000002);
49 CHECKREG(p3, 0x00000003);
50 CHECKREG(p4, 0x00000004);
51
52 dbg_pass;
53 //jump 2;
54 //jump -2;
55 .dd 0xFFFFFFFF
56 .dd 0xFFFFFFFF
57 .dd 0xFFFFFFFF
58 .dd 0xFFFFFFFF
59 .dd 0xFFFFFFFF
60 .dd 0xFFFFFFFF
61 .dd 0xFFFFFFFF
62 .dd 0xFFFFFFFF
63
64 //dbg_pass;
65
66 MidUserCode:
67 .dd 0xFFFFFFFF
68 R0 = 0;
69 R1 = 1;
70 R2 = 2;
71 R3 = 3;
72 CC = R0;
73 IF !CC JUMP BeginUserCode;
74
75 .dd 0xFFFFFFFF
76 .dd 0xFFFFFFFF
77 .dd 0xFFFFFFFF
78 .dd 0xFFFFFFFF
79 .dd 0xFFFFFFFF
80 .dd 0xFFFFFFFF
81 .dd 0xFFFFFFFF
82 .dd 0xFFFFFFFF
83
84 //.code 0x800
85
86 exception_handler:
87 R4 = RETX; // error handler: RETX has the address of the same Illegal instr
88 R5 = 5;
89 R6 = 6;
90 R7 = 7;
91 R4 += 4; // we have to add 4 to point to next instr after return
92 RETX = R4;
93
94 RTX; // return from exception
95 //nop;
96
97 .section MEM_DATA_ADDR_1,"aw"
98 .dd 0xDEADBEEF
99 .dd 0xBAD00BAD
This page took 0.032771 seconds and 4 git commands to generate.