On Sun, 13 Jan 2013 13:23:23 +0100 al_bin <al_...@vp.pl> wrote: > W dniu 2013-01-13 09:53:00 użytkownik Molnár Károly <prot...@freemail.hu> > napisał: > ... > > Something left out of the calculation. In the case of TMRx, differ the read > > and write sequence. > > write: first TMRxH, second TMRxL > > read: first TMRxL, second TMRxH > > > > :-) > > As for mcs51: > SDCC manual (http://sdcc.sourceforge.net/doc/sdccman.pdf) ch. 3.4.1.7 > > > "16 Bit and 32 bit special function register combinations which require a > certain access order are better not declared > using __sfr16 or __sfr32. Allthough SDCC usually accesses them Least > Significant Byte (LSB) first, this is not > guaranteed." > > Albert >
This would be good for a new type: __sfr16_t --- "t" -> timer Perhaps even these will: __sfr16_be --- "be" -> big-endian __sfr16_le --- "le" -> little-endian Otherwise, I now updated the PIC16 branch (device and include files). From now on use the __ sfr16 type. Due to the above to TMRx registers, no sfr16. Two examples of the realization: ..................................... __at(0x0FC3) __sfr ADRES; __at(0x0FC3) __sfr ADRESL; __at(0x0FC3) __sfr16 ADRESw; __at(0x0FC4) __sfr ADRESH; ..................................... __at(0x0FD9) __sfr FSR2L; __at(0x0FD9) __sfr16 FSR2w; __at(0x0FDA) __sfr FSR2H; ..................................... Károly ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_123012 _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user