A89: I'm Happy to Bring you Great News!


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

A89: I'm Happy to Bring you Great News!




If your first impulse was to say "Just what we've been waiting for!" then send
me a personal e-mail. You're obviously a Sailor Moon nut too. :)

Anyway, for the REAL news, I finally got someone to reveal the secret of
displaying d0 on the screen, or at least making it a string. So for those of
you who have been begging, but never got any response (like me), here's what
none other than Jimmy Mardell gave me:

;   IN:  d0  - The number
;	 d1  - Number of digits
;	 a0  - Pointer to string
;   OUT: *a0 - The string (null-terminated)
;
; --------------------------------

ConvStr:
 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
 rts


Now, to use it, do this:

 move.w #1000,d0
 move.w #4,d1
 lea buf(PC),a0
 bsr ConvStr
 ; display string at A0 - i don't remember how you did that :)

buf:
 ds.b 5 ; must be at least no. of digits+1 byte


I haven't tried this yet, so don't sue me if it doesn't work. :) However, I
know that some people (like me) are having a REALLY hard time finding a d0
display routine, and, well, here it is. Happy coding!


Follow-Ups: