Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Paul E Bennett Newsgroups: comp.lang.forth Subject: Re: Program or be Programmed ! Date: Wed, 24 Dec 2014 14:33:50 +0000 Organization: Hidecs Consultancy Lines: 30 Message-ID: References: <7x8uhxihxz.fsf@ruckus.brouhaha.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Trace: individual.net SDhU/r9r9mTF+nQEHW+9dQ16D3+QHuPX4azeY59QC6Ykd7chz0 Cancel-Lock: sha1:6X6YoFrNxBTvY/ge9DoAhVqCcFQ= User-Agent: KNode/4.11.4 Xref: csiph.com comp.lang.forth:35187 Paul Rubin wrote: > Paul E Bennett writes: >>>> : (DDA) ( S: sin\cos -- sin'\cos' ) >>>> ( This code is the main sine wave generator ) >>>> tuck over >>>> 256 / + -rot >>>> swap 256 / - swap >>>> ; >> Comments on the rest of the code and the coding style (which is my >> rough-out standard) are welcome. > > : h* ( n -- n ) 8 rshift ; > : (DDA) ( sin cos -- sin' cos') 2dup h* >r h* - swap r> + swap ; Thanks Paul, Just tried out the differences. My version was 58 bytes (22 instructions) in Vfxlin. Yours was 4 bytes (2 instructions) for h* and 22 bytes (10 instructions) for (DDA). I might make that change and see how it does speed- wise. -- ******************************************************************** Paul E. Bennett IEng MIET..... Forth based HIDECS Consultancy............. Mob: +44 (0)7811-639972 Tel: +44 (0)1235-510979 Going Forth Safely ..... EBA. www.electric-boat-association.org.uk.. ********************************************************************