Sujet : Re: OOS approach revisited
De : zbigniew2011 (at) *nospam* gmail.com (LIT)
Groupes : comp.lang.forthDate : 27. Jun 2025, 17:55:14
Autres entêtes
Organisation : novaBBS
Message-ID : <bc63996456fe967e5c66d17cbbeb21c2@www.novabbs.com>
References : 1 2 3 4 5 6
User-Agent : Rocksolid Light
It really depends on how counted loops are implemented.
Most CPUs have operators for register-based count-down loops
that are blazingly fast.
>
If they can be used within Forth-based loop constructs
I would expect a greater speed increase than what you measured.
In that old fig-Forth it's rather short and simple:
sqHeader '(LOOP)'
XLOOP dw $ + 2
mov BX,1
XLOO1: add [BP],BX
mov AX,[BP]
sub AX,[BP+2]
xor AX,BX
js BRAN1
add BP,4
inc SI
inc SI
jmp NEXT
It doesn't look that bad. Can it be
done even shorter?
--