Hi found C code for 16bit float arthimatic http://www.jhauser.us/arithmetic/SoftFloat.html It is possible to include Softfloat library to incorporate in SDCC C compiler ?
float16 for all 8bit Controller sdcc l
__sfr __at 0X89 P2M1; __sfr __at 0X91 SFRS; define P2M1_P2 2 define PosBit7 0x07 define Set(Reg,Bit) #ifdef Reg_P2 { SFRS = 2; Reg |= (1<<Bit); SFRS =0; } #elseif { Reg |= (1<<Bit); } #else #endif void main (void) { Set(P2M1,3); }
Noted
include<at89x52.h></at89x52.h> ifdef Bit #define SET(Reg,Bit) Reg|=(1<<Bit) #else #define SET(Reg,Bit) Bit=1; #endif #define SET1(Reg,Bit) Bit=1; define SET1(Reg,Bit) Bit=1; void main(void) { SET(PCON,SMOD); SET(P0,P0_3); SET1(P0,P0_3); } compilation fail ref the attached JPG image
include<at89x52.h></at89x52.h> ifdef Bit #define SET(Reg,Bit) Reg|=(1<<Bit) #else #define SET(Reg,Bit) Bit=1; #endif define SET1(Reg,Bit) Bit=1; void main(void) { SET(PCON,SMOD); SET(P0,P0_3); SET1(P0,P0_3); } compilation fail ref the attached JPG image
__asm MUL A,B; MUL AB; __endasm; does not generate error Message for MUL A,B;
Half precision float (16 bits )