1 | /* |
---|
2 | * Test_040 |
---|
3 | * |
---|
4 | * end_ko : infinite_loop |
---|
5 | * end_ok : Write in R1 the stop address and stop an data |
---|
6 | * The store in the destination of an jump |
---|
7 | * start : Test l.slli |
---|
8 | */ |
---|
9 | |
---|
10 | .file "crt0.s" |
---|
11 | /* |
---|
12 | .section .vector |
---|
13 | */ |
---|
14 | .section .text |
---|
15 | .align 4 |
---|
16 | |
---|
17 | /* ---[ 0x0 : Print a error ]------------------------------------------- */ |
---|
18 | |
---|
19 | .org 0x0 |
---|
20 | _end_ko : |
---|
21 | l.movhi r1, hi(_tty) |
---|
22 | l.ori r1, r1, lo(_tty) |
---|
23 | l.sw 4(r1), r1 /* stop address */ |
---|
24 | _infinite_loop : |
---|
25 | l.j _infinite_loop |
---|
26 | l.nop |
---|
27 | |
---|
28 | _end_ok : |
---|
29 | l.movhi r1, hi(_tty) |
---|
30 | l.ori r1, r1, lo(_tty) |
---|
31 | l.sw 4(r1), r0 /* stop address */ |
---|
32 | |
---|
33 | |
---|
34 | /* ---[ 0x100: RESET exception ]----------------------------------------- */ |
---|
35 | .org 0x100 |
---|
36 | .global _start |
---|
37 | _start: |
---|
38 | /* |
---|
39 | A (r1) B (r2) - D (r3 wait) |
---|
40 | (r4) |
---|
41 | 1) 0xdeadbeef 0x00000000 - 0xdeadbeef |
---|
42 | 2) 0xdeadbeef 0x00000008 - 0xadbeef00 |
---|
43 | 3) 0xdeadbeef 0x00000010 - 0xbeef0000 |
---|
44 | 4) 0xdeadbeef 0x00000018 - 0xef000000 |
---|
45 | 5) 0xdeadbeef 0x0000001f - 0x80000000 |
---|
46 | */ |
---|
47 | |
---|
48 | /***********/ |
---|
49 | /* Test 1 */ |
---|
50 | /***********/ |
---|
51 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
52 | l.ori r1, r1, lo(0xdeadbeef) |
---|
53 | l.movhi r3, hi(0xdeadbeef) /* RD wait */ |
---|
54 | l.ori r3, r3, lo(0xdeadbeef) |
---|
55 | |
---|
56 | l.slli r4, r1, 0 |
---|
57 | |
---|
58 | /* Test result */ |
---|
59 | l.sfeq r3, r4 |
---|
60 | l.bnf _end_ko |
---|
61 | l.nop |
---|
62 | |
---|
63 | /***********/ |
---|
64 | /* Test 2 */ |
---|
65 | /***********/ |
---|
66 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
67 | l.ori r1, r1, lo(0xdeadbeef) |
---|
68 | l.movhi r3, hi(0xadbeef00) /* RD wait */ |
---|
69 | l.ori r3, r3, lo(0xadbeef00) |
---|
70 | |
---|
71 | l.slli r4, r1, 8 |
---|
72 | |
---|
73 | /* Test result */ |
---|
74 | l.sfeq r3, r4 |
---|
75 | l.bnf _end_ko |
---|
76 | l.nop |
---|
77 | |
---|
78 | /***********/ |
---|
79 | /* Test 3 */ |
---|
80 | /***********/ |
---|
81 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
82 | l.ori r1, r1, lo(0xdeadbeef) |
---|
83 | l.movhi r3, hi(0xbeef0000) /* RD wait */ |
---|
84 | l.ori r3, r3, lo(0xbeef0000) |
---|
85 | |
---|
86 | l.slli r4, r1, 16 |
---|
87 | |
---|
88 | /* Test result */ |
---|
89 | l.sfeq r3, r4 |
---|
90 | l.bnf _end_ko |
---|
91 | l.nop |
---|
92 | |
---|
93 | /***********/ |
---|
94 | /* Test 4 */ |
---|
95 | /***********/ |
---|
96 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
97 | l.ori r1, r1, lo(0xdeadbeef) |
---|
98 | l.movhi r3, hi(0xef000000) /* RD wait */ |
---|
99 | l.ori r3, r3, lo(0xef000000) |
---|
100 | |
---|
101 | l.slli r4, r1, 24 |
---|
102 | |
---|
103 | /* Test result */ |
---|
104 | l.sfeq r3, r4 |
---|
105 | l.bnf _end_ko |
---|
106 | l.nop |
---|
107 | |
---|
108 | /***********/ |
---|
109 | /* Test 5 */ |
---|
110 | /***********/ |
---|
111 | l.movhi r1, hi(0xdeadbeef) /* RA */ |
---|
112 | l.ori r1, r1, lo(0xdeadbeef) |
---|
113 | l.movhi r3, hi(0x80000000) /* RD wait */ |
---|
114 | l.ori r3, r3, lo(0x80000000) |
---|
115 | |
---|
116 | l.slli r4, r1, 31 |
---|
117 | |
---|
118 | /* Test result */ |
---|
119 | l.sfeq r3, r4 |
---|
120 | l.bnf _end_ko |
---|
121 | l.nop |
---|
122 | |
---|
123 | |
---|
124 | /**********/ |
---|
125 | /* End */ |
---|
126 | /**********/ |
---|
127 | |
---|
128 | l.j _end_ok |
---|
129 | l.nop |
---|