Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #35187

Re: Program or be Programmed !

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 <Paul_E.Bennett@topmail.co.uk>
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 <cg016fFtk4aU1@mid.individual.net> (permalink)
References <cfrte2Frt26U1@mid.individual.net> <OcydnVONz8oAFwTJnZ2dnUU7-a2dnZ2d@supernews.com> <cfu8olFga0mU1@mid.individual.net> <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

Show key headers only | View raw


Paul Rubin wrote:

> Paul E Bennett <Paul_E.Bennett@topmail.co.uk> 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.....<email://Paul_E.Bennett@topmail.co.uk>
Forth based HIDECS Consultancy.............<http://www.hidecs.co.uk>
Mob: +44 (0)7811-639972
Tel: +44 (0)1235-510979
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk..
********************************************************************

Back to comp.lang.forth | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: Program or be Programmed ! Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-12-23 01:05 +0000
  Re: Program or be Programmed ! Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-12-23 09:30 -0600
    Re: Program or be Programmed ! Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-12-23 22:30 +0000
      Re: Program or be Programmed ! Paul Rubin <no.email@nospam.invalid> - 2014-12-24 00:13 -0800
        Re: Program or be Programmed ! Paul E Bennett <Paul_E.Bennett@topmail.co.uk> - 2014-12-24 14:33 +0000

csiph-web