]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430X_MSP430F5438_IAR/RegTest.s43
Update version number.
[freertos] / FreeRTOS / Demo / MSP430X_MSP430F5438_IAR / RegTest.s43
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 #include "msp430.h"\r
65 #include "FreeRTOSConfig.h"\r
66 #include "data_model.h"\r
67 \r
68 /*\r
69  * The definition of the "register test" tasks, as described at the top of\r
70  * main.c\r
71  */\r
72 \r
73 \r
74 \r
75         IMPORT usRegTest1Counter\r
76         IMPORT usRegTest2Counter\r
77         IMPORT vPortYield\r
78         \r
79         EXPORT vRegTest1Task\r
80         EXPORT vRegTest2Task\r
81 \r
82         RSEG CODE\r
83         \r
84         EVEN\r
85 \r
86 vRegTest1Task:\r
87 \r
88         /* Fill each general purpose register with a known value. */\r
89         mov_x   #0x4444, r4\r
90         mov_x   #0x5555, r5\r
91         mov_x   #0x6666, r6\r
92         mov_x   #0x7777, r7\r
93         mov_x   #0x8888, r8\r
94         mov_x   #0x9999, r9\r
95         mov_x   #0xaaaa, r10\r
96         mov_x   #0xbbbb, r11\r
97         mov_x   #0xcccc, r12\r
98         mov_x   #0xdddd, r13\r
99         mov_x   #0xeeee, r14\r
100         mov_x   #0xffff, r15\r
101         \r
102 prvRegTest1Loop:\r
103 \r
104         /* Test each general purpose register to check that it still contains the\r
105         expected known value, jumping to vRegTest1Error if any register contains\r
106         an unexpected value. */\r
107         cmp_x   #0x4444, r4\r
108         jne             vRegTest1Error\r
109         cmp_x   #0x5555, r5\r
110         jne             vRegTest1Error\r
111         cmp_x   #0x6666, r6\r
112         jne             vRegTest1Error\r
113         cmp_x   #0x7777, r7\r
114         jne             vRegTest1Error\r
115         cmp_x   #0x8888, r8\r
116         jne             vRegTest1Error\r
117         cmp_x   #0x9999, r9\r
118         jne             vRegTest1Error\r
119         cmp_x   #0xaaaa, r10\r
120         jne             vRegTest1Error\r
121         cmp_x   #0xbbbb, r11\r
122         jne             vRegTest1Error\r
123         cmp_x   #0xcccc, r12\r
124         jne             vRegTest1Error\r
125         cmp_x   #0xdddd, r13\r
126         jne             vRegTest1Error\r
127         cmp_x   #0xeeee, r14\r
128         jne             vRegTest1Error\r
129         cmp_x   #0xffff, r15\r
130         jne             vRegTest1Error\r
131         \r
132         /* This task is still running without jumping to vRegTest1Error, so increment\r
133         the loop counter so the check task knows the task is running error free. */\r
134         incx.w  &usRegTest1Counter\r
135         \r
136         /* Loop again, performing the same tests. */\r
137         jmp             prvRegTest1Loop\r
138         nop\r
139 \r
140         \r
141         EVEN\r
142         \r
143 vRegTest1Error:\r
144         jmp vRegTest1Error\r
145         nop\r
146         \r
147 /*-----------------------------------------------------------*/\r
148 \r
149 /* See the comments in vRegTest1Task.  This task is the same, it just uses\r
150 different values in its registers. */\r
151 vRegTest2Task:\r
152 \r
153         mov_x   #0x4441, r4\r
154         mov_x   #0x5551, r5\r
155         mov_x   #0x6661, r6\r
156         mov_x   #0x7771, r7\r
157         mov_x   #0x8881, r8\r
158         mov_x   #0x9991, r9\r
159         mov_x   #0xaaa1, r10\r
160         mov_x   #0xbbb1, r11\r
161         mov_x   #0xccc1, r12\r
162         mov_x   #0xddd1, r13\r
163         mov_x   #0xeee1, r14\r
164         mov_x   #0xfff1, r15\r
165         \r
166 prvRegTest2Loop:\r
167 \r
168         cmp_x   #0x4441, r4\r
169         jne             vRegTest2Error\r
170         cmp_x   #0x5551, r5\r
171         jne             vRegTest2Error\r
172         cmp_x   #0x6661, r6\r
173         jne             vRegTest2Error\r
174         cmp_x   #0x7771, r7\r
175         jne             vRegTest2Error\r
176         cmp_x   #0x8881, r8\r
177         jne             vRegTest2Error\r
178         cmp_x   #0x9991, r9\r
179         jne             vRegTest2Error\r
180         cmp_x   #0xaaa1, r10\r
181         jne             vRegTest2Error\r
182         cmp_x   #0xbbb1, r11\r
183         jne             vRegTest2Error\r
184         cmp_x   #0xccc1, r12\r
185         jne             vRegTest2Error\r
186         cmp_x   #0xddd1, r13\r
187         jne             vRegTest2Error\r
188         cmp_x   #0xeee1, r14\r
189         jne             vRegTest2Error\r
190         cmp_x   #0xfff1, r15\r
191         jne             vRegTest2Error\r
192         \r
193         /* Also perform a manual yield, just to increase the scope of the test. */\r
194         calla   #vPortYield\r
195         \r
196         incx.w  &usRegTest2Counter\r
197         jmp             prvRegTest2Loop\r
198         nop\r
199 \r
200         \r
201 vRegTest2Error:\r
202         jmp vRegTest2Error\r
203         nop\r
204 /*-----------------------------------------------------------*/\r
205 \r
206                 \r
207         END\r
208                 \r