"basic label" jumper (in asm ofcourse)
Moderator: MaxCoderz Staff
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
-
- Calc King
- Posts: 2195
- Joined: Sun 27 Mar, 2005 4:06 am
- Location: sleeping
- Contact:
- elfprince13
- Sir Posts-A-Lot
- Posts: 234
- Joined: Sun 11 Dec, 2005 2:21 am
- Contact:
from what Ive seen, it doesn't.chickendude wrote:There is already a BASIC>ASM program somewhere on ticalc, not sure how well it works though.
whats three exec and fourexec? and yes, I meant on-calc, it would be really hard to do offcalc without a ROM and an emulator...King Harold wrote:Ive seen that one, i think elfprince means on-calc? right?
should be possible, afterall, we have the famous "three exec" and "fourexec" i dont see them being used a lot though lol
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
I don't remember the exact naming of the bcalls, but basically, there's a bcall that handles any TI-BASIC commands that take only one parameter, another that handles commands that take 2 params, another (threeexec?) that handles commands that take 3 params, and another (fourexec?) that handles commands that take 4 params. There might be another for commands with 5 or more params, but I don't remember off the top of my head. I would assume converting a TI-BASIC program into a series of FPSpush and exec commands "should" speed it up, although I'm not sure if this'll work for things like For(, Goto, etc. but it might be worth a try.
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
I have a nice subroutine setup in my TILEMENU program for pure ti-le. It looks something like this:
That will create space for and draw in a window with a shadow by specifying x, y, length, and height parameters. If I wanted to add more subroutines to the program and still be optimal, I can put the subrountines in a If (theta):Then: ... :End block. It's a nifty way of adding in a subroutine to a program by using up a variable as a reference to which subroutine you're calling to. It'll still have to scan for the data but it's faster and more structurally sound than using Goto.
I did that above code to save space in the TILEMENU program without creating a new program. Saved me a few hundred bytes and made it easier to do more windows, plus calling to the program TILEMENU to make a new window from any of the Pure TI-le programs is cleaner, period.
Code: Select all
PROGRAM:TILEMENU
If (theta)=1:Then
For(I,0,1+int(H/2
Line(X,-Z-I,X+L,-Z-I,0
Line(X,-Z-H+I,X+L,-Z-H+I,0
End
For(I,0,1
Line(X+I,-Z-H-I,X+L+1,-Z-H-I
Line(X+L+I,-Z-I,X+L+I,-Z-H-I
End
Line(X,-Z,X+L,-Z
Line(X,-Z,X,-Z-H
0->(theta):Return:End
...
1->(theta):0->X:1->Z
52->L:22->H
prgmTILEMENU
I did that above code to save space in the TILEMENU program without creating a new program. Saved me a few hundred bytes and made it easier to do more windows, plus calling to the program TILEMENU to make a new window from any of the Pure TI-le programs is cleaner, period.
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
how does this relate to the label-jumper though?
you know you cant just put everything in if:then things..
that would cause HUGE memory leak..
by the way, your method takes more code, and i allready have some 7K and bigger basic programs, which run fine with normal Goto's, but they could be faster..
(i put a goto to somewhere in the middle at the beginning, and the code that has to run fast just after it, but it could be better..)
you know you cant just put everything in if:then things..
that would cause HUGE memory leak..
by the way, your method takes more code, and i allready have some 7K and bigger basic programs, which run fine with normal Goto's, but they could be faster..
(i put a goto to somewhere in the middle at the beginning, and the code that has to run fast just after it, but it could be better..)
Actually, IIRC, putting things in if-then loops doesn't necesarily cause memory leaks, if you Return from within the if-then statement... like if-then-something-return-end-continue
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
Yea, so long as you reach End for every statement that requires it.
For example:
For(A,0,100
If A=20:Goto B
End
Lbl B
Since it never reaches the End, a memory leak will evnetually ensue. But DarkAuron's code, since each For() statement exits the loop through the use of the End command, it should be perfectly stable.
It's been so long since I've touched BASIC...
EDIT:
I'm not quite sure how the return statement works, but I think that might actually cause a memory leak, as it exits before the End is reached. Please correct me if I'm wrong!
For example:
For(A,0,100
If A=20:Goto B
End
Lbl B
Since it never reaches the End, a memory leak will evnetually ensue. But DarkAuron's code, since each For() statement exits the loop through the use of the End command, it should be perfectly stable.
It's been so long since I've touched BASIC...
EDIT:
Code: Select all
0->(theta):Return:End
AFAIK, "Return" closes any open If or if-then statements... but I forgot where I read that... /me tries on-calc... /me gets confused and gives up trying on-calc... that reached 635 before Err:Mem, all the while slowing down... however, "0:prgmAAA"this code happily reached 1500 and would have continued, w/o slowing down and thus, w/o leaking memory had I not pressed [ON] to break it. this also did not leak any memory... thus Return can close more than one if-then statement
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
Code: Select all
PROGRAM:AAB
:ClrHome
:1
:Lbl A
:Output(1,1,Ans
:If 1
:Then
:Ans+1
Goto A
Code: Select all
PROGRAM:AAA
:If Ans!=0
:Then
:Return
:End
:ClrHome
:1
:Lbl A
:Output(1,1,Ans
:prgmAAA
:Ans+1
:Goto A
Code: Select all
PROGRAM:AAC
:If Ans!=0
:Then
:If 1
:Then
:Return
:End:End
:ClrHome
:1
:Lbl A
:Output(1,1,Ans
:prgmAAC
:Ans+1
:Goto A
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am