Post Reply 
TI Conditionals & Spaghetti Code
05-26-2024, 07:01 AM
Post: #21
RE: TI Conditionals & Spaghetti Code
Hi,

I think only the branching instruction,
so you can change it from a label to a line number to speed up your program.

Marc.
Find all posts by this user
Quote this message in a reply
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
05-30-2024, 05:12 PM
Post: #23
RE: TI Conditionals & Spaghetti Code
Hello!

(05-25-2024 01:05 PM)Pierre Wrote:  For TI-58/58c/59 the Ins and Del commands do not recalculate direct addressing (GTO, GSB, DSZ, GE...)

I was so sure that it did recalculate... I wonder why? I haven't programmed a Ti calculator in ages, but this is the way that I remembered it. Probably some kind of glorification of the the days when we were young.

Regards
Max
Find all posts by this user
Quote this message in a reply
05-30-2024, 06:14 PM
Post: #24
RE: TI Conditionals & Spaghetti Code
(05-30-2024 05:12 PM)Maximilian Hohmann Wrote:  I was so sure that it did recalculate... I wonder why? I haven't programmed a Ti calculator in ages, but this is the way that I remembered it. Probably some kind of glorification of the the days when we were young.

Sorry but I'm absolutely sure since I still sometimes use my TI-58C.
This is also why it was better to use labels with addressing supplemented by NOPs, in order to be able to test and modify the programs before then optimizing them.
Tedious work of recalculating the addresses especially if we wanted to remove those labels which had become useless.
As for the troubles of memory, I remember my first loves as being even more beautiful and smiling than they surely were been...
The older you get, the more beautiful memories are embellished with time... Nostalgia...

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
05-31-2024, 01:06 PM
Post: #25
RE: TI Conditionals & Spaghetti Code
As someone who likes the stack to be kept tidy, I find I need additional spaghetti to do this.

Thomas, I think, pondering about a way of implementing another language in plus42. Well I guess there is already the algebraic equation functionality, and I suppose keystroke programming is not dissimilar to assembly, so doesn't seem crazy to have a structured language compile down to RPN.
Find all posts by this user
Quote this message in a reply
05-31-2024, 06:25 PM
Post: #26
RE: TI Conditionals & Spaghetti Code
(05-30-2024 06:14 PM)Pierre Wrote:  The older you get, the more beautiful memories are embellished with time... Nostalgia...
Nah. Nostalgia ain't what it used to be…
;-)
Find all posts by this user
Quote this message in a reply
05-31-2024, 07:11 PM
Post: #27
RE: TI Conditionals & Spaghetti Code
(05-31-2024 06:25 PM)vaklaff Wrote:  Nostalgia ain't what it used to be
and thanks to Simone Signoret (best actress Oscars 1960 !) for the title of her book :
"La nostalgie n'est plus ce qu'elle était"

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
06-03-2024, 05:01 AM
Post: #28
RE: TI Conditionals & Spaghetti Code
(05-31-2024 01:06 PM)dm319 Wrote:  Thomas, I think, pondering about a way of implementing another language in plus42. Well I guess there is already the algebraic equation functionality, and I suppose keystroke programming is not dissimilar to assembly, so doesn't seem crazy to have a structured language compile down to RPN.

Absolutely. RPN with dynamic stack and local variables is a great target for code generation.

I keep thinking of implementing an RPL compiler in Plus42, I think that would be a fun project... although I should probably turn the type system into proper C++ first, and I don't know yet how to combine an HP-48/49/50 free-form command line with the highly modal command entry style of the HP-42S.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




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