]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43
Prepare for V7.3.0 release.
[freertos] / FreeRTOS / Demo / MSP430X_MSP430F5438_IAR / RegTest.s43
1 /*\r
2     FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
3 \r
4     FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT \r
5     http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     ***************************************************************************\r
8      *                                                                       *\r
9      *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
10      *    Complete, revised, and edited pdf reference manuals are also       *\r
11      *    available.                                                         *\r
12      *                                                                       *\r
13      *    Purchasing FreeRTOS documentation will not only help you, by       *\r
14      *    ensuring you get running as quickly as possible and with an        *\r
15      *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
16      *    the FreeRTOS project to continue with its mission of providing     *\r
17      *    professional grade, cross platform, de facto standard solutions    *\r
18      *    for microcontrollers - completely free of charge!                  *\r
19      *                                                                       *\r
20      *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
21      *                                                                       *\r
22      *    Thank you for using FreeRTOS, and thank you for your support!      *\r
23      *                                                                       *\r
24     ***************************************************************************\r
25 \r
26 \r
27     This file is part of the FreeRTOS distribution.\r
28 \r
29     FreeRTOS is free software; you can redistribute it and/or modify it under\r
30     the terms of the GNU General Public License (version 2) as published by the\r
31     Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
32     >>>NOTE<<< The modification to the GPL is included to allow you to\r
33     distribute a combined work that includes FreeRTOS without being obliged to\r
34     provide the source code for proprietary components outside of the FreeRTOS\r
35     kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
36     WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
37     or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
38     more details. You should have received a copy of the GNU General Public\r
39     License and the FreeRTOS license exception along with FreeRTOS; if not it\r
40     can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
41     by writing to Richard Barry, contact details for whom are available on the\r
42     FreeRTOS WEB site.\r
43 \r
44     1 tab == 4 spaces!\r
45     \r
46     ***************************************************************************\r
47      *                                                                       *\r
48      *    Having a problem?  Start by reading the FAQ "My application does   *\r
49      *    not run, what could be wrong?"                                     *\r
50      *                                                                       *\r
51      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
52      *                                                                       *\r
53     ***************************************************************************\r
54 \r
55     \r
56     http://www.FreeRTOS.org - Documentation, training, latest versions, license \r
57     and contact details.  \r
58     \r
59     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
60     including FreeRTOS+Trace - an indispensable productivity tool.\r
61 \r
62     Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
63     the code with commercial support, indemnification, and middleware, under \r
64     the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
65     provide a safety engineered and independently SIL3 certified version under \r
66     the SafeRTOS brand: http://www.SafeRTOS.com.\r
67 */\r
68 #include "msp430.h"\r
69 #include "FreeRTOSConfig.h"\r
70 #include "data_model.h"\r
71 \r
72 /*\r
73  * The definition of the "register test" tasks, as described at the top of\r
74  * main.c\r
75  */\r
76 \r
77 \r
78 \r
79         IMPORT usRegTest1Counter\r
80         IMPORT usRegTest2Counter\r
81         IMPORT vPortYield\r
82         \r
83         EXPORT vRegTest1Task\r
84         EXPORT vRegTest2Task\r
85 \r
86         RSEG CODE\r
87         \r
88         EVEN\r
89 \r
90 vRegTest1Task:\r
91 \r
92         /* Fill each general purpose register with a known value. */\r
93         mov_x   #0x4444, r4\r
94         mov_x   #0x5555, r5\r
95         mov_x   #0x6666, r6\r
96         mov_x   #0x7777, r7\r
97         mov_x   #0x8888, r8\r
98         mov_x   #0x9999, r9\r
99         mov_x   #0xaaaa, r10\r
100         mov_x   #0xbbbb, r11\r
101         mov_x   #0xcccc, r12\r
102         mov_x   #0xdddd, r13\r
103         mov_x   #0xeeee, r14\r
104         mov_x   #0xffff, r15\r
105         \r
106 prvRegTest1Loop:\r
107 \r
108         /* Test each general purpose register to check that it still contains the\r
109         expected known value, jumping to vRegTest1Error if any register contains\r
110         an unexpected value. */\r
111         cmp_x   #0x4444, r4\r
112         jne             vRegTest1Error\r
113         cmp_x   #0x5555, r5\r
114         jne             vRegTest1Error\r
115         cmp_x   #0x6666, r6\r
116         jne             vRegTest1Error\r
117         cmp_x   #0x7777, r7\r
118         jne             vRegTest1Error\r
119         cmp_x   #0x8888, r8\r
120         jne             vRegTest1Error\r
121         cmp_x   #0x9999, r9\r
122         jne             vRegTest1Error\r
123         cmp_x   #0xaaaa, r10\r
124         jne             vRegTest1Error\r
125         cmp_x   #0xbbbb, r11\r
126         jne             vRegTest1Error\r
127         cmp_x   #0xcccc, r12\r
128         jne             vRegTest1Error\r
129         cmp_x   #0xdddd, r13\r
130         jne             vRegTest1Error\r
131         cmp_x   #0xeeee, r14\r
132         jne             vRegTest1Error\r
133         cmp_x   #0xffff, r15\r
134         jne             vRegTest1Error\r
135         \r
136         /* This task is still running without jumping to vRegTest1Error, so increment\r
137         the loop counter so the check task knows the task is running error free. */\r
138         incx.w  &usRegTest1Counter\r
139         \r
140         /* Loop again, performing the same tests. */\r
141         jmp             prvRegTest1Loop\r
142         nop\r
143 \r
144         \r
145         EVEN\r
146         \r
147 vRegTest1Error:\r
148         jmp vRegTest1Error\r
149         nop\r
150         \r
151 /*-----------------------------------------------------------*/\r
152 \r
153 /* See the comments in vRegTest1Task.  This task is the same, it just uses\r
154 different values in its registers. */\r
155 vRegTest2Task:\r
156 \r
157         mov_x   #0x4441, r4\r
158         mov_x   #0x5551, r5\r
159         mov_x   #0x6661, r6\r
160         mov_x   #0x7771, r7\r
161         mov_x   #0x8881, r8\r
162         mov_x   #0x9991, r9\r
163         mov_x   #0xaaa1, r10\r
164         mov_x   #0xbbb1, r11\r
165         mov_x   #0xccc1, r12\r
166         mov_x   #0xddd1, r13\r
167         mov_x   #0xeee1, r14\r
168         mov_x   #0xfff1, r15\r
169         \r
170 prvRegTest2Loop:\r
171 \r
172         cmp_x   #0x4441, r4\r
173         jne             vRegTest2Error\r
174         cmp_x   #0x5551, r5\r
175         jne             vRegTest2Error\r
176         cmp_x   #0x6661, r6\r
177         jne             vRegTest2Error\r
178         cmp_x   #0x7771, r7\r
179         jne             vRegTest2Error\r
180         cmp_x   #0x8881, r8\r
181         jne             vRegTest2Error\r
182         cmp_x   #0x9991, r9\r
183         jne             vRegTest2Error\r
184         cmp_x   #0xaaa1, r10\r
185         jne             vRegTest2Error\r
186         cmp_x   #0xbbb1, r11\r
187         jne             vRegTest2Error\r
188         cmp_x   #0xccc1, r12\r
189         jne             vRegTest2Error\r
190         cmp_x   #0xddd1, r13\r
191         jne             vRegTest2Error\r
192         cmp_x   #0xeee1, r14\r
193         jne             vRegTest2Error\r
194         cmp_x   #0xfff1, r15\r
195         jne             vRegTest2Error\r
196         \r
197         /* Also perform a manual yield, just to increase the scope of the test. */\r
198         calla   #vPortYield\r
199         \r
200         incx.w  &usRegTest2Counter\r
201         jmp             prvRegTest2Loop\r
202         nop\r
203 \r
204         \r
205 vRegTest2Error:\r
206         jmp vRegTest2Error\r
207         nop\r
208 /*-----------------------------------------------------------*/\r
209 \r
210                 \r
211         END\r
212                 \r