Hi everyone, new here to the forum.

I recently picked up a TI-84+CE and am going through the bootcamp process of learning assembly programming.

I am trying to add two numbers together and display the output on screen. When I try to do this using the HL register I get a very inaccurate final value output to the display, here is what I am currently doing and what is not working.


Code:

#include "ti84pce.inc"
.assume ADL=1
.org userMem-2
.db tExtTok,tAsm84CeCmp
   call _homeup
   call _ClrScrnFull
   ld a,5
   add a,10
   ld h,0
   ld l,a
   call _DispHL
   call _GetKey
   call _ClrScrnFull
   res donePrgm,(iy+doneFlags)
   ret


I get as an output 13631503

I was wondering if I could get an explanation as to the internals behind how this value is being calculated.
On the ez80, hl is a 3 byte value, so the upper byte is non-zero.
Replace the line that sets h to 0 with ld hl,0
commandblockguy wrote:
On the ez80, hl is a 3 byte value, so the upper byte is non-zero.
Replace the line that sets h to 0 with ld hl,0


Thank you, that seems to have done it.
  
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 UTC - 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

 

Advertisement