Add unsigned long to bcd conversion;
Replace for(i=n;i>0;i--) with for(i=n;i!=0;i--), so sdcc would use djnz to implement the loop;
Clean up code