]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX600_RX62N-RDK_IAR/RegTest.s
Update version number.
[freertos] / FreeRTOS / Demo / RX600_RX62N-RDK_IAR / RegTest.s
1 /*\r
2     FreeRTOS V7.5.1 - Copyright (C) 2013 Real Time Engineers Ltd.\r
3 \r
4     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
5 \r
6     ***************************************************************************\r
7      *                                                                       *\r
8      *    FreeRTOS provides completely free yet professionally developed,    *\r
9      *    robust, strictly quality controlled, supported, and cross          *\r
10      *    platform software that has become a de facto standard.             *\r
11      *                                                                       *\r
12      *    Help yourself get started quickly and support the FreeRTOS         *\r
13      *    project by purchasing a FreeRTOS tutorial book, reference          *\r
14      *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
15      *                                                                       *\r
16      *    Thank you!                                                         *\r
17      *                                                                       *\r
18     ***************************************************************************\r
19 \r
20     This file is part of the FreeRTOS distribution.\r
21 \r
22     FreeRTOS is free software; you can redistribute it and/or modify it under\r
23     the terms of the GNU General Public License (version 2) as published by the\r
24     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
25 \r
26     >>! NOTE: The modification to the GPL is included to allow you to distribute\r
27     >>! a combined work that includes FreeRTOS without being obliged to provide\r
28     >>! the source code for proprietary components outside of the FreeRTOS\r
29     >>! kernel.\r
30 \r
31     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
32     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
33     FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
34     link: http://www.freertos.org/a00114.html\r
35 \r
36     1 tab == 4 spaces!\r
37 \r
38     ***************************************************************************\r
39      *                                                                       *\r
40      *    Having a problem?  Start by reading the FAQ "My application does   *\r
41      *    not run, what could be wrong?"                                     *\r
42      *                                                                       *\r
43      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
44      *                                                                       *\r
45     ***************************************************************************\r
46 \r
47     http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
48     license and Real Time Engineers Ltd. contact details.\r
49 \r
50     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
51     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
52     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
53 \r
54     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
55     Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
56     licenses offer ticketed support, indemnification and middleware.\r
57 \r
58     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
59     engineered and independently SIL3 certified version for use in safety and\r
60     mission critical applications that require provable dependability.\r
61 \r
62     1 tab == 4 spaces!\r
63 */\r
64 \r
65         PUBLIC _prvRegTest1Implementation\r
66         PUBLIC _prvRegTest2Implementation\r
67         \r
68         EXTERN _ulRegTest1CycleCount\r
69         EXTERN _ulRegTest2CycleCount\r
70 \r
71         RSEG CODE:CODE(4)\r
72 \r
73 /* This function is explained in the comments at the top of main.c. */\r
74 _prvRegTest1Implementation:\r
75 \r
76         /* Put a known value in each register. */\r
77         MOV     #1, R1                                          \r
78         MOV     #2, R2                                          \r
79         MOV     #3, R3                                          \r
80         MOV     #4, R4                                          \r
81         MOV     #5, R5                                          \r
82         MOV     #6, R6                                          \r
83         MOV     #7, R7                                          \r
84         MOV     #8, R8                                          \r
85         MOV     #9, R9                                          \r
86         MOV     #10, R10                                        \r
87         MOV     #11, R11                                        \r
88         MOV     #12, R12                                        \r
89         MOV     #13, R13                                        \r
90         MOV     #14, R14                                        \r
91         MOV     #15, R15                                        \r
92         \r
93         /* Loop, checking each itteration that each register still contains the\r
94         expected value. */\r
95 TestLoop1:                                                              \r
96 \r
97         /* Push the registers that are going to get clobbered. */\r
98         PUSHM   R14-R15                                         \r
99         \r
100         /* Increment the loop counter to show this task is still getting CPU time. */\r
101         MOV     #_ulRegTest1CycleCount, R14     \r
102         MOV     [ R14 ], R15                            \r
103         ADD     #1, R15                                         \r
104         MOV     R15, [ R14 ]                            \r
105         \r
106         /* Yield to extend the text coverage.  Set the bit in the ITU SWINTR register. */\r
107         MOV     #1, R14                                         \r
108         MOV     #0872E0H, R15                           \r
109         MOV.B   R14, [R15]                                      \r
110         NOP                                                             \r
111         NOP                                                             \r
112         \r
113         /* Restore the clobbered registers. */\r
114         POPM    R14-R15                                         \r
115         \r
116         /* Now compare each register to ensure it still contains the value that was\r
117         set before this loop was entered. */\r
118         CMP     #1, R1                                          \r
119         BNE     RegTest1Error                           \r
120         CMP     #2, R2                                          \r
121         BNE     RegTest1Error                           \r
122         CMP     #3, R3                                          \r
123         BNE     RegTest1Error                           \r
124         CMP     #4, R4                                          \r
125         BNE     RegTest1Error                           \r
126         CMP     #5, R5                                          \r
127         BNE     RegTest1Error                           \r
128         CMP     #6, R6                                          \r
129         BNE     RegTest1Error                           \r
130         CMP     #7, R7                                          \r
131         BNE     RegTest1Error                           \r
132         CMP     #8, R8                                          \r
133         BNE     RegTest1Error                           \r
134         CMP     #9, R9                                          \r
135         BNE     RegTest1Error                           \r
136         CMP     #10, R10                                        \r
137         BNE     RegTest1Error                           \r
138         CMP     #11, R11                                        \r
139         BNE     RegTest1Error                           \r
140         CMP     #12, R12                                        \r
141         BNE     RegTest1Error                           \r
142         CMP     #13, R13                                        \r
143         BNE     RegTest1Error                           \r
144         CMP     #14, R14                                        \r
145         BNE     RegTest1Error                           \r
146         CMP     #15, R15                                        \r
147         BNE     RegTest1Error                           \r
148 \r
149         /* All comparisons passed, start a new itteratio of this loop. */\r
150         BRA             TestLoop1                               \r
151         \r
152 RegTest1Error:                                                  \r
153         /* A compare failed, just loop here so the loop counter stops incrementing\r
154         - causing the check task to indicate the error. */\r
155         BRA RegTest1Error                                       \r
156 /*-----------------------------------------------------------*/\r
157 \r
158 /* This function is explained in the comments at the top of main.c. */\r
159 _prvRegTest2Implementation:\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         /* Loop, checking each itteration that each register still contains the\r
179         expected value. */\r
180 TestLoop2:                                                              \r
181 \r
182         /* Push the registers that are going to get clobbered. */\r
183         PUSHM   R14-R15                                         \r
184         \r
185         /* Increment the loop counter to show this task is still getting CPU time. */\r
186         MOV     #_ulRegTest2CycleCount, R14     \r
187         MOV     [ R14 ], R15                            \r
188         ADD     #1, R15                                         \r
189         MOV     R15, [ R14 ]                            \r
190         \r
191         /* Restore the clobbered registers. */\r
192         POPM    R14-R15                                         \r
193         \r
194         /* Now compare each register to ensure it still contains the value that was\r
195         set before this loop was entered. */\r
196         CMP     #10H, R1                                        \r
197         BNE     RegTest2Error                           \r
198         CMP     #20H, R2                                        \r
199         BNE     RegTest2Error                           \r
200         CMP     #30H, R3                                        \r
201         BNE     RegTest2Error                           \r
202         CMP     #40H, R4                                        \r
203         BNE     RegTest2Error                           \r
204         CMP     #50H, R5                                        \r
205         BNE     RegTest2Error                           \r
206         CMP     #60H, R6                                        \r
207         BNE     RegTest2Error                           \r
208         CMP     #70H, R7                                        \r
209         BNE     RegTest2Error                           \r
210         CMP     #80H, R8                                        \r
211         BNE     RegTest2Error                           \r
212         CMP     #90H, R9                                        \r
213         BNE     RegTest2Error                           \r
214         CMP     #100H, R10                                      \r
215         BNE     RegTest2Error                           \r
216         CMP     #110H, R11                                      \r
217         BNE     RegTest2Error                           \r
218         CMP     #120H, R12                                      \r
219         BNE     RegTest2Error                           \r
220         CMP     #130H, R13                                      \r
221         BNE     RegTest2Error                           \r
222         CMP     #140H, R14                                      \r
223         BNE     RegTest2Error                           \r
224         CMP     #150H, R15                                      \r
225         BNE     RegTest2Error                           \r
226 \r
227         /* All comparisons passed, start a new itteratio of this loop. */\r
228         BRA     TestLoop2                                       \r
229         \r
230 RegTest2Error:                                                  \r
231         /* A compare failed, just loop here so the loop counter stops incrementing\r
232         - causing the check task to indicate the error. */\r
233         BRA RegTest2Error                                       \r
234 \r
235         \r
236         END\r