I'm writing a program in assembler for the TI-83+ calculator, and there's one feature t开发者_如何学Gohat I want, but I cannot figure out how I would execute it.
I have retrieved the string from the Ans variable, and I was hoping that I could glean ASCII values from it easily, but short of creating a full look-up table, I cannot think of how I would go about doing this. Texas Instruments uses their own encoding for the tokens, and some tokens represent many characters.
In short, I need to figure out how to translate a string of TI tokens into a string of ASCII characters.
There's a B_CALL Get_Tok_String which will do what you want. According to the docs, it takes the pointer to the token in HL, and returns the ASCII text of the token in OP3. The accumulator holds length of the string. You'll have to loop to process each token in the string. The B_CALL IsA2ByteTok will let you know how big each token is when you're looping.
(For the record, Get_Tok_String is documented on page 16-14 in the System Routines PDF, IsA2ByteTok on 16-15.)
精彩评论