Post Reply 
TI Conditionals & Spaghetti Code
05-26-2024, 08:37 AM
Post: #22
RE: TI Conditionals & Spaghetti Code
Sometimes it can be useful to optimize the execution time of a somewhat long program to use direct addressing.
But it is not imperative and we should not make it an obsession.
The step count must also be considered.

----------Example #1 ----------
Code:

001 LBL
002 A
.../...
051 GTO
052 A
.../...
067 GTO
068 A
==> 6 steps

----------Example #2 ----------
Code:

001 LBL
002 A
.../...
051 GTO
052 00
053 03
.../...
068 GTO
069 00
070 03
==> 8 steps

Equivalent response time because label analysis starts at step 001

You can also write :
----------Example #3 ----------
Code:

001 LBL
002 A
.../...
051 RST
.../...
066 RST
==> 4 steps

RST is even faster than GTO
Works on TI-58/58C/59
But be careful on some calculators, RST returns to step 000 and execution stops.

http://ti58c.phweb.me
http://clones.phweb.me
http://www.instagram.com/ti58c
"No! Do or Do not. There is no try!" [Master Yoda]
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: TI Conditionals & Spaghetti Code - Pierre - 05-26-2024 08:37 AM



User(s) browsing this thread: 3 Guest(s)