Re: BASIC > ASM


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

Re: BASIC > ASM



CyberBotX wrote:
>
> I posted earlier on the newsgroup and it seems that some people
> misunderstood what I was asking.  I will restate myself:  I want to know if
> there is anyone that knows how to program 92+ ASM and can program an ASM
> prog from looking at BASIC code??  I hope this will get the correct response
> I am looking for.

Already answered twice:

1st answer:

Why the basic is so slow (despite it has a low consumption 68000 at 10Mhz
!):
1) takes some time to read a token and then call the corresponding ROM
entry point. interpreting the semi-compiled program is not so easy that
just reading tokens one after the other. Some tokens will need parameters,
etc...

2) the basic works only with dynamic size integers (implies very slow
loops). almost all basic operations call a complex machine language
function. That's why an empty 'For' loop counts up to 6000 in 1 minute
instead of 10000000 for a machine language loop !

3) all variables are pointers and operation on them use indirection (slower
than register access), but the advantage is you don't need to specify their
type.

4) most of the basic function are not oriented on fast numerical
application but on slow formal application (main difference between a
calculator='slow but powerful' and a computer='fast but stupid').

2nd answer:

The difference comes from the king of words to execute: tokens or
machine language words. Of course the first case takes more time but this
not the main reason of the bad speed of the TI Basic.

Then again: No, I don't know a program which translates Basic->ASM because
this is not interesting. You will win at most a factor of 2 (complex
operation) to 5 (simple operation) in speed. But improving the data type of
the TI as well as replacing some algorithm (like using IEEE representation
for integers and floats instead of bcd) will improve the speed by a factor
of 100 (float) to 1000 (int). But it also means to rewrite 90% of the ROM !

>  Also, like I asked in my last post,  is there any way to
> prevent modifications of a BASIC prog so it cannot be edited on the calc or
> in the Graph-Link program???  Thanx in advance.

Lock it ?

Hope this help...

--
[ Deniau Laurent -- Data Analysis and Signal Processing ]
[ CERN -- The European Laboratory for Particle Physics  ]
[ Laurent.Deniau@cern.ch - http://home.cern.ch/~ldeniau ]
[   -- One becomes old when dreams become regrets --    ]

******************************************************************
* To UNSUBSCRIBE, send an email TO: listserv@lists.ppp.ti.com
* with a message (not the subject) that reads SIGNOFF CALC-TI
*
* Archives at http://peach.ease.lsoft.com/archives/calc-ti.html
******************************************************************


Follow-Ups: References: