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.
Z80 & 68k Assembly =>
z80 & ez80 Assembly
Author |
Message |
|
bananaman Indestructible
Calc Guru
Joined: 12 Sep 2005 Posts: 1124
|
Posted: 23 Nov 2008 08:31:25 pm Post subject: |
|
|
I have two questions involving small text.
1) When vputs is executed, it says in TI's documentation that hl is destroyed. My guess is that it increments hl to point at each character individually. Can I use this to my benefit? Does hl really point to the 0 at the end of the text or does it point one byte beyond the text, or does it really get destroyed beyond use?
Edit:
First question answered with some testing. It does indeed point to the next byte in memory. This means that if you want to display 2 strings in a row, you have to place them adjacently in memory and you can get rid of one ld hl,string command.
2) I am trying to use the '[' character, but for some reason it is displayed as a theta. Is this because spasm is interpreting it wrong or something with vputs?
Last edited by Guest on 23 Nov 2008 08:36:42 pm; edited 1 time in total |
|
Back to top |
|
|
luby I want to go back to Philmont!!
Calc Guru
Joined: 23 Apr 2006 Posts: 1477
|
Posted: 23 Nov 2008 08:38:19 pm Post subject: |
|
|
1. Don't. It might be a nice side affect now, but if TI changes it, you are up a crick w/o a paddle
2. '[' is actually TI-OS's ASCII character for theta. Try tLBrack instead. Do "stuff: ", tLBrack, "dkasd]". |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 23 Nov 2008 08:39:48 pm Post subject: |
|
|
bananaman wrote: I have two questions involving small text.
1) When vputs is executed, it says in TI's documentation that hl is destroyed. My guess is that it increments hl to point at each character individually. Can I use this to my benefit? Does hl really point to the 0 at the end of the text or does it point one byte beyond the text, or does it really get destroyed beyond use? It probably does get incremented the way you describe, but I don't suggest relying on it. Imagine if you test it and it turns out you're right -- except on some obscure OS version where _VPutS was written differently. Or worse yet, the new OS comes out the next month and it doesn't work the same way. It's better to just save the HL register, in my opinion.
Quote: 2) I am trying to use the '[' character, but for some reason it is displayed as a theta. Is this because spasm is interpreting it wrong or something with vputs?
[post="129376"]<{POST_SNAPBACK}>[/post]
That's because the TI character table is slightly different from the ASCII table. ASCII has "...WXYZ[\]..." at the relevant point in the table, but the TI character table has [font="arial"]θ immediately following the uppercase letters, replacing [. If you want to type a [ instead, use $C1. This is defined as "LlBrack" (not tLBrack) in most ti83plus.inc files, but unless you're using it often you might as well write out the hex value.
Last edited by Guest on 23 Nov 2008 08:41:56 pm; edited 1 time in total |
|
Back to top |
|
|
bananaman Indestructible
Calc Guru
Joined: 12 Sep 2005 Posts: 1124
|
Posted: 23 Nov 2008 08:48:25 pm Post subject: |
|
|
I just got done writing a creative little loop that would display most of my text for me utilizing the principle of hl being incremented, and now you suggest that I throw it out the window. If we are so conscious that TI might change the OS, why do we even trust any of its documentation about which registers are destroyed, because the new routines might destroy different registers. And they also might purge some unnecessary bcalls as well.
Maybe, I'm just being angry that I can't use my cool optimization and I have to unroll my code again.
2) Thanks for the help in displaying the left brace. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 23 Nov 2008 08:52:34 pm Post subject: |
|
|
bananaman wrote: I just got done writing a creative little loop that would display most of my text for me utilizing the principle of hl being incremented, and now you suggest that I throw it out the window. If we are so conscious that TI might change the OS, why do we even trust any of its documentation about which registers are destroyed, because the new routines might destroy different registers. And they also might purge some unnecessary bcalls as well.
[post="129383"]<{POST_SNAPBACK}>[/post] The reason that documentation is there is because in theory, they will keep the details in the documentation the same even if they decide to rewrite the routine. For example, if they decide that the DE register should be used for going through the string, they're not going to change the routine, but just add code for switching the DE and HL registers at the beginning, so the input remains the same.
Come to think of it, however, TI documentation isn't particularly careful about stating the details of what gets destroyed and what doesn't, and they probably haven't looked at that code in ages. I wouldn't worry about the undocumented value of HL terribly. If you really like the routine, keep it.
Last edited by Guest on 23 Nov 2008 08:53:06 pm; edited 1 time in total |
|
Back to top |
|
|
FloppusMaximus
Advanced Member
Joined: 22 Aug 2008 Posts: 472
|
Posted: 23 Nov 2008 09:09:01 pm Post subject: |
|
|
Yes, it's undocumented... but at the same time, VPutS is not a routine that is ever going to change in any substantial way. It is nearly identical on every calculator ever made. There are probably many programs that make the same assumption. |
|
Back to top |
|
|
|
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