Omnimaga

Calculator Community => TI Calculators => General Calculator Help => Topic started by: Michael_Lee on February 23, 2011, 08:48:59 pm

Title: Character vs token? (and other questions)
Post by: Michael_Lee on February 23, 2011, 08:48:59 pm
The character 'f' (lowercase F) is designated the number '102' (66 in hexadecimal) by the calculator (and therefore, by ASCII), but according to the table of tokens located at tibasicdev (http://tibasicdev.wikidot.com/one-byte-tokens), the token 'Normal' is also represented by '66'.

How does the calculator distinguish between the two?
Title: Re: Character vs token?
Post by: squidgetx on February 23, 2011, 08:51:59 pm
The lowercase letters are 2 byte tokens:

BB66 = f
66 = Normal

Check out the xml's included with Merth's Tokens (maybe you can get them other places, idk)
Title: Re: Character vs token?
Post by: Michael_Lee on February 23, 2011, 08:55:52 pm
Ahh... Okay, I think I've got it now.  Thanks.
Title: Re: Character vs token?
Post by: jnesselr on February 23, 2011, 10:23:44 pm
Ahh... Okay, I think I've got it now.  Thanks.
But that only applies to tokens.  f still is 0x66, and is that when displaying characters with an asm routine like getC.  Tokens are strange in that manner.  Maybe I should update that page.
Title: Re: Character vs token?
Post by: Xeda112358 on February 23, 2011, 10:35:49 pm
The difference between tokens and ASCII is that when the calc reads "Normal" the calc displays the ASCII letters for 'N' 'o' 'r' 'm' 'a' 'l'
In certain situations, the calc reads data as tokens and in other situations it reads it as ASCII.
Title: Re: Character vs token? (and other questions)
Post by: Michael_Lee on February 24, 2011, 11:21:44 am
I don't really want to start a new topic, so I'll periodically ask a few questions here:

The type of variable is indicated by a single byte - for example, a program would have a byte set to 05 whereas an appvar is set to 06 (I think?).

Does anybody know where I can get a complete table of all the types?  (So I can find out what kind of variable 03 indicates, for example).
Title: Re: Character vs token? (and other questions)
Post by: Xeda112358 on February 24, 2011, 11:26:09 am
Yes, I happen to know a few (I have made a bunch) and actually 06 is a Protected Program and an Appvar is 15h. I included a chart in my BatLib readmes as well as their compatibilities with each other:
Code: [Select]
00=Real            00h
01=List            01h
02=Matrix          02h
03=EQU             03h
04=String          04h
05=Program         05h
06=ProtProg        06h
07=Picture         07h
08=GDB             08h
09=Unknown         09h
10=Unknown Equ     0Ah
11=New EQU         0Bh
12=Complex         0Ch
13=Complex List    0Dh
14=Undefined       0Eh
15=Window          0Fh
16=ZSto            10h
17=Table Range     11h
18=LCD             12h
19=BackUp          13h
20=App             14h
21=Appvar          15h
22=TempProg        16h
23=Group           17h
EDIT:Added hex equivalents :D
Title: Re: Character vs token? (and other questions)
Post by: Michael_Lee on February 24, 2011, 11:39:07 am
Ahh, cool, thanks!
Title: Re: Character vs token? (and other questions)
Post by: Xeda112358 on February 24, 2011, 11:45:33 am
As a note, if you are going to be playing around by switching variable types, some types are not compatible. For example, you can change that 05 you were talking about to a 15 to make it an appvar, but you should not change that to a 00, for example.