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