Re: LZ: Re: your mail


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

Re: LZ: Re: your mail



On Mon, 26 Aug 1996, Andrew Haninger wrote:


> pd-
> okay, i guess i've stirred up enough trouble around herre for now and i
> think i would like to learn asm and i will, when i really have a lot of
> time on my hands like next summer. also, you or somebody said that if you
> could convert them, they would be neither small nor fast...  huh?
   
 
The problem with converting an interpreters programs into asm
programs is that the interpreted program is really data to the
interpreter, which is the real program that's controlling the
cpu.


The 1k tibasic program you write is really 1k + the length of the
rom.  I don't recall the size of the rom in the TI but I think you
get the point.


If you translate that basic program into assembly and the assembly
program has full access to the rom routines, then you can usually
make that run a little faster although it'll probably be larger
because it's going to have to replace some of the interpreter's
functionality.  Not a lot is gained.


If you really want to make a program run fast then write it in
asm from scratch.  This lets you use the cpu and memory to best
effect for your program.  The rom routines and a translated
basic program have to be very general.  The program written
in asm can take full advantage of the way the system works.


Asm isnt faster because of it's name.  It's faster because it
lets you do things in the best possible way for every specific
circumstance.  It can also be used to copy the slower, more
general methods that the interpreter and the rom has to use.


Even if you write it initially in asm, theres no guarantee
it'll be faster.  Asm gives you a lot of ways to do things
very fast, but it lets you do things very slowly if you prefer.
I've seen some very slow asm programs.  And I've even (blush)
written a few.


Barry


References: