toraora wrote:
Hi all,
I'm wondering how to access the calculator variables (A, B, C, L1, L2, Str1, etc.) in ASM. I tried going through the 28 days tutorial but it doesn't quite make sense to me.
Thanks
Edit: When in doubt, read this document:
http://education.ti.com/downloads/guidebooks/sdk/83p/83psysroutines.pdf
Older post: Allow me to present this probably quite poor code from Doors CS 4:
Code: ;+---------------------------------------------+
;| Set BASIC Variables Routines |
;+---------------------------------------------+
;| Thanks to Tutorial 25 of ASMGuru for this! |
;+---------------------------------------------+
SETVAR_X:
call SETVAR_INIT
ld hl,'X'
ld (OP1+1),hl
jp _STOOTHER
SETVAR_Y:
call SETVAR_INIT
ld hl,'Y'
ld (OP1+1),hl
jp _STOOTHER
SETVAR_A:
call SETVAR_INIT
ld hl,'A'
ld (OP1+1),hl
jp _STOOTHER
SETVAR_N:
call SETVAR_INIT
ld hl,'N'
ld (OP1+1),hl
jp _STOOTHER
SETVAR_N_hl:
call _SetXXXXOp2
call _Op2ToOp1
call _PUSHREALO1
call _ZEROOP1
ld hl,'N'
ld (OP1+1),hl
jp _STOOTHER
SETVAR_INIT:
ld (op1),a
call _Setxxop1
call _PUSHREALO1
call _ZEROOP1
ret
;+---------------------------------------------+
;| Get BASIC Variables Routines |
;+---------------------------------------------+
;| Thanks to Tutorial 25 of ASMGuru for this! |
;+---------------------------------------------+
GET_A:
call _zerooop1
ld hl,op1+1
ld (hl),'A' ;or any other var
jp GETVAR
GET_X:
call _zerooop1
ld hl,op1+1
ld (hl),'X' ;or any other var
jp GETVAR
GET_Y:
call _zerooop1
ld hl,op1+1
ld (hl),'Y' ;or any other var
jp GETVAR
GET_N:
call _zerooop1
ld hl,op1+1
ld (hl),'N' ;or any other var
GETVAR:
call _rclvarsym ;op1 / op2 -> value
call _convop1
ld a,e ;previously ld a,hl
ret
Note that this is TI-83 ASM. For TI-83+ ASM, all the call _routines need to be bcall(_routine)s.