]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_IAR.s
Update version number in readiness for V10.3.0 release. Sync SVN with reviewed releas...
[freertos] / FreeRTOS / Demo / RX700_RX71M_RSK_GCC_e2studio_IAR / src / Full_Demo / RegTest_IAR.s
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         PUBLIC _vRegTest1Implementation\r
29         PUBLIC _vRegTest2Implementation\r
30         \r
31         EXTERN _ulRegTest1LoopCounter\r
32         EXTERN _ulRegTest2LoopCounter\r
33 \r
34         RSEG CODE:CODE(4)\r
35 \r
36 /* This function is explained in the comments at the top of main.c. */\r
37 _vRegTest1Implementation:\r
38 \r
39         ;/* Put a known value in the guard byte of the accumulators. */\r
40         MOV.L   #10, R1\r
41         MVTACGU R1, A0\r
42         MOV.L   #20, R1\r
43         MVTACGU R1, A1\r
44 \r
45         /* Put a known value in each register. */\r
46         MOV     #1, R1                                          \r
47         MOV     #2, R2                                          \r
48         MOV     #3, R3                                          \r
49         MOV     #4, R4                                          \r
50         MOV     #5, R5                                          \r
51         MOV     #6, R6                                          \r
52         MOV     #7, R7                                          \r
53         MOV     #8, R8                                          \r
54         MOV     #9, R9                                          \r
55         MOV     #10, R10                                        \r
56         MOV     #11, R11                                        \r
57         MOV     #12, R12                                        \r
58         MOV     #13, R13                                        \r
59         MOV     #14, R14                                        \r
60         MOV     #15, R15                                        \r
61         \r
62         ;/* Put a known value in the hi and low of the accumulators. */\r
63         MVTACHI R1, A0\r
64         MVTACLO R2, A0\r
65         MVTACHI R3, A1\r
66         MVTACLO R4, A1\r
67         /* Loop, checking each iteration that each register still contains the\r
68         expected value. */\r
69 TestLoop1:                                                              \r
70 \r
71         /* Push the registers that are going to get clobbered. */\r
72         PUSHM   R14-R15                                         \r
73         \r
74         /* Increment the loop counter to show this task is still getting CPU time. */\r
75         MOV     #_ulRegTest1LoopCounter, R14    \r
76         MOV     [ R14 ], R15                            \r
77         ADD     #1, R15                                         \r
78         MOV     R15, [ R14 ]                            \r
79         \r
80         /* Yield to extend the text coverage.  Set the bit in the ITU SWINTR register. */\r
81         MOV     #1, R14                                         \r
82         MOV     #0872E0H, R15                           \r
83         MOV.B   R14, [R15]                                      \r
84         NOP                                                             \r
85         NOP                                                             \r
86         \r
87         ;/* Check accumulators. */\r
88         MVFACHI #0, A0, R15\r
89         CMP #1, R15\r
90         BNE RegTest1Error\r
91         MVFACLO #0, A0, R15\r
92         CMP #2, R15\r
93         BNE RegTest1Error\r
94         MVFACGU #0, A0, R15\r
95         CMP #10, R15\r
96         BNE RegTest1Error\r
97         MVFACHI #0, A1, R15\r
98         CMP #3, R15\r
99         BNE RegTest1Error\r
100         MVFACLO #0, A1, R15\r
101         CMP #4, R15\r
102         BNE RegTest1Error\r
103         MVFACGU #0, A1, R15\r
104         CMP #20, R15\r
105         BNE RegTest1Error\r
106 \r
107         /* Restore the clobbered registers. */\r
108         POPM    R14-R15                                         \r
109         \r
110         /* Now compare each register to ensure it still contains the value that was\r
111         set before this loop was entered. */\r
112         CMP     #1, R1                                          \r
113         BNE     RegTest1Error                           \r
114         CMP     #2, R2                                          \r
115         BNE     RegTest1Error                           \r
116         CMP     #3, R3                                          \r
117         BNE     RegTest1Error                           \r
118         CMP     #4, R4                                          \r
119         BNE     RegTest1Error                           \r
120         CMP     #5, R5                                          \r
121         BNE     RegTest1Error                           \r
122         CMP     #6, R6                                          \r
123         BNE     RegTest1Error                           \r
124         CMP     #7, R7                                          \r
125         BNE     RegTest1Error                           \r
126         CMP     #8, R8                                          \r
127         BNE     RegTest1Error                           \r
128         CMP     #9, R9                                          \r
129         BNE     RegTest1Error                           \r
130         CMP     #10, R10                                        \r
131         BNE     RegTest1Error                           \r
132         CMP     #11, R11                                        \r
133         BNE     RegTest1Error                           \r
134         CMP     #12, R12                                        \r
135         BNE     RegTest1Error                           \r
136         CMP     #13, R13                                        \r
137         BNE     RegTest1Error                           \r
138         CMP     #14, R14                                        \r
139         BNE     RegTest1Error                           \r
140         CMP     #15, R15                                        \r
141         BNE     RegTest1Error                           \r
142 \r
143         /* All comparisons passed, start a new itteratio of this loop. */\r
144         BRA             TestLoop1                               \r
145         \r
146 RegTest1Error:                                                  \r
147         /* A compare failed, just loop here so the loop counter stops incrementing\r
148         - causing the check task to indicate the error. */\r
149         BRA RegTest1Error                                       \r
150 /*-----------------------------------------------------------*/\r
151 \r
152 /* This function is explained in the comments at the top of main.c. */\r
153 _vRegTest2Implementation:\r
154 \r
155         ;/* Put a known value in the guard byte of the accumulators. */\r
156         MOV.L   #1H, R1\r
157         MVTACGU R1, A0\r
158         MOV.L   #2H, R1\r
159         MVTACGU R1, A1\r
160 \r
161         /* Put a known value in each register. */\r
162         MOV     #10H, R1                                        \r
163         MOV     #20H, R2                                        \r
164         MOV     #30H, R3                                        \r
165         MOV     #40H, R4                                        \r
166         MOV     #50H, R5                                        \r
167         MOV     #60H, R6                                        \r
168         MOV     #70H, R7                                        \r
169         MOV     #80H, R8                                        \r
170         MOV     #90H, R9                                        \r
171         MOV     #100H, R10                                      \r
172         MOV     #110H, R11                                      \r
173         MOV     #120H, R12                                      \r
174         MOV     #130H, R13                                      \r
175         MOV     #140H, R14                                      \r
176         MOV     #150H, R15                                      \r
177 \r
178         ;/* Put a known value in the hi and low of the accumulators. */\r
179         MVTACHI R1, A0\r
180         MVTACLO R2, A0\r
181         MVTACHI R3, A1\r
182         MVTACLO R4, A1\r
183 \r
184         /* Loop, checking each iteration that each register still contains the\r
185         expected value. */\r
186 TestLoop2:                                                              \r
187 \r
188         /* Push the registers that are going to get clobbered. */\r
189         PUSHM   R14-R15                                         \r
190         \r
191         /* Increment the loop counter to show this task is still getting CPU time. */\r
192         MOV     #_ulRegTest2LoopCounter, R14    \r
193         MOV     [ R14 ], R15                            \r
194         ADD     #1, R15                                         \r
195         MOV     R15, [ R14 ]                            \r
196         \r
197         ;/* Check accumulators. */\r
198         MVFACHI #0, A0, R15\r
199         CMP #10H, R15\r
200         BNE RegTest1Error\r
201         MVFACLO #0, A0, R15\r
202         CMP #20H, R15\r
203         BNE RegTest1Error\r
204         MVFACGU #0, A0, R15\r
205         CMP #1H, R15\r
206         BNE RegTest1Error\r
207         MVFACHI #0, A1, R15\r
208         CMP #30H, R15\r
209         BNE RegTest1Error\r
210         MVFACLO #0, A1, R15\r
211         CMP #40H, R15\r
212         BNE RegTest1Error\r
213         MVFACGU #0, A1, R15\r
214         CMP #2H, R15\r
215         BNE RegTest1Error\r
216 \r
217         /* Restore the clobbered registers. */\r
218         POPM    R14-R15                                         \r
219         \r
220         /* Now compare each register to ensure it still contains the value that was\r
221         set before this loop was entered. */\r
222         CMP     #10H, R1                                        \r
223         BNE     RegTest2Error                           \r
224         CMP     #20H, R2                                        \r
225         BNE     RegTest2Error                           \r
226         CMP     #30H, R3                                        \r
227         BNE     RegTest2Error                           \r
228         CMP     #40H, R4                                        \r
229         BNE     RegTest2Error                           \r
230         CMP     #50H, R5                                        \r
231         BNE     RegTest2Error                           \r
232         CMP     #60H, R6                                        \r
233         BNE     RegTest2Error                           \r
234         CMP     #70H, R7                                        \r
235         BNE     RegTest2Error                           \r
236         CMP     #80H, R8                                        \r
237         BNE     RegTest2Error                           \r
238         CMP     #90H, R9                                        \r
239         BNE     RegTest2Error                           \r
240         CMP     #100H, R10                                      \r
241         BNE     RegTest2Error                           \r
242         CMP     #110H, R11                                      \r
243         BNE     RegTest2Error                           \r
244         CMP     #120H, R12                                      \r
245         BNE     RegTest2Error                           \r
246         CMP     #130H, R13                                      \r
247         BNE     RegTest2Error                           \r
248         CMP     #140H, R14                                      \r
249         BNE     RegTest2Error                           \r
250         CMP     #150H, R15                                      \r
251         BNE     RegTest2Error                           \r
252 \r
253         /* All comparisons passed, start a new itteratio of this loop. */\r
254         BRA     TestLoop2                                       \r
255         \r
256 RegTest2Error:                                                  \r
257         /* A compare failed, just loop here so the loop counter stops incrementing\r
258         - causing the check task to indicate the error. */\r
259         BRA RegTest2Error                                       \r
260 \r
261         \r
262         END\r