]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX600_RX62N-RSK_IAR/RegTest.s
Prepare for V9.0.0 release:
[freertos] / FreeRTOS / Demo / RX600_RX62N-RSK_IAR / RegTest.s
1 /*\r
2     FreeRTOS V9.0.0 - 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 _prvRegTest1Implementation\r
71         PUBLIC _prvRegTest2Implementation\r
72         \r
73         EXTERN _ulRegTest1CycleCount\r
74         EXTERN _ulRegTest2CycleCount\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 _prvRegTest1Implementation:\r
80 \r
81         /* Put a known value in each register. */\r
82         MOV     #1, R1                                          \r
83         MOV     #2, R2                                          \r
84         MOV     #3, R3                                          \r
85         MOV     #4, R4                                          \r
86         MOV     #5, R5                                          \r
87         MOV     #6, R6                                          \r
88         MOV     #7, R7                                          \r
89         MOV     #8, R8                                          \r
90         MOV     #9, R9                                          \r
91         MOV     #10, R10                                        \r
92         MOV     #11, R11                                        \r
93         MOV     #12, R12                                        \r
94         MOV     #13, R13                                        \r
95         MOV     #14, R14                                        \r
96         MOV     #15, R15                                        \r
97         \r
98         /* Loop, checking each iteration that each register still contains the\r
99         expected value. */\r
100 TestLoop1:                                                              \r
101 \r
102         /* Push the registers that are going to get clobbered. */\r
103         PUSHM   R14-R15                                         \r
104         \r
105         /* Increment the loop counter to show this task is still getting CPU time. */\r
106         MOV     #_ulRegTest1CycleCount, R14     \r
107         MOV     [ R14 ], R15                            \r
108         ADD     #1, R15                                         \r
109         MOV     R15, [ R14 ]                            \r
110         \r
111         /* Yield to extend the text coverage.  Set the bit in the ITU SWINTR register. */\r
112         MOV     #1, R14                                         \r
113         MOV     #0872E0H, R15                           \r
114         MOV.B   R14, [R15]                                      \r
115         NOP                                                             \r
116         NOP                                                             \r
117         \r
118         /* Restore the clobbered registers. */\r
119         POPM    R14-R15                                         \r
120         \r
121         /* Now compare each register to ensure it still contains the value that was\r
122         set before this loop was entered. */\r
123         CMP     #1, R1                                          \r
124         BNE     RegTest1Error                           \r
125         CMP     #2, R2                                          \r
126         BNE     RegTest1Error                           \r
127         CMP     #3, R3                                          \r
128         BNE     RegTest1Error                           \r
129         CMP     #4, R4                                          \r
130         BNE     RegTest1Error                           \r
131         CMP     #5, R5                                          \r
132         BNE     RegTest1Error                           \r
133         CMP     #6, R6                                          \r
134         BNE     RegTest1Error                           \r
135         CMP     #7, R7                                          \r
136         BNE     RegTest1Error                           \r
137         CMP     #8, R8                                          \r
138         BNE     RegTest1Error                           \r
139         CMP     #9, R9                                          \r
140         BNE     RegTest1Error                           \r
141         CMP     #10, R10                                        \r
142         BNE     RegTest1Error                           \r
143         CMP     #11, R11                                        \r
144         BNE     RegTest1Error                           \r
145         CMP     #12, R12                                        \r
146         BNE     RegTest1Error                           \r
147         CMP     #13, R13                                        \r
148         BNE     RegTest1Error                           \r
149         CMP     #14, R14                                        \r
150         BNE     RegTest1Error                           \r
151         CMP     #15, R15                                        \r
152         BNE     RegTest1Error                           \r
153 \r
154         /* All comparisons passed, start a new itteratio of this loop. */\r
155         BRA             TestLoop1                               \r
156         \r
157 RegTest1Error:                                                  \r
158         /* A compare failed, just loop here so the loop counter stops incrementing\r
159         - causing the check task to indicate the error. */\r
160         BRA RegTest1Error                                       \r
161 /*-----------------------------------------------------------*/\r
162 \r
163 /* This function is explained in the comments at the top of main.c. */\r
164 _prvRegTest2Implementation:\r
165 \r
166         /* Put a known value in each register. */\r
167         MOV     #10H, R1                                        \r
168         MOV     #20H, R2                                        \r
169         MOV     #30H, R3                                        \r
170         MOV     #40H, R4                                        \r
171         MOV     #50H, R5                                        \r
172         MOV     #60H, R6                                        \r
173         MOV     #70H, R7                                        \r
174         MOV     #80H, R8                                        \r
175         MOV     #90H, R9                                        \r
176         MOV     #100H, R10                                      \r
177         MOV     #110H, R11                                      \r
178         MOV     #120H, R12                                      \r
179         MOV     #130H, R13                                      \r
180         MOV     #140H, R14                                      \r
181         MOV     #150H, R15                                      \r
182         \r
183         /* Loop, checking each iteration that each register still contains the\r
184         expected value. */\r
185 TestLoop2:                                                              \r
186 \r
187         /* Push the registers that are going to get clobbered. */\r
188         PUSHM   R14-R15                                         \r
189         \r
190         /* Increment the loop counter to show this task is still getting CPU time. */\r
191         MOV     #_ulRegTest2CycleCount, R14     \r
192         MOV     [ R14 ], R15                            \r
193         ADD     #1, R15                                         \r
194         MOV     R15, [ R14 ]                            \r
195         \r
196         /* Restore the clobbered registers. */\r
197         POPM    R14-R15                                         \r
198         \r
199         /* Now compare each register to ensure it still contains the value that was\r
200         set before this loop was entered. */\r
201         CMP     #10H, R1                                        \r
202         BNE     RegTest2Error                           \r
203         CMP     #20H, R2                                        \r
204         BNE     RegTest2Error                           \r
205         CMP     #30H, R3                                        \r
206         BNE     RegTest2Error                           \r
207         CMP     #40H, R4                                        \r
208         BNE     RegTest2Error                           \r
209         CMP     #50H, R5                                        \r
210         BNE     RegTest2Error                           \r
211         CMP     #60H, R6                                        \r
212         BNE     RegTest2Error                           \r
213         CMP     #70H, R7                                        \r
214         BNE     RegTest2Error                           \r
215         CMP     #80H, R8                                        \r
216         BNE     RegTest2Error                           \r
217         CMP     #90H, R9                                        \r
218         BNE     RegTest2Error                           \r
219         CMP     #100H, R10                                      \r
220         BNE     RegTest2Error                           \r
221         CMP     #110H, R11                                      \r
222         BNE     RegTest2Error                           \r
223         CMP     #120H, R12                                      \r
224         BNE     RegTest2Error                           \r
225         CMP     #130H, R13                                      \r
226         BNE     RegTest2Error                           \r
227         CMP     #140H, R14                                      \r
228         BNE     RegTest2Error                           \r
229         CMP     #150H, R15                                      \r
230         BNE     RegTest2Error                           \r
231 \r
232         /* All comparisons passed, start a new itteratio of this loop. */\r
233         BRA     TestLoop2                                       \r
234         \r
235 RegTest2Error:                                                  \r
236         /* A compare failed, just loop here so the loop counter stops incrementing\r
237         - causing the check task to indicate the error. */\r
238         BRA RegTest2Error                                       \r
239 \r
240         \r
241         END\r