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