"basic label" jumper (in asm ofcourse)

Got a brilliant program idea? Let us know!

Moderator: MaxCoderz Staff

chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

...or maybe TI can let you know?
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

3fg says it's 412b.
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

Is this 83+ or 83 regular? Either way I don't see why they would call that area.
Image
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

83+.
User avatar
elfprince13
Sir Posts-A-Lot
Posts: 234
Joined: Sun 11 Dec, 2005 2:21 am
Contact:

Post by elfprince13 »

chickendude wrote:There is already a BASIC>ASM program somewhere on ticalc, not sure how well it works though.
from what Ive seen, it doesn't.
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
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
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

three-exec and fourexec are bcalls that take 3 or 4 values off hte FPS to work with, with the function to perform in a, can all be found in the sysroutines pdf thingy..
User avatar
Saibot84
New Member
Posts: 38
Joined: Fri 17 Feb, 2006 9:14 pm
Location: Jersey City, NJ

Post by Saibot84 »

Image 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 Image Image
MyBlog ChatWithMe
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

program controll flow might give some trouble, the rest shouldnt be any poblem, but i origionally only wanted to get rid of the silly way "Goto" works, its just too idiotic to let it continue to work like it currently does..
DarkAuron
Maxcoderz Staff
Posts: 1349
Joined: Sat 18 Dec, 2004 6:53 pm

Post by DarkAuron »

I have a nice subroutine setup in my TILEMENU program for pure ti-le. It looks something like this:

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
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.
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

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..)
User avatar
Saibot84
New Member
Posts: 38
Joined: Fri 17 Feb, 2006 9:14 pm
Location: Jersey City, NJ

Post by Saibot84 »

Image 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 Image Image
MyBlog ChatWithMe
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

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:

Code: Select all

0->(theta):Return:End 
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!
User avatar
Saibot84
New Member
Posts: 38
Joined: Fri 17 Feb, 2006 9:14 pm
Location: Jersey City, NJ

Post by Saibot84 »

Image 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...

Code: Select all

PROGRAM:AAB
:ClrHome
:1
:Lbl A
:Output(1,1,Ans
:If 1
:Then
:Ans+1
Goto A
that reached 635 before Err:Mem, all the while slowing down... however, "0:prgmAAA"

Code: Select all

PROGRAM:AAA
:If Ans!=0
:Then
:Return
:End
:ClrHome
:1
:Lbl A
:Output(1,1,Ans
:prgmAAA
:Ans+1
:Goto A
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. ;)

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
this also did not leak any memory... thus Return can close more than one if-then statement :D
____________________
XDG Kat-Productions
-Michael Image Image
MyBlog ChatWithMe
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Good work, detective!
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

wasnt only "End" supposed to do that?
anyway, no trick is ever going to be as fast as a nice asm program to handle jumps..
Post Reply