Today, I tried to write one of my first ASM programs. It was just a test and not meant for public release. It is meant to check the battery's charge and report it back as a numerical value, but something isn't working. Could someone help me?

#include "ti83plus.inc"

.org _UserMem

ld l,a
ld hl,l

I'm unsure of what those b_call addresses are, since you used the number instead of word constants, but I do see one problem immediately.

You have written


.org _UserMem

    ;Code here

whereas you should have


.org _UserMem - 2
.db t2ByteTok, tAsmCmp

    ;Code here

This is necessary because those 2 bytes are a header that tell the calculator your program is an assembly program.
Oh, ok. Thanks!
That shouldn't even assemble: the symbol is "UserMem", not "_UserMem". In general, the assembler will point you to problems like that that can be fixed with a little bit of proofreading. Smile
Also there is an illegal instruction in there as well.

What assembler are you using?

Have you had a look into the DCS kit?
And to continue to point out things you should consider changing, to nip bad habits in the bud, you should really use the bcall names instead of their hexadecimal equivalents whenever possible.
Though there aren't any jumps/calls here, so the .org error shouldn't cause any troubles. But you can't do "ld hl,l". All that would do anyway is load l into l, so it wouldn't change anything. That last BCALL is also missing a number: bcall(452h), probably $452E (_NewLine).

Instead of using the hex addresses, use the equates from ti83plus.inc. It'll make your code much more readable. At the very least put a comment next to the bcall saying which bcall it is and/or what it does.

What problems are you having? Is it not assembling?
chickendude wrote:
What problems are you having? Is it not assembling?

Probably. I have to wonder though: Is there any reason why you decided to use the address equivalents instead of the text representations? Have you made any progress on this so far?
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