]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/reg_task.asm
Get main_full.c working in the RM48 demo.
[freertos] / FreeRTOS / Demo / CORTEX_R4_RM48_CCS5 / demo / reg_task.asm
1 ;-------------------------------------------------\r
2 ;\r
3                 .def    vRegTestTask1\r
4                 .ref    usRegTest1Counter\r
5                 .text\r
6                 .arm\r
7 ;\r
8 vRegTestTask1:\r
9                 ; Fill each general purpose register with a known value.\r
10                 mov             r0,  #0xFF\r
11                 mov             r1,  #0x11\r
12                 mov             r2,  #0x22\r
13                 mov             r3,  #0x33\r
14                 mov     r4,  #0x44              \r
15                 mov     r5,  #0x55\r
16                 mov     r6,  #0x66\r
17                 mov     r7,  #0x77\r
18                 mov     r8,  #0x88\r
19                 mov     r9,  #0x99\r
20                 mov     r10, #0xAA\r
21                 mov     r11, #0xBB\r
22                 mov     r12, #0xCC\r
23                 mov             r14, #0xEE\r
24         \r
25 regTestLoop1:\r
26                 ; Force yeild\r
27                 swi             #0\r
28 \r
29                 ; Test each general purpose register to check that it still contains the\r
30                 ; expected known value, jumping to vRegTest1Error if any register contains\r
31                 ; an unexpected value.\r
32                 cmp             r0, #0xFF\r
33                 bne             regTestError1           \r
34                 cmp             r1, #0x11\r
35                 bne             regTestError1           \r
36                 cmp             r2, #0x22\r
37                 bne             regTestError1           \r
38                 cmp             r3, #0x33\r
39                 bne             regTestError1           \r
40                 cmp             r4, #0x44\r
41                 bne             regTestError1           \r
42                 cmp             r5, #0x55\r
43                 bne             regTestError1           \r
44                 cmp             r6, #0x66\r
45                 bne             regTestError1           \r
46                 cmp             r7, #0x77\r
47                 bne             regTestError1           \r
48                 cmp             r8, #0x88\r
49                 bne             regTestError1           \r
50                 cmp             r9, #0x99\r
51                 bne             regTestError1           \r
52                 cmp             r10, #0xAA\r
53                 bne             regTestError1           \r
54                 cmp             r11, #0xBB\r
55                 bne             regTestError1           \r
56                 cmp             r12, #0xCC\r
57                 bne             regTestError1           \r
58                 cmp             r14, #0xEE\r
59                 bne             regTestError1           \r
60         \r
61                 ; This task is still running without jumping to vRegTest1Error, so increment\r
62                 ; the loop counter so the check task knows the task is running error free.\r
63                 stmfd   sp!, { r0-r1 }\r
64                 ldr             r0, count1\r
65                 ldr             r1, [r0]\r
66                 add             r1, r1, #1\r
67                 str     r1, [r0]\r
68                 ldmfd   sp!, { r0-r1 }\r
69                 \r
70                 ; Loop again, performing the same tests.\r
71                 b               regTestLoop1\r
72 \r
73 count1  .word   usRegTest1Counter\r
74         \r
75 regTestError1:\r
76                 b       regTestError1\r
77 \r
78 \r
79 ;-------------------------------------------------\r
80 ;\r
81                 .def    vRegTestTask2\r
82                 .ref    usRegTest2Counter\r
83                 .text\r
84                 .arm\r
85 ;\r
86 vRegTestTask2:\r
87                 ; Fill each general purpose register with a known value.\r
88                 mov             r0,  #0xFF000000\r
89                 mov             r1,  #0x11000000\r
90                 mov             r2,  #0x22000000\r
91                 mov             r3,  #0x33000000\r
92                 mov     r4,  #0x44000000                \r
93                 mov     r5,  #0x55000000\r
94                 mov     r6,  #0x66000000\r
95                 mov     r7,  #0x77000000\r
96                 mov     r8,  #0x88000000\r
97                 mov     r9,  #0x99000000\r
98                 mov     r10, #0xAA000000\r
99                 mov     r11, #0xBB000000\r
100                 mov     r12, #0xCC000000\r
101                 mov     r14, #0xEE000000\r
102         \r
103 regTestLoop2:\r
104                 ; Force yeild\r
105                 swi             #0\r
106 \r
107                 ; Test each general purpose register to check that it still contains the\r
108                 ; expected known value, jumping to vRegTest1Error if any register contains\r
109                 ; an unexpected value.\r
110                 cmp             r0, #0xFF000000\r
111                 bne             regTestError2           \r
112                 cmp             r1, #0x11000000\r
113                 bne             regTestError2   \r
114                 cmp             r2, #0x22000000\r
115                 bne             regTestError2   \r
116                 cmp             r3, #0x33000000\r
117                 bne             regTestError2   \r
118                 cmp             r4, #0x44000000\r
119                 bne             regTestError2   \r
120                 cmp             r5, #0x55000000\r
121                 bne             regTestError2   \r
122                 cmp             r6, #0x66000000\r
123                 bne             regTestError2   \r
124                 cmp             r7, #0x77000000\r
125                 bne             regTestError2   \r
126                 cmp             r8, #0x88000000\r
127                 bne             regTestError2   \r
128                 cmp             r9, #0x99000000\r
129                 bne             regTestError2   \r
130                 cmp             r10, #0xAA000000\r
131                 bne             regTestError2   \r
132                 cmp             r11, #0xBB000000\r
133                 bne             regTestError2   \r
134                 cmp             r12, #0xCC000000\r
135                 bne             regTestError2   \r
136                 cmp     r14, #0xEE000000\r
137                 bne             regTestError2   \r
138         \r
139                 ; This task is still running without jumping to vRegTest1Error, so increment\r
140                 ; the loop counter so the check task knows the task is running error free.\r
141                 stmfd   sp!, { r0-r1 }\r
142                 ldr             r0, count2\r
143                 ldr             r1, [r0]\r
144                 add             r1, r1, #1\r
145                 str     r1, [r0]\r
146                 ldmfd   sp!, { r0-r1 }\r
147                 \r
148                 ; Loop again, performing the same tests.\r
149                 b               regTestLoop2\r
150 \r
151 count2  .word   usRegTest2Counter\r
152         \r
153 regTestError2:\r
154                 b       regTestError2\r
155 \r
156 ;-------------------------------------------------\r
157         \r
158         \r
159         \r