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