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

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


> an implementation using SI does:
> DROP LODSW
> DUP  MOV [SI],AX DEC SI DEC SI ( or something like that)
> whereas with BP or AX as stack pointers that are swapped with SP to use
> push/pop, DROP and DUP are equal:
> DROP XCHG BP SP  POP AX XCHG BP SP
> DUP XCHG BP SP PUSH AX XCHG BP SP
> But that's not only about DUP and DROP, that's also about binary operators
> also, they perform a kind of DROP
> ( they take 2 parameters and leave 1 result)

OK, I see.  I believe that the code for DUP and DROP can be reliably factored
out of all primitives, regardless of register usage.

> A shortage in my brain. What I wanted to write is that if you don't care
> enough about the size of the code you inline you may end-up with this kind
> of implementation. However sometimes code grows faster than you think. An
> inline string may send a THEN out of range if inline too much or too big
> code chuncks.

This is true; however, my coding style is highly factored.  It's not uncommon
to have only a single word between IF and THEN.  I think the largest for me is
about eight words.  :)  Strings are definitely something I've not considered
before, but it's good to keep in mind.

--
Samuel A. Falvo II


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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