All the standard TI-Basic Number to string implementations have a bit to be desired so I figured I'd try to write up a quick on that could be manually typed in as hex for basic programmers to use. After failing because I was never very good at ASM MateoC came up with the following which I figured I'd share.


Code:
.nolist
#include "ti83plus.inc"
.list

   .org userMem-2
   .db $BB,$6D
   ; Program code goes here
    ld hl,0
 bcall(_createtempstring)
 push de
  bcall(_PushRealO4)
 pop de
 bcall(_SetEmptyEditPtr)
 
 bcall(_ansname)
 bcall(_rclvartoedit)
 bcall(_closeeditequ)
 
 bcall(_PopRealO1)
 bcall(_StoAns)
   ret

HEX for use with ExecASM or hand typed AsmPrgm input:
210000EF2443D5EFB143D1EF6949EF524BEFAB49EF6C49EF9043EFBF4AC9

SC3 project here: http://sc.cemetech.net/?hash=gTRaP+uRqzBFhgHCGHbwc6pQtLIl

I feel like there should be a simpler method using bcall(_FormBase) but I'm not sure how you'd go from the string starting at OP3 to Ans or a string var so I'll leave it there.


EDIT:
And because I couldn't give up on a good idea I came up with this as an alternate solution, but the alternate solution has the problem that the decimal point is displayed as the token CubicReg because of reasons that I couldn't find a good solution to.


Code:

.nolist
#include "ti83plus.inc"
.list

   .org userMem-2
   .db $BB,$6D
   ; Program code goes here
   bcall(_RclAns)
   bcall(_EOP1NotReal)
   LD A,$0A
   bcall(_FormEReal)
   ;Push BC
   ;POP HL
   LD HL,$0A
    bcall(_createtempstring)
   LD HL,OP3
   INC DE
   INC DE
   bcall(_StrCopy)
   LD HL,OP4
   RST 20h
   bcall(_StoAns)
   ret
(Long overdue reply to this topic). Thanks for coming up with this and sharing it, TheStorm. It's always nice to see one of our otherwise lapsed ASM programmers contributing something to the community to fill a gap. I hope those of us looking for such a routine will find it (and I suspect it should also go in the relevant Useful z80/ez80 ASM Routines topic).
  
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