This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's z80 & ez80 Assembly subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Z80 & 68k Assembly => z80 & ez80 Assembly
Author Message
adje


Newbie


Joined: 24 Dec 2007
Posts: 24

Posted: 08 Oct 2008 12:09:56 pm    Post subject:

How can i store a 1 byte string (like 'A' or '5') to Ans.
the character is stored in A

ive tried with LD (tAns),A and with several rom calls, but its hard because i cant find much info about the calls.

thank you
Back to top
FloppusMaximus


Advanced Member


Joined: 22 Aug 2008
Posts: 472

Posted: 08 Oct 2008 01:29:11 pm    Post subject:

You need to create a string variable with the desired contents. Use CreateTempString to create a string one (or two) bytes in length, store the desired token in it, then use StoAns to copy the result to Ans.

For instance:

Code:
   ld hl,2
   B_CALL CreateTempString
   ex de,hl
   inc hl
   inc hl
   ld (hl),t2ByteTok
   inc hl
   ld (hl),tLa
   B_CALL OP4ToOP1
   B_CALL StoAns


(Unrelated note: WikiTI's category display is broken...)
Back to top
brandonw


Advanced Member


Joined: 12 Jan 2007
Posts: 455

Posted: 08 Oct 2008 04:07:04 pm    Post subject:

Unfortunately, a lot of WikiTI is broken at the moment, including the search feature. We're looking into some solutions.

For now, I recommend googling with site:wikiti.denglend.net with what you want to know.
Back to top
adje


Newbie


Joined: 24 Dec 2007
Posts: 24

Posted: 09 Oct 2008 09:27:39 am    Post subject:

i get an error thrown when i try to compile it.
Label not found: _CreateTempStrin
i use ti83plus.inc as include file and use rom call like b_call(_CreateTempString). But he couldnt see the last g or something? Maybe name 's too big. I tried with b_call 4324 also, but the wabbitemu crashed.

What precisely does CreateTempString? Store into OP4:
StrngObj,tVarStrng,$omething like this?

And i work with the ASCII code of the characters. So to use token i have to make some sort of token bank. Cant i just store into OP1 a string (with Mov9ToOP1) and them store it into Ans?

+EDIT
okay, found out working with ASCII code is not that handy when the commands work with tokens. Is there no command-routine which stores a character (from which you know the ascii code) into ans or a string or just translates it into something useful?

Thank you


Last edited by Guest on 09 Oct 2008 10:13:11 am; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 09 Oct 2008 10:51:13 am    Post subject:

Try b_call(4324h) or b_call($4324). The label isn't in my ti83plus.inc either, so...

What the bcall does is create a temporary variable of the type string with hl bytes in it. It takes care of variable allocationy stuff so you probably don't want to replicate it.

For working with tokens: one lucky break is that numbers 0-9 and uppercase letters match in value. I'm pretty sure nothing else does.
Back to top
FloppusMaximus


Advanced Member


Joined: 22 Aug 2008
Posts: 472

Posted: 09 Oct 2008 01:51:28 pm    Post subject:

I don't think the OS has any code for converting character values into tokens.

If you only need a specific subset of characters (say, letters, numbers, and a few others) you might consider handling the special cases by hand.

If you really want to convert arbitrary characters into tokens, here's a table you can use (assuming you're using OS 1.15 or above; if you want your code to run on earlier OSes you'll have to remove the newer tokens.)

Code:
 .dw $0000, $2162, $0000, $0000, $0000, $ecbb, $0000, $f3bb
 .dw $f1bb, $f0bb, $007f, $0080, $0081, $dfbb, $0000, $0000
 .dw $f4bb, $000c, $000d, $dcbb, $000b, $000a, $000e, $006d
 .dw $006f, $006e, $00b0, $003b, $0004, $eabb, $edbb, $eebb
 .dw $0029, $002d, $002a, $d2bb, $0000, $dabb, $d4bb, $d0bb
 .dw $0010, $0011, $0082, $0070, $002b, $0071, $003a, $0083
 .dw $0030, $0031, $0032, $0033, $0034, $0035, $0036, $0037
 .dw $0038, $0039, $003e, $d6bb, $006b, $006a, $006c, $ffbb
 .dw $d1bb, $0041, $0042, $0043, $0044, $0045, $0046, $0047
 .dw $0048, $0049, $004a, $004b, $004c, $004d, $004e, $004f
 .dw $0050, $0051, $0052, $0053, $0054, $0055, $0056, $0057
 .dw $0058, $0059, $005a, $005b, $d7bb, $0007, $00f0, $d9bb
 .dw $d5bb, $b0bb, $b1bb, $b2bb, $b3bb, $b4bb, $b5bb, $b6bb
 .dw $b7bb, $b8bb, $b9bb, $babb, $bcbb, $bdbb, $bebb, $bfbb
 .dw $c0bb, $c1bb, $c2bb, $c3bb, $c4bb, $c5bb, $c6bb, $c7bb
 .dw $c8bb, $c9bb, $cabb, $0008, $d8bb, $0009, $cfbb, $f5bb
 .dw $e0bb, $e1bb, $e2bb, $e3bb, $e4bb, $e5bb, $e6bb, $e7bb
 .dw $e8bb, $e9bb, $6ebb, $6fbb, $70bb, $71bb, $72bb, $73bb
 .dw $74bb, $75bb, $76bb, $77bb, $78bb, $79bb, $7abb, $7bbb
 .dw $7cbb, $7dbb, $cdbb, $7fbb, $80bb, $81bb, $82bb, $83bb
 .dw $84bb, $85bb, $86bb, $87bb, $88bb, $89bb, $8abb, $8bbb
 .dw $8cbb, $8dbb, $8ebb, $8fbb, $90bb, $91bb, $92bb, $93bb
 .dw $94bb, $95bb, $96bb, $97bb, $98bb, $99bb, $9abb, $9bbb
 .dw $9cbb, $9dbb, $9ebb, $9fbb, $a0bb, $a1bb, $a2bb, $a3bb
 .dw $a4bb, $0006, $a5bb, $a6bb, $a7bb, $a8bb, $a9bb, $cbbb
 .dw $ccbb, $abbb, $acbb, $0362, $0c62, $debb, $dbbb, $ebbb
 .dw $0000, $0000, $0000, $0000, $0000, $000f, $003f, $002c
 .dw $adbb, $aebb, $afbb, $31bb, $00eb, $2b63, $0000, $0000
 .dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
 .dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
 .dw $0000, $0000, $d3bb, $f2bb, $ddbb, $0000, $0000, $0000
 .dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
Back to top
adje


Newbie


Joined: 24 Dec 2007
Posts: 24

Posted: 16 Oct 2008 09:55:34 am    Post subject:

hmm,
it doesnt throw an error at b_call(_$4324)

but i there an easy way to display tokens? token by token.
because _putmap or _putc dont work with tokens.
Back to top
magicdanw
pcGuru()


Calc Guru


Joined: 14 Feb 2007
Posts: 1110

Posted: 16 Oct 2008 10:47:25 am    Post subject:

There's a bcall that goes something like tok_to_strng, or something. It'll convert a token into a string of displayable characters.
Back to top
adje


Newbie


Joined: 24 Dec 2007
Posts: 24

Posted: 16 Oct 2008 11:50:05 am    Post subject:

k now i got most of the symbols tokens together with the character value.
but i cant find these arrow tokens.
with character value im talking bout the 1 byte hex code metioned at the 'Large Font Map ' in asm28days.

i guess for all the symbols displayed there, you can display all of them (except for $D6...bug?), there should be a token.
does someone know these by heart Smile hehe, guess not, but maybe someone does know where to find them.

you would really help me out Very Happy
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 16 Oct 2008 01:04:05 pm    Post subject:

http://tibasicdev.wikidot.com/tokens

It's probably the case that there's a better way to do whatever it is you're doing, though.
Back to top
adje


Newbie


Joined: 24 Dec 2007
Posts: 24

Posted: 17 Oct 2008 10:28:33 am    Post subject:



why, i have through ti83plus.inc tokens like 4 times.it ends at token Garbage collect. that why i couldnt find the arrow tokens.
i thank you darkliner Very Happy
imma gonna search for newer ti83plus.inc or edit the one i got myself.
when edited should i post it here?
Back to top
darkstone knight


Advanced Member


Joined: 07 Sep 2008
Posts: 438

Posted: 17 Oct 2008 12:25:23 pm    Post subject:

darkliner? >.>

who is that? lol Neutral
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement