Mark Rages wrote: > On 4/30/05, Dennis Crawley wrote: >> Mark Rages wrote: >>> Yes, and I applaud you for it. >>> >>> Anyone *else* used AN575 arithmetic? >> >> Your results are OK!. >> The problem is the Microchip format. >> To convert to IEEE format simple do this: >> >> IEEE_to_PIC16/17 PIC16/17_to_IEEE >> RLCF AARGB0,F RLCF AARGB0,F >> RLCF AEXP,F RRCF AEXP,F >> RRCF AARGB0,F RRCF AARGB0,F >> >> delete de C for 16 series. >> > > Thanks. > > I'm not sure that solves my problem though. I do. > > I'll try it on a simulator when I have time and post the raw > (unconverted) byte values. I've already did it for you, this is the code. Do not forget all the includes, and read carefully page 3 of AN575: ;-1.0 + -1.0 =3D -2.0 ;-1.0 =3D IEEE FORMAT: BF800000 ;-1.0 =3D PIC FORMAT: 7F800000 ;Expected: ;-2.0 =3D IEEE FORMAT: C0000000 ;-2.0 =3D PIC FORMAT: 80800000 SELF ;input in IEEE format MOVLW 0xbf MOVWF AEXP MOVLW 0x80 MOVWF AARGB0 MOVLW 0x00 MOVWF AARGB1 MOVLW 0xbf MOVWF BEXP MOVLW 0x80 MOVWF BARGB0 MOVLW 0x00 MOVWF BARGB1 IEEE2MCHP: RLF AARGB0,F RLF AEXP,F RRF AARGB0,F RLF BARGB0,F ;yeah! RLF BEXP,F ;also this one RRF BARGB0,F CALL FPA24 MCHP2IEEE: RLF AARGB0,F RRF AEXP,F RRF AARGB0,F GOTO SELF Voil=E1! Dennis Crawley Argentina. :))))$300!!! --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist