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
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 01 Nov 2003 10:04:13 am    Post subject:

I can store a string to a new appvar, and read the whole thing fine, but what if I am storing options to an appvar, say like the content of the appvar would be "10110" for on off on on off. How would i get that first 1 and store it to a, that 0 and store it to a. Normally for a string (iff you know the appvar exists) you do:


Code:
ld hl,appvarname
bcall(_chkfindsym)
inc de
inc de
ex hl,de
bcall(_puts)

appvarname:
.db AppVarObj,"Test",0


However instead of reading the whole contents of the appvar, I want to read 1 sigle number or character. I tried doing ld a,(de) after the inc de's and it didnt work. How do I do this?
Back to top
Justin W.
Shattered Silence


Advanced Member


Joined: 24 May 2003
Posts: 429

Posted: 01 Nov 2003 01:24:51 pm    Post subject:

Jeffrey wrote:

Code:
ld hl,appvarname
bcall(_chkfindsym)
inc de
inc de
ex hl,de
bcall(_puts)

appvarname:
.db AppVarObj,"Test",0

First of all your code will not work. You never copied the appvar data to op1 using rst 20h.


Code:
 ld hl,appvarname
 rst 20h
 bcall(_chkfindsym)
 ret c    ;If it doesn't exist return to OS
 inc de
 inc de
 ld a,(de)   ;get first byte of appvar and store it into A
                ;You can do whatever you want with it now.

appvarname:
.db AppVarObj,"Test",0
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 01 Nov 2003 01:30:57 pm    Post subject:

Sorry, that was an error on my part just typing it here.

The program that I made didnt have that error, but it still didnt return a as a valid number. If the first object in the appvar were a number, a would be 50 something.
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 01 Nov 2003 01:48:07 pm    Post subject:

here is my entire source


Code:
;Standard template for ti83+ asm programs
#include "ti83plus.inc";File needed to access system routines
.org userMem-2   ;Define where to start in memory
.db $BB,$6D   ;AsmPrgm instruction

   ld hl,appvarname
  rst 20h   ;don't use bcall(_Mov9ToOp1) it takes 2 more bytes than rst 20h and they
    ;do the same thing.
  ld hl,24
  bcall(_CreateAppVar)
   
   inc de
   inc de    ;by incrementing de twice we have bypassed the size bytes of the appvar
  
   ld hl,stufftoput ;load pointer to text into hl
  ld bc,10    ;10 being the length of the string
  ldir      ;copy the bytes  

   bcall(_clrlcdfull)
   
   ld hl,appvarname
   rst 20h
   bcall(_chkfindsym)
   ret c   ;If it doesn't exist return to OS
   inc de
   inc de
   ld a,(de)  ;get first byte of appvar and store it into A
              ;You can do whatever you want with it now.

   ld h,$00
   ld l,a
   bcall(_disphl)


   bcall(_GETKEY)

   bjump(_jforcecmdnochar)


appvarname:
.db AppVarObj,"Testing",0

stufftoput:
.db 8,9,5,2,6,7,6,2,9,0
   
 
 ret    ;Exit program
.end    ;End of code
Back to top
sgm


Calc Guru


Joined: 04 Sep 2003
Posts: 1265

Posted: 02 Nov 2003 12:12:43 am    Post subject:

Please tell me:

  • Why you are using JForce.
  • What you mean by "A would be 50 something". A would be 8.
  • Why in the name of Christ do you have a RET after all your static data


Last edited by Guest on 02 Nov 2003 12:14:47 am; edited 1 time in total
Back to top
Jeffrey


Member


Joined: 12 Jun 2003
Posts: 212

Posted: 02 Nov 2003 11:51:35 am    Post subject:

1. I am using Jforce to return to the homescreen
2. Run the program I made. It returns the ASCII code of 8, not "8" itself
3. I forgot to take it out

lol
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