1 \ -----------------------------
2 \ MSP-EXP430FR5969_TSTWORDS.4th
3 \ -----------------------------
8 \ -----------------------------------------------------------------------
9 \ test some assembler words and show how to mix FORTH/ASSEMBLER routines
10 \ -----------------------------------------------------------------------
11 LOAD" \misc\TestASM.4th"
13 \ -------------------------------------
14 \ here we returned in the TestWords.4th
15 \ -------------------------------------
20 : LOOP_TEST 8 0 DO I . LOOP
23 LOOP_TEST \ you should see 0 1 2 3 4 5 6 7 -->
26 : LOOP_TEST1 \ n <LOOP_TEST1> ---
34 : FIND_NOTHING \ FIND_NOTHING --
37 LOOP \ 14 cycles by loop
38 ABORT" 25000 x nothing = nothing..."
43 : FIND_TEST \ FIND_TEST <word> --
51 0= IF ABORT" <-- not found !"
52 ELSE ABORT" <-- found !"
56 \ seeking $ word, FIND jumps all words on their first character so time of word loop is 20 cycles
57 \ see FIND in the source file for more information
59 \ FIND_TEST <lastword> result @ 8MHz, monothread : 1,2s
61 \ FIND_TEST $ results @ 8MHz, monothread, 201 words in vocabulary FORTH :
62 \ 27 seconds with only FORTH vocabulary in CONTEXT
63 \ 540 us for one search ( which gives the delay for QNUMBER in INTERPRET routine)
64 \ 2.6866 us / word, 21,49 cycles / word (for 20 cycles calculated (see FIND in source file)
67 \ FIND_TEST $ results @ 8MHz, 2 threads, 201 words in vocabulary FORTH :
68 \ 13 second with only FORTH vocabulary in CONTEXT
69 \ 260 us for one search ( which gives the delay for QNUMBER in INTERPRET routine)
70 \ 1,293 us / word, 10,34 cycles / word
72 \ FIND_TEST $ results @ 8MHz, 4 threads, 201 words in vocabulary FORTH :
73 \ 8 second with only FORTH vocabulary in CONTEXT
74 \ 160 us for one search ( which gives the delay for QNUMBER in INTERPRET routine)
75 \ 0,796 us / word, 6,37 cycles / word
77 \ FIND_TEST $ results @ 8MHz, 8 threads, 201 words in vocabulary FORTH :
78 \ 4.66 second with only FORTH vocabulary in CONTEXT
79 \ 93 us for one search ( which gives the delay for QNUMBER in INTERPRET routine)
80 \ 0,4463 us / word, 3,7 cycles / word
82 \ FIND_TEST $ results @ 8MHz, 16 threads, 201 words in vocabulary FORTH :
83 \ 2,8 second with only FORTH vocabulary in CONTEXT
84 \ 56 us for one search ( which gives the delay for QNUMBER in INTERPRET routine)
85 \ 0,278 us / word, 2,22 cycles / word
93 KEY EMIT \ wait for a KEY, then emit it