I know that in Grammer and BatLib BASIC ReCode, you can change the calculator into 15 MHz mode which makes programs run significantly faster. Is there a way to do this so as to effect all functions on a calculator, so that all programs of any language would run faster in 15 MHz mode? This would be a great way for me to just speed programs up. :)
In TI-BASIC, all functions are executed at the fastest speed. This means graphing is done at 15MHz and BASIC programs are run at 15MHz. The only stuff that isn't run at top speed automatically are assembly programs run using the Asm( token. The OS runs these at 6MHz to maintain compatibility with older assembly programs that are sensitive to speed. Assembly programmers can add a few bytes of code to the beginning of their programs to switch to 15MHz, but this is absolutely not practical for small programs. Here is the detailed reason:
At 6MHz, you can execute 6000000 t-states of code per second. At 15MHz, you can execute 15000000 t-states of code. A program like 3E02D310C9 takes 28 t-states to execute. At 6MHz, that is about .0000046666… seconds (a little over 4 millionths of a second). At 15MHz, it would take about .00000186666… seconds. You really aren't going to notice a difference. Now, in order to speed it up by 1 second, how much code do you have to go through?
You would need ten million t-states in order to even save 1 second! Since most instructions take about 6 or 7 t-states, you may need to execute aver a million lines of code for this to work. However, you would be correct to to think that we don't write programs that are millions of lines long. Instead, we use lots of loops, executing the same code over and over, and this is where you see a big speed up in Grammer, Axe, or ReCode. Drawing commands can often take thousands or even tens of thousands of t-states and only be about 100 instructions. A single loop in Grammer of a gravity engine might take about 200000 t-states, so it could execute 30 times per second at 6MHz. At 15MHz, it would work at 75 times per second, and this is noticeable.
So when is it useful for assembly programs to include the DB0207E601D320 (set speed to 15MHz if possible) at the start of their programs?
1) When they have code that gets repeated constantly
2) When the code is very long
47%? Take a look and try to imagine how cool 100% will be. This has won zContest 2011 and made news on TICalc. This compromise between Assembly and BASIC parses like BASIC and is fast like assembly. Grammer 2
Wow, thank you for that! :) I'll keep this in mind. Do all BatLib commands using the dim( parser hook run at 15 MHz by default then? Or only ReCode with the Full token?