OSDN Git Service

Looking at incrmenters
authorJoel Matthew Rees <joel.rees@gmail.com>
Mon, 6 Feb 2023 13:13:58 +0000 (22:13 +0900)
committerJoel Matthew Rees <joel.rees@gmail.com>
Mon, 6 Feb 2023 13:13:58 +0000 (22:13 +0900)
FIG68K.S

index a61548e..afbefe4 100644 (file)
--- a/FIG68K.S
+++ b/FIG68K.S
@@ -2283,10 +2283,11 @@ COLUMS  DC.L    DOUSER
 ** ( n --- ninc ) \r
 ** Characteristic of an INCREMENTER.\r
 ** This is probably too naive:\r
-* DOINC        MOVE.L  NATWID(W),D0    ; Get the increment,\r
-*      ADD.L   D0,(PSP)        ; and add it.\r
-*      BRA.W   NEXT\r
+DOINC  MOVE.L  NATWID(W),D0    ; Get the increment,\r
+       ADD.L   D0,(PSP)        ; and add it.\r
+       BRA.W   NEXT\r
 * Compiling word should check that it is compiling a CONSTANT.\r
+* On the other hand, there are reasons not to:\r
 *\r
 * ======>>  83  <<\r
 * ( n --- n+1 )\r
@@ -2300,20 +2301,18 @@ COLUMS  DC.L    DOUSER
 ONEP   DC.L    DOCOL,ONE,PLUS\r
        DC.L    SEMIS\r
 ** Greedy alternative:\r
-* ONEP DC.L    *+NATWID\r
-*      LDD     ,U\r
-*      ADDD    ONEV,PCR\r
-*      STD     ,U\r
-*      LBRA    NEXT\r
+ONEP1  DC.L    *+NATWID\r
+       MOVE.L  (PSP),D0\r
+       ADD.L   ONEV(PC),D0\r
+       MOVE.L  D0,(PSP)\r
+       BRA.W   NEXT\r
 * Naive alternative:\r
-* ONEP DC.L    DOINC\r
-*      DC.L    1\r
+ONEP2  DC.L    DOINC\r
+       DC.L    1\r
 * Naive alternative:\r
-* ONEP DC.L    *+NATWID\r
-*      LDD     ,U\r
-*      ADDD    #1       ; It's hard to imagine 1+ being other than 1.\r
-*      STD     ,U\r
-*      LBRA    NEXT\r
+ONEP3  DC.L    *+NATWID\r
+       ADD.L   #1,(PSP) ; It's hard to imagine 1+ being other than 1.\r
+       BRA.W   NEXT\r
 *\r
 * ======>>  84  <<\r
 * ( n --- n+2 )\r
@@ -2489,7 +2488,6 @@ PSCODE:
 COMPIL:\r
 SMUDGE:\r
 LBRAK:\r
-COMMA:\r
 \r
 \r
 *\r