- for (;;)\r
- {\r
- /* Change all of the Context sensitive registers (except SP and RA). */\r
- __asm( " mov %d0, 7 \n" \\r
- " mov %d1, 6 \n" \\r
- " mov %d2, 5 \n" \\r
- " mov %d3, 4 \n" \\r
- " mov %d4, 3 \n" \\r
- " mov %d5, 2 \n" \\r
- " mov %d6, 1 \n" \\r
- " mov %d7, 0 \n" \\r
- " mov %d8, 15 \n" \\r
- " mov %d9, 14 \n" \\r
- " mov %d10, 13 \n" \\r
- " mov %d11, 12 \n" \\r
- " mov %d12, 11 \n" \\r
- " mov %d13, 10 \n" \\r
- " mov %d14, 9 \n" \\r
- " mov %d15, 8 \n" \\r
- " mov.a %a2, 14 \n" \\r
- " mov.a %a3, 13 \n" \\r
- " mov.a %a4, 12 \n" \\r
- " mov.a %a5, 7 \n" \\r
- " mov.a %a6, 6 \n" \\r
- " mov.a %a7, 5 \n" \\r
- " mov.a %a12, 4 \n" \\r
- " mov.a %a13, 3 \n" \\r
- " mov.a %a14, 2 \n" );\r
- /* Yield to force a context switch. */\r
- taskYIELD();\r
- /* Check the values of the registers. */\r
- __asm( " eq %d0, %d0, 7 \n" \\r
- " jne %d0, 1, _task2_loop \n" \\r
- " eq %d1, %d1, 6 \n" \\r
- " jne %d1, 1, _task2_loop \n" \\r
- " eq %d2, %d2, 5 \n" \\r
- " jne %d2, 1, _task2_loop \n" \\r
- " eq %d3, %d3, 4 \n" \\r
- " jne %d3, 1, _task2_loop \n" \\r
- " eq %d4, %d4, 3 \n" \\r
- " jne %d4, 1, _task2_loop \n" \\r
- " eq %d5, %d5, 2 \n" \\r
- " jne %d5, 1, _task2_loop \n" \\r
- " eq %d6, %d6, 1 \n" \\r
- " jne %d6, 1, _task2_loop \n" \\r
- " eq %d7, %d7, 0 \n" \\r
- " jne %d7, 1, _task2_loop \n" \\r
- " eq %d8, %d8, 15 \n" \\r
- " jne %d8, 1, _task2_loop \n" \\r
- " eq %d9, %d9, 14 \n" \\r
- " jne %d9, 1, _task2_loop \n" \\r
- " eq %d10, %d10, 13 \n" \\r
- " jne %d10, 1, _task2_loop \n" \\r
- " eq %d11, %d11, 12 \n" \\r
- " jne %d11, 1, _task2_loop \n" \\r
- " eq %d12, %d12, 11 \n" \\r
- " jne %d12, 1, _task2_loop \n" \\r
- " eq %d13, %d13, 10 \n" \\r
- " jne %d13, 1, _task2_loop \n" \\r
- " eq %d14, %d14, 9 \n" \\r
- " jne %d14, 1, _task2_loop \n" \\r
- " eq %d15, %d15, 8 \n" \\r
- " jne %d15, 1, _task2_loop \n" \\r
- " mov.a %a15, 14 \n" \\r
- " jne.a %a15, %a2, _task2_loop \n" \\r
- " mov.a %a15, 13 \n" \\r
- " jne.a %a15, %a3, _task2_loop \n" \\r
- " mov.a %a15, 12 \n" \\r
- " jne.a %a15, %a4, _task2_loop \n" \\r
- " mov.a %a15, 7 \n" \\r
- " jne.a %a15, %a5, _task2_loop \n" \\r
- " mov.a %a15, 6 \n" \\r
- " jne.a %a15, %a6, _task2_loop \n" \\r
- " mov.a %a15, 5 \n" \\r
- " jne.a %a15, %a7, _task2_loop \n" \\r
- " mov.a %a15, 4 \n" \\r
- " jne.a %a15, %a12, _task2_loop \n" \\r
- " mov.a %a15, 3 \n" \\r
- " jne.a %a15, %a13, _task2_loop \n" \\r
- " mov.a %a15, 2 \n" \\r
- " jne.a %a15, %a14, _task2_loop \n" \\r
- " j _task2_skip \n" \\r
- "_task2_loop: \n" \\r
- " j _task2_loop \n" \\r
- "_task2_skip: \n" );\r
-\r
- /* Load the parameter address from the stack and modify the value. */\r
- __asm volatile( \\r
- " ld.w %d15, [%sp]4 \n" \\r
- " add %d15, %d15, 1 \n" \\r
- " st.w [%sp]4, %d15 \n" \\r
- " ld.a %a4, [%sp] \n" \\r
- " st.w [%a4], %d15 \n" );\r
- }\r
+ /* Change all of the Context sensitive registers (except SP and RA). */\r
+ __asm volatile( " mov %d0, 7 \n" \\r
+ " mov %d1, 1 \n" \\r
+ " mov %d2, 5 \n" \\r
+ " mov %d3, 4 \n" \\r
+ " mov %d4, 3 \n" \\r
+ " mov %d5, 2 \n" \\r
+ " mov %d6, 1 \n" \\r
+ " mov %d7, 0 \n" \\r
+ " mov %d8, 15 \n" \\r
+ " mov %d9, 14 \n" \\r
+ " mov %d10, 13 \n" \\r
+ " mov %d11, 12 \n" \\r
+ " mov %d12, 11 \n" \\r
+ " mov %d13, 10 \n" \\r
+ " mov %d14, 9 \n" \\r
+ " mov %d15, 8 \n" \\r
+ " mov.a %a2, 14 \n" \\r
+ " mov.a %a3, 13 \n" \\r
+ " mov.a %a4, 12 \n" \\r
+ " mov.a %a5, 7 \n" \\r
+ " mov.a %a6, 6 \n" \\r
+ " mov.a %a7, 5 \n" \\r
+ " mov.a %a12, 4 \n" \\r
+ " mov.a %a13, 3 \n" \\r
+ " mov.a %a14, 2 \n" );\r
+ /* Yield to force a context switch. */\r
+ taskYIELD();\r
+\r
+ /* Check the values of the registers. */\r
+ __asm volatile( " _task2_loop: \n" \\r
+ " eq %d1, %d0, 7 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d1, 1 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d2, 5 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d3, 4 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d4, 3 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d5, 2 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d6, 1 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d7, 0 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d8, 15 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d9, 14 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d10, 13 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d11, 12 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d12, 11 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d13, 10 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d14, 9 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " eq %d1, %d15, 8 \n" \\r
+ " jne %d1, 1, _task2_error_loop \n" \\r
+ " mov.a %a15, 14 \n" \\r
+ " jne.a %a15, %a2, _task2_error_loop \n" \\r
+ " mov.a %a15, 13 \n" \\r
+ " jne.a %a15, %a3, _task2_error_loop \n" \\r
+ " mov.a %a15, 12 \n" \\r
+ " jne.a %a15, %a4, _task2_error_loop \n" \\r
+ " mov.a %a15, 7 \n" \\r
+ " jne.a %a15, %a5, _task2_error_loop \n" \\r
+ " mov.a %a15, 6 \n" \\r
+ " jne.a %a15, %a6, _task2_error_loop \n" \\r
+ " mov.a %a15, 5 \n" \\r
+ " jne.a %a15, %a7, _task2_error_loop \n" \\r
+ " mov.a %a15, 4 \n" \\r
+ " jne.a %a15, %a12, _task2_error_loop \n" \\r
+ " mov.a %a15, 3 \n" \\r
+ " jne.a %a15, %a13, _task2_error_loop \n" \\r
+ " mov.a %a15, 2 \n" \\r
+ " jne.a %a15, %a14, _task2_error_loop \n" \\r
+ " j _task2_skip_error_loop \n" \\r
+ "_task2_error_loop: \n" /* Hitting this error loop will stop the counter incrementing, allowing the check task to recognise an error. */ \\r
+ " j _task2_error_loop \n" \\r
+ "_task2_skip_error_loop: \n" );\r
+\r
+ /* Load the parameter address from the stack and modify the value. */\r
+ __asm volatile( " ld.w %d1, [%sp]4 \n" \\r
+ " add %d1, %d1, 1 \n" \\r
+ " st.w [%sp]4, %d1 \n" \\r
+ " ld.a %a15, [%sp] \n" \\r
+ " st.w [%a15], %d1 \n" \\r
+ " j _task2_loop \n" );\r