A92: Re: Letters and Numbers


[Prev][Next][Index][Thread]

A92: Re: Letters and Numbers




Hi.
For what you need there's a small routine that will do the job, here it is :

First you need to input these :
 d0 = number to be converted
 d1 = number of digits
 a0 = string's adress        ( you need to declare a string in your
variables. Check that you have a Nul byte at the end, it's needed for
WriteStr or DrawStr ).


ConvStr:
 movem.l d0-d7/a0-a6,-(a7)
  adda.l  d1,a0
  clr.b   (a0)
  subq.b  #1,d1
RepConv:
  divu  #10,d0
  move.l  d0,d2
  lsr.l  #8,d2
  lsr.l  #8,d2
  add.b  #48,d2
  move.b  d2,-(a0)
  and.l  #$FFFF,d0
  dbra  d1,RepConv
 movem.l (a7)+,d0-d7/a0-a6
  rts


VIVES Fabien
fvives@NOSPAMfree.fr
( Enlevez NOSPAM pour me repondre )
( Get NOSPAM off to answer me ).
WebSite : http://fvives.free.fr/MLTS.htm ( About Ti92...)
ICQ : 16950211

----- Message d'origine -----
De : Noah Medling <medlingn@zdnetmail.com>
À : <assembly-92@lists.ticalc.org>
Envoyé : jeudi 5 août 1999 00:33
Objet : A92: Letters and Numbers


>
> Does anyone know how to convert numbers into strings, so I can use them
with DrawStr or WriteStr, without using libraries?
>
>
> Free web-based email, anytime, anywhere!
> ZDNet Mail - http://www.zdnetmail.com
>
>



References: