Author Topic: TokenIDE - TI-BASIC IDE  (Read 83212 times)

0 Members and 5 Guests are viewing this topic.

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Tokens
« Reply #60 on: October 31, 2010, 05:44:58 pm »
I am working on a project and I need to be able to convert text files to and from 8xp. Could I maybe please begging-of-you-please have either A) an explanation of how to read and write in 8xp, or B) the code that you wrote to do that (just that little bit). I would like A better. Either way, PM me, PLEASE (can you tell I'm desperate?).
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Tokens
« Reply #61 on: October 31, 2010, 05:50:18 pm »
Are you doing this in BASIC or ASM/Axe? The latter is fairly easy to convert to text using any of the multiple disassemblers available such as SPASM. If it's BASIC, the task is rather more difficult unless you're willing to use an emulator to view the BASIC file on-calc.
« Last Edit: October 31, 2010, 05:50:53 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Tokens
« Reply #62 on: October 31, 2010, 06:08:41 pm »
I'm trying to look at BASIC, and an emulator won't work. My program needs to be able to "look" at the text.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Tokens
« Reply #63 on: October 31, 2010, 06:34:09 pm »
Ah...

May I ask what type of program necessitates looking at ASCII characters? Text isn't a very computer friendly medium.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Tokens
« Reply #64 on: October 31, 2010, 06:39:58 pm »
Not really...
Numbers might be more friendlier to a computer, but not really human-readable, and graphics are barely comprehensible to a program.
« Last Edit: October 31, 2010, 06:40:10 pm by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Tokens
« Reply #65 on: October 31, 2010, 06:40:38 pm »

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Tokens
« Reply #67 on: October 31, 2010, 07:07:08 pm »
I'm planning to write a program that will compile Axe source to z80 assembly code. That way it could be optimized, edited, etc.
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Tokens
« Reply #68 on: October 31, 2010, 07:18:00 pm »
Could you add some sort of system that would allow users to choose what tokens result from characters or character combinations that could represent more than one thing? I was recently using your program, which is great by the way, to edit an Axe source file that someone sent me. However, when I opened the file and then recompiled it without making any changes, the output file wasn't the same and resulted in errors when compiled with Axe parser. After writing another program in Axe to search through the two programs on-calc byte-by-byte to find any differences, I found two culprits. An apostrophe character was being converted into BBD0 instead of the expected AE, and "<<" (the signed less than or equal comparison for Axe source files) was being converted into BBEB instead of the expected 6B6B.

SourceCoder handles this problem by using characters or character combinations enclosed in curly brackets (like "{L1}") to define some special tokens, and characters not found on a keyboard (like "≠") to define others. TI's Program Editor that was bundled with older versions of TI Connect handles this problem by using a custom font that replaces unused characters (namely accented letters) with the symbols needed to form the tokens (like "▸"). Both of these require a selector to pick these special tokens, which may be the way to go.

Personally, I would use a custom font and form special characters out of the same character combinations you already defined, but let the user undo the combination. For instance, if I wanted the L1 token, I would type "L1" which would be changed to "L1" as soon as I type the one (the small 1 would replace an unused ASCII value in the custom font). However, if the user wanted the literal string "L1" they could use ctrl+z to undo the combinaton. In this manner, the whole file couldn't be updated each time the user typed a new character, or it would keep changing user overrides back into special characters. I don't know how difficult it would be to do this, but the fix would probably be to only try to form special characters out of text the user just typed or pasted.



EDIT:

I'm planning to write a program that will compile Axe source to z80 assembly code. That way it could be optimized, edited, etc.

Wouldn't you just be rewriting Axe parser? That wouldn't be very fair to Quigibo.

If you want to hand-optimize compiled Axe programs, I guess you could compile source files with Axe in an emulator like wabbitemu and then transfer the compiled programs back to your computer and disassemble them there. I personally think that would undermine the spirit of using Axe, but you may feel differently.
« Last Edit: October 31, 2010, 07:25:52 pm by Runer112 »

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Tokens
« Reply #69 on: October 31, 2010, 07:37:47 pm »
I'm planning to write a program that will compile Axe source to z80 assembly code. That way it could be optimized, edited, etc.

I believe Quigibo is writing an on-computer version of Axe as well.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Binder News

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 785
  • Rating: +46/-3
  • Zombie of Tomorrow
    • View Profile
Re: Tokens
« Reply #70 on: October 31, 2010, 07:41:15 pm »
The reason for compiling to z80 is twofold. ONE) Optimizations. I could probably write a companion program to strip away any unneeded pieces of code. This would decrease the size a lot. Also, If you needed to do some actual code (BCAlls and the like), you could add it in with this. TWO) The other reason would be for learning. I think it would help people a lot to be able to see the code they do understand, compared to the code they don't understand, to learn assembly. Finally, if Quigibo want's me to stop, I will. It is his app and his idea. I don't want to infringe.

EDIT: Then I would love to help. I am actually a very good computer programmer, and have a lot of free time.

EDIT4: I've (mostly) solved reading. Writing in 8xp is still beyond reach.
« Last Edit: October 31, 2010, 10:26:27 pm by Binder News »
Spoiler For userbars:







Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:





Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Tokens
« Reply #71 on: October 31, 2010, 08:54:58 pm »
Good, glad to hear it. Can this program also compile pure TI-BASIC as well? I think that would be really useful.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Tokens
« Reply #72 on: October 31, 2010, 09:33:45 pm »
Good, glad to hear it. Can this program also compile pure TI-BASIC as well? I think that would be really useful.

You mean a TI-BASIC to TI-ASM compiler? It's a lot harder than a language like Axe. There's a version of it on ticalc but it doesn't work.




Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Tokens
« Reply #73 on: October 31, 2010, 09:36:59 pm »
Good, glad to hear it. Can this program also compile pure TI-BASIC as well? I think that would be really useful.

You mean a TI-BASIC to TI-ASM compiler? It's a lot harder than a language like Axe. There's a version of it on ticalc but it doesn't work.

I can't imagine why it would be harder to translate the syntax. The interpreter doesn't do much more than Axe with respect to that. Sure, the way the instructions are handled in RAM is different than a native ASM program, but I'd take an 8kb limit in BASIC if it brought even part of the speed of compiled ASM to it.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Tokens
« Reply #74 on: October 31, 2010, 09:41:03 pm »
Good, glad to hear it. Can this program also compile pure TI-BASIC as well? I think that would be really useful.

You mean a TI-BASIC to TI-ASM compiler? It's a lot harder than a language like Axe. There's a version of it on ticalc but it doesn't work.

I can't imagine why it would be harder to translate the syntax. The interpreter doesn't do much more than Axe with respect to that. Sure, the way the instructions are handled in RAM is different than a native ASM program, but I'd take an 8kb limit in BASIC if it brought even part of the speed of compiled ASM to it.

Axe was designed to be compiled into ASM. Not TI-BASIC. Converting that to ASM would involve a lot of messy floating-point calculations and stuff like that, unless you used TI's own routines, but if you did that, it would run at essentially the same speed, so there'd be no point to convert it in the first place. It's possible, though.
« Last Edit: October 31, 2010, 09:41:13 pm by Deep Thought »