Does the optimizing code in TI-BASIC really matter?

I know that in TI-BASIC the agreement is to obsessively optimize and save as many bits as possible (which is pretty funny, I admit).

For instance,

DelVar Z
Prompt X
If X=0
Then
    Disp "X is zero"
End                   //28 bytes

will be cleared as

DelVar ZPrompt X
If not(X
    "X is zero        //20 bytes

But does the optimization code in this way really matter? Does it significantly faster or memory storage?

+4
source share
3 answers

Yes. TI-Basic code optimization matters, and this difference is much larger than you would find for most programming languages.

, TI-Basic - ( ). , , 24 . , ; -, , , .

, TI-Basic . quirk For(, , ( ) , Ans , (, 1000 +).

- . , .. , , , .. . (, Goto).

, . :

  • , , .
  • , .
  • , .
+5

TI-BASIC - , , .

, , , , , , , . , . , - .

, , . , , , i = i + 1, 4 i++, 2- . ( TI-BASIC ++).

, , , . , , . for(int i = 0; i < count; i++) , , i , , i count.

. , JavaScript , js- JIT CPU.

UPDATE: , .

+2

, . RPG TI-84 + CSE, , , . CSE Sorcery of Uvutu , , . 20 . 1 . . , - , " ". , - . .

. , - , ; , , , , , , , , . , , . ( , , ), .

, , , TI-Basic . , TI-Basic - . , , , , , , , , , , . , TI-84 + Zilog Z80 1976 , , . , , , ​​ Ans, , ( /float, , , ..), , .

Sources: My own experience described here: https://codewalr.us/index.php?topic=778.msg27190#msg27190

TI-84 + CSE RAM numbers came from here: https://education.ti.com/en/products/calculators/graphing-calculators/ti-84-plus-c-se?category=specifications

Information about the Z80 appeared here: http://segaretro.org/Zilog_Z80

0
source

Source: https://habr.com/ru/post/1657435/


All Articles