+2007-01-02 Borut Razem <borut.razem AT siol.net>
+
+ * doc/sdccman.lyx: documented #pragma sdcc_hash
+ * support/cpp2/sdcpp.c: allow_naked_hash (value of #pragma sdcc_hash)
+ initialized to 0
+
2007-01-01 Bernhard Held <bernhard AT bernhardheld.de>
* src/SDCCast.c (createDo): backPatchLabels() needs falseLabel in
\layout Itemize
+\series bold
+pedantic_parse_number
+\series default
+
+\begin_inset LatexCommand \index{\#pragma pedantic\_parse\_number}
+
+\end_inset
+
+ (+ | -) - Pedantic parse numbers so that situations like 0xfe-LO_B(3) are
+ parsed properly and the macro LO_B(3) gets expanded.
+ Default is off.
+ Below is an example on how to use this pragma.
+
+\emph on
+ Note: this functionality is not in conformance with standard!
+
+\layout Verse
+
+
+\family typewriter
+#pragma pedantic_parse_number +
+\begin_inset LatexCommand \index{\#pragma pedantic\_parse\_number}
+
+\end_inset
+
+
+\newline
+\newline
+#define LO_B(x) ((x) & 0xff)
+\newline
+\newline
+unsigned char foo(void)
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+unsigned char c=0xfe-LO_B(3);
+\newline
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+
+return c;
+\newline
+}
+\newline
+
+\layout Itemize
+
+
\series bold
preproc_asm
\series default
\series bold
-pedantic_parse_number
+sdcc_hash
\series default
-\begin_inset LatexCommand \index{\#pragma pedantic\_parse\_number}
+\begin_inset LatexCommand \index{\#pragma sdcc\_hash}
\end_inset
- (+ | -) - Pedantic parse numbers so that situations like 0xfe-LO_B(3) are
- parsed properly and the macro LO_B(3) gets expanded.
- Default is off.
+ (+ | -) - Allow "naked" hash in macro definition, for example:
+\newline
+\family typewriter
+#define DIR_LO(x) #(x & 0xff)
+\family default
+\newline
+Default is off.
Below is an example on how to use this pragma.
-
-\emph on
- Note: this functionality is not in conformance with standard!
-
\layout Verse
\family typewriter
-#pragma pedantic_parse_number +
-\begin_inset LatexCommand \index{\#pragma pedantic\_parse\_number}
+#pragma preproc_asm +
+\newline
+#pragma sdcc_hash +
+\begin_inset LatexCommand \index{\#pragma sdcc\_hash}
\end_inset
-\newline
-\newline
-#define LO_B(x) ((x) & 0xff)
\newline
\newline
-unsigned char foo(void)
+#define ROMCALL(x)
+\backslash
\newline
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
-unsigned char c=0xfe-LO_B(3);
+mov R6_B3, #(x & 0xff)
+\backslash
\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+mov R7_B3, #((x >> 8) & 0xff)
+\backslash
\newline
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
-
-return c;
+lcall __romcall
\newline
-}
+\newline
+...
+\newline
+_asm
+\newline
+ROMCALL(72)
+\newline
+_endasm;
+\newline
+...
\newline
\layout Standard
{
unsigned int ret = sdcpp_common_init_options(argc, argv);
+ CPP_OPTION (parse_in, allow_naked_hash) = 0;
CPP_OPTION (parse_in, preproc_asm) = 1;
CPP_OPTION (parse_in, pedantic_parse_number) = 0;
CPP_OPTION (parse_in, obj_ext) = NULL;