]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430X_MSP430FR5969_LaunchPad_IAR_CCS/CCS_Only/RegTest.asm
Update version number in readiness for V10.3.0 release. Sync SVN with reviewed releas...
[freertos] / FreeRTOS / Demo / MSP430X_MSP430FR5969_LaunchPad_IAR_CCS / CCS_Only / RegTest.asm
1 ;\r
2 ;/*\r
3 ; * FreeRTOS Kernel V10.3.0\r
4 ; * Copyright (C) 2020 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
5 ; *\r
6 ; * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
7 ; * this software and associated documentation files (the "Software"), to deal in\r
8 ; * the Software without restriction, including without limitation the rights to\r
9 ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
10 ; * the Software, and to permit persons to whom the Software is furnished to do so,\r
11 ; * subject to the following conditions:\r
12 ; *\r
13 ; * The above copyright notice and this permission notice shall be included in all\r
14 ; * copies or substantial portions of the Software.\r
15 ; *\r
16 ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
17 ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
18 ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
19 ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
20 ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
21 ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
22 ; *\r
23 ; * http://www.FreeRTOS.org\r
24 ; * http://aws.amazon.com/freertos\r
25 ; *\r
26 ; * 1 tab == 4 spaces!\r
27 ; */\r
28 \r
29 ; * The definition of the "register test" tasks, as described at the top of\r
30 ; * main.c\r
31 \r
32         .include data_model.h\r
33 \r
34         .if $DEFINED( __LARGE_DATA_MODEL__ )\r
35                 .define "cmp.a", cmp_x\r
36                 .define "incx.w", inc_x\r
37         .else\r
38                 .define "cmp.w", cmp_x\r
39                 .define "inc.w", inc_x\r
40         .endif\r
41 \r
42 \r
43         .global usRegTest1LoopCounter\r
44         .global usRegTest2LoopCounter\r
45         .global vPortYield\r
46         \r
47         .def vRegTest1Implementation\r
48         .def vRegTest2Implementation\r
49 \r
50         .text\r
51         \r
52         .align 2\r
53 vRegTest1Implementation: .asmfunc\r
54 \r
55         ; Fill each general purpose register with a known value.\r
56         mov_x   #0x4444, r4\r
57         mov_x   #0x5555, r5\r
58         mov_x   #0x6666, r6\r
59         mov_x   #0x7777, r7\r
60         mov_x   #0x8888, r8\r
61         mov_x   #0x9999, r9\r
62         mov_x   #0xaaaa, r10\r
63         mov_x   #0xbbbb, r11\r
64         mov_x   #0xcccc, r12\r
65         mov_x   #0xdddd, r13\r
66         mov_x   #0xeeee, r14\r
67         mov_x   #0xffff, r15\r
68         \r
69 prvRegTest1Loop:\r
70 \r
71         ; Test each general purpose register to check that it still contains the\r
72         ; expected known value, jumping to vRegTest1Error if any register contains\r
73         ; an unexpected value.\r
74         cmp_x   #0x4444, r4\r
75         jne             vRegTest1Error\r
76         cmp_x   #0x5555, r5\r
77         jne             vRegTest1Error\r
78         cmp_x   #0x6666, r6\r
79         jne             vRegTest1Error\r
80         cmp_x   #0x7777, r7\r
81         jne             vRegTest1Error\r
82         cmp_x   #0x8888, r8\r
83         jne             vRegTest1Error\r
84         cmp_x   #0x9999, r9\r
85         jne             vRegTest1Error\r
86         cmp_x   #0xaaaa, r10\r
87         jne             vRegTest1Error\r
88         cmp_x   #0xbbbb, r11\r
89         jne             vRegTest1Error\r
90         cmp_x   #0xcccc, r12\r
91         jne             vRegTest1Error\r
92         cmp_x   #0xdddd, r13\r
93         jne             vRegTest1Error\r
94         cmp_x   #0xeeee, r14\r
95         jne             vRegTest1Error\r
96         cmp_x   #0xffff, r15\r
97         jne             vRegTest1Error\r
98         \r
99         ; This task is still running without jumping to vRegTest1Error, so increment\r
100         ; the loop counter so the check task knows the task is running error free.\r
101         inc_x   &usRegTest1LoopCounter\r
102         \r
103         ; Loop again, performing the same tests.\r
104         jmp             prvRegTest1Loop\r
105         nop\r
106         \r
107 vRegTest1Error:\r
108         jmp vRegTest1Error\r
109         nop\r
110         .endasmfunc     \r
111 ; -----------------------------------------------------------\r
112 \r
113 ; See the comments in vRegTest1Implementation.  This task is the same, it just uses\r
114 ; different values in its registers.\r
115         .align 2\r
116 vRegTest2Implementation: .asmfunc\r
117 \r
118         mov_x   #0x4441, r4\r
119         mov_x   #0x5551, r5\r
120         mov_x   #0x6661, r6\r
121         mov_x   #0x7771, r7\r
122         mov_x   #0x8881, r8\r
123         mov_x   #0x9991, r9\r
124         mov_x   #0xaaa1, r10\r
125         mov_x   #0xbbb1, r11\r
126         mov_x   #0xccc1, r12\r
127         mov_x   #0xddd1, r13\r
128         mov_x   #0xeee1, r14\r
129         mov_x   #0xfff1, r15\r
130         \r
131 prvRegTest2Loop:\r
132 \r
133         cmp_x   #0x4441, r4\r
134         jne             vRegTest2Error\r
135         cmp_x   #0x5551, r5\r
136         jne             vRegTest2Error\r
137         cmp_x   #0x6661, r6\r
138         jne             vRegTest2Error\r
139         cmp_x   #0x7771, r7\r
140         jne             vRegTest2Error\r
141         cmp_x   #0x8881, r8\r
142         jne             vRegTest2Error\r
143         cmp_x   #0x9991, r9\r
144         jne             vRegTest2Error\r
145         cmp_x   #0xaaa1, r10\r
146         jne             vRegTest2Error\r
147         cmp_x   #0xbbb1, r11\r
148         jne             vRegTest2Error\r
149         cmp_x   #0xccc1, r12\r
150         jne             vRegTest2Error\r
151         cmp_x   #0xddd1, r13\r
152         jne             vRegTest2Error\r
153         cmp_x   #0xeee1, r14\r
154         jne             vRegTest2Error\r
155         cmp_x   #0xfff1, r15\r
156         jne             vRegTest2Error\r
157         \r
158         ; Also perform a manual yield, just to increase the scope of the test.\r
159         call_x  #vPortYield\r
160         \r
161         inc_x   &usRegTest2LoopCounter\r
162         jmp             prvRegTest2Loop\r
163         nop\r
164 \r
165         \r
166 vRegTest2Error:\r
167         jmp vRegTest2Error\r
168         nop\r
169         .endasmfunc\r
170 ; /*-----------------------------------------------------------\r
171 \r
172                 \r
173         .end\r
174                 \r