[A89] BCD in sprintf
[Prev][Next][Index][Thread]
[A89] BCD in sprintf
here's another newbie question :P
How should I pass a BCD to sprintf? this is what I'm doing right now:
(all this is after calling bcddiv, so a6 holds the address of the result)
lea -30(sp),sp
move.w 8(a6),-(sp)
move.l 4(a6),-(sp)
move.l (a6),-(sp)
pea DispString(pc)
pea 14(sp)
move.l sprintf(a5),a4
jsr (a4)
DispString:
.string "r=%f"
but it's not working. I tried the same with a "constant" float, so I
replaced the move's for something like this:
move.w #0x00,-(sp)
move.l #0x6250,-(sp)
move.l #0x4C00,-(sp)
I also tried the other order (pushing the last word at the end and
0x4C00 first) but with the same result. What's the right way to pass
a BCD number to a function?
tia,
ra.-
Follow-Ups: