]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX700_RX71M_RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_IAR.s
Update version number to 9.0.0rc2.
[freertos] / FreeRTOS / Demo / RX700_RX71M_RSK_GCC_e2studio_IAR / src / Full_Demo / RegTest_IAR.s
1 /*\r
2     FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution.\r
8 \r
9     FreeRTOS is free software; you can redistribute it and/or modify it under\r
10     the terms of the GNU General Public License (version 2) as published by the\r
11     Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
12 \r
13     ***************************************************************************\r
14     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
15     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
16     >>!   obliged to provide the source code for proprietary components     !<<\r
17     >>!   outside of the FreeRTOS kernel.                                   !<<\r
18     ***************************************************************************\r
19 \r
20     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
21     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
22     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
23     link: http://www.freertos.org/a00114.html\r
24 \r
25     ***************************************************************************\r
26      *                                                                       *\r
27      *    FreeRTOS provides completely free yet professionally developed,    *\r
28      *    robust, strictly quality controlled, supported, and cross          *\r
29      *    platform software that is more than just the market leader, it     *\r
30      *    is the industry's de facto standard.                               *\r
31      *                                                                       *\r
32      *    Help yourself get started quickly while simultaneously helping     *\r
33      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
34      *    tutorial book, reference manual, or both:                          *\r
35      *    http://www.FreeRTOS.org/Documentation                              *\r
36      *                                                                       *\r
37     ***************************************************************************\r
38 \r
39     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
40     the FAQ page "My application does not run, what could be wrong?".  Have you\r
41     defined configASSERT()?\r
42 \r
43     http://www.FreeRTOS.org/support - In return for receiving this top quality\r
44     embedded software for free we request you assist our global community by\r
45     participating in the support forum.\r
46 \r
47     http://www.FreeRTOS.org/training - Investing in training allows your team to\r
48     be as productive as possible as early as possible.  Now you can receive\r
49     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
50     Ltd, and the world's leading authority on the world's leading RTOS.\r
51 \r
52     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
53     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
54     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
55 \r
56     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
57     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
58 \r
59     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
60     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
61     licenses offer ticketed support, indemnification and commercial middleware.\r
62 \r
63     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
64     engineered and independently SIL3 certified version for use in safety and\r
65     mission critical applications that require provable dependability.\r
66 \r
67     1 tab == 4 spaces!\r
68 */\r
69 \r
70         PUBLIC _vRegTest1Implementation\r
71         PUBLIC _vRegTest2Implementation\r
72         \r
73         EXTERN _ulRegTest1LoopCounter\r
74         EXTERN _ulRegTest2LoopCounter\r
75 \r
76         RSEG CODE:CODE(4)\r
77 \r
78 /* This function is explained in the comments at the top of main.c. */\r
79 _vRegTest1Implementation:\r
80 \r
81         ;/* Put a known value in the guard byte of the accumulators. */\r
82         MOV.L   #10, R1\r
83         MVTACGU R1, A0\r
84         MOV.L   #20, R1\r
85         MVTACGU R1, A1\r
86 \r
87         /* Put a known value in each register. */\r
88         MOV     #1, R1                                          \r
89         MOV     #2, R2                                          \r
90         MOV     #3, R3                                          \r
91         MOV     #4, R4                                          \r
92         MOV     #5, R5                                          \r
93         MOV     #6, R6                                          \r
94         MOV     #7, R7                                          \r
95         MOV     #8, R8                                          \r
96         MOV     #9, R9                                          \r
97         MOV     #10, R10                                        \r
98         MOV     #11, R11                                        \r
99         MOV     #12, R12                                        \r
100         MOV     #13, R13                                        \r
101         MOV     #14, R14                                        \r
102         MOV     #15, R15                                        \r
103         \r
104         ;/* Put a known value in the hi and low of the accumulators. */\r
105         MVTACHI R1, A0\r
106         MVTACLO R2, A0\r
107         MVTACHI R3, A1\r
108         MVTACLO R4, A1\r
109         /* Loop, checking each iteration that each register still contains the\r
110         expected value. */\r
111 TestLoop1:                                                              \r
112 \r
113         /* Push the registers that are going to get clobbered. */\r
114         PUSHM   R14-R15                                         \r
115         \r
116         /* Increment the loop counter to show this task is still getting CPU time. */\r
117         MOV     #_ulRegTest1LoopCounter, R14    \r
118         MOV     [ R14 ], R15                            \r
119         ADD     #1, R15                                         \r
120         MOV     R15, [ R14 ]                            \r
121         \r
122         /* Yield to extend the text coverage.  Set the bit in the ITU SWINTR register. */\r
123         MOV     #1, R14                                         \r
124         MOV     #0872E0H, R15                           \r
125         MOV.B   R14, [R15]                                      \r
126         NOP                                                             \r
127         NOP                                                             \r
128         \r
129         ;/* Check accumulators. */\r
130         MVFACHI #0, A0, R15\r
131         CMP #1, R15\r
132         BNE RegTest1Error\r
133         MVFACLO #0, A0, R15\r
134         CMP #2, R15\r
135         BNE RegTest1Error\r
136         MVFACGU #0, A0, R15\r
137         CMP #10, R15\r
138         BNE RegTest1Error\r
139         MVFACHI #0, A1, R15\r
140         CMP #3, R15\r
141         BNE RegTest1Error\r
142         MVFACLO #0, A1, R15\r
143         CMP #4, R15\r
144         BNE RegTest1Error\r
145         MVFACGU #0, A1, R15\r
146         CMP #20, R15\r
147         BNE RegTest1Error\r
148 \r
149         /* Restore the clobbered registers. */\r
150         POPM    R14-R15                                         \r
151         \r
152         /* Now compare each register to ensure it still contains the value that was\r
153         set before this loop was entered. */\r
154         CMP     #1, R1                                          \r
155         BNE     RegTest1Error                           \r
156         CMP     #2, R2                                          \r
157         BNE     RegTest1Error                           \r
158         CMP     #3, R3                                          \r
159         BNE     RegTest1Error                           \r
160         CMP     #4, R4                                          \r
161         BNE     RegTest1Error                           \r
162         CMP     #5, R5                                          \r
163         BNE     RegTest1Error                           \r
164         CMP     #6, R6                                          \r
165         BNE     RegTest1Error                           \r
166         CMP     #7, R7                                          \r
167         BNE     RegTest1Error                           \r
168         CMP     #8, R8                                          \r
169         BNE     RegTest1Error                           \r
170         CMP     #9, R9                                          \r
171         BNE     RegTest1Error                           \r
172         CMP     #10, R10                                        \r
173         BNE     RegTest1Error                           \r
174         CMP     #11, R11                                        \r
175         BNE     RegTest1Error                           \r
176         CMP     #12, R12                                        \r
177         BNE     RegTest1Error                           \r
178         CMP     #13, R13                                        \r
179         BNE     RegTest1Error                           \r
180         CMP     #14, R14                                        \r
181         BNE     RegTest1Error                           \r
182         CMP     #15, R15                                        \r
183         BNE     RegTest1Error                           \r
184 \r
185         /* All comparisons passed, start a new itteratio of this loop. */\r
186         BRA             TestLoop1                               \r
187         \r
188 RegTest1Error:                                                  \r
189         /* A compare failed, just loop here so the loop counter stops incrementing\r
190         - causing the check task to indicate the error. */\r
191         BRA RegTest1Error                                       \r
192 /*-----------------------------------------------------------*/\r
193 \r
194 /* This function is explained in the comments at the top of main.c. */\r
195 _vRegTest2Implementation:\r
196 \r
197         ;/* Put a known value in the guard byte of the accumulators. */\r
198         MOV.L   #1H, R1\r
199         MVTACGU R1, A0\r
200         MOV.L   #2H, R1\r
201         MVTACGU R1, A1\r
202 \r
203         /* Put a known value in each register. */\r
204         MOV     #10H, R1                                        \r
205         MOV     #20H, R2                                        \r
206         MOV     #30H, R3                                        \r
207         MOV     #40H, R4                                        \r
208         MOV     #50H, R5                                        \r
209         MOV     #60H, R6                                        \r
210         MOV     #70H, R7                                        \r
211         MOV     #80H, R8                                        \r
212         MOV     #90H, R9                                        \r
213         MOV     #100H, R10                                      \r
214         MOV     #110H, R11                                      \r
215         MOV     #120H, R12                                      \r
216         MOV     #130H, R13                                      \r
217         MOV     #140H, R14                                      \r
218         MOV     #150H, R15                                      \r
219 \r
220         ;/* Put a known value in the hi and low of the accumulators. */\r
221         MVTACHI R1, A0\r
222         MVTACLO R2, A0\r
223         MVTACHI R3, A1\r
224         MVTACLO R4, A1\r
225 \r
226         /* Loop, checking each iteration that each register still contains the\r
227         expected value. */\r
228 TestLoop2:                                                              \r
229 \r
230         /* Push the registers that are going to get clobbered. */\r
231         PUSHM   R14-R15                                         \r
232         \r
233         /* Increment the loop counter to show this task is still getting CPU time. */\r
234         MOV     #_ulRegTest2LoopCounter, R14    \r
235         MOV     [ R14 ], R15                            \r
236         ADD     #1, R15                                         \r
237         MOV     R15, [ R14 ]                            \r
238         \r
239         ;/* Check accumulators. */\r
240         MVFACHI #0, A0, R15\r
241         CMP #10H, R15\r
242         BNE RegTest1Error\r
243         MVFACLO #0, A0, R15\r
244         CMP #20H, R15\r
245         BNE RegTest1Error\r
246         MVFACGU #0, A0, R15\r
247         CMP #1H, R15\r
248         BNE RegTest1Error\r
249         MVFACHI #0, A1, R15\r
250         CMP #30H, R15\r
251         BNE RegTest1Error\r
252         MVFACLO #0, A1, R15\r
253         CMP #40H, R15\r
254         BNE RegTest1Error\r
255         MVFACGU #0, A1, R15\r
256         CMP #2H, R15\r
257         BNE RegTest1Error\r
258 \r
259         /* Restore the clobbered registers. */\r
260         POPM    R14-R15                                         \r
261         \r
262         /* Now compare each register to ensure it still contains the value that was\r
263         set before this loop was entered. */\r
264         CMP     #10H, R1                                        \r
265         BNE     RegTest2Error                           \r
266         CMP     #20H, R2                                        \r
267         BNE     RegTest2Error                           \r
268         CMP     #30H, R3                                        \r
269         BNE     RegTest2Error                           \r
270         CMP     #40H, R4                                        \r
271         BNE     RegTest2Error                           \r
272         CMP     #50H, R5                                        \r
273         BNE     RegTest2Error                           \r
274         CMP     #60H, R6                                        \r
275         BNE     RegTest2Error                           \r
276         CMP     #70H, R7                                        \r
277         BNE     RegTest2Error                           \r
278         CMP     #80H, R8                                        \r
279         BNE     RegTest2Error                           \r
280         CMP     #90H, R9                                        \r
281         BNE     RegTest2Error                           \r
282         CMP     #100H, R10                                      \r
283         BNE     RegTest2Error                           \r
284         CMP     #110H, R11                                      \r
285         BNE     RegTest2Error                           \r
286         CMP     #120H, R12                                      \r
287         BNE     RegTest2Error                           \r
288         CMP     #130H, R13                                      \r
289         BNE     RegTest2Error                           \r
290         CMP     #140H, R14                                      \r
291         BNE     RegTest2Error                           \r
292         CMP     #150H, R15                                      \r
293         BNE     RegTest2Error                           \r
294 \r
295         /* All comparisons passed, start a new itteratio of this loop. */\r
296         BRA     TestLoop2                                       \r
297         \r
298 RegTest2Error:                                                  \r
299         /* A compare failed, just loop here so the loop counter stops incrementing\r
300         - causing the check task to indicate the error. */\r
301         BRA RegTest2Error                                       \r
302 \r
303         \r
304         END\r