]> git.sur5r.net Git - freertos/blobdiff - Demo/NEC_78K0R_IAR/RegTest.s26
Continue 78K0R development.
[freertos] / Demo / NEC_78K0R_IAR / RegTest.s26
index 9b51b407c84fe591ba2f284bc828b45124a81981..a95758b64de54c4e0e0e44d19b0f0e6e667be386 100644 (file)
 ;\r
 ;------------------------------------------------------------------------------\r
 \r
+\r
+;\r
+; This file defines the RegTest tasks as described at the top of main.c\r
+;\r
+\r
 ;------------------------------------------------------------------------------\r
 \r
 #if __CORE__ != __78K0R__\r
@@ -53,7 +58,7 @@
 ;\r
 ;   Input:  NONE\r
 ;\r
-;   Call:   CALL    vRegTest1\r
+;   Call:   Created as a task.\r
 ;\r
 ;   Output: NONE\r
 ;\r
@@ -61,6 +66,7 @@
     RSEG CODE:CODE\r
 vRegTest1:\r
 \r
+       ; First fill the registers.\r
        MOVW    AX, #0x1122\r
        MOVW    BC, #0x3344\r
        MOVW    DE, #0x5566\r
@@ -69,10 +75,19 @@ vRegTest1:
        MOV             ES, #0x02\r
 \r
 loop1:\r
+       ; Continuously check that the register values remain at their expected\r
+       ; values.  The BRK is to test the yield.  This task runs at low priority\r
+       ; so will also regularly get preempted.\r
        BRK\r
+\r
+       ; Compare with the expected value.\r
        CMPW    AX, #0x1122\r
        BZ              +5\r
+       ; Jump over the branch to vRegTestError() if the register contained the\r
+       ; expected value - otherwise flag an error by executing vRegTestError().\r
        BR              vRegTestError   \r
+\r
+       ; Repeat for all the registers.\r
        MOVW    AX, BC\r
        CMPW    AX, #0x3344\r
        BZ              +5\r
@@ -104,7 +119,7 @@ loop1:
 ;\r
 ;   Input:  NONE\r
 ;\r
-;   Call:   CALL    vRegTest1\r
+;   Call:   Created as a task.\r
 ;\r
 ;   Output: NONE\r
 ;\r