Hi Emmanuel,
Have you done any work with your board? I'd like to hear about it.
Here is a test of my knowledge of the GA144 instruction set. At first
pass, I expect the machine code produced by your source was
@p push . .
1000 (literal data)
outerloop:
@p push . .
1000 (literal data)
@p drop unext .
0 (literal data)
next outerloop
The inner loop (@p drop unext) would take (5 + 1.4 + 2.4) or 7.8 ns or
7.8 us for the total inner loop. The outer loop only adds some 15 ns to
this time for an estimated <8 ms total time.
One important side effect is that this code won't work! Each time
through the inner loop when the literal 0 is accessed the PC will be
incremented and when the loop is exited it will be 999 words past the
location closing the outer loop. So you can't use a literal in a unext
loop.
One fix it to use a different way to get the literal 0. The data stack
could be initialized to all 0s before the loop is entered with one
literal and 9 dups. Then the code could just do the drop, but that is
not really in the spirit of the benchmark. Otherwise the instructions
DUP DUP OR could be used to generate a 0 from whatever is on the stack.
But then the loop would be five opcodes meaning you can't use a unext
loop. Fastest would be to store a 0 in the A register, then it could be
retrieved with the a instruction as
a drop unext .
This would be only 5.2 ns per inner loop or <6 ms for the full
benchmark. Obviously what was done was to use the much slower and
larger next rather than the micronext instruction.
@p push . .
1000 (literal data)
outerloop:
@p push . .
1000 (literal data)
innerloop:
@p drop . .
0 (literal data)
next innerloop
next outerloop
Now the PC gets reset to the correct place every time through the loop
and the literal is read correctly. But the timing is... (5 + 1.4 + 1.4
+ 1.4 + 1.2 + 5.2) or 15.6 ns or nearly 16 ms total which is about what
you measured.
Unfortunately this benchmark does not show the GA144 running at optimal
speed which is three times faster. But to get that sort of optimal
utility takes a lot of work to learn how and to do such optimizations.
Rick
PS Gavino means well, he is just a misguided youth.