I'm trying to access a user defined variable (N) from assembly. This is my code:
Code:
.nolist
#include "ti83plus.inc"
.list
.org $9D95 - 2
.db t2ByteTok, tAsmCmp
LD HL, RealVariableN
bcall(_Mov9toOP1)
bcall(_RclVarSym)
bcall(_DispOP1A)
ret
RealVariableN:
.db RealObj, "N", 0, 0 ;line 17
When N is not defined the code errors "UNDEFINED" (as expected), when N is defined (1→N) the error is "OVERFLOW". What am I doing wrong?
I'm going to assume you meant when N is defined there
It's because the register A is never set before you call _DispOP1A. Hope this helps!
MateoConLechuga wrote:
I'm going to assume you meant when N is defined there
It's because the register A is never set before you call _DispOP1A. Hope this helps!
Edited, thanks .
I added Code: LD A, 5
before that line, and the program has stopped crashing, but it still doesn't display anything to the screen. Do you know what the problem is?
Yeah, you probably just didn't set up penCol and penRow, but I imagine the real reason is you didn't copy the graph buffer to the screen at the end of your code
I think calling _GrBufCpy at the end will fix that.
MateoConLechuga wrote:
Yeah, you probably just didn't set up penCol and penRow, but I imagine the real reason is you didn't copy the graph buffer to the screen at the end of your code
I think calling _GrBufCpy at the end will fix that.
I'll try tomorrow, thanks! Why should the graph buffer be copied though?
The graph buffer is basically where the screen data exists. Since the LCD screen is not memory mapped, it uses ports to write the data in the graph buffer to the physical screen
I'm sorry it took so long, but it still doesn't work. My current code:
Code:
.nolist
#include "ti83plus.inc"
.list
.org $9D95 - 2
.db t2ByteTok, tAsmCmp
LD HL, RealVariableN
bcall(_Mov9toOP1)
bcall(_RclVarSym)
LD A, 5
bcall(_DispOP1A)
bcall(_GrBufCpy)
ret
RealVariableN:
.db RealObj, "N", 0, 0
The display show the axis and nothing else.
Sounds like you need to set (penCol) and (penRow) before the displaying
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
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