X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Favr%2Fgen.c;h=faf4c36ca613bbdfabcbfecfed91ca40400a12eb;hb=fd99dea2da897ab79bde30eb6718abf497e12265;hp=3bed205bdb5639365e7abc92729823ba911cfc8d;hpb=974a7cddf9d12dd6de03e0d9fe97b203b7839394;p=fw%2Fsdcc diff --git a/src/avr/gen.c b/src/avr/gen.c index 3bed205b..faf4c36c 100644 --- a/src/avr/gen.c +++ b/src/avr/gen.c @@ -34,6 +34,9 @@ #ifdef HAVE_SYS_ISA_DEFS_H #include #else +#ifdef HAVE_MACHINE_ENDIAN_H +#include +#else #ifdef HAVE_ENDIAN_H #include #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 {