From: Joel Matthew Rees Date: Mon, 6 Feb 2023 13:13:58 +0000 (+0900) Subject: Looking at incrmenters X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d88af22f6c3adf4e6871246e7fea6276e327af4f;p=fig-forth-68000%2Ffig-forth-68000.git Looking at incrmenters --- diff --git a/FIG68K.S b/FIG68K.S index a61548e..afbefe4 100644 --- a/FIG68K.S +++ b/FIG68K.S @@ -2283,10 +2283,11 @@ COLUMS DC.L DOUSER ** ( n --- ninc ) ** Characteristic of an INCREMENTER. ** This is probably too naive: -* DOINC MOVE.L NATWID(W),D0 ; Get the increment, -* ADD.L D0,(PSP) ; and add it. -* BRA.W NEXT +DOINC MOVE.L NATWID(W),D0 ; Get the increment, + ADD.L D0,(PSP) ; and add it. + BRA.W NEXT * Compiling word should check that it is compiling a CONSTANT. +* On the other hand, there are reasons not to: * * ======>> 83 << * ( n --- n+1 ) @@ -2300,20 +2301,18 @@ COLUMS DC.L DOUSER ONEP DC.L DOCOL,ONE,PLUS DC.L SEMIS ** Greedy alternative: -* ONEP DC.L *+NATWID -* LDD ,U -* ADDD ONEV,PCR -* STD ,U -* LBRA NEXT +ONEP1 DC.L *+NATWID + MOVE.L (PSP),D0 + ADD.L ONEV(PC),D0 + MOVE.L D0,(PSP) + BRA.W NEXT * Naive alternative: -* ONEP DC.L DOINC -* DC.L 1 +ONEP2 DC.L DOINC + DC.L 1 * Naive alternative: -* ONEP DC.L *+NATWID -* LDD ,U -* ADDD #1 ; It's hard to imagine 1+ being other than 1. -* STD ,U -* LBRA NEXT +ONEP3 DC.L *+NATWID + ADD.L #1,(PSP) ; It's hard to imagine 1+ being other than 1. + BRA.W NEXT * * ======>> 84 << * ( n --- n+2 ) @@ -2489,7 +2488,6 @@ PSCODE: COMPIL: SMUDGE: LBRAK: -COMMA: *