home .. forth .. colorforth mail list archive ..

RE: [colorforth] FS/Forth for DOS: crude performance test


I'm trying to send this again, the last time it didn't work...
Just curious why all this XCHGing is required.

My forth doesn't use a PFA, so maybe it is for that?


------------- Begin Forwarded Message -------------


It seems FS/Forth and 4IM both are swapping (exchanging) between the
RSP and PSP (return stack and parameter stack pointers.) Why is this
necessary? Can't the pointers simply be left in their own dedicated
register? 

The reason I'm asking, is that, in order to learn Forth, I ended up
writing a simple DOS based "classical" forth -- to get a better idea of
what was going on internally. I don't recall having to XCHG the 
two stack pointers. Is this for CREATE ... DOES> ? I haven't figured
"DOES>" out yet... 

Sorry for the off-topic question, but since both the Forths mentioned
above swap pointers (and I think Eforth does too.) it is making me wonder 
if I've missed something in my implementation. 


Thanks,

-Lonnie




>> Some things to consider about FS/Forth:
>> 
>> 1.  It's constantly exchanging BP and SP to selectively gain 
>> access to the data
>> stack.  It's aggressive about keeping SP the return stack 
>[...]
>> 
>> 2.  Primitives ARE NOT compiled inline; hence +, -, *, /, 
>> U/MOD, et. al. are
>> all encoded as subroutine calls, which means CALL and RET 
>[...]
>> 
>> Despite these deficiencies (which will utterly disappear in 
>> the Linux version
>> of FS/Forth, which WILL be a MachineForth), FS/Forth is still 
>> slightly faster
>> than PygmyForth.  I am very pleased with the results.  Things 
>> can only improve
>> from here.
>> 
>I think that 4IM ( http://membres.lycos.fr/astrobe ) may interest you.
>I'm also interested in comparing performances of our systems.
>4IM is subroutine threade with code inlining. I've chosen to you AX as stack
>pointer and
>SP as return stack pointer because XCHG AX SP is one byte long and uses only
>3 cycles, which
>allowed me to inline DROP, DUP and co. in the size of a call. 
>> --
>> Samuel A. Falvo II
>> 
>
> Amicalement,
>  Frederic
>
>" The thruth is a horizon"
>
>


------------- End Forwarded Message -------------




---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com