#ifndef __SDC51_STDARG_H
#define __SDC51_STDARG_H 1
-#ifdef SDCC_USE_XSTACK
+#if defined(SDCC_STACK_TENBIT)
+
+#error Foo!
+
+typedef unsigned char _xdata * va_list ;
+#define va_arg(marker,type) *((type _xdata * )(marker -= sizeof(type)))
+#define va_start(marker,first) { marker = (va_list) ((char _xdata * )&first) ; }
+
+#elif defined(SDCC_USE_XSTACK)
typedef unsigned char _pdata * va_list ;
#define va_arg(marker,type) *((type _data * )(marker -= sizeof(type)))
/* set the macro for stack autos */
if ( options.stackAuto )
_addToList(preArgv, "-DSDCC_STACK_AUTO");
+
+ /* set the macro for stack autos */
+ if ( options.stack10bit )
+ _addToList(preArgv, "-DSDCC_STACK_TENBIT");
/* set the macro for large model */
switch(options.model)
aopOp(right,ic,FALSE);
/* special case both in far space */
- /* However, if we are using 10 bit stack mode,
- * the result should be held in DPTR2,
- * so we can operate without the special case.
- *
- * I think.
- */
- if (AOP_TYPE(right) == AOP_DPTR &&
+ if ((AOP_TYPE(right) == AOP_DPTR ||
+ AOP_TYPE(right) == AOP_DPTR2) &&
IS_TRUE_SYMOP(result) &&
isOperandInFarSpace(result)) {
- if (!options.stack10bit)
- {
- genFarFarAssign (result,right,ic);
- return ;
- }
- else
- {
- fprintf(stderr, "*** 10bit stack opt 1\n");
- emitcode(";", "look at me: optimization possible?\n");
- }
+ genFarFarAssign (result,right,ic);
+ return ;
}
aopOp(result,ic,TRUE);