This is some code I have in Ti-Basic. Sorry for some bad characters that were "changed in transition" to this forum.


Code:

ZoomSto
"="->Str9
0->A
0->B
0->X
16->Y
0->C
0->K
int(KORHALIV

Lbl UA
60->Ástep
ë^(B,A,Str0,0

60->Ástep
ë^(Y,X,Str9,4
int("DD
getKey->K

If Kø0
Then
K->C
If K=24
">"->Str9
If K=25
"+"->Str9
If K=26
"Horiz"->Str9
If K=34
"Polar"->Str9
End

If C=24
Then
X-4->X
If X<0 and Aø0
Then
80->X
A+96->A
End
X+4(X=-4)->X
If Str9="="
Then
">"->Str9
Else
"="->Str9
End
Goto UA
End


If C=25
Then
Y-4->Y
If Y<0 and Bø0
Then
48->Y
B+64->B
End
Y+4(Y=-4)->Y
If Str9="Horiz"
Then
"Func"->Str9
Else
"Horiz"->Str9
End
Goto UA
End


If C=26
Then
X+4->X
If X>80 and Aø864
Then
0->X
A-96->A
End
X-4(X=84)->X
If Str9="="
Then
">"->Str9
Else
"="->Str9
End
Goto UA
End

If C=34
Then
Y+4->Y
If Y>48 and Aø576
Then
0->Y
B-64->B
End
Y-4(X=52)->Y
If Str9="Func"
Then
"Polar"->Str9
Else
"Func"->Str9
End
Goto UA
End

Goto UA


Str0 is 2400 characters long, so naturally the program is slowing down little by little and does not stop slowing down. Is there a way to fix this assuming I'm using a parser? Otherwise, if I work with a bunch of smaller strings, will that fix the problem?
Just as I suspected, you have a giant mass of memory leaks. Every time you Goto out of an If/Then/End, For/End, While/End, or Repeat/End structure, you leak memory. I'm surprised you got as far as writing an ASM tutorial without discovering TI-BASIC memory leaks. Smile It has nothing to do with the sting, though.
KermMartian wrote:
I'm surprised you got as far as writing an ASM tutorial without discovering TI-BASIC memory leaks. Smile


Now you know why I'm not very good at Ti-Basic 0_0

Edit: What about this one? I don't know what would cause a memory leak here, but it's apparently happening again


Code:



ZoomSto
"="->Str9
0->A
0->B
0->X
16->Y
0->C
0->K
int(KORHALIV

Lbl UA
60->Ástep
ë^(B,A,Str0,0

60->Ástep
ë^(Y,X,Str9,4
int("DD
getKey->K

If Kø0
Then
K->C
If K=24
">"->Str9
If K=25
"+"->Str9
If K=26
"Horiz"->Str9
If K=34
"Polar"->Str9
End

If C=24
Then
X-4->X
If X<0 and Aø0
Then
80->X
A+96->A
End
X+4(X=-4)->X
If Str9="="
Then
">"->Str9
Else
"="->Str9
End
End


If C=25
Then
Y-4->Y
If Y<0 and Bø0
Then
48->Y
B+64->B
End
Y+4(Y=-4)->Y
If Str9="Horiz"
Then
"Func"->Str9
Else
"Horiz"->Str9
End
End


If C=26
Then
X+4->X
If X>80 and Aø864
Then
0->X
A-96->A
End
X-4(X=84)->X
If Str9="="
Then
">"->Str9
Else
"="->Str9
End
End

If C=34
Then
Y+4->Y
If Y>48 and Aø576
Then
0->Y
B-64->B
End
Y-4(X=52)->Y
If Str9="Func"
Then
"Polar"->Str9
Else
"Func"->Str9
End
End

Goto UA



Tanner: Don't double post, please Smile
If you don't mind, could you use SourceCoder and convert the program then use the BBCode text and repost it? Some of the things it is cutting off are important imo
_player1537 wrote:
If you don't mind, could you use SourceCoder and convert the program then use the BBCode text and repost it? Some of the things it is cutting off are important imo
Definitely this. It's very hard to read in that format. It would be especially good with indentation turned on.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement