Re: [Flashforth-devel] C stack - passing the params (pic24/33)
Brought to you by:
oh2aun
From: pito <pi...@vo...> - 2014-07-16 07:49:28
|
It works basically, but the order of the operands and its words is weird, so I have to swap everything before calling Cfsub. So the order of the shorts passed needs to be rearranged.. "30000 - 10000" = 10000 s>f swap 30000 s>f swap Cf- f. 20000.0 ok<#,ram> However, even with 2 addtional swaps I get following result for Cfsub: forth version: bench- 2.72317E3 CPU INSTRs per f- ok<#,ram> Cf- version: bench- 283.740E0 CPU INSTRs per f- ok<#,ram> So the C version of the f- is ~10x faster than the forth version. Nice... Pito ______________________________________________________________ > Od: Mikael Nordman <mik...@pp...> > Komu: <pi...@vo...>, <fla...@li...> > Datum: 16.07.2014 08:53 > Předmět: Re: [Flashforth-devel] C stack - passing the params (pic24/33) > >Probably, but check the xc16 help section. I think it describes the parameter passing. > >Mike > >Sent from my LG Mobile > >------ Original message------ > >From: pito > >Date: Wed, 16/07/2014 02:52 > >To: flashforth-devel; > >Subject:[Flashforth-devel] C stack - passing the params (pic24/33) > >In the C example we pass a single 16bit short param: mov [W14], W0 .extern C4add call _C4add mov W0, [W14] So my current understanding is to pass 4 shorts (2 floats) would mean something like this: ( f1l f1h f2l f2h -- fl fh ) mov [W14--], W0 ; f2h mov [W14--], W1 ; f2l mov [W14--], W2 ; f1h mov [W14], W3 ; f1l .extern Cfadd call _Cfadd mov W0, [W14++] ; fl mov W1, [W14] ; fh Am I correct?? Thanks, P. ------------------------------------------------------------------------------ Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now. http://p.sf.net/sfu/bds _______________________________________________ Flashforth-devel mailing list Fla...@li... https://lists.sourceforge.net/lists/listinfo/flashforth-devel > |