"basic label" jumper (in asm ofcourse)
Moderator: MaxCoderz Staff
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
"basic label" jumper (in asm ofcourse)
Lots of basic programmers are annoyed by basic's super slow labels (it is said the TI OS searches the program from the top untill it finds the right label).
I think it should be possible to run a program at the beginning of a program (or do something else if it has to be an app) which scans the whole program for "Label *" and stores the adress and label in a tabel, then when you "Goto *" it should be run again (parser hook or run the program with different input) and make the jump to "Label *" as a jump instead of searching the program for it.
The program will, as a whole, take longer to finish, but the part of the program that actually does something should become faster.
i think its a terribly good idea, but that's only because its my idea
I think it should be possible to run a program at the beginning of a program (or do something else if it has to be an app) which scans the whole program for "Label *" and stores the adress and label in a tabel, then when you "Goto *" it should be run again (parser hook or run the program with different input) and make the jump to "Label *" as a jump instead of searching the program for it.
The program will, as a whole, take longer to finish, but the part of the program that actually does something should become faster.
i think its a terribly good idea, but that's only because its my idea
I seem to remember a nice asm program i once found on ticalc... </me google-ing> </me found it> Subroutine v2.0: "This program lets you run internal subroutines from within BASIC programs."
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
-
- Calc King
- Posts: 2195
- Joined: Sun 27 Mar, 2005 4:06 am
- Location: sleeping
- Contact:
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
@saibot: i know that one, but it doesnt do what i was thinking of, it just finds labels, i want to JUMP to labels, so almost instantly, so save all labels first then recalling them..
almost the same as the for(/repeat( trick and using End to return, but that takes up more memory and cant allways be used, also can cause memory leak, actually i know someone who had a Ti 83+ for 2 years and had a memory leak in every program he made, quote from him "HUH?!?!?! How can it be that your programs never get slower while they've been running for an hour??" -me "because i know how to avoid memory leak.." Also this program should be able to jump to any label (inside the programs it has been run in) not just the last one like with the repeat + end trick, so.. cool!
i might not be able to code it though.. im not much of a asm programmer yet..
almost the same as the for(/repeat( trick and using End to return, but that takes up more memory and cant allways be used, also can cause memory leak, actually i know someone who had a Ti 83+ for 2 years and had a memory leak in every program he made, quote from him "HUH?!?!?! How can it be that your programs never get slower while they've been running for an hour??" -me "because i know how to avoid memory leak.." Also this program should be able to jump to any label (inside the programs it has been run in) not just the last one like with the repeat + end trick, so.. cool!
i might not be able to code it though.. im not much of a asm programmer yet..
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
- elfprince13
- Sir Posts-A-Lot
- Posts: 234
- Joined: Sun 11 Dec, 2005 2:21 am
- Contact:
you know what would be cool having a program that uses that records all the instructions the TI-OS calls when running a TI-Basic program and essentially "precompile" it into the Asm that would get run anyway. this would make the program run a lot faster since it could be run as Assembly and wouldn't have to be translated as it was run.
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
There is already a BASIC>ASM program somewhere on ticalc, not sure how well it works though.
EDIT: http://www.ticalc.org/archives/files/fi ... 17882.html
EDIT: http://www.ticalc.org/archives/files/fi ... 17882.html
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
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
also, yes that program looks for "label" ofcourse, but it shouldnt be the hardest part to figure out, harder is to figure out where to store the labels, it may be possible someone has up to 36^2 labels, and they'd all take 2 bytes, that is a shitload of memory, although no serious program has 36^2 labels.. maybe 1 or 2..
if this gets to be an app that catches "goto *" (and "label *" to remember where it was) then you cant even writeback, can you? (can you write to flash just like that?) but aside from that, catching label and goto would allways make a basic program faster, provided that the label comes before the goto, if it would encounter an "unknown" goto it still has to seach, but atleast it only has to do it once, and not from the start since you allready know that any higher in the current program such label does not exist, else you would have found it allready.
does this make sence to you all?
edit: i tried to read the source of the "subroutine" program, but whoever wrote it seemed to have put a lot of efford into making it as unclear as possible (all bcalls have their $ number and he's doing some very confusing things with labels.. )
should be possible, afterall, we have the famous "three exec" and "fourexec" i dont see them being used a lot though lol
also, yes that program looks for "label" ofcourse, but it shouldnt be the hardest part to figure out, harder is to figure out where to store the labels, it may be possible someone has up to 36^2 labels, and they'd all take 2 bytes, that is a shitload of memory, although no serious program has 36^2 labels.. maybe 1 or 2..
if this gets to be an app that catches "goto *" (and "label *" to remember where it was) then you cant even writeback, can you? (can you write to flash just like that?) but aside from that, catching label and goto would allways make a basic program faster, provided that the label comes before the goto, if it would encounter an "unknown" goto it still has to seach, but atleast it only has to do it once, and not from the start since you allready know that any higher in the current program such label does not exist, else you would have found it allready.
does this make sence to you all?
edit: i tried to read the source of the "subroutine" program, but whoever wrote it seemed to have put a lot of efford into making it as unclear as possible (all bcalls have their $ number and he's doing some very confusing things with labels.. )
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
so what does this mean?
Code: Select all
stackname:
call $2B41
.dw $5AB3
.db $78
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
I remember my friend Benny Baumann once discovering a bcall that he named _CallPrivateBC because it would call a private bcall. you did something like bcall $XXXX \ .dw Addr \ .db Page and it would call the routine @ Addr on page Page. Maybe $2B41 is the address of this bcall in TIOsv1.14 ... but i don't have TIOS w/ me to check
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
follow the call with CalcSys or in the Flash Debugger and figure out what the call he's calling does
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe
____________________
XDG Kat-Productions
-Michael
MyBlog ChatWithMe