]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX600_RX64M_RSK_Renesas_e2studio/Source/RegTest.src
Update version number in readiness for V10.3.0 release. Sync SVN with reviewed releas...
[freertos] / FreeRTOS / Demo / RX600_RX64M_RSK_Renesas_e2studio / Source / RegTest.src
1 ;/*\r
2 ; * FreeRTOS Kernel V10.3.0\r
3 ; * Copyright (C) 2020 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
4 ; *\r
5 ; * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
6 ; * this software and associated documentation files (the "Software"), to deal in\r
7 ; * the Software without restriction, including without limitation the rights to\r
8 ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
9 ; * the Software, and to permit persons to whom the Software is furnished to do so,\r
10 ; * subject to the following conditions:\r
11 ; *\r
12 ; * The above copyright notice and this permission notice shall be included in all\r
13 ; * copies or substantial portions of the Software.\r
14 ; *\r
15 ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
16 ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
17 ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
18 ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
19 ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
20 ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
21 ; *\r
22 ; * http://www.FreeRTOS.org\r
23 ; * http://aws.amazon.com/freertos\r
24 ; *\r
25 ; * 1 tab == 4 spaces!\r
26 ; */\r
27 \r
28         .GLB _vRegTest1Implementation\r
29         .GLB _vRegTest2Implementation\r
30 \r
31         .GLB _ulRegTest1LoopCounter\r
32         .GLB _ulRegTest2LoopCounter\r
33 \r
34         .SECTION   P,CODE\r
35 \r
36 \r
37 ;/* This function is explained in the comments at the top of main.c. */\r
38 _vRegTest1Implementation:\r
39 \r
40         ;/* Put a known value in the guard byte of the accumulators. */\r
41         MOV.L   #10, R1\r
42         MVTACGU R1, A0\r
43         MOV.L   #20, R1\r
44         MVTACGU R1, A1\r
45 \r
46         ;/* Put a known value in each register. */\r
47         MOV.L   #1, R1\r
48         MOV.L   #2, R2\r
49         MOV.L   #3, R3\r
50         MOV.L   #4, R4\r
51         MOV.L   #5, R5\r
52         MOV.L   #6, R6\r
53         MOV.L   #7, R7\r
54         MOV.L   #8, R8\r
55         MOV.L   #9, R9\r
56         MOV.L   #10, R10\r
57         MOV.L   #11, R11\r
58         MOV.L   #12, R12\r
59         MOV.L   #13, R13\r
60         MOV.L   #14, R14\r
61         MOV.L   #15, R15\r
62 \r
63         ;/* Put a known value in the hi and low of the accumulators. */\r
64         MVTACHI R1, A0\r
65         MVTACLO R2, A0\r
66         MVTACHI R3, A1\r
67         MVTACLO R4, A1\r
68 \r
69         ;/* Loop, checking each iteration that each register still contains the\r
70         ;expected value. */\r
71 TestLoop1:\r
72 \r
73         ;/* Push the registers that are going to get clobbered. */\r
74         PUSHM   R14-R15\r
75 \r
76         ;/* Increment the loop counter to show this task is still getting CPU time. */\r
77         MOV.L   #_ulRegTest1LoopCounter, R14\r
78         MOV.L   [ R14 ], R15\r
79         ADD     #1, R15\r
80         MOV.L   R15, [ R14 ]\r
81 \r
82         ;/* Yield to extend the text coverage.  Set the bit in the ITU SWINTR register. */\r
83         MOV.L   #1, R14\r
84         MOV.L   #0872E0H, R15\r
85         MOV.B   R14, [R15]\r
86         NOP\r
87         NOP\r
88 \r
89         ;/* Check accumulators. */\r
90         MVFACHI #0, A0, R15\r
91         CMP #1, R15\r
92         BNE RegTest1Error\r
93         MVFACLO #0, A0, R15\r
94         CMP #2, R15\r
95         BNE RegTest1Error\r
96         MVFACGU #0, A0, R15\r
97         CMP #10, R15\r
98         BNE RegTest1Error\r
99         MVFACHI #0, A1, R15\r
100         CMP #3, R15\r
101         BNE RegTest1Error\r
102         MVFACLO #0, A1, R15\r
103         CMP #4, R15\r
104         BNE RegTest1Error\r
105         MVFACGU #0, A1, R15\r
106         CMP #20, R15\r
107         BNE RegTest1Error\r
108 \r
109         ;/* Restore the clobbered registers. */\r
110         POPM    R14-R15\r
111 \r
112         ;/* Now compare each register to ensure it still contains the value that was\r
113         ;set before this loop was entered. */\r
114         CMP     #1, R1\r
115         BNE     RegTest1Error\r
116         CMP     #2, R2\r
117         BNE     RegTest1Error\r
118         CMP     #3, R3\r
119         BNE     RegTest1Error\r
120         CMP     #4, R4\r
121         BNE     RegTest1Error\r
122         CMP     #5, R5\r
123         BNE     RegTest1Error\r
124         CMP     #6, R6\r
125         BNE     RegTest1Error\r
126         CMP     #7, R7\r
127         BNE     RegTest1Error\r
128         CMP     #8, R8\r
129         BNE     RegTest1Error\r
130         CMP     #9, R9\r
131         BNE     RegTest1Error\r
132         CMP     #10, R10\r
133         BNE     RegTest1Error\r
134         CMP     #11, R11\r
135         BNE     RegTest1Error\r
136         CMP     #12, R12\r
137         BNE     RegTest1Error\r
138         CMP     #13, R13\r
139         BNE     RegTest1Error\r
140         CMP     #14, R14\r
141         BNE     RegTest1Error\r
142         CMP     #15, R15\r
143         BNE     RegTest1Error\r
144 \r
145         ;/* All comparisons passed, start a new itteratio of this loop. */\r
146         BRA             TestLoop1\r
147 \r
148 RegTest1Error:\r
149         ;/* A compare failed, just loop here so the loop counter stops incrementing\r
150         ;- causing the check task to indicate the error. */\r
151         BRA RegTest1Error\r
152 ;/*-----------------------------------------------------------*/\r
153 \r
154 ;/* This function is explained in the comments at the top of main.c. */\r
155 _vRegTest2Implementation:\r
156 \r
157         ;/* Put a known value in the guard byte of the accumulators. */\r
158         MOV.L   #1H, R1\r
159         MVTACGU R1, A0\r
160         MOV.L   #2H, R1\r
161         MVTACGU R1, A1\r
162 \r
163         ;/* Put a known value in each general purpose register. */\r
164         MOV.L   #10H, R1\r
165         MOV.L   #20H, R2\r
166         MOV.L   #30H, R3\r
167         MOV.L   #40H, R4\r
168         MOV.L   #50H, R5\r
169         MOV.L   #60H, R6\r
170         MOV.L   #70H, R7\r
171         MOV.L   #80H, R8\r
172         MOV.L   #90H, R9\r
173         MOV.L   #100H, R10\r
174         MOV.L   #110H, R11\r
175         MOV.L   #120H, R12\r
176         MOV.L   #130H, R13\r
177         MOV.L   #140H, R14\r
178         MOV.L   #150H, R15\r
179 \r
180         ;/* Put a known value in the hi and low of the accumulators. */\r
181         MVTACHI R1, A0\r
182         MVTACLO R2, A0\r
183         MVTACHI R3, A1\r
184         MVTACLO R4, A1\r
185 \r
186         ;/* Loop, checking each iteration that each register still contains the\r
187         ;expected value. */\r
188 TestLoop2:\r
189 \r
190         ;/* Push the registers that are going to get clobbered. */\r
191         PUSHM   R14-R15\r
192 \r
193         ;/* Increment the loop counter to show this task is still getting CPU time. */\r
194         MOV.L   #_ulRegTest2LoopCounter, R14\r
195         MOV.L   [ R14 ], R15\r
196         ADD     #1, R15\r
197         MOV.L   R15, [ R14 ]\r
198 \r
199         ;/* Check accumulators. */\r
200         MVFACHI #0, A0, R15\r
201         CMP #10H, R15\r
202         BNE RegTest1Error\r
203         MVFACLO #0, A0, R15\r
204         CMP #20H, R15\r
205         BNE RegTest1Error\r
206         MVFACGU #0, A0, R15\r
207         CMP #1H, R15\r
208         BNE RegTest1Error\r
209         MVFACHI #0, A1, R15\r
210         CMP #30H, R15\r
211         BNE RegTest1Error\r
212         MVFACLO #0, A1, R15\r
213         CMP #40H, R15\r
214         BNE RegTest1Error\r
215         MVFACGU #0, A1, R15\r
216         CMP #2H, R15\r
217         BNE RegTest1Error\r
218 \r
219         ;/* Restore the clobbered registers. */\r
220         POPM    R14-R15\r
221 \r
222         ;/* Now compare each register to ensure it still contains the value that was\r
223         ;set before this loop was entered. */\r
224         CMP     #10H, R1\r
225         BNE     RegTest2Error\r
226         CMP     #20H, R2\r
227         BNE     RegTest2Error\r
228         CMP     #30H, R3\r
229         BNE     RegTest2Error\r
230         CMP     #40H, R4\r
231         BNE     RegTest2Error\r
232         CMP     #50H, R5\r
233         BNE     RegTest2Error\r
234         CMP     #60H, R6\r
235         BNE     RegTest2Error\r
236         CMP     #70H, R7\r
237         BNE     RegTest2Error\r
238         CMP     #80H, R8\r
239         BNE     RegTest2Error\r
240         CMP     #90H, R9\r
241         BNE     RegTest2Error\r
242         CMP     #100H, R10\r
243         BNE     RegTest2Error\r
244         CMP     #110H, R11\r
245         BNE     RegTest2Error\r
246         CMP     #120H, R12\r
247         BNE     RegTest2Error\r
248         CMP     #130H, R13\r
249         BNE     RegTest2Error\r
250         CMP     #140H, R14\r
251         BNE     RegTest2Error\r
252         CMP     #150H, R15\r
253         BNE     RegTest2Error\r
254 \r
255         ;/* All comparisons passed, start a new itteratio of this loop. */\r
256         BRA     TestLoop2\r
257 \r
258 RegTest2Error:\r
259         ;/* A compare failed, just loop here so the loop counter stops incrementing\r
260         ;- causing the check task to indicate the error. */\r
261         BRA RegTest2Error\r
262 \r
263 \r
264         .END\r