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:
Code:
I'm using this assembler.
I just learned z80 asm, so any pointers (hehe) would be useful!
This is the code I have so far:
Code:
#include "ti83plus.inc"
#define progStart $9D95
.org progStart-2
.db $BB,$6D
start:
;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
b_call(_ZeroOP1)
ld hl,op1+1
ld (hl),'b'
b_call(_RclVarSym)
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
ret
I'm using this assembler.
I just learned z80 asm, so any pointers (hehe) would be useful!