+2005-06-30 Maarten Brock <sourceforge.brock AT dse.nl>
+
+ * doc/sdccman.lyx: documented sfr16/sfr32,
+ added example for using storage class with function pointers
+ * src/mcs51/gen.c (genPlusIncr): optimized small offsets from dptr
+
2005-06-28 Maarten Brock <sourceforge.brock AT dse.nl>
* device/lib/_gptrget.c: also push/pop _PSBANK, added # to 0x03
\begin_inset LatexCommand \index{\_\_sfr}
+\end_inset
+
+ / sfr16
+\begin_inset LatexCommand \index{sfr16}
+
+\end_inset
+
+
+\begin_inset LatexCommand \index{\_\_sfr16}
+
+\end_inset
+
+ / sfr32
+\begin_inset LatexCommand \index{sfr32}
+
+\end_inset
+
+
+\begin_inset LatexCommand \index{\_\_sfr32}
+
\end_inset
/ sbit
Like the bit keyword,
\emph on
-sfr / sbit
+sfr / sfr16 / sfr32 / sbit
\emph default
-signifies both a data-type and storage class, they are used to describe
- the
+signify both a data-type and storage class, they are used to describe the
+
\emph on
s
\emph default
0x80 P0;\SpecialChar ~
/* special function register P0 at location 0x80 */
\newline
+/* 16 bit special function register combination for timer 0 */
+\newline
+/* with the high byte at location 0x8C and the low byte at location 0x8A
+ */
+\newline
+sfr16 at
+\begin_inset LatexCommand \index{at}
+
+\end_inset
+
+
+\begin_inset LatexCommand \index{\_\_at}
+
+\end_inset
+
+ 0x8C8A TMR0;
+\newline
sbit at 0xd7 CY; /* CY (Carry Flag
\begin_inset LatexCommand \index{Flags}
sbit
\emph default
addresses a specific bit within these sfr.
+\newline
+16 Bit and 32 bit special function register combinations which require a
+ certain access order are better not declared using
+\emph on
+sfr16
+\emph default
+ or
+\emph on
+sfr32.
+
+\emph default
+ Allthough SDCC usually accesses them Least Significant Byte (LSB) first,
+ this is not guaranteed.
\layout Subsubsection
Pointers
*/
\newline
char * xdata p;
+\newline
+
+\newline
+/* the following is a function pointer physically located in data space
+ */
+\newline
+char (* data fp)(void);
\layout Standard
Well you get the idea.
return TRUE;
}
+ /* if result is dptr */
+ if ((AOP_TYPE (IC_RESULT (ic)) == AOP_STR) &&
+ (AOP_SIZE (IC_RESULT (ic)) == 2) &&
+ !strncmp(AOP (IC_RESULT (ic))->aopu.aop_str[0], "dpl", 4) &&
+ !strncmp(AOP (IC_RESULT (ic))->aopu.aop_str[1], "dph", 4))
+ {
+ if (aopGetUsesAcc (IC_LEFT (ic), 0))
+ return FALSE;
+
+ if (icount > 9)
+ return FALSE;
+
+ if ((AOP_TYPE (IC_LEFT (ic)) != AOP_DIR) && (icount > 5))
+ return FALSE;
+
+ aopPut (IC_RESULT (ic), aopGet (IC_LEFT (ic), 0, FALSE, FALSE), 0, FALSE);
+ aopPut (IC_RESULT (ic), aopGet (IC_LEFT (ic), 1, FALSE, FALSE), 1, FALSE);
+ while (icount--)
+ emitcode ("inc", "dptr");
+
+ return TRUE;
+ }
+
/* if the sizes are greater than 1 then we cannot */
if (AOP_SIZE (IC_RESULT (ic)) > 1 ||
AOP_SIZE (IC_LEFT (ic)) > 1)