1 | /* |
---|
2 | * Test_047 |
---|
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.sh / l.lhs (l.lhz) |
---|
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 | l.movhi r1, hi(_stack) /* address */ |
---|
39 | l.ori r1, r1, lo(_stack) |
---|
40 | |
---|
41 | l.movhi r2, hi(0x00000010) /* iteration */ |
---|
42 | l.ori r2, r2, lo(0x00000010) |
---|
43 | |
---|
44 | l.movhi r3, hi(0xdeadbeef) /* data */ |
---|
45 | l.ori r3, r3, lo(0xdeadbeef) |
---|
46 | |
---|
47 | l.and r21, r1, r1 |
---|
48 | l.j _loop1_store_test |
---|
49 | l.and r22, r0, r0 |
---|
50 | _loop1_store_body : |
---|
51 | l.sh 0(r21), r3 |
---|
52 | l.addi r21, r21, -2 |
---|
53 | l.addi r3, r3, 1 |
---|
54 | _loop1_store_test : |
---|
55 | l.sfeq r22, r2 |
---|
56 | l.bnf _loop1_store_body |
---|
57 | l.addi r22, r22, 1 |
---|
58 | |
---|
59 | |
---|
60 | /* load Zero */ |
---|
61 | l.movhi r3, hi(0x0000beef) /* data */ |
---|
62 | l.ori r3, r3, lo(0x0000beef) |
---|
63 | |
---|
64 | l.and r21, r1, r1 |
---|
65 | l.j _loop1_loadz_test |
---|
66 | l.and r22, r0, r0 |
---|
67 | _loop1_loadz_body : |
---|
68 | l.lhz r4, 0(r21) |
---|
69 | l.addi r21, r21, -2 |
---|
70 | l.sfeq r4, r3 |
---|
71 | l.bnf _end_ko |
---|
72 | l.addi r3, r3, 1 |
---|
73 | _loop1_loadz_test : |
---|
74 | l.sfeq r22, r2 |
---|
75 | l.bnf _loop1_loadz_body |
---|
76 | l.addi r22, r22, 1 |
---|
77 | |
---|
78 | /* load Signed */ |
---|
79 | l.movhi r3, hi(0xffffbeef) /* data */ |
---|
80 | l.ori r3, r3, lo(0xffffbeef) |
---|
81 | |
---|
82 | l.and r21, r1, r1 |
---|
83 | l.j _loop1_loads_test |
---|
84 | l.and r22, r0, r0 |
---|
85 | _loop1_loads_body : |
---|
86 | l.lhs r4, 0(r21) |
---|
87 | l.addi r21, r21, -2 |
---|
88 | l.sfeq r4, r3 |
---|
89 | l.bnf _end_ko |
---|
90 | l.addi r3, r3, 1 |
---|
91 | _loop1_loads_test : |
---|
92 | l.sfeq r22, r2 |
---|
93 | l.bnf _loop1_loads_body |
---|
94 | l.addi r22, r22, 1 |
---|
95 | |
---|
96 | l.movhi r3, hi(0x12345678) /* data */ |
---|
97 | l.ori r3, r3, lo(0x12345678) |
---|
98 | |
---|
99 | l.and r21, r1, r1 |
---|
100 | l.j _loop2_store_test |
---|
101 | l.and r22, r0, r0 |
---|
102 | _loop2_store_body : |
---|
103 | l.sh 0(r21), r3 |
---|
104 | l.addi r21, r21, -2 |
---|
105 | l.addi r3, r3, 1 |
---|
106 | _loop2_store_test : |
---|
107 | l.sfeq r22, r2 |
---|
108 | l.bnf _loop2_store_body |
---|
109 | l.addi r22, r22, 1 |
---|
110 | |
---|
111 | /* load Zero */ |
---|
112 | l.movhi r3, hi(0x00005678) /* data */ |
---|
113 | l.ori r3, r3, lo(0x00005678) |
---|
114 | |
---|
115 | l.and r21, r1, r1 |
---|
116 | l.j _loop2_loadz_test |
---|
117 | l.and r22, r0, r0 |
---|
118 | _loop2_loadz_body : |
---|
119 | l.lhz r4, 0(r21) |
---|
120 | l.addi r21, r21, -2 |
---|
121 | l.sfeq r4, r3 |
---|
122 | l.bnf _end_ko |
---|
123 | l.addi r3, r3, 1 |
---|
124 | _loop2_loadz_test : |
---|
125 | l.sfeq r22, r2 |
---|
126 | l.bnf _loop2_loadz_body |
---|
127 | l.addi r22, r22, 1 |
---|
128 | |
---|
129 | /* load Signed */ |
---|
130 | l.movhi r3, hi(0x00005678) /* data */ |
---|
131 | l.ori r3, r3, lo(0x00005678) |
---|
132 | |
---|
133 | l.and r21, r1, r1 |
---|
134 | l.j _loop2_loads_test |
---|
135 | l.and r22, r0, r0 |
---|
136 | _loop2_loads_body : |
---|
137 | l.lhs r4, 0(r21) |
---|
138 | l.addi r21, r21, -2 |
---|
139 | l.sfeq r4, r3 |
---|
140 | l.bnf _end_ko |
---|
141 | l.addi r3, r3, 1 |
---|
142 | _loop2_loads_test : |
---|
143 | l.sfeq r22, r2 |
---|
144 | l.bnf _loop2_loads_body |
---|
145 | l.addi r22, r22, 1 |
---|
146 | |
---|
147 | /* end test */ |
---|
148 | l.j _end_ok |
---|
149 | l.nop |
---|