Re: A92: function template


[Prev][Next][Index][Thread]

Re: A92: function template





On Thu, 4 Sep 1997 gil.guillory@mwk.com wrote:

>      
>      Being a bit lazy, and not altogether interested in learning all the 
>      details of assembly on the 68000, I'm looking for advice and perhaps a 
>      go-by to work with.
>      
>      I have developed a series of functions on my TI-92 (in TI-basic) that 
>      calculate various thermodynamic properties of steam and water. The 
>      only problem I have is computation time. Most of the interesting and 
>      useful calculations take several seconds.
>      
>      I am hoping to be able to code some of the core functions (maybe all 
>      of them) in assembler, but I have not yet found how to return a value 
>      across the Fargo veil.
>      
>      My questions:
>      
>      1. Is it possible to write functions in assembler?

Subroutienes, yes.  Functions....well, we don't know yet.

>      
>      2. Is it likely that doing so would increase the speed of the 
>      computations? Note that I use a good deal of loops and constants. 
>      Also, how would functions calling functions affect the speed?

If you could figure out how to code the computations in assembler, it
would most definitely be faster.  Loops are more efficient when assembled
(vs. interpreted) ... etc. (Standard spiel about interpreted vs.
compiled/assembled computation).  However, I would suggest converting most
or none of your computations into asm.  To call a fargo program (in Fargo
v 0.1.13), the core does some really time-consuming things, e.g. saving
a copy of the screen, etc.

>      
>      3. How should I do the calculations? What are the 
>      advantages/disadvantages of using floating-point vs. BCD ?
>     

It has been a while since I've done any 68000 programming, but I don't
think the m68k has quite the support for BCD as, say, the i80x86 line.  If
you want to do fractional computation in asm, I would suggest 16 bit fixed
point.  This has the advantage of being relatively easy to code (compared
to floating point....) and reasonably accurate (then again...)  Like many
microprocessors of its era, the m68k is simply not adept at anything but
integer arithmetic.

 
>      4. If the answers to 1 & 2 above are yes, does anyone have (or would 
>      some kind soul construct for me) a template that I could use to do 
>      some simple assembly programming? Note that I intend to submit my 
>      final version to the ticalc.org site and you will get an author's 
>      mention for any substantial help you provide.


What sort of computation are you attempting?  I am not well versed in
physics, but I have a strong math background.  Perhaps you could fill me
in on what type of calculations are involved (i.e., monte-carlo
simulation, summation, integration, large products,etc)


>      
>      -gil


Hope this helps some,

--Shawn Walker (swalker@joe.math.uga.edu))


References: