As far as I can see, there is some problem with Darrel subroutine.
To get correct number in microchip format I used this code:
Result is: $833E0000Code:aint = 2375 Gosub itofa ' Convert int to float bint = 100 Gosub itofb ' Convert int to float Gosub fpdiv
And I can display correctly with this code:
Output is:Code:A_Float = $833E0000 ; with 1 decimal place Bint = 10 GOSUB ItoFB GOSUB fpmul GOSUB FtoIA HSEROUT2 [" ",SDEC Aint/10,".",DEC1 ABS(Aint),13,10] A_Float = B ; with 2 decimal places Bint = 100 GOSUB ItoFB GOSUB fpmul GOSUB FtoIA HSEROUT2 [" ",SDEC Aint/100,".",DEC2 ABS(Aint),13,10] A_Float = B ; with 3 decimal places Bint = 1000 GOSUB ItoFB GOSUB fpmul GOSUB FtoIA HSEROUT2 [" ",SDEC Aint/1000,".",DEC3 ABS(Aint),13,10,13,10]
23.7
23.74
23.749
That is fine...
But when I try to convert $41BE0000 with Darrel's routine result is
IEEE = 41BE0000
Mchip= 82BE0000




Bookmarks