Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: Runer112 on June 22, 2010, 10:57:26 pm

Title: Token Display
Post by: Runer112 on June 22, 2010, 10:57:26 pm
How can you display tokens? I'm pretty sure there's no way to do it in Axe (though I may be wrong), but is there at least a way to do it with assembly?
Title: Re: Token Display
Post by: SirCmpwn on June 22, 2010, 11:01:47 pm
You can do it with Axe by storing the value of the token to a variable and using the >Char (>Frac) command:
Code: [Select]
Disp A>Char
Old Axe:
Disp A>Frac

Assembly is the same story, but with register A and the PutC command.
Title: Re: Token Display
Post by: Runer112 on June 22, 2010, 11:06:29 pm
I'm not talking about ASCII characters, I'm talking about tokens. Things like DiagnosticOff, For(, Str0, etc.
Title: Re: Token Display
Post by: calcdude84se on June 22, 2010, 11:08:46 pm
GetTokLen, IsA2ByteTok, PutTokString, and Get_Tok_Strng are the desired routines. Unfortunately, I can't document them right now, so at least someone can use these to help you further.
Title: Re: Token Display
Post by: Builderboy on June 22, 2010, 11:18:01 pm
Actualy there is only one routine you need, i have the hex codes from my Basic Editor right here.  The routine i use reads from memory though, so you need to give it the address of the token you want to read, 1 or 2 byte.

Code: [Select]
LAsm(EF  94  45  6F  26  00)
Disp e848E

848E is the location of Op1, where the string is put.  You can display it directly, just use the little E thingy :)
Title: Re: Token Display
Post by: DJ Omnimaga on June 22, 2010, 11:18:47 pm
Does this require inline ASM HEX code?
Title: Re: Token Display
Post by: Quigibo on June 22, 2010, 11:20:38 pm
It's been on the wish-list for a while, I have all the routines written already.  They were just commented out becasue I need to get the token data working first so you can actually use the feature.  Like the same way you can do 'A' to get the ascii value, you would be able to use tA to get the token value.  Also, like you can use the double quotes to define a string, I'm going to add some way to define a series of tokens.  That will be especially useful if I decide to add a "Parse" command to execute the token data as BASIC code.
Title: Re: Token Display
Post by: Runer112 on June 22, 2010, 11:25:48 pm
Uncomment it! ;D
Title: Re: Token Display
Post by: SirCmpwn on June 22, 2010, 11:43:33 pm
^++
Please!
Title: Re: Token Display
Post by: calcdude84se on June 22, 2010, 11:44:55 pm
I agree, this could be rather useful. But yes, what token to use as a quote?
Title: Re: Token Display
Post by: Quigibo on June 22, 2010, 11:48:09 pm
I agree, this could be rather useful. But yes, what token to use as a quote?
I will probably use the little "L" that BASIC uses for custom lists.  I don't need any endquote.
Title: Re: Token Display
Post by: Runer112 on June 22, 2010, 11:55:04 pm
I was actually wondering how to display tokens because one thing I enjoy doing is making tools for programming (like my sprite editor). I was actually planning on making an Axe program editor like you plan on in future versions. If I got it in good working condition, then you could even just absorb it into your Axe releases and not have to worry about all the work for it, I'd do it for you. ;)