../cvsm
[fw/sdcc] / src / avr / gen.c
index 3bed205bdb5639365e7abc92729823ba911cfc8d..faf4c36ca613bbdfabcbfecfed91ca40400a12eb 100644 (file)
@@ -34,6 +34,9 @@
 #ifdef HAVE_SYS_ISA_DEFS_H
 #include <sys/isa_defs.h>
 #else
+#ifdef HAVE_MACHINE_ENDIAN_H
+#include <machine/endian.h>
+#else
 #ifdef HAVE_ENDIAN_H
 #include <endian.h>
 #else
@@ -43,6 +46,7 @@
 #endif
 #endif
 #endif
+#endif
 
 #include "common.h"
 #include "SDCCpeeph.h"
@@ -4639,16 +4643,17 @@ genAddrOf (iCode * ic)
        int size, offset;
 
        aopOp (IC_RESULT (ic), ic, FALSE);
-
+       assert(AOP_SIZE(IC_RESULT(ic)) >= 2);
        /* if the operand is on the stack then we
           need to get the stack offset of this
           variable */
        if (sym->onStack) {
                /* if it has an offset then we need to compute it */
                if (sym->stack) {
-                       emitcode ("mov", "a,_bp");
-                       emitcode ("add", "a,#0x%02x",
+#if 0
+                       if (AOP_ISHIGHREG(AOP(
                                  ((char) sym->stack & 0xff));
+#endif
                        aopPut (AOP (IC_RESULT (ic)), "a", 0);
                }
                else {