Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
I'm trying to write a BASIC poke and peek equivalent for the TI-83+ to experiment. I'm trying to figure out how to read the values from user variables (A,B,C,θ). From what I've read I have to use the OPs to access the variable information, but I haven't come across ways to change user vars. For peek, I would like to put the output in a variable so TI-BASIC programs can use it.

This is the code I have so far:


#include    "ti83plus.inc"
#define     progStart   $9D95
.org        progStart-2
.db         $BB,$6D
   ;get poke address
   b_call(_ZeroOP1) ;reset op1
   ld hl,op1+1   ;set hl to the address of the location of op1s var name (a)
   ld (hl),'a' ;set a to the op1s var name (the address stored in hl)
   b_call(_RclVarSym) ;set op1 to the var name and value
   ld hl,op1+9 ;set hl to the address of the location of op1s var value. first nine bytes is for a var name
   push hl
   ;get poke value, same thing except we are accessing var b
   ld hl,op1+1
   ld (hl),'b'
   ld de,(op1+9) ;we want the content at this address, not the actual address
   push de
   pop hl ; Im just swapping hl and de
   pop de ; I read somewhere that de changes or something, thats why i pushed it in the first place
   ld (de),hl ; putting the value at address in hl into the address in de

I'm using this assembler.
I just learned z80 asm, so any pointers (hehe) would be useful!
Whoops. Can't load HL into DE's address.
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
Page 1 of 1
» All times are GMT - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum