On 14 May 2013, at 16:54, George Gwilt wrote:

> 
> Interesting. I used:
> 


 This is what should have appeared earlier!!

At entry:
        D0.L contains the (positive) number
        A0 points to the end of the area to
        contain the ASCII result

 At exit
        D0 = 0
        A0 points to the start of the number

LTOD    SWAP    D0
                BEQ.S   LTODW2
                MOVE.W   D0,D1
                BEQ.S   LTODW
                EXT.L   D1
                DIVU    #10,D1
                SWAP    D1
                MOVE.W D1,D0
                SWAP    D0
                DIVU    #10,D0
                SWAP    D0
                ADDI.W  #48,D0
                MOVE.B  D0,-(A0)
                SWAP    D0
                MOVE.W   D0,D1
                MOVE.L  D1,D0
                BRA.S   LTOD
LTODW1  DIVU    #10,D1
                SWAP    D0
LTODW2  ADDI.W  #48,D0
                MOVE.B  D0,-(A0)
                CLR.W   D0
LTODW   SWAP    D0
                BNE.S   LTODW1
                RTS     

This, and a further routine to deal with negatives, is in the Library files on 
my website.


> 
> 
> George

George

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to