To put things in perspective, Fleet Forth's new MATCH was used to find DECIMAL in the following screen from Blazin' Forth's system loader.
Code:
( I/O EXTENSIONS PADDLE PADDLE BUTTON SDBJUN85 )
HEX
CODE PADDLE SEI, DC02 LDA, PHA, 0C0 # LDA, DC02 STA,
BOT LDA, .A LSR, 80 # LDA, TAY, CS IF, .A LSR, THEN,
DC00 STA, BEGIN, NOP, DEY, 0< UNTIL,
BOT LDA, 1 # EOR, TAY, D419 ,Y LDA,
BOT STA, PLA, DC02 STA, CLI, NEXT JMP, END-CODE
CODE PADDLEBUTTON BOT LDA, 2 # CMP, CS
IF, DC01 LDA, ELSE, DC00 LDA, THEN, PHA,
BOT LDA, .A LSR, PLA, CS IF, 8 # AND, ELSE, 4 # AND, THEN,
0= IF, DEY, THEN, TYA, PHA, PUT JMP, END-CODE
DECIMAL
To obtain more acurate timing data, MATCH was run in a test word to get it to run the same match one thousand times. The times were on a Commodore 64 simulation running at 1 MHz.
Code:
: TIMEIT
' 0 0 JIFFY! EXECUTE JIFFY@ CR D. ;
DEFER TESTWORD
: TESTIT
0
DO
TESTWORD
LOOP ;
On the Commodore 64 sixty (60) jiffies are in one second.
Running the following testword took 36 jiffies.
Code:
: TEST
2OVER 2OVER
2DROP
2DROP ;
' TEST IS TESTWORD
17 BLOCK B/BUF " DECIMAL" COUNT
1000 TIMEIT TESTIT
2DROP 2DROP
Running MATCHTEST took 5867 jiffies.
Code:
: MATCHTEST
2OVER 2OVER MATCH 2DROP ;
' MATCHTEST IS TESTWORD
17 BLOCK B/BUF " DECIMAL" COUNT
1000 TIMEIT TESTIT
2DROP 2DROP
Subtracting the overhead of duplicating parameters and dropping results, running MATCH 1000 times took around 5831 jiffies or about 0.0972 seconds to run once to find DECIMAL in this dense screen of Blazin' Forth system loader source.
MATCH took closer to 0.04185 seconds to find MAL in that same screen.