Changed Safe_calloc to use 2 arguements to mimic teh standard calloc function
authorjtvolpe <jtvolpe@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 6 Feb 2001 03:07:54 +0000 (03:07 +0000)
committerjtvolpe <jtvolpe@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 6 Feb 2001 03:07:54 +0000 (03:07 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@588 4a8a32a2-be11-0410-ad9d-d568d2c75423

29 files changed:
debugger/mcs51/break.c
debugger/mcs51/sdcdb.c
debugger/mcs51/symtab.c
src/SDCC.lex
src/SDCC.y
src/SDCCBBlock.c
src/SDCCast.c
src/SDCCbitv.c
src/SDCCcse.c
src/SDCCglue.c
src/SDCChasht.c
src/SDCCicode.c
src/SDCCloop.c
src/SDCCmain.c
src/SDCCpeeph.c
src/SDCCset.c
src/SDCCsymt.c
src/SDCCval.c
src/avr/gen.c
src/avr/ralloc.c
src/ds390/gen.c
src/mcs51/gen.c
src/pic/gen.c
src/pic/glue.c
src/z80/gen.c
support/Util/NewAlloc.c
support/Util/newalloc.h
support/cpp/config.h
support/cpp/cpplib.c

index 61286f54de3270685c5bbc88c7aac42f16596fb2..fe412946ed06e74a3f9318c16ea543709fbdb633 100644 (file)
@@ -1,24 +1,24 @@
 /*-------------------------------------------------------------------------
   break.c - Source file for break point management
-             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+        Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "sdcdb.h"
@@ -29,20 +29,20 @@ static hTab *bptable = NULL;
 char userBpPresent = 0;
 /* call stack can be 1024 deep */
 STACK_DCL(callStack,function *,1024);
+
 /*-----------------------------------------------------------------*/
 /* setBreakPoint - creates an entry in the break point table       */
 /*-----------------------------------------------------------------*/
 int setBreakPoint (unsigned addr, char addrType, char bpType,
-                   int (*callBack)(unsigned,char,char,int,context *) ,
-                   char *fileName, int lineno)
+        int (*callBack)(unsigned,char,char,int,context *) ,
+        char *fileName, int lineno)
 {
     breakp *bp, *bpl;
     static long bpnum = 0;
     char simbuf[50];
 
     /* allocate & init a new bp */
-    Safe_calloc(bp,sizeof(breakp));
+    Safe_calloc(1,bp,sizeof(breakp));
     bp->addr = addr;
     bp->addrType = addrType;
     bp->bpType = bpType;
@@ -50,38 +50,38 @@ int setBreakPoint (unsigned addr, char addrType, char bpType,
     bp->bpnum = (bpType == USER ? ++bpnum : 0);
     bp->filename = fileName;
     bp->lineno = lineno;
-    
+
     /* if this is an user break point then
        check if there already exists one for this address */
     if (bpType == USER) {
-       for ( bpl = hTabFirstItemWK(bptable,addr) ; bpl;
-             bpl = hTabNextItemWK(bptable)) {
-           
-           /* if also a user break point then issue Note : */
-           if (bpl->bpType == USER)
-               fprintf(stderr,"Note: breakpoint %d also set at pc 0x%x\n",
-                       bpl->bpnum,bpl->addr);
-       }
-
-       fprintf(stderr,"Breakpoint %d at 0x%x: file %s, line %d.\n",
-               bp->bpnum, addr, fileName, lineno);
-
-       userBpPresent++;
+  for ( bpl = hTabFirstItemWK(bptable,addr) ; bpl;
+        bpl = hTabNextItemWK(bptable)) {
+
+      /* if also a user break point then issue Note : */
+      if (bpl->bpType == USER)
+    fprintf(stderr,"Note: breakpoint %d also set at pc 0x%x\n",
+      bpl->bpnum,bpl->addr);
+  }
+
+  fprintf(stderr,"Breakpoint %d at 0x%x: file %s, line %d.\n",
+    bp->bpnum, addr, fileName, lineno);
+
+  userBpPresent++;
     }
 
     /* if a break point does not already exist then
        send command to simulator to add one */
-    if (!hTabSearch(bptable,addr)) 
-       /* send the break command to the simulator */
-       simSetBP (addr);
-          
+    if (!hTabSearch(bptable,addr))
+  /* send the break command to the simulator */
+  simSetBP (addr);
+
 
     /* now add the break point to list */
     hTabAddItem(&bptable,addr,bp);
-    
+
     return bp->bpnum ;
 }
-       
+
 /*-----------------------------------------------------------------*/
 /* deleteSTEPbp - deletes all step break points                    */
 /*-----------------------------------------------------------------*/
@@ -92,21 +92,21 @@ void deleteSTEPbp ()
 
     /* for break points delete if they are STEP */
     for ( bp = hTabFirstItem(bptable,&k); bp ;
-         bp = hTabNextItem(bptable,&k)) {
-       
-       /* if this is a step then delete */
-       if (bp->bpType == STEP) {
-           hTabDeleteItem(&bptable,bp->addr,bp,DELETE_ITEM,NULL);
-           
-           /* if this leaves no other break points then
-              send command to simulator to delete bp from this addr */
-           if (hTabSearch(bptable,bp->addr) == NULL) 
-               simClearBP (bp->addr);      
-
-           free(bp);
-       }
+    bp = hTabNextItem(bptable,&k)) {
+
+  /* if this is a step then delete */
+  if (bp->bpType == STEP) {
+      hTabDeleteItem(&bptable,bp->addr,bp,DELETE_ITEM,NULL);
+
+      /* if this leaves no other break points then
+         send command to simulator to delete bp from this addr */
+      if (hTabSearch(bptable,bp->addr) == NULL)
+    simClearBP (bp->addr);
+
+      free(bp);
+  }
     }
-  
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -120,21 +120,21 @@ void deleteNEXTbp ()
 
     /* for break points delete if they are NEXT */
     for ( bp = hTabFirstItem(bptable,&k); bp ;
-         bp = hTabNextItem(bptable,&k)) {
-       
-       /* if this is a step then delete */
-       if (bp->bpType == NEXT) {
-           hTabDeleteItem(&bptable,bp->addr,bp,DELETE_ITEM,NULL);
-       
-           /* if this leaves no other break points then
-              send command to simulator to delete bp from this addr */
-           if (hTabSearch(bptable,bp->addr) == NULL) {
-               simClearBP(bp->addr);
-               
-           }       
-           
-           free(bp);
-       }
+    bp = hTabNextItem(bptable,&k)) {
+
+  /* if this is a step then delete */
+  if (bp->bpType == NEXT) {
+      hTabDeleteItem(&bptable,bp->addr,bp,DELETE_ITEM,NULL);
+
+      /* if this leaves no other break points then
+         send command to simulator to delete bp from this addr */
+      if (hTabSearch(bptable,bp->addr) == NULL) {
+    simClearBP(bp->addr);
+
+      }
+
+      free(bp);
+  }
     }
 
 }
@@ -150,32 +150,32 @@ void deleteUSERbp (int bpnum)
 
     /* for break points delete if they are STEP */
     for ( bp = hTabFirstItem(bptable,&k); bp ;
-         bp = hTabNextItem(bptable,&k)) {
-       
-       /* if this is a user then delete if break
-          point matches or bpnumber == -1 (meaning delete
-          all user break points */
-       if (bp->bpType == USER && ( bp->bpnum == bpnum || bpnum == -1)) {
-           hTabDeleteItem(&bptable,bp->addr,bp,DELETE_ITEM,NULL);
-           
-           /* if this leaves no other break points then
-              send command to simulator to delete bp from this addr */
-           if (hTabSearch(bptable,bp->addr) == NULL) {
-               simClearBP (bp->addr);
-               
-           }       
-           fprintf(stdout,"Deleted breakpoint %d\n",
-                   bp->bpnum);
-           userBpPresent --;
-           if (bpnum == -1)
-               continue ;
-           else
-               break;
-       }
+    bp = hTabNextItem(bptable,&k)) {
+
+  /* if this is a user then delete if break
+     point matches or bpnumber == -1 (meaning delete
+     all user break points */
+  if (bp->bpType == USER && ( bp->bpnum == bpnum || bpnum == -1)) {
+      hTabDeleteItem(&bptable,bp->addr,bp,DELETE_ITEM,NULL);
+
+      /* if this leaves no other break points then
+         send command to simulator to delete bp from this addr */
+      if (hTabSearch(bptable,bp->addr) == NULL) {
+    simClearBP (bp->addr);
+
+      }
+      fprintf(stdout,"Deleted breakpoint %d\n",
+        bp->bpnum);
+      userBpPresent --;
+      if (bpnum == -1)
+    continue ;
+      else
+    break;
+  }
     }
 
     if (!bp && bpnum != -1)
-       fprintf(stderr,"No breakpoint number %d.\n",bpnum);
+  fprintf(stderr,"No breakpoint number %d.\n",bpnum);
 }
 
 /*-----------------------------------------------------------------*/
@@ -188,19 +188,19 @@ void listUSERbp ()
 
     /* if there are none then say so & return */
     if (!userBpPresent) {
-       fprintf(stdout,"No breakpoints.\n");
-       return ;
+  fprintf(stdout,"No breakpoints.\n");
+  return ;
     }
     fprintf(stdout,"Num Address What\n");
     for ( bp = hTabFirstItem(bptable,&k) ; bp ;
-         bp = hTabNextItem(bptable,&k)) {
-       
-       if (bp->bpType == USER ) {
-           fprintf(stdout,"%-3d 0x%04x  at %s:%d\n",
-                   bp->bpnum,bp->addr,
-                   bp->filename,bp->lineno);
-           
-       }
+    bp = hTabNextItem(bptable,&k)) {
+
+  if (bp->bpType == USER ) {
+      fprintf(stdout,"%-3d 0x%04x  at %s:%d\n",
+        bp->bpnum,bp->addr,
+        bp->filename,bp->lineno);
+
+  }
     }
 }
 
@@ -209,9 +209,9 @@ void listUSERbp ()
 /*-----------------------------------------------------------------*/
 static int simStopBPCB( unsigned int addr)
 {
-       fprintf(stdout,"Simulator stopped at Address 0x%04x\n",addr);
-       fprintf(stdout,"%s",simResponse());
-       return 1;
+  fprintf(stdout,"Simulator stopped at Address 0x%04x\n",addr);
+  fprintf(stdout,"%s",simResponse());
+  return 1;
 }
 
 /*-----------------------------------------------------------------*/
@@ -224,27 +224,27 @@ void clearUSERbp ( unsigned int addr )
 
     /* for break points delete if they are STEP */
     for ( bp = hTabFirstItemWK(bptable,addr); bp ;
-         bp = hTabNextItemWK(bptable)) {
-       
-       /* if this is a step then delete */
-       if (bp->bpType == USER) {
-           hTabDeleteItem(&bptable,bp->addr,bp,DELETE_ITEM,NULL);
-           
-           /* if this leaves no other break points then
-              send command to simulator to delete bp from this addr */
-           if (hTabSearch(bptable,bp->addr) == NULL) {
-               simClearBP(bp->addr);
-               
-           }      
-           fprintf(stdout,"Deleted breakpoint %d\n",
-                   bp->bpnum);
-           userBpPresent-- ;
-           break;
-       }
+    bp = hTabNextItemWK(bptable)) {
+
+  /* if this is a step then delete */
+  if (bp->bpType == USER) {
+      hTabDeleteItem(&bptable,bp->addr,bp,DELETE_ITEM,NULL);
+
+      /* if this leaves no other break points then
+         send command to simulator to delete bp from this addr */
+      if (hTabSearch(bptable,bp->addr) == NULL) {
+    simClearBP(bp->addr);
+
+      }
+      fprintf(stdout,"Deleted breakpoint %d\n",
+        bp->bpnum);
+      userBpPresent-- ;
+      break;
+  }
     }
 
     if (!bp)
-       fprintf(stderr,"No breakpoint at address 0x%x.\n",addr);
+  fprintf(stderr,"No breakpoint at address 0x%x.\n",addr);
 }
 
 /*-----------------------------------------------------------------*/
@@ -258,29 +258,29 @@ int dispatchCB (unsigned addr, context *ctxt)
     /* if no break points set for this address
        then use a simulator stop break point */
     if ((bp = hTabFirstItemWK(bptable,addr)) == NULL) {
-           return simStopBPCB(addr);
+      return simStopBPCB(addr);
     }
 
     /* dispatch the call back functions */
     for (; bp; bp = hTabNextItemWK(bptable)) {
-           
-           rv += (*bp->callBack)(addr,bp->addrType,
-                                 bp->bpType,bp->bpnum,ctxt);
+
+      rv += (*bp->callBack)(addr,bp->addrType,
+          bp->bpType,bp->bpnum,ctxt);
 
     }
-    
+
     return rv;
 }
 
 /*-----------------------------------------------------------------*/
 /* fentryCB - callback function for function entry                 */
 /*-----------------------------------------------------------------*/
-BP_CALLBACK(fentryCB) 
+BP_CALLBACK(fentryCB)
 {
     /* add the current function into the call stack */
     STACK_PUSH(callStack,ctxt->func);
-    
-    /* will have to add code here to get the value of SP 
+
+    /* will have to add code here to get the value of SP
        which will be used to display the value of local variables
        and parameters on the stack */
 
@@ -290,7 +290,7 @@ BP_CALLBACK(fentryCB)
 /*-----------------------------------------------------------------*/
 /* fexitCB - call back for function exit                           */
 /*-----------------------------------------------------------------*/
-BP_CALLBACK(fexitCB) 
+BP_CALLBACK(fexitCB)
 {
     /* pop the top most from the call stack */
     STACK_POP(callStack);
@@ -302,25 +302,25 @@ BP_CALLBACK(fexitCB)
 BP_CALLBACK(userBpCB)
 {
     if (srcMode == SRC_CMODE) {
-       fprintf(stdout,"Breakpoint %d, %s() at %s:%d\n",
-               bpnum, 
-               ctxt->func->sym->name, 
-               ctxt->func->mod->c_name,
-               ctxt->cline);
-       if (ctxt->func->mod && ctxt->cline > 0)
-           fprintf(stdout,"%d\t%s",ctxt->cline,
-                   ctxt->func->mod->cLines[ctxt->cline]->src);
+  fprintf(stdout,"Breakpoint %d, %s() at %s:%d\n",
+    bpnum,
+    ctxt->func->sym->name,
+    ctxt->func->mod->c_name,
+    ctxt->cline);
+  if (ctxt->func->mod && ctxt->cline > 0)
+      fprintf(stdout,"%d\t%s",ctxt->cline,
+        ctxt->func->mod->cLines[ctxt->cline]->src);
     } else {
-       fprintf(stdout,"Breakpoint %d, %s() at %s:%d\n",
-               bpnum, 
-               ctxt->func->sym->name, 
-               ctxt->func->mod->asm_name,
-               ctxt->asmline);
-       if (ctxt->func->mod && ctxt->asmline > 0)
-           fprintf(stdout,"%d\t%s",ctxt->asmline,
-                   ctxt->func->mod->asmLines[ctxt->asmline]->src);
+  fprintf(stdout,"Breakpoint %d, %s() at %s:%d\n",
+    bpnum,
+    ctxt->func->sym->name,
+    ctxt->func->mod->asm_name,
+    ctxt->asmline);
+  if (ctxt->func->mod && ctxt->asmline > 0)
+      fprintf(stdout,"%d\t%s",ctxt->asmline,
+        ctxt->func->mod->asmLines[ctxt->asmline]->src);
     }
-       
+
     return 1;
 }
 
@@ -330,29 +330,29 @@ BP_CALLBACK(userBpCB)
 BP_CALLBACK(stepBpCB)
 {
     static function *lfunc = NULL;
-    
+
     if (srcMode == SRC_CMODE) {
-       if ((lfunc && lfunc != ctxt->func) || !lfunc) 
-           fprintf(stdout,"%s () at %s:%d\n",
-                   ctxt->func->sym->name, 
-                   ctxt->func->mod->c_name,
-                   ctxt->cline);
-       
-       if (ctxt->func->mod && ctxt->cline > 0) {
-           fprintf(stdout,"%d\t%s",ctxt->cline ,
-                   ctxt->func->mod->cLines[ctxt->cline]->src);    
-       }
+  if ((lfunc && lfunc != ctxt->func) || !lfunc)
+      fprintf(stdout,"%s () at %s:%d\n",
+        ctxt->func->sym->name,
+        ctxt->func->mod->c_name,
+        ctxt->cline);
+
+  if (ctxt->func->mod && ctxt->cline > 0) {
+      fprintf(stdout,"%d\t%s",ctxt->cline ,
+        ctxt->func->mod->cLines[ctxt->cline]->src);
+  }
     } else {
-       if ((lfunc && lfunc != ctxt->func) || !lfunc) 
-           fprintf(stdout,"%s () at %s:%d\n",
-                   ctxt->func->sym->name, 
-                   ctxt->func->mod->asm_name,
-                   ctxt->asmline);
-       
-       if (ctxt->func->mod && ctxt->cline > 0) {
-           fprintf(stdout,"%d\t%s",ctxt->asmline ,
-                   ctxt->func->mod->asmLines[ctxt->asmline]->src);    
-       }
+  if ((lfunc && lfunc != ctxt->func) || !lfunc)
+      fprintf(stdout,"%s () at %s:%d\n",
+        ctxt->func->sym->name,
+        ctxt->func->mod->asm_name,
+        ctxt->asmline);
+
+  if (ctxt->func->mod && ctxt->cline > 0) {
+      fprintf(stdout,"%d\t%s",ctxt->asmline ,
+        ctxt->func->mod->asmLines[ctxt->asmline]->src);
+  }
     }
     lfunc = ctxt->func;
 
@@ -368,26 +368,26 @@ BP_CALLBACK(nextBpCB)
     static function *lfunc = NULL;
 
     if (srcMode == SRC_CMODE) {
-       if ((lfunc && lfunc != ctxt->func) || !lfunc) 
-           fprintf(stdout,"%s () at %s:%d\n",
-                   ctxt->func->sym->name, 
-                   ctxt->func->mod->c_name,
-                   ctxt->cline);
-       
-       if (ctxt->func->mod && ctxt->cline > 0)
-           fprintf(stdout,"%d\t%s",ctxt->cline,
-                   ctxt->func->mod->cLines[ctxt->cline]->src);
+  if ((lfunc && lfunc != ctxt->func) || !lfunc)
+      fprintf(stdout,"%s () at %s:%d\n",
+        ctxt->func->sym->name,
+        ctxt->func->mod->c_name,
+        ctxt->cline);
+
+  if (ctxt->func->mod && ctxt->cline > 0)
+      fprintf(stdout,"%d\t%s",ctxt->cline,
+        ctxt->func->mod->cLines[ctxt->cline]->src);
     } else {
-       if ((lfunc && lfunc != ctxt->func) || !lfunc) 
-           fprintf(stdout,"%s () at %s:%d\n",
-                   ctxt->func->sym->name, 
-                   ctxt->func->mod->asm_name,
-                   ctxt->asmline);
-       
-       if (ctxt->func->mod && ctxt->asmline > 0)
-           fprintf(stdout,"%d\t%s",ctxt->asmline,
-                   ctxt->func->mod->asmLines[ctxt->asmline]->src);
-       
+  if ((lfunc && lfunc != ctxt->func) || !lfunc)
+      fprintf(stdout,"%s () at %s:%d\n",
+        ctxt->func->sym->name,
+        ctxt->func->mod->asm_name,
+        ctxt->asmline);
+
+  if (ctxt->func->mod && ctxt->asmline > 0)
+      fprintf(stdout,"%d\t%s",ctxt->asmline,
+        ctxt->func->mod->asmLines[ctxt->asmline]->src);
+
     }
     lfunc = ctxt->func;
 
index 3cb36cc86f5033ac371eca2e705ef39a7fd7821d..020814529a1f0eac5c8110ee514e4a4f96faa5b8 100644 (file)
@@ -1,24 +1,24 @@
 /*-------------------------------------------------------------------------
   sdcdb.c - main source file for sdcdb debugger
-             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+        Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "sdcdb.h"
@@ -50,10 +50,10 @@ int fatalError = 0;
 /* command table */
 struct cmdtab
 {
-    char      *cmd ;  /* command the user will enter */       
+    char      *cmd ;  /* command the user will enter */
     int (*cmdfunc)(char *,context *);   /* function to execute when command is entered */
-    char *htxt ;    /* short help text */    
-    
+    char *htxt ;    /* short help text */
+
 } cmdTab[] = {
     /* NOTE:- the search is done from the top, so "break" should
        precede the synonym "b" */
@@ -80,10 +80,10 @@ struct cmdtab
 
     { "help"     ,  cmdHelp       ,
       "{h|?}elp\t\t this message\n"
-    },    
+    },
     { "?"        ,  cmdHelp       , NULL },
     { "h"        ,  cmdHelp       , NULL },
-    
+
     { "info"     ,  cmdInfo       ,
       "info\n"
       "\t {break}\t list all break points\n"
@@ -98,38 +98,38 @@ struct cmdtab
     { "la"       ,  cmdListAsm    , NULL },
     { "list"     ,  cmdListSrc    ,
       "{l}ist\t\t\t [LINE | FILE:LINE | FILE:FUNCTION | FUNCTION]\n"
-    },    
+    },
     { "l"        ,  cmdListSrc    , NULL },
     { "show"     ,  cmdShow       ,
       "show\n"
       "\t {copying}\t copying & distribution terms\n"
       "\t {warranty}\t warranty information\n"
     },
-    { "set"      ,  cmdSetOption  , NULL },    
+    { "set"      ,  cmdSetOption  , NULL },
     { "step"     ,  cmdStep       ,
       "{s}tep\t\t\t Step program until it reaches a different source line.\n"
     },
     { "s"        ,  cmdStep       , NULL },
-    { "next"     ,  cmdNext       , 
+    { "next"     ,  cmdNext       ,
       "{n}ext\t\t\t Step program, proceeding through subroutine calls.\n"
     },
     { "n"        ,  cmdNext       , NULL },
-    { "run"      ,  cmdRun        , 
+    { "run"      ,  cmdRun        ,
       "{r}un\t\t\t Start debugged program. \n"
     },
     { "r"        ,  cmdRun        , NULL },
-    { "ptype"    ,  cmdPrintType  , 
+    { "ptype"    ,  cmdPrintType  ,
       "{pt}ype <variable>\t print type information of a variable\n"
     },
     { "pt"       ,  cmdPrintType  , NULL },
-    { "print"    ,  cmdPrint      , 
+    { "print"    ,  cmdPrint      ,
       "{p}rint <variable>\t print value of given variable\n"
     },
     { "p"        ,  cmdPrint      , NULL },
     { "file"     ,  cmdFile       ,
       "file <filename>\t\t load symbolic information from <filename>\n"
-    },  
-    { "frame"    ,  cmdFrame      , 
+    },
+    { "frame"    ,  cmdFrame      ,
       "{fr}ame\t\t\t print information about the current Stack\n"
     },
     { "finish"   ,  cmdFinish     ,
@@ -138,10 +138,10 @@ struct cmdtab
     { "fi"       ,  cmdFinish     , NULL },
     { "fr"       ,  cmdFrame      , NULL },
     { "f"        ,  cmdFrame      , NULL },
-    { "!"        ,  cmdSimulator  , 
+    { "!"        ,  cmdSimulator  ,
       "!<simulator command>\t send a command directly to the simulator\n"
     },
-    { "quit"     ,  cmdQuit       , 
+    { "quit"     ,  cmdQuit       ,
       "{q}uit\t\t\t \"Watch me now. Iam going Down. My name is Bobby Brown\"\n"
     },
     { "q"        ,  cmdQuit       , NULL }
@@ -153,7 +153,7 @@ struct cmdtab
 char *gc_strdup(const char *s)
 {
     char *ret;
-    Safe_calloc(ret, strlen(s)+1);
+    Safe_calloc(1,ret, strlen(s)+1);
     strcpy(ret, s);
     return ret;
 }
@@ -166,9 +166,9 @@ char *alloccpy ( char *s, int size)
     char *d;
 
     if (!size)
-       return NULL;
+  return NULL;
 
-    Safe_calloc(d,size+1);
+    Safe_calloc(1,d,size+1);
     memcpy(d,s,size);
     d[size] = '\0';
 
@@ -183,17 +183,17 @@ void **resize (void **array, int newSize)
     void **vptr;
 
     if (array)
-       vptr = Safe_realloc(array,newSize*(sizeof(void **)));
+  vptr = Safe_realloc(array,newSize*(sizeof(void **)));
     else
-       vptr = calloc(1, sizeof(void **));
-    
+  vptr = calloc(1, sizeof(void **));
+
     if (!vptr) {
-       fprintf(stderr,"sdcdb: out of memory \n");
-       exit(1);
+  fprintf(stderr,"sdcdb: out of memory \n");
+  exit(1);
     }
 
     return vptr;
-       
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -205,51 +205,51 @@ static int readCdb (FILE *file)
     cdbrecs *currl ;
     char buffer[1024];
     char *bp ;
-    
+
     if (!(bp = fgets(buffer,sizeof(buffer),file)))
-           return 0;
-    
-    Safe_calloc(currl,sizeof(cdbrecs));
+      return 0;
+
+    Safe_calloc(1,currl,sizeof(cdbrecs));
     recsRoot = currl ;
 
     while (1) {
-       
-       /* make sure this is a cdb record */
-       if (strchr("STLFM",*bp) && *(bp+1) == ':') {
-           /* depending on the record type */
-           
-           switch (*bp) {
-           case 'S':
-               /* symbol record */
-               currl->type = SYM_REC;
-               break;
-           case 'T':
-               currl->type = STRUCT_REC;
-               break;
-           case 'L':
-               currl->type = LNK_REC;
-               break;
-           case 'F':
-               currl->type = FUNC_REC;
-               break;
-           case 'M':
-               currl->type = MOD_REC ;
-           }
-           
-           bp += 2;
-           Safe_calloc(currl->line,strlen(bp));
-           strncpy(currl->line,bp,strlen(bp)-1);
-           currl->line[strlen(bp)-1] = '\0';
-       }
-       
-       if (!(bp = fgets(buffer,sizeof(buffer),file)))
-           break;
-       
-       if (feof(file))
-           break;
-       
-       Safe_calloc(currl->next,sizeof(cdbrecs));
-       currl = currl->next;
+
+  /* make sure this is a cdb record */
+  if (strchr("STLFM",*bp) && *(bp+1) == ':') {
+      /* depending on the record type */
+
+      switch (*bp) {
+      case 'S':
+    /* symbol record */
+    currl->type = SYM_REC;
+    break;
+      case 'T':
+    currl->type = STRUCT_REC;
+    break;
+      case 'L':
+    currl->type = LNK_REC;
+    break;
+      case 'F':
+    currl->type = FUNC_REC;
+    break;
+      case 'M':
+    currl->type = MOD_REC ;
+      }
+
+      bp += 2;
+      Safe_calloc(1,currl->line,strlen(bp));
+      strncpy(currl->line,bp,strlen(bp)-1);
+      currl->line[strlen(bp)-1] = '\0';
+  }
+
+  if (!(bp = fgets(buffer,sizeof(buffer),file)))
+      break;
+
+  if (feof(file))
+      break;
+
+  Safe_calloc(1,currl->next,sizeof(cdbrecs));
+  currl = currl->next;
     }
 
     return (recsRoot->line ? 1 : 0);
@@ -266,35 +266,35 @@ char *searchDirsFname (char *fname)
 
     /* first try the current directory */
     if ((rfile = fopen(fname,"r"))) {
-       fclose(rfile);
-       return strdup(fname) ;
+  fclose(rfile);
+  return strdup(fname) ;
     }
 
     if (!ssdirl)
-       return strdup(fname);
+  return strdup(fname);
 
     /* make a copy of the source directories */
-    dirs = sdirs = strdup(ssdirl);    
-   
-    /* assume that the separator is ':' 
+    dirs = sdirs = strdup(ssdirl);
+
+    /* assume that the separator is ':'
        and try for each directory in the search list */
     dirs = strtok(dirs,":");
     while (dirs) {
-       if (dirs[strlen(dirs)] == '/')
-           sprintf(buffer,"%s%s",dirs,fname);
-       else
-           sprintf(buffer,"%s/%s",dirs,fname);
-       if ((rfile = fopen(buffer,"r")))
-           break ;
-       dirs = strtok(NULL,":");
+  if (dirs[strlen(dirs)] == '/')
+      sprintf(buffer,"%s%s",dirs,fname);
+  else
+      sprintf(buffer,"%s/%s",dirs,fname);
+  if ((rfile = fopen(buffer,"r")))
+      break ;
+  dirs = strtok(NULL,":");
     }
-    
+
     free(sdirs);
     if (rfile) {
-       fclose(rfile);
-       return strdup(buffer);
+  fclose(rfile);
+  return strdup(buffer);
     } else
-       return strdup(fname);    
+  return strdup(fname);
 }
 
 /*-----------------------------------------------------------------*/
@@ -308,26 +308,26 @@ FILE *searchDirsFopen(char *fname)
 
     /* first try the current directory */
     if ((rfile = fopen(fname,"r")))
-       return rfile;
+  return rfile;
 
     if (!ssdirl)
-       return NULL;
+  return NULL;
     /* make a copy of the source directories */
-    dirs = sdirs = strdup(ssdirl);    
-   
-    /* assume that the separator is ':' 
+    dirs = sdirs = strdup(ssdirl);
+
+    /* assume that the separator is ':'
        and try for each directory in the search list */
     dirs = strtok(dirs,":");
     while (dirs) {
-       sprintf(buffer,"%s/%s",dirs,fname);
-       if ((rfile = fopen(buffer,"r")))
-           break ;
-       dirs = strtok(NULL,":");
+  sprintf(buffer,"%s/%s",dirs,fname);
+  if ((rfile = fopen(buffer,"r")))
+      break ;
+  dirs = strtok(NULL,":");
     }
-    
+
     free(sdirs);
     return rfile ;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -339,20 +339,20 @@ srcLine **loadFile (char *name, int *nlines)
     char buffer[512];
     char *bp;
     srcLine **slines = NULL;
-    
-    
+
+
     if (!(mfile = searchDirsFopen(name))) {
-       fprintf(stderr,"sdcdb: cannot open module %s -- use '--directory=<source directory> option\n",name);
-       return NULL;
+  fprintf(stderr,"sdcdb: cannot open module %s -- use '--directory=<source directory> option\n",name);
+  return NULL;
     }
 
     while ((bp = fgets(buffer,sizeof(buffer),mfile))) {
-       (*nlines)++;
+  (*nlines)++;
 
-       slines = (srcLine **)resize((void **)slines,*nlines);
+  slines = (srcLine **)resize((void **)slines,*nlines);
 
-       Safe_calloc(slines[(*nlines)-1],sizeof(srcLine));
-       slines[(*nlines)-1]->src = alloccpy(bp,strlen(bp));     
+  Safe_calloc(1,slines[(*nlines)-1],sizeof(srcLine));
+  slines[(*nlines)-1]->src = alloccpy(bp,strlen(bp));
     }
 
     fclose(mfile);
@@ -372,44 +372,44 @@ static void loadModules ()
     /* go thru the records & find out the module
        records & load the modules specified */
     for ( loop = recsRoot ; loop ; loop = loop->next ) {
-       
-       switch (loop->type) {
-       /* for module records do */
-       case MOD_REC: 
-           currMod = parseModule(loop->line,TRUE);
-           currModName = currMod->name ;
-           
-           currMod->cfullname = searchDirsFname(currMod->c_name);
-
-           /* load it into buffer */
-           currMod->cLines = loadFile (currMod->c_name,
-                                       &currMod->ncLines);
-
-           /* do the same for the assembler file */
-           currMod->afullname = searchDirsFname(currMod->asm_name);
-           currMod->asmLines=loadFile (currMod->asm_name,
-                                       &currMod->nasmLines);
-           break;
-
-       /* if this is a function record */
-       case FUNC_REC:
-           parseFunc(loop->line);
-           break;
-
-       /* if this is a structure record */
-       case STRUCT_REC:
-           parseStruct(loop->line);
-           break;
-
-       /* if symbol then parse the symbol */
-       case  SYM_REC:
-           parseSymbol(loop->line,&rs);
-           break;      
-
-       case LNK_REC:
-           parseLnkRec(loop->line);
-           break;
-       }
+
+  switch (loop->type) {
+  /* for module records do */
+  case MOD_REC:
+      currMod = parseModule(loop->line,TRUE);
+      currModName = currMod->name ;
+
+      currMod->cfullname = searchDirsFname(currMod->c_name);
+
+      /* load it into buffer */
+      currMod->cLines = loadFile (currMod->c_name,
+          &currMod->ncLines);
+
+      /* do the same for the assembler file */
+      currMod->afullname = searchDirsFname(currMod->asm_name);
+      currMod->asmLines=loadFile (currMod->asm_name,
+          &currMod->nasmLines);
+      break;
+
+  /* if this is a function record */
+  case FUNC_REC:
+      parseFunc(loop->line);
+      break;
+
+  /* if this is a structure record */
+  case STRUCT_REC:
+      parseStruct(loop->line);
+      break;
+
+  /* if symbol then parse the symbol */
+  case  SYM_REC:
+      parseSymbol(loop->line,&rs);
+      break;
+
+  case LNK_REC:
+      parseLnkRec(loop->line);
+      break;
+  }
     }
 }
 
@@ -423,93 +423,93 @@ static void functionPoints ()
 
     /* for all functions do */
     for ( func = setFirstItem(functions); func;
-         func = setNextItem(functions)) {
-       int j ;
-       module *mod;
-       
-       sym = func->sym;
-
-#ifdef SDCDB_DEBUG     
-       printf("func '%s' has entry '%x' exit '%x'\n",
-              func->sym->name,
-              func->sym->addr,
-              func->sym->eaddr);
+    func = setNextItem(functions)) {
+  int j ;
+  module *mod;
+
+  sym = func->sym;
+
+#ifdef SDCDB_DEBUG
+  printf("func '%s' has entry '%x' exit '%x'\n",
+         func->sym->name,
+         func->sym->addr,
+         func->sym->eaddr);
 #endif
-       if (!func->sym->addr && !func->sym->eaddr)
-           continue ;
-
-       /* for all source lines in the module find
-          the ones with address >= start and <= end
-          and put them in the point */
-       mod = NULL ;
-       if (! applyToSet(modules,moduleWithName,func->modName,&mod))
-           continue ;
-       func->mod = mod ;       
-       func->entryline= INT_MAX;
-       func->exitline =  0;
-       func->aentryline = INT_MAX ;
-       func->aexitline = 0;
-
-       /* do it for the C Lines first */
-       for ( j = 0 ; j < mod->ncLines ; j++ ) {
-           if (mod->cLines[j]->addr >= sym->addr &&
-               mod->cLines[j]->addr <= sym->eaddr ) {
-               
-               exePoint *ep ;
-
-               /* add it to the execution point */
-               if (func->entryline > j)
-                   func->entryline = j;
-
-               if (func->exitline < j)
-                   func->exitline = j;
-
-               Safe_calloc(ep,sizeof(exePoint));
-               ep->addr =  mod->cLines[j]->addr ;
-               ep->line = j;
-               ep->block= mod->cLines[j]->block;
-               ep->level= mod->cLines[j]->level;
-               addSet(&func->cfpoints,ep);
-           }
-       }
-
-       /* do the same for asm execution points */
-       for ( j = 0 ; j < mod->nasmLines ; j++ ) {
-           if (mod->asmLines[j]->addr >= sym->addr &&
-               mod->asmLines[j]->addr <= sym->eaddr ) {
-               
-               exePoint *ep ;
-               /* add it to the execution point */
-               if (func->aentryline > j)
-                   func->aentryline = j;
-
-               if (func->aexitline < j)
-                   func->aexitline = j;
-
-               /* add it to the execution point */
-               Safe_calloc(ep,sizeof(exePoint));
-               ep->addr =  mod->asmLines[j]->addr ;
-               ep->line = j;
-               addSet(&func->afpoints,ep);     
-           }
-       }
+  if (!func->sym->addr && !func->sym->eaddr)
+      continue ;
+
+  /* for all source lines in the module find
+     the ones with address >= start and <= end
+     and put them in the point */
+  mod = NULL ;
+  if (! applyToSet(modules,moduleWithName,func->modName,&mod))
+      continue ;
+  func->mod = mod ;
+  func->entryline= INT_MAX;
+  func->exitline =  0;
+  func->aentryline = INT_MAX ;
+  func->aexitline = 0;
+
+  /* do it for the C Lines first */
+  for ( j = 0 ; j < mod->ncLines ; j++ ) {
+      if (mod->cLines[j]->addr >= sym->addr &&
+    mod->cLines[j]->addr <= sym->eaddr ) {
+
+    exePoint *ep ;
+
+    /* add it to the execution point */
+    if (func->entryline > j)
+        func->entryline = j;
+
+    if (func->exitline < j)
+        func->exitline = j;
+
+    Safe_calloc(1,ep,sizeof(exePoint));
+    ep->addr =  mod->cLines[j]->addr ;
+    ep->line = j;
+    ep->block= mod->cLines[j]->block;
+    ep->level= mod->cLines[j]->level;
+    addSet(&func->cfpoints,ep);
+      }
+  }
+
+  /* do the same for asm execution points */
+  for ( j = 0 ; j < mod->nasmLines ; j++ ) {
+      if (mod->asmLines[j]->addr >= sym->addr &&
+    mod->asmLines[j]->addr <= sym->eaddr ) {
+
+    exePoint *ep ;
+    /* add it to the execution point */
+    if (func->aentryline > j)
+        func->aentryline = j;
+
+    if (func->aexitline < j)
+        func->aexitline = j;
+
+    /* add it to the execution point */
+    Safe_calloc(1,ep,sizeof(exePoint));
+    ep->addr =  mod->asmLines[j]->addr ;
+    ep->line = j;
+    addSet(&func->afpoints,ep);
+      }
+  }
 
 #ifdef SDCDB_DEBUG
-       printf("function '%s' has the following C exePoints\n",
-              func->sym->name);
-       {
-           exePoint *ep;
-
-           for (ep = setFirstItem(func->cfpoints); ep;
-                ep = setNextItem(func->cfpoints))
-               fprintf (stdout,"{%x,%d} %s",ep->addr,ep->line,mod->cLines[ep->line]->src);
-
-           fprintf(stdout," and the following ASM exePoints\n");
-           for (ep = setFirstItem(func->afpoints); ep;
-                ep = setNextItem(func->afpoints))
-               fprintf (stdout,"{%x,%d} %s",ep->addr,ep->line,mod->asmLines[ep->line]->src);
-                   
-       }
+  printf("function '%s' has the following C exePoints\n",
+         func->sym->name);
+  {
+      exePoint *ep;
+
+      for (ep = setFirstItem(func->cfpoints); ep;
+     ep = setNextItem(func->cfpoints))
+    fprintf (stdout,"{%x,%d} %s",ep->addr,ep->line,mod->cLines[ep->line]->src);
+
+      fprintf(stdout," and the following ASM exePoints\n");
+      for (ep = setFirstItem(func->afpoints); ep;
+     ep = setNextItem(func->afpoints))
+    fprintf (stdout,"{%x,%d} %s",ep->addr,ep->line,mod->asmLines[ep->line]->src);
+
+  }
 #endif
     }
 }
@@ -524,13 +524,13 @@ DEFSETFUNC(setEntryExitBP)
 
     if (func->sym && func->sym->addr && func->sym->eaddr) {
 
-       /* set the entry break point */
-       setBreakPoint (func->sym->addr , CODE , FENTRY , 
-                      fentryCB ,func->mod->c_name , func->entryline);
+  /* set the entry break point */
+  setBreakPoint (func->sym->addr , CODE , FENTRY ,
+           fentryCB ,func->mod->c_name , func->entryline);
 
-       /* set the exit break point */
-       setBreakPoint (func->sym->eaddr , CODE , FEXIT  ,
-                      fexitCB  ,func->mod->c_name , func->exitline );
+  /* set the exit break point */
+  setBreakPoint (func->sym->eaddr , CODE , FEXIT  ,
+           fexitCB  ,func->mod->c_name , func->exitline );
     }
 
     return 0;
@@ -547,29 +547,29 @@ int cmdFile (char *s,context *cctxt)
 
     while (isspace(*s)) s++;
     if (!*s) {
-       fprintf(stdout,"No exec file now.\nNo symbol file now.\n");
-       return 0;
+  fprintf(stdout,"No exec file now.\nNo symbol file now.\n");
+  return 0;
     }
 
     sprintf(buffer,"%s.cdb",s);
     /* try creating the cdbfile */
     if (!(cdbFile = searchDirsFopen(buffer))) {
-       fprintf(stdout,"Cannot open file\"%s\"",buffer);
-       return 0;
+  fprintf(stdout,"Cannot open file\"%s\"",buffer);
+  return 0;
     }
 
     /* allocate for context */
-    Safe_calloc(currCtxt ,sizeof(context));
-    
+    Safe_calloc(1,currCtxt ,sizeof(context));
+
     /* readin the debug information */
     if (!readCdb (cdbFile)) {
-       fprintf(stdout,"No symbolic information found in file %s.cdb\n",s);
-       return 0;
-    }  
-       
+  fprintf(stdout,"No symbolic information found in file %s.cdb\n",s);
+  return 0;
+    }
+
     /* parse and load the modules required */
     loadModules();
-    
+
     /* determine the execution points for this
        module */
     functionPoints();
@@ -577,7 +577,7 @@ int cmdFile (char *s,context *cctxt)
     /* start the simulator & setup connection to it */
     openSimulator((char **)simArgs,nsimArgs);
     fprintf(stdout,"%s",simResponse());
-    /* now send the filename to be loaded to the simulator */    
+    /* now send the filename to be loaded to the simulator */
     sprintf(buffer,"%s.ihx",s);
     bp=searchDirsFname(buffer);
     simLoadFile(bp);
@@ -596,16 +596,16 @@ int cmdFile (char *s,context *cctxt)
 /* cmdHelp - help command                                          */
 /*-----------------------------------------------------------------*/
 int cmdHelp (char *s, context *cctxt)
-{   
+{
     int i ;
-        
+
     for (i = 0 ; i < (sizeof(cmdTab)/sizeof(struct cmdtab)) ; i++) {
-       
-       /* command string matches */
-       if (cmdTab[i].htxt)
-           fprintf(stdout,"%s",cmdTab[i].htxt);
+
+  /* command string matches */
+  if (cmdTab[i].htxt)
+      fprintf(stdout,"%s",cmdTab[i].htxt);
     }
-           
+
     return 0;
 }
 
@@ -624,43 +624,43 @@ int interpretCmd (char *s)
     /* if nothing & previous command exists then
        execute the previous command again */
     if (*s == '\n' && pcmd)
-       strcpy(s,pcmd);
+  strcpy(s,pcmd);
     /* if previous command exists & is different
        from the current command then copy it */
     if (pcmd) {
-       if (strcmp(pcmd,s)) {
-           free(pcmd);
-           pcmd = strdup(s);
-       }
+  if (strcmp(pcmd,s)) {
+      free(pcmd);
+      pcmd = strdup(s);
+  }
     } else
-       pcmd = strdup(s);
+  pcmd = strdup(s);
     /* lookup the command table and do the
        task required */
     strtok(s,"\n");
 
     for (i = 0 ; i < (sizeof(cmdTab)/sizeof(struct cmdtab)) ; i++) {
-       
-       /* command string matches */
-       if (strncmp(s,cmdTab[i].cmd,strlen(cmdTab[i].cmd)) == 0) {
-           if (!cmdTab[i].cmdfunc)
-               return 1;
-           rv = (*cmdTab[i].cmdfunc)(s + strlen(cmdTab[i].cmd),currCtxt);
-           
-           /* if full name then give the file name & position */
-           if (fullname && currCtxt && currCtxt->func) {
-               if (srcMode == SRC_CMODE)
-                   fprintf(stdout,"\032\032%s:%d:1\n",
-                           currCtxt->func->mod->cfullname,
-                           currCtxt->cline+1);
-               else
-                   fprintf(stdout,"\032\032%s:%d:1\n",
-                           currCtxt->func->mod->afullname,
-                           currCtxt->asmline+1); 
-           }
-           goto ret;
-       }
+
+  /* command string matches */
+  if (strncmp(s,cmdTab[i].cmd,strlen(cmdTab[i].cmd)) == 0) {
+      if (!cmdTab[i].cmdfunc)
+    return 1;
+      rv = (*cmdTab[i].cmdfunc)(s + strlen(cmdTab[i].cmd),currCtxt);
+
+      /* if full name then give the file name & position */
+      if (fullname && currCtxt && currCtxt->func) {
+    if (srcMode == SRC_CMODE)
+        fprintf(stdout,"\032\032%s:%d:1\n",
+          currCtxt->func->mod->cfullname,
+          currCtxt->cline+1);
+    else
+        fprintf(stdout,"\032\032%s:%d:1\n",
+          currCtxt->func->mod->afullname,
+          currCtxt->asmline+1);
+      }
+      goto ret;
+  }
     }
-   
+
     fprintf(stdout,"Undefined command: \"%s\".  Try \"help\".\n",s);
  ret:
     return rv;
@@ -673,15 +673,15 @@ void commandLoop()
 {
 
     while (1) {
-       fprintf(stdout,"%s",prompt);
-       fflush(stdout);
+  fprintf(stdout,"%s",prompt);
+  fflush(stdout);
 
-       if (fgets(cmdbuff,sizeof(cmdbuff),stdin) == NULL)
-           break;
+  if (fgets(cmdbuff,sizeof(cmdbuff),stdin) == NULL)
+      break;
+
+  if (interpretCmd(cmdbuff))
+      break;
 
-       if (interpretCmd(cmdbuff))
-           break;
-       
     }
 }
 
@@ -691,11 +691,11 @@ void commandLoop()
 static void printVersionInfo()
 {
     fprintf(stdout,
-           "SDCDB is free software and you are welcome to distribute copies of it\n"
-           "under certain conditions; type \"show copying\" to see the conditions.\n"
-           "There is absolutely no warranty for SDCDB; type \"show warranty\" for details.\n"
-           "SDCDB 0.8 . Copyright (C) 1999 Sandeep Dutta (sandeep.dutta@usa.net)\n"
-           "Type ? for help\n");
+      "SDCDB is free software and you are welcome to distribute copies of it\n"
+      "under certain conditions; type \"show copying\" to see the conditions.\n"
+      "There is absolutely no warranty for SDCDB; type \"show warranty\" for details.\n"
+      "SDCDB 0.8 . Copyright (C) 1999 Sandeep Dutta (sandeep.dutta@usa.net)\n"
+      "Type ? for help\n");
 
 }
 
@@ -708,90 +708,90 @@ static void parseCmdLine (int argc, char **argv)
     char *filename = NULL;
     char buffer[100];
     for ( i = 1; i < argc ; i++) {
-       fprintf(stdout,"%s\n",argv[i]);
-       
-       /* if this is an option */
-       if (argv[i][0] == '-') {
-           
-           /* if directory then mark directory */
-           if (strncmp(argv[i],"--directory=",12) == 0) {
-               if (!ssdirl)
-                   ssdirl = &argv[i][12];
-               else {
-                   char *p = Safe_malloc(strlen(ssdirl)+strlen(&argv[i][12])+2);
-                   strcat(strcat(strcpy(p,&argv[i][12]),":"),ssdirl);
-                   ssdirl = p;
-               }
-               continue;
-           }
-           
-           if (strncmp(argv[i],"-fullname",9) == 0) {
-               fullname = TRUE;
-               continue;
-           }
-           
-           if (strcmp(argv[i],"-cd") == 0) {
-               i++;
-               chdir(argv[i]);
-               continue;
-           }
-           
-           if (strncmp(argv[i],"-cd=",4) == 0) {
-               chdir(argv[i][4]);
-               continue;
-           }
-           
-           /* the simulator arguments */
-
-           /* cpu */
-           if (strcmp(argv[i],"-t") == 0 ||
-               strcmp(argv[i],"-cpu") == 0) {
-
-                   simArgs[nsimArgs++] = "-t";          
-                   simArgs[nsimArgs++] = strdup(argv[++i]);
-                   continue ;
-           }
-           
-           /* XTAL Frequency */
-           if (strcmp(argv[i],"-X") == 0 ||
-               strcmp(argv[i],"-frequency") == 0) {
-                   simArgs[nsimArgs++] = "-X";
-                   simArgs[nsimArgs++] = strdup(argv[++i]);
-                   continue ;
-           }
-
-           /* serial port */
-           if (strcmp(argv[i],"-s") == 0) {
-                   simArgs[nsimArgs++] = "-s";         
-                   simArgs[nsimArgs++] = strdup(argv[++i]);
-                   continue ;
-           }
-
-           if (strcmp(argv[i],"-S") == 0) {
-                   simArgs[nsimArgs++] = "-s";         
-                   simArgs[nsimArgs++] = strdup(argv[++i]);
-                   continue ;
-           }   
-
-           fprintf(stderr,"unknown option %s --- ignored\n",
-                   argv[i]);
-       } else {
-           /* must be file name */
-           if (filename) {
-               fprintf(stderr,"too many filenames .. parameter '%s' ignored\n",
-                       argv[i]);
-               continue ;
-           }
-
-           filename = strtok(argv[i],".");
-
-       }           
+  fprintf(stdout,"%s\n",argv[i]);
+
+  /* if this is an option */
+  if (argv[i][0] == '-') {
+
+      /* if directory then mark directory */
+      if (strncmp(argv[i],"--directory=",12) == 0) {
+    if (!ssdirl)
+        ssdirl = &argv[i][12];
+    else {
+        char *p = Safe_malloc(strlen(ssdirl)+strlen(&argv[i][12])+2);
+        strcat(strcat(strcpy(p,&argv[i][12]),":"),ssdirl);
+        ssdirl = p;
+    }
+    continue;
+      }
+
+      if (strncmp(argv[i],"-fullname",9) == 0) {
+    fullname = TRUE;
+    continue;
+      }
+
+      if (strcmp(argv[i],"-cd") == 0) {
+    i++;
+    chdir(argv[i]);
+    continue;
+      }
+
+      if (strncmp(argv[i],"-cd=",4) == 0) {
+    chdir(argv[i][4]);
+    continue;
+      }
+
+      /* the simulator arguments */
+
+      /* cpu */
+      if (strcmp(argv[i],"-t") == 0 ||
+    strcmp(argv[i],"-cpu") == 0) {
+
+        simArgs[nsimArgs++] = "-t";
+        simArgs[nsimArgs++] = strdup(argv[++i]);
+        continue ;
+      }
+
+      /* XTAL Frequency */
+      if (strcmp(argv[i],"-X") == 0 ||
+    strcmp(argv[i],"-frequency") == 0) {
+        simArgs[nsimArgs++] = "-X";
+        simArgs[nsimArgs++] = strdup(argv[++i]);
+        continue ;
+      }
+
+      /* serial port */
+      if (strcmp(argv[i],"-s") == 0) {
+        simArgs[nsimArgs++] = "-s";
+        simArgs[nsimArgs++] = strdup(argv[++i]);
+        continue ;
+      }
+
+      if (strcmp(argv[i],"-S") == 0) {
+        simArgs[nsimArgs++] = "-s";
+        simArgs[nsimArgs++] = strdup(argv[++i]);
+        continue ;
+      }
+
+      fprintf(stderr,"unknown option %s --- ignored\n",
+        argv[i]);
+  } else {
+      /* must be file name */
+      if (filename) {
+    fprintf(stderr,"too many filenames .. parameter '%s' ignored\n",
+      argv[i]);
+    continue ;
+      }
+
+      filename = strtok(argv[i],".");
+
+  }
     }
-    
+
     if (filename)
-       cmdFile(filename,NULL);
+  cmdFile(filename,NULL);
 }
-  
+
 /*-----------------------------------------------------------------*/
 /* main -                                                          */
 /*-----------------------------------------------------------------*/
@@ -803,6 +803,6 @@ int main ( int argc, char **argv)
     parseCmdLine(argc,argv);
 
     commandLoop();
-    
+
     return 0;
 }
index c79906c27cdbb3071b55ef92f458b4862108a36a..5333eae4ef7a9ea8dc46676f6d53c19b81702856 100644 (file)
@@ -1,24 +1,24 @@
 /*-------------------------------------------------------------------------
   symtab.c - Header file for symbol table for sdcdb ( debugger )
-             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
+        Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "sdcdb.h"
@@ -34,50 +34,50 @@ unsigned int   getSize ( link *p )
 {
     /* if nothing return 0 */
     if ( ! p )
-       return 0 ;
-    
+  return 0 ;
+
     if ( IS_SPEC(p) ) { /* if this is the specifier then */
-       
-       switch (SPEC_NOUN(p)) { /* depending on the specifier type */
-       case V_INT:
-           return (IS_LONG(p) ? LONGSIZE : ( IS_SHORT(p) ? SHORTSIZE: INTSIZE)) ;
-       case V_FLOAT:
-           return FLOATSIZE ;
-       case V_CHAR:
-           return   CHARSIZE ;
-       case V_VOID:
-           return   0 ;
-       case V_STRUCT:
-           return   SPEC_STRUCT(p)->size ;
-       case V_LABEL:
-           return 0 ;
-       case V_SBIT:
-           return BITSIZE ;
-       case V_BIT:
-           return ((SPEC_BLEN(p) / 8) + (SPEC_BLEN(p) % 8 ? 1 : 0)) ;
-       default  :
-           return 0 ;
-       }
+
+  switch (SPEC_NOUN(p)) { /* depending on the specifier type */
+  case V_INT:
+      return (IS_LONG(p) ? LONGSIZE : ( IS_SHORT(p) ? SHORTSIZE: INTSIZE)) ;
+  case V_FLOAT:
+      return FLOATSIZE ;
+  case V_CHAR:
+      return   CHARSIZE ;
+  case V_VOID:
+      return   0 ;
+  case V_STRUCT:
+      return   SPEC_STRUCT(p)->size ;
+  case V_LABEL:
+      return 0 ;
+  case V_SBIT:
+      return BITSIZE ;
+  case V_BIT:
+      return ((SPEC_BLEN(p) / 8) + (SPEC_BLEN(p) % 8 ? 1 : 0)) ;
+  default  :
+      return 0 ;
+  }
     }
-    
+
     /* this is a specifier  */
     switch (DCL_TYPE(p))  {
     case FUNCTION:
-       return 2;
+  return 2;
     case ARRAY:
-       return DCL_ELEM(p) * getSize (p->next) ;
+  return DCL_ELEM(p) * getSize (p->next) ;
     case IPOINTER:
     case PPOINTER:
     case POINTER:
-       return ( PTRSIZE ) ;
+  return ( PTRSIZE ) ;
     case FPOINTER:
     case CPOINTER:
-       return ( FPTRSIZE );
+  return ( FPTRSIZE );
     case GPOINTER:
-       return ( GPTRSIZE );
-       
+  return ( GPTRSIZE );
+
     default     :
-       return  0 ;
+  return  0 ;
     }
 }
 
@@ -90,15 +90,15 @@ void parseFunc (char *line)
     function *func ;
     char *rs;
     int i;
-    Safe_calloc(func,sizeof(function));
+    Safe_calloc(1,func,sizeof(function));
     func->sym = parseSymbol(line,&rs);
     func->sym->isfunc = 1;
-    func->modName = currModName ;   
+    func->modName = currModName ;
     while(*rs != ',') rs++;
     rs++;
     sscanf(rs,"%d,%d,%d",&i,
-          &(SPEC_INTN(func->sym->etype)),
-          &(SPEC_BANK(func->sym->etype)));
+     &(SPEC_INTN(func->sym->etype)),
+     &(SPEC_BANK(func->sym->etype)));
     SPEC_INTRTN(func->sym->etype) = i;
     addSet(&functions,func);
 }
@@ -106,7 +106,7 @@ void parseFunc (char *line)
 /*-----------------------------------------------------------------*/
 /* parseTypeInfo - parse the type info of a symbol expects the type*/
 /*                 info to be of the form                          */
-/*                 ({<size>}<type info chain)                      */  
+/*                 ({<size>}<type info chain)                      */
 /*-----------------------------------------------------------------*/
 static char  *parseTypeInfo (symbol *sym, char *s)
 {
@@ -116,115 +116,115 @@ static char  *parseTypeInfo (symbol *sym, char *s)
     /* get the size */
     sym->size = strtol (s,&bp,10);
     /* bp now points to '}' ... go past it */
-    s = ++bp;    
+    s = ++bp;
     while (*s != ')') { /* till we reach the end */
-       link *type;
-       Safe_calloc(type,sizeof(link));
-       if (*s == ',') s++;
-
-       /* is a declarator */
-       if (*s == 'D') {
-           s++;
-           switch (*s) {
-           case 'F':           
-               DCL_TYPE(type) = FUNCTION;
-               s++;
-               break;
-           case 'G':           
-               DCL_TYPE(type) = GPOINTER;
-               s++;
-               break;
-           case 'C':
-               DCL_TYPE(type) = CPOINTER;
-               s++;
-               break;
-           case 'X':
-               DCL_TYPE(type) = FPOINTER;
-               s++;
-               break;
-           case 'D':
-               DCL_TYPE(type) = POINTER;
-               s++;
-               break;
-           case 'I':
-               DCL_TYPE(type) = IPOINTER;
-               s++;
-               break;
-           case 'P':
-               DCL_TYPE(type) = PPOINTER;
-               s++;
-               break;
-           case 'A':
-               s++;
-               DCL_TYPE(type) = ARRAY ;
-               DCL_ELEM(type) = strtol(s,&s,10);
-               break;
-           }
-       } else {            
-           /* is a specifier */
-           type->class = SPECIFIER ;
-           s++;
-           switch (*s) {
-           case 'L':
-               SPEC_NOUN(type) = V_INT;
-               SPEC_LONG(type) = 1;
-               s++;
-               break;
-           case 'I':
-               SPEC_NOUN(type) = V_INT;
-               s++;
-               break;
-           case 'S':
-           case 'C':
-               SPEC_NOUN(type) = V_CHAR ;
-               s++;
-               break;
-           case 'V':
-               SPEC_NOUN(type) = V_VOID;
-               s++;
-               break;
-           case 'F':
-               SPEC_NOUN(type) = V_FLOAT;
-               s++;
-               break;
-           case 'T':
-               s++;
-               SPEC_NOUN(type) = V_STRUCT;
-               { 
-                   char *ss = strtok(strdup(s),",):");
-                   
-                   SPEC_STRUCT(type) = structWithName(ss);
-                   free(ss);
-               }
-               break;
-           case 'X':
-               s++;
-               SPEC_NOUN(type) = V_SBIT;
-               break;
-           case 'B':
-               SPEC_NOUN(type) = V_BIT;
-               s++;
-               SPEC_BSTR(type) = strtol(s,&s,10);
-               s++;
-               SPEC_BLEN(type) = strtol(s,&s,10);
-               break;
-           }
-           while (*s != ':') s++;
-           s++;
-           if (*s++ == 'S')
-               SPEC_USIGN(type) = 0;
-           else
-               SPEC_USIGN(type) = 1;
-
-       }
-
-       /* add the type to the symbol's type chain */
-       if (sym->type) 
-           sym->etype = sym->etype->next = type;
-       else
-           sym->type = sym->etype = type;
+  link *type;
+  Safe_calloc(1,type,sizeof(link));
+  if (*s == ',') s++;
+
+  /* is a declarator */
+  if (*s == 'D') {
+      s++;
+      switch (*s) {
+      case 'F':
+    DCL_TYPE(type) = FUNCTION;
+    s++;
+    break;
+      case 'G':
+    DCL_TYPE(type) = GPOINTER;
+    s++;
+    break;
+      case 'C':
+    DCL_TYPE(type) = CPOINTER;
+    s++;
+    break;
+      case 'X':
+    DCL_TYPE(type) = FPOINTER;
+    s++;
+    break;
+      case 'D':
+    DCL_TYPE(type) = POINTER;
+    s++;
+    break;
+      case 'I':
+    DCL_TYPE(type) = IPOINTER;
+    s++;
+    break;
+      case 'P':
+    DCL_TYPE(type) = PPOINTER;
+    s++;
+    break;
+      case 'A':
+    s++;
+    DCL_TYPE(type) = ARRAY ;
+    DCL_ELEM(type) = strtol(s,&s,10);
+    break;
+      }
+  } else {
+      /* is a specifier */
+      type->class = SPECIFIER ;
+      s++;
+      switch (*s) {
+      case 'L':
+    SPEC_NOUN(type) = V_INT;
+    SPEC_LONG(type) = 1;
+    s++;
+    break;
+      case 'I':
+    SPEC_NOUN(type) = V_INT;
+    s++;
+    break;
+      case 'S':
+      case 'C':
+    SPEC_NOUN(type) = V_CHAR ;
+    s++;
+    break;
+      case 'V':
+    SPEC_NOUN(type) = V_VOID;
+    s++;
+    break;
+      case 'F':
+    SPEC_NOUN(type) = V_FLOAT;
+    s++;
+    break;
+      case 'T':
+    s++;
+    SPEC_NOUN(type) = V_STRUCT;
+    {
+        char *ss = strtok(strdup(s),",):");
+
+        SPEC_STRUCT(type) = structWithName(ss);
+        free(ss);
     }
-    
+    break;
+      case 'X':
+    s++;
+    SPEC_NOUN(type) = V_SBIT;
+    break;
+      case 'B':
+    SPEC_NOUN(type) = V_BIT;
+    s++;
+    SPEC_BSTR(type) = strtol(s,&s,10);
+    s++;
+    SPEC_BLEN(type) = strtol(s,&s,10);
+    break;
+      }
+      while (*s != ':') s++;
+      s++;
+      if (*s++ == 'S')
+    SPEC_USIGN(type) = 0;
+      else
+    SPEC_USIGN(type) = 1;
+
+  }
+
+  /* add the type to the symbol's type chain */
+  if (sym->type)
+      sym->etype = sym->etype->next = type;
+  else
+      sym->type = sym->etype = type;
+    }
+
     return ++s;
 
 }
@@ -240,10 +240,10 @@ symbol *parseSymbol (char *s, char **rs)
     symbol *nsym ;
     char *bp = s;
 
-    Safe_calloc(nsym,sizeof(symbol));
+    Safe_calloc(1,nsym,sizeof(symbol));
 
     /* copy over the mangled name */
-    while (*bp != '(') bp++;   
+    while (*bp != '(') bp++;
      bp -= 1;
     nsym->rname = alloccpy(s,bp - s);
 
@@ -251,39 +251,39 @@ symbol *parseSymbol (char *s, char **rs)
     nsym->scopetype = *s;
     s++ ;
     if (nsym->scopetype != 'G') {
-       /* get the function name it is local to */
-       bp = s;
-       while (*s != '$') s++;
-       nsym->sname = alloccpy(bp,s - bp);
+  /* get the function name it is local to */
+  bp = s;
+  while (*s != '$') s++;
+  nsym->sname = alloccpy(bp,s - bp);
     }
 
-    /* next get the name */    
+    /* next get the name */
     bp = ++s;
     while ( *s != '$' ) s++;
     nsym->name = alloccpy(bp,s - bp);
-    
+
     s++;
     /* get the level number */
     nsym->level = strtol (s,&bp,10);
     s = ++bp;
     /* skip the '$' & get the block number */
     nsym->block = strtol (s,&bp,10);
-    
-    s = parseTypeInfo(nsym,bp);        
+
+    s = parseTypeInfo(nsym,bp);
 
     /* get the address space after going past the comma */
     s++;
     nsym->addrspace =*s;
 
-    s+= 2;    
+    s+= 2;
     nsym->isonstack = strtol(s,&s,10);
     /* get the stack offset */
     s++;
     nsym->offset = strtol(s,&s,10);
     *rs = s;
-   
+
     addSet(&symbols,nsym);
-    
+
     return nsym;
 }
 
@@ -297,10 +297,10 @@ structdef *parseStruct (char *s)
     structdef *nsdef ;
     char *bp;
     char *name;
-    symbol *fields = NULL;    
-    
+    symbol *fields = NULL;
+
     while (*s != '$') s++;
-   
+
     bp =++s;
     while (*s != '[') s++ ;
     name = alloccpy(bp,s - bp);
@@ -308,22 +308,22 @@ structdef *parseStruct (char *s)
     nsdef->fields = NULL;
     s++;
     while (*s && *s != ']') {
-       int offset ;
-       symbol *sym ;
-       while (!isdigit(*s)) s++;
-       offset = strtol(s,&s,10);
-       while (*s != ':') s++;
-       s++;
-       sym = parseSymbol(s,&s);
-       sym->offset = offset ;
-       s += 3;
-       if (!fields) 
-           fields = nsdef->fields = sym;
-       else
-           fields = fields->next = sym;
-       
+  int offset ;
+  symbol *sym ;
+  while (!isdigit(*s)) s++;
+  offset = strtol(s,&s,10);
+  while (*s != ':') s++;
+  s++;
+  sym = parseSymbol(s,&s);
+  sym->offset = offset ;
+  s += 3;
+  if (!fields)
+      fields = nsdef->fields = sym;
+  else
+      fields = fields->next = sym;
+
     }
-    
+
     return nsdef;
 }
 
@@ -335,25 +335,25 @@ module *parseModule (char *s, bool createName )
     module *nmod ;
     char buffer[512];
 
-    Safe_calloc(nmod,sizeof(module));    
-    
+    Safe_calloc(1,nmod,sizeof(module));
+
     addSet (&modules,nmod);
-    
-           
+
+
     /* create copy file name */
     nmod->name = s;
-    
+
     if (createName) {
-       sprintf(buffer,"%s.c",s);
-       
-       Safe_calloc(nmod->c_name,strlen(buffer)+1);
-       strcpy(nmod->c_name,buffer);       
-       
-       sprintf(buffer,"%s.asm",s);
-       Safe_calloc(nmod->asm_name,strlen(buffer)+1);
-       strcpy(nmod->asm_name,buffer);              
+  sprintf(buffer,"%s.c",s);
+
+  Safe_calloc(1,nmod->c_name,strlen(buffer)+1);
+  strcpy(nmod->c_name,buffer);
+
+  sprintf(buffer,"%s.asm",s);
+  Safe_calloc(1,nmod->asm_name,strlen(buffer)+1);
+  strcpy(nmod->asm_name,buffer);
     }
-    
+
     return nmod;
 }
 
@@ -365,15 +365,15 @@ DEFSETFUNC(moduleWithName)
     module *mod = item;
     V_ARG(char *,s);
     V_ARG(module **,rmod);
-    
+
     if (*rmod)
-       return 0;
+  return 0;
 
     if (strcmp(mod->name,s) == 0) {
-       *rmod = mod ;
-       return 1;
+  *rmod = mod ;
+  return 1;
     }
-    
+
     return 0;
 }
 
@@ -385,14 +385,14 @@ DEFSETFUNC(moduleWithCName)
     module *mod = item;
     V_ARG(char *,s);
     V_ARG(module **,rmod);
-       
+
     if (*rmod)
-       return 0;
+  return 0;
     if (strcmp(mod->c_name,s) == 0) {
-       *rmod = mod;
-       return 1;
+  *rmod = mod;
+  return 1;
     }
-    
+
     return 0;
 }
 
@@ -404,14 +404,14 @@ DEFSETFUNC(moduleWithAsmName)
     module *mod = item;
     V_ARG(char *,s);
     V_ARG(module **,rmod);
-       
+
     if (*rmod)
-       return 0;
+  return 0;
     if (strcmp(mod->asm_name,s) == 0) {
-       *rmod = mod;
-       return 1;
+  *rmod = mod;
+  return 1;
     }
-    
+
     return 0;
 }
 
@@ -427,15 +427,15 @@ structdef *structWithName (char *s)
     /* go thru the struct table looking for a match */
     for ( i = 0 ; i < nStructs ; i++ ) {
 
-       if (strcmp(currModName,structs[i]->sname) == 0 &&
-           strcmp(s,structs[i]->tag) == 0)
-           return structs[i];
+  if (strcmp(currModName,structs[i]->sname) == 0 &&
+      strcmp(s,structs[i]->tag) == 0)
+      return structs[i];
     }
 
-    Safe_calloc(nsdef,sizeof(structdef));
+    Safe_calloc(1,nsdef,sizeof(structdef));
     nsdef->tag = alloccpy(s,strlen(s));
     nsdef->sname = currModName ;
-    
+
     nStructs++;
     structs = (struct structdef **)resize((void **)structs,nStructs);
     structs[nStructs-1] = nsdef;
@@ -452,12 +452,12 @@ DEFSETFUNC(symWithRName)
     V_ARG(symbol **,rsym);
 
     if (*rsym)
-       return 0;
+  return 0;
 
     if (strcmp(sym->rname,s) == 0) {
-       *rsym = sym;
-       return 1;
-    }    
+  *rsym = sym;
+  return 1;
+    }
 
     return 0;
 }
@@ -472,13 +472,13 @@ DEFSETFUNC(funcWithRName)
     V_ARG(function **,rfunc);
 
     if (*rfunc)
-       return 0;
-    
+  return 0;
+
     if (strcmp(func->sym->rname,s) == 0) {
-       *rfunc = func;
-       return 1;
-    }    
-    
+  *rfunc = func;
+  return 1;
+    }
+
     return 0;
 }
 
@@ -495,20 +495,20 @@ DEFSETFUNC(symLocal)
     V_ARG(symbol **,rsym);
 
     if (strcmp(name,sym->name) == 0 && /* name matches */
-       sym->scopetype != 'G'       && /* local scope  */
-       (sym->sname && strcmp(sym->sname,sname) == 0) && /* scope == specified scope */
-       sym->block <= block         && /* block & level kindo matches */
-       sym->level <= level) {
-       
-       /* if a symbol was previously found then
-          sure that ones block & level are less
-          then this one */
-       if (*rsym && (*rsym)->block >= block && 
-           (*rsym)->level >= level)
-           return 0;
-
-       *rsym = sym;
-       return 1;       
+  sym->scopetype != 'G'       && /* local scope  */
+  (sym->sname && strcmp(sym->sname,sname) == 0) && /* scope == specified scope */
+  sym->block <= block         && /* block & level kindo matches */
+  sym->level <= level) {
+
+  /* if a symbol was previously found then
+     sure that ones block & level are less
+     then this one */
+  if (*rsym && (*rsym)->block >= block &&
+      (*rsym)->level >= level)
+      return 0;
+
+  *rsym = sym;
+  return 1;
     }
 
     return 0;
@@ -524,13 +524,13 @@ DEFSETFUNC(symGlobal)
     V_ARG(symbol **,rsym);
 
     if (*rsym)
-       return 0;
+  return 0;
 
     /* simple :: global & name matches */
     if (sym->scopetype == 'G' &&
-       strcmp(sym->name,name) == 0) {
-       *rsym = sym;
-       return 1;
+  strcmp(sym->name,name) == 0) {
+  *rsym = sym;
+  return 1;
     }
 
     return 0;
@@ -546,24 +546,24 @@ symbol *symLookup (char *name, context *ctxt)
     /* first try & find a local variable for the
        given name */
     if ( applyToSet(symbols,symLocal,
-                   name, 
-                   ctxt->func->sym->name,
-                   ctxt->block,
-                   ctxt->level,
-                   &sym))
-       return sym;
-    
+        name,
+        ctxt->func->sym->name,
+        ctxt->block,
+        ctxt->level,
+        &sym))
+  return sym;
+
     sym = NULL;
     /* then try local to this module */
     if (applyToSet(symbols,symLocal,
-                  name,
-                  ctxt->func->mod->name,
-                  0,0,&sym))
-       return sym;
+       name,
+       ctxt->func->mod->name,
+       0,0,&sym))
+  return sym;
     sym = NULL;
     /* no:: try global */
     if ( applyToSet(symbols,symGlobal,name,&sym))
-       return sym;
+  return sym;
 
     /* cannot find return null */
     return NULL;
@@ -579,17 +579,17 @@ static void lnkFuncEnd (char *s)
 
     /* copy till we get to a ':' */
     while ( *s != ':' )
-       *bp++ = *s++;
+  *bp++ = *s++;
     bp -= 1;
-    *bp = '\0';        
+    *bp = '\0';
 
     func = NULL;
     if (!applyToSet(functions,funcWithRName,sname,&func))
-       return ;
-    
+  return ;
+
     s++;
     sscanf(s,"%x",&func->sym->eaddr);
-#ifdef SDCDB_DEBUG    
+#ifdef SDCDB_DEBUG
     printf("%s(eaddr%x)\n",func->sym->name,func->sym->eaddr);
 #endif
 }
@@ -604,15 +604,15 @@ static void lnkSymRec (char *s)
 
     /* copy till we get to a ':' */
     while ( *s != ':')
-       *bp++ = *s++;
+  *bp++ = *s++;
     bp -= 1;
     *bp = '\0';
-        
+
 
     sym = NULL;
     if (!applyToSet(symbols,symWithRName,sname,&sym))
-       return ;
-    
+  return ;
+
     s++;
     sscanf(s,"%x",&sym->addr);
 #ifdef SDCDB_DEBUG
@@ -630,25 +630,25 @@ static void lnkAsmSrc (char *s)
     unsigned addr;
     module *mod = NULL;
 
-    /* input will be of format 
+    /* input will be of format
        filename$<line>:<address> */
     while (*s != '$' && *s != '.')
-       *bp++ = *s++;
+  *bp++ = *s++;
     *bp = '\0';
     /* skip to line stuff */
     while (*s != '$') s++;
-    
+
     if (!applyToSet(modules,moduleWithName,mname,&mod))
-       return ;    
+  return ;
 
     if (sscanf(s,"$%d:%x",&line,&addr) != 2)
-       return ;
+  return ;
 
     line--;
     if (line < mod->nasmLines) {
-       mod->asmLines[line]->addr = addr;
+  mod->asmLines[line]->addr = addr;
 #ifdef SDCDB_DEBUG
-       printf("%s(%d:%x) %s",mod->asm_name,line,addr,mod->asmLines[line]->src);
+  printf("%s(%d:%x) %s",mod->asm_name,line,addr,mod->asmLines[line]->src);
 #endif
     }
 }
@@ -662,39 +662,39 @@ static void lnkCSrc (char *s)
     int block,level,line;
     unsigned int addr;
     module *mod ;
-    
-    /* input will be of format 
+
+    /* input will be of format
        filename.ext$<level>$<block>$<line>:<address> */
     /* get the module name */
     while (*s != '$' )
-       *bp++ = *s++;
+  *bp++ = *s++;
     *bp = '\0';
     /* skip the extension */
     while (*s != '$') s++;
 
     if (sscanf(s,"$%d$%d$%d:%x",
-              &line,&level,&block,&addr) != 4)
-       return ;
+         &line,&level,&block,&addr) != 4)
+  return ;
 
     mod = NULL;
-    if (!applyToSet(modules,moduleWithCName,mname,&mod)) { 
-       mod = parseModule(mname,FALSE);
-       mod->c_name = alloccpy(mname,strlen(mname));
-       mod->cfullname=searchDirsFname(mod->c_name);
-       mod->cLines = loadFile(mod->c_name,&mod->ncLines);
-    }      
-    
+    if (!applyToSet(modules,moduleWithCName,mname,&mod)) {
+  mod = parseModule(mname,FALSE);
+  mod->c_name = alloccpy(mname,strlen(mname));
+  mod->cfullname=searchDirsFname(mod->c_name);
+  mod->cLines = loadFile(mod->c_name,&mod->ncLines);
+    }
+
     line--;
     if (line < mod->ncLines && line > 0) {
-       mod->cLines[line]->addr = addr;
-       mod->cLines[line]->block = block;
-       mod->cLines[line]->level = level;
+  mod->cLines[line]->addr = addr;
+  mod->cLines[line]->block = block;
+  mod->cLines[line]->level = level;
 #ifdef SDCDB_DEBUG
-       printf("%s(%d:%x) %s",mod->c_name,
-              line+1,addr,mod->cLines[line]->src);
+  printf("%s(%d:%x) %s",mod->c_name,
+         line+1,addr,mod->cLines[line]->src);
 #endif
     }
-    return;    
+    return;
 
 }
 
@@ -703,26 +703,26 @@ static void lnkCSrc (char *s)
 /*-----------------------------------------------------------------*/
 void parseLnkRec (char *s)
 {
-    /* link records can be several types 
+    /* link records can be several types
        dpeneding on the type do */
-    
+
     switch (*s) {
-       
-       /* c source line address */
-    case 'C': 
-       lnkCSrc(s+2);
-       break;
-       /* assembler source address */
+
+  /* c source line address */
+    case 'C':
+  lnkCSrc(s+2);
+  break;
+  /* assembler source address */
     case 'A':
-       lnkAsmSrc(s+2);
-       break;
-       
-    case 'X': 
-       lnkFuncEnd(s+1);
-       break; 
-       
+  lnkAsmSrc(s+2);
+  break;
+
+    case 'X':
+  lnkFuncEnd(s+1);
+  break;
+
     default :
-       lnkSymRec(s);
-       break;
+  lnkSymRec(s);
+  break;
     }
 }
index a668b0aed4f095474c602d77bdab90de8b8f56e1..b335a917aaf958af396969789c558046a5d9867b 100644 (file)
@@ -263,7 +263,7 @@ int checkCurrFile ( char *s)
        /* mark the end of the filename */
        while (*s != '"') s++;
        *s = '\0';
-       currFname = Safe_calloc(strlen(sb)+1);
+       currFname = Safe_calloc(1,strlen(sb)+1);
        strcpy(currFname,sb);
        yylineno = lNum - 2;
     }
index cfc15ea5b9685ca9aca9756b81d96a634d3c42c2..98b944db8b945ed14153918536b25597ec1dc461 100644 (file)
@@ -1115,7 +1115,7 @@ statement
    | jump_statement
    | INLINEASM  ';'      {
                             ast *ex = newNode(INLINEASM,NULL,NULL);
-                           ex->values.inlineasm = Safe_calloc(strlen($1)+1);
+                           ex->values.inlineasm = Safe_calloc(1,strlen($1)+1);
                            strcpy(ex->values.inlineasm,$1);                        
                            $$ = ex;
                          }   
index 2059b3d7a622a76d49d0a8b531e0b694126aca5e..5693670bd20656297ed60c01d6e9fcd702d779e0 100644 (file)
@@ -8,19 +8,19 @@
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "common.h"
@@ -47,19 +47,19 @@ eBBlock *neweBBlock ()
 {
     eBBlock *ebb;
 
-    ebb = Safe_calloc(sizeof(eBBlock));   
+    ebb = Safe_calloc(1,sizeof(eBBlock));
     return ebb ;
 }
 
 /*-----------------------------------------------------------------*/
 /* newEdge - allocates & initialises an edge to given values       */
 /*-----------------------------------------------------------------*/
-edge *newEdge (eBBlock *from, eBBlock *to) 
+edge *newEdge (eBBlock *from, eBBlock *to)
 {
     edge *ep ;
 
-    ep = Safe_calloc(sizeof(edge));     
-    
+    ep = Safe_calloc(1,sizeof(edge));
+
     ep->from = from;
     ep->to = to;
     return ep;
@@ -75,58 +75,58 @@ void dumpLiveRanges (char *ext,hTab *liveRanges)
     int k;
 
     if (ext) {
-       /* create the file name */
-       strcpy(buffer,srcFileName);
-       strcat(buffer,ext);
-       
-       if (!(file = fopen(buffer,"a+"))) {
-           werror(E_FILE_OPEN_ERR,buffer);
-           exit(1);
-       }
-    } else 
-       file = stdout;
-    
-    for (sym = hTabFirstItem(liveRanges,&k); sym ; 
-        sym = hTabNextItem(liveRanges,&k)) {
-
-       fprintf (file,"%s [k%d lr%d:%d so:%d]{ re%d rm%d}",
-                (sym->rname[0] ? sym->rname : sym->name), 
-                sym->key,
-                sym->liveFrom,sym->liveTo,
-                sym->stack,
-                sym->isreqv,sym->remat
-                );
-       
-       fprintf(file,"{"); printTypeChain(sym->type,file); 
-       if (sym->usl.spillLoc) {
-           fprintf(file,"}{ sir@ %s",sym->usl.spillLoc->rname);
-       }
-       fprintf(file,"}");
-       
-       /* if assigned to registers */
-       if (sym->nRegs) {
-           if (sym->isspilt) {
-               if (!sym->remat)
-                   if (sym->usl.spillLoc)
-                       fprintf(file,"[%s]",(sym->usl.spillLoc->rname[0] ?
-                                            sym->usl.spillLoc->rname :
-                                            sym->usl.spillLoc->name));
-                   else
-                       fprintf(file,"[err]");
-               else
-                   fprintf(file,"[remat]");
-           }
-           else {
-               int i;
-               fprintf(file,"[");
-               for(i=0;i<sym->nRegs;i++)
-                   fprintf(file,"%s ", port->getRegName(sym->regs[i]));
-               fprintf(file,"]");
-           }
-       }
-       fprintf(file,"\n");
+  /* create the file name */
+  strcpy(buffer,srcFileName);
+  strcat(buffer,ext);
+
+  if (!(file = fopen(buffer,"a+"))) {
+      werror(E_FILE_OPEN_ERR,buffer);
+      exit(1);
+  }
+    } else
+  file = stdout;
+
+    for (sym = hTabFirstItem(liveRanges,&k); sym ;
+   sym = hTabNextItem(liveRanges,&k)) {
+
+  fprintf (file,"%s [k%d lr%d:%d so:%d]{ re%d rm%d}",
+     (sym->rname[0] ? sym->rname : sym->name),
+     sym->key,
+     sym->liveFrom,sym->liveTo,
+     sym->stack,
+     sym->isreqv,sym->remat
+     );
+
+  fprintf(file,"{"); printTypeChain(sym->type,file);
+  if (sym->usl.spillLoc) {
+      fprintf(file,"}{ sir@ %s",sym->usl.spillLoc->rname);
+  }
+  fprintf(file,"}");
+
+  /* if assigned to registers */
+  if (sym->nRegs) {
+      if (sym->isspilt) {
+    if (!sym->remat)
+        if (sym->usl.spillLoc)
+      fprintf(file,"[%s]",(sym->usl.spillLoc->rname[0] ?
+               sym->usl.spillLoc->rname :
+               sym->usl.spillLoc->name));
+        else
+      fprintf(file,"[err]");
+    else
+        fprintf(file,"[remat]");
+      }
+      else {
+    int i;
+    fprintf(file,"[");
+    for(i=0;i<sym->nRegs;i++)
+        fprintf(file,"%s ", port->getRegName(sym->regs[i]));
+    fprintf(file,"]");
+      }
+  }
+  fprintf(file,"\n");
     }
-       
+
     fclose(file);
 }
 /*-----------------------------------------------------------------*/
@@ -138,32 +138,32 @@ void dumpEbbsToFileExt (char *ext,eBBlock **ebbs, int count)
     int i;
 
     if (ext) {
-       /* create the file name */
-       strcpy(buffer,srcFileName);
-       strcat(buffer,ext);
-       
-       if (!(of = fopen(buffer,"a+"))) {
-           werror(E_FILE_OPEN_ERR,buffer);
-           exit(1);
-       }
+  /* create the file name */
+  strcpy(buffer,srcFileName);
+  strcat(buffer,ext);
+
+  if (!(of = fopen(buffer,"a+"))) {
+      werror(E_FILE_OPEN_ERR,buffer);
+      exit(1);
+  }
     } else
-       of = stdout;
+  of = stdout;
 
     for (i=0; i < count ; i++ ) {
-       fprintf(of,"\n----------------------------------------------------------------\n");
-       fprintf(of,"Basic Block %s : loop Depth = %d noPath = %d , lastinLoop = %d\n",
-               ebbs[i]->entryLabel->name, 
-               ebbs[i]->depth,
-               ebbs[i]->noPath,
-               ebbs[i]->isLastInLoop);
-       fprintf(of,"\ndefines bitVector :");
-       bitVectDebugOn(ebbs[i]->defSet,of);
-       fprintf(of,"\nlocal defines bitVector :");
-       bitVectDebugOn(ebbs[i]->ldefs,of);
-       fprintf(of,"\npointers Set bitvector :");
-       bitVectDebugOn(ebbs[i]->ptrsSet,of);
-       fprintf(of,"\n----------------------------------------------------------------\n");
-       printiCChain(ebbs[i]->sch,of);
+  fprintf(of,"\n----------------------------------------------------------------\n");
+  fprintf(of,"Basic Block %s : loop Depth = %d noPath = %d , lastinLoop = %d\n",
+    ebbs[i]->entryLabel->name,
+    ebbs[i]->depth,
+    ebbs[i]->noPath,
+    ebbs[i]->isLastInLoop);
+  fprintf(of,"\ndefines bitVector :");
+  bitVectDebugOn(ebbs[i]->defSet,of);
+  fprintf(of,"\nlocal defines bitVector :");
+  bitVectDebugOn(ebbs[i]->ldefs,of);
+  fprintf(of,"\npointers Set bitvector :");
+  bitVectDebugOn(ebbs[i]->ptrsSet,of);
+  fprintf(of,"\n----------------------------------------------------------------\n");
+  printiCChain(ebbs[i]->sch,of);
     }
     fclose(of);
 }
@@ -173,60 +173,60 @@ void dumpEbbsToFileExt (char *ext,eBBlock **ebbs, int count)
 /*-----------------------------------------------------------------*/
 eBBlock *iCode2eBBlock (iCode *ic)
 {
-    iCode *loop ;        
+    iCode *loop ;
     eBBlock *ebb = neweBBlock(); /* a llocate an entry */
-    
+
     /* put the first one unconditionally */
-    ebb->sch = ic ;   
+    ebb->sch = ic ;
 
     /* if this is a label then */
     if (ic->op == LABEL)
-       ebb->entryLabel = ic->argLabel.label ;
+  ebb->entryLabel = ic->argLabel.label ;
     else {
-       sprintf(buffer,"_eBBlock%d",eBBNum++);
-       ebb->entryLabel = newSymbol(buffer,1);
-       ebb->entryLabel->key = labelKey++;
+  sprintf(buffer,"_eBBlock%d",eBBNum++);
+  ebb->entryLabel = newSymbol(buffer,1);
+  ebb->entryLabel->key = labelKey++;
     }
-    
-    if (ic && 
-       ( ic->op == GOTO       ||
-         ic->op == JUMPTABLE  ||
-         ic->op == IFX        )) {
-       ebb->ech = ebb->sch;
-       return ebb;
+
+    if (ic &&
+  ( ic->op == GOTO       ||
+    ic->op == JUMPTABLE  ||
+    ic->op == IFX        )) {
+  ebb->ech = ebb->sch;
+  return ebb;
     }
 
     if ((ic->next && ic->next->op == LABEL) ||
-       !ic->next ) {
-       ebb->ech = ebb->sch ;
-       return ebb ;
+  !ic->next ) {
+  ebb->ech = ebb->sch ;
+  return ebb ;
     }
-    
+
     /* loop thru till we find one with a label */
-    for ( loop = ic->next ; loop ; loop = loop->next ) {       
-       
-       /* if this is the last one */
-       if (!loop->next)
-           break;
-       /* if this is a function call */
-       if (loop->op == CALL || loop->op == PCALL) {
-           ebb->hasFcall = 1;
-           if (currFunc)
-               currFunc->hasFcall = 1;
-       }
-
-       /* if the next one is a label */
-       /* if this is a goto or ifx */
-       if (loop->next->op == LABEL ||
-           loop->op == GOTO        ||
-           loop->op == JUMPTABLE   ||
-           loop->op == IFX )
-           break ;     
+    for ( loop = ic->next ; loop ; loop = loop->next ) {
+
+  /* if this is the last one */
+  if (!loop->next)
+      break;
+  /* if this is a function call */
+  if (loop->op == CALL || loop->op == PCALL) {
+      ebb->hasFcall = 1;
+      if (currFunc)
+    currFunc->hasFcall = 1;
+  }
+
+  /* if the next one is a label */
+  /* if this is a goto or ifx */
+  if (loop->next->op == LABEL ||
+      loop->op == GOTO        ||
+      loop->op == JUMPTABLE   ||
+      loop->op == IFX )
+      break ;
     }
-    
+
     /* mark the end of the chain */
     ebb->ech = loop ;
-    
+
     return ebb;
 }
 
@@ -236,12 +236,12 @@ eBBlock *iCode2eBBlock (iCode *ic)
 eBBlock *eBBWithEntryLabel ( eBBlock **ebbs , symbol *eLabel, int count)
 {
     int i;
-    
+
     for ( i = 0 ; i < count ; i++ ) {
-       if (isSymbolEqual(ebbs[i]->entryLabel,eLabel))
-           return ebbs[i] ;
+  if (isSymbolEqual(ebbs[i]->entryLabel,eLabel))
+      return ebbs[i] ;
     }
-    
+
     return NULL ;
 }
 
@@ -255,7 +255,7 @@ DEFSETFUNC(ifFromIs)
     V_ARG(eBBlock *,this);
 
     if (ep->from == this)
-       return 1;
+  return 1;
 
     return 0;
 }
@@ -270,10 +270,10 @@ set *edgesTo ( eBBlock *to )
     edge *loop ;
 
     for (loop = setFirstItem(graphEdges) ; loop ; loop = setNextItem(graphEdges))
-       if (loop->to == to && !loop->from->noPath)
-           addSet(&result,loop->from);
-    
-    return result ;    
+  if (loop->to == to && !loop->from->noPath)
+      addSet(&result,loop->from);
+
+    return result ;
 }
 
 
@@ -285,77 +285,77 @@ void addiCodeToeBBlock ( eBBlock *ebp, iCode *ic , iCode *ip)
     ic->prev = ic->next = NULL;
     /* if the insert point is given */
     if (ip) {
-       ic->lineno = ip->lineno;
-       ic->prev = ip->prev;
-       ip->prev = ic;
-       ic->next = ip;
-       if (!ic->prev)
-           ebp->sch = ic;
-       else
-           ic->prev->next = ic;        
-       return;
+  ic->lineno = ip->lineno;
+  ic->prev = ip->prev;
+  ip->prev = ic;
+  ic->next = ip;
+  if (!ic->prev)
+      ebp->sch = ic;
+  else
+      ic->prev->next = ic;
+  return;
     }
 
     /* if the block has no  instructions */
     if (ebp->ech == NULL ) {
-       ebp->sch = ebp->ech = ic;
-       ic->next = NULL;
-       return ;
+  ebp->sch = ebp->ech = ic;
+  ic->next = NULL;
+  return ;
     }
 
     /* if the last instruction is a goto */
     /* we add it just before the goto    */
     if ( ebp->ech->op == GOTO || ebp->ech->op == JUMPTABLE
-      || ebp->ech->op == RETURN) 
+      || ebp->ech->op == RETURN)
     {
-       ic->lineno = ebp->ech->lineno;
-       ic->prev = ebp->ech->prev;       
-       ebp->ech->prev = ic;
-       ic->next = ebp->ech;
-       if (!ic->prev) /* was the last only on in the block */
-           ebp->sch = ic;
-       else
-           ic->prev->next = ic;
-       return;
+  ic->lineno = ebp->ech->lineno;
+  ic->prev = ebp->ech->prev;
+  ebp->ech->prev = ic;
+  ic->next = ebp->ech;
+  if (!ic->prev) /* was the last only on in the block */
+      ebp->sch = ic;
+  else
+      ic->prev->next = ic;
+  return;
     }
 
-    /* if the last one was a ifx statement we check to see */ 
+    /* if the last one was a ifx statement we check to see */
     /* if the condition was defined in the previous instruction */
     /* if this is true then we put it before the condition else */
     /* we put it before if, this is to reduce register pressure,*/
     /* we don't have to hold  condition too long in a register  */
     if ( ebp->ech->op == IFX ) {
-       iCode *ipoint ;
-
-/*     if ( !ebp->ech->prev )  */
-/*         ipoint = ebp->ech ; */
-/*     else  */
-/*         if (!IC_RESULT(ebp->ech->prev)) */
-/*             ipoint = ebp->ech ; */
-/*         else */
-/*             if (IC_COND(ebp->ech)->key == IC_RESULT(ebp->ech->prev)->key) */
-/*                 ipoint = ebp->ech->prev; */
-/*             else */
-/*                 ipoint = ebp->ech ; */
-       ipoint = ebp->ech ;
-       ic->lineno = ipoint->lineno;
-       ic->prev = ipoint->prev;
-       ipoint->prev = ic;
-       ic->next = ipoint;
-       if (!ic->prev)
-           ebp->sch = ic;
-       else
-           ic->prev->next = ic;
-       return;
+  iCode *ipoint ;
+
+/*  if ( !ebp->ech->prev )  */
+/*      ipoint = ebp->ech ; */
+/*  else  */
+/*      if (!IC_RESULT(ebp->ech->prev)) */
+/*    ipoint = ebp->ech ; */
+/*      else */
+/*    if (IC_COND(ebp->ech)->key == IC_RESULT(ebp->ech->prev)->key) */
+/*        ipoint = ebp->ech->prev; */
+/*    else */
+/*        ipoint = ebp->ech ; */
+  ipoint = ebp->ech ;
+  ic->lineno = ipoint->lineno;
+  ic->prev = ipoint->prev;
+  ipoint->prev = ic;
+  ic->next = ipoint;
+  if (!ic->prev)
+      ebp->sch = ic;
+  else
+      ic->prev->next = ic;
+  return;
     }
-        
+
     /* will add it to the very end */
     ip = ebp->ech;
     ip->next = ic;
     ic->prev = ip;
     ic->next = NULL;
     ebp->ech = ic;
-    
+
     return ;
 }
 
@@ -364,15 +364,15 @@ void addiCodeToeBBlock ( eBBlock *ebp, iCode *ic , iCode *ip)
 /*-----------------------------------------------------------------*/
 void remiCodeFromeBBlock (eBBlock *ebb, iCode *ic)
 {
-    if (ic->prev) 
-       ic->prev->next = ic->next ;
-    else 
-       ebb->sch = ic->next ;
-    
+    if (ic->prev)
+  ic->prev->next = ic->next ;
+    else
+  ebb->sch = ic->next ;
+
     if (ic->next)
-       ic->next->prev = ic->prev;
+  ic->next->prev = ic->prev;
     else
-       ebb->ech = ic->prev;    
+  ebb->ech = ic->prev;
 }
 
 /*-----------------------------------------------------------------*/
@@ -381,98 +381,98 @@ void remiCodeFromeBBlock (eBBlock *ebb, iCode *ic)
 eBBlock **iCodeBreakDown (iCode *ic, int *count)
 {
     eBBlock **ebbs = NULL ;
-    iCode *loop = ic;       
+    iCode *loop = ic;
 
     *count = 0 ;
 
     /* allocate for the first entry */
 
-    ebbs = Safe_calloc(sizeof(eBBlock **));
-       
-    while (loop) {       
-
-       /* convert 2 block */
-       eBBlock *ebb = iCode2eBBlock(loop);
-       loop = ebb->ech->next ; 
-           
-       ebb->ech->next = NULL ; /* mark the end of this chain */
-       if (loop)
-           loop->prev = NULL ;
-       ebb->bbnum = *count ;    /* save this block number     */
-       /* put it in the array */
-       ebbs[(*count)++] = ebb ;
-       
-       /* allocate for the next one. Remember to clear the new */
-       /*  pointer at the end, that was created by realloc. */
-
-       ebbs = Safe_realloc(ebbs,(*count + 1)*sizeof(eBBlock **)) ;
-
-       ebbs[*count] = 0;
-
-       /* if this one ends in a goto or a conditional */
-       /* branch then check if the block it is going  */
-       /* to already exists, if yes then this could   */
-       /* be a loop, add a preheader to the block it  */
-       /* goes to  if it does not already have one    */
-       if (ebbs[(*count) - 1]->ech   &&
-           (ebbs[(*count) - 1]->ech->op == GOTO ||
-            ebbs[(*count) - 1]->ech->op == IFX )) {
-           
-           symbol *label ;
-           eBBlock *destBlock;
-
-           if (ebbs[(*count) - 1]->ech->op == GOTO)
-               label = IC_LABEL(ebbs[(*count)-1]->ech);
-           else
-               if (!(label = IC_TRUE(ebbs[(*count)-1]->ech)))
-                   label = IC_FALSE(ebbs[(*count)-1]->ech);
-           
-           if ((destBlock = eBBWithEntryLabel(ebbs,label,(*count))) &&
-               destBlock->preHeader == NULL                         &&
-               otherPathsPresent(ebbs,destBlock) ) {
-               
-               symbol *preHeaderLabel = newiTempPreheaderLabel();
-               int i,j ;
-               eBBlock *pBlock ;
-               
-               /* go thru all block replacing the entryLabel with new label */
-               /* till we reach the block , then we insert a new ebblock    */
-               for ( i = 0 ; i < (*count) ; i++ ) {
-                   if ( ebbs[i] == destBlock )
-                       break ;
-                   replaceLabel(ebbs[i],label,preHeaderLabel);
-               }
-               
-               (*count)++ ;
-               
-               /* if we have stopped at the block , allocate for an extra one */
-
-               ebbs = Safe_realloc(ebbs,(*count + 1)*sizeof(eBBlock **)) ;
-
-               ebbs[*count] = 0;
-               
-               /* then move the block down one count */  
-               pBlock = ebbs[j = i];
-               for ( i += 1; i < (*count) ; i++ ) {
-                   eBBlock *xBlock;
-                   
-                   xBlock = ebbs[i];
-                   ebbs[i] = pBlock;
-                   ebbs[i]->bbnum = i;
-                   pBlock = xBlock ;
-               }
-               
-               destBlock->preHeader = ebbs[j] = neweBBlock();
-               ebbs[j]->bbnum = j;
-               ebbs[j]->entryLabel = preHeaderLabel ;
-               ebbs[j]->sch = ebbs[j]->ech = newiCodeLabelGoto(LABEL,preHeaderLabel);
-               ebbs[j]->sch->lineno = destBlock->sch->lineno;
-           }               
-       }
+    ebbs = Safe_calloc(1,sizeof(eBBlock **));
+
+    while (loop) {
+
+  /* convert 2 block */
+  eBBlock *ebb = iCode2eBBlock(loop);
+  loop = ebb->ech->next ;
+
+  ebb->ech->next = NULL ; /* mark the end of this chain */
+  if (loop)
+      loop->prev = NULL ;
+  ebb->bbnum = *count ;    /* save this block number     */
+  /* put it in the array */
+  ebbs[(*count)++] = ebb ;
+
+  /* allocate for the next one. Remember to clear the new */
+  /*  pointer at the end, that was created by realloc. */
+
+  ebbs = Safe_realloc(ebbs,(*count + 1)*sizeof(eBBlock **)) ;
+
+  ebbs[*count] = 0;
+
+  /* if this one ends in a goto or a conditional */
+  /* branch then check if the block it is going  */
+  /* to already exists, if yes then this could   */
+  /* be a loop, add a preheader to the block it  */
+  /* goes to  if it does not already have one    */
+  if (ebbs[(*count) - 1]->ech   &&
+      (ebbs[(*count) - 1]->ech->op == GOTO ||
+       ebbs[(*count) - 1]->ech->op == IFX )) {
+
+      symbol *label ;
+      eBBlock *destBlock;
+
+      if (ebbs[(*count) - 1]->ech->op == GOTO)
+    label = IC_LABEL(ebbs[(*count)-1]->ech);
+      else
+    if (!(label = IC_TRUE(ebbs[(*count)-1]->ech)))
+        label = IC_FALSE(ebbs[(*count)-1]->ech);
+
+      if ((destBlock = eBBWithEntryLabel(ebbs,label,(*count))) &&
+    destBlock->preHeader == NULL                         &&
+    otherPathsPresent(ebbs,destBlock) ) {
+
+    symbol *preHeaderLabel = newiTempPreheaderLabel();
+    int i,j ;
+    eBBlock *pBlock ;
+
+    /* go thru all block replacing the entryLabel with new label */
+    /* till we reach the block , then we insert a new ebblock    */
+    for ( i = 0 ; i < (*count) ; i++ ) {
+        if ( ebbs[i] == destBlock )
+      break ;
+        replaceLabel(ebbs[i],label,preHeaderLabel);
     }
-    
+
+    (*count)++ ;
+
+    /* if we have stopped at the block , allocate for an extra one */
+
+    ebbs = Safe_realloc(ebbs,(*count + 1)*sizeof(eBBlock **)) ;
+
+    ebbs[*count] = 0;
+
+    /* then move the block down one count */
+    pBlock = ebbs[j = i];
+    for ( i += 1; i < (*count) ; i++ ) {
+        eBBlock *xBlock;
+
+        xBlock = ebbs[i];
+        ebbs[i] = pBlock;
+        ebbs[i]->bbnum = i;
+        pBlock = xBlock ;
+    }
+
+    destBlock->preHeader = ebbs[j] = neweBBlock();
+    ebbs[j]->bbnum = j;
+    ebbs[j]->entryLabel = preHeaderLabel ;
+    ebbs[j]->sch = ebbs[j]->ech = newiCodeLabelGoto(LABEL,preHeaderLabel);
+    ebbs[j]->sch->lineno = destBlock->sch->lineno;
+      }
+  }
+    }
+
     /* mark the end */
-    ebbs[*count] = NULL ;   
+    ebbs[*count] = NULL ;
 
     return ebbs ;
 }
@@ -488,48 +488,48 @@ eBBlock **iCodeBreakDown (iCode *ic, int *count)
 
     /* for all blocks in the set do */
     for ( loop = sset ; loop ; loop = loop->next) {
-       iCode *ic ;
-
-       rBlock = loop->item ;
-       /* for all instructions in this block do */
-       for ( ic = rBlock->sch ; ic ; ic = ic->next ) {
-
-           /* if we find usage */
-           if (ic->op == IFX && isOperandEqual(src,IC_COND(ic))) {
-               bitVectUnSetBit (OP_USES(IC_COND(ic)),ic->key);
-               IC_COND(ic) = operandFromOperand(dest);
-               OP_USES(dest) = bitVectSetBit (OP_USES(dest),ic->key);
-               continue ;
-           }
-
-           if (isOperandEqual(IC_RIGHT(ic),src)) {            
-               bitVectUnSetBit (OP_USES(IC_RIGHT(ic)),ic->key);
-               IC_RIGHT(ic) = operandFromOperand(dest);
-               IC_RIGHT(ic)->isaddr = 0;
-               OP_USES(dest) = bitVectSetBit (OP_USES(dest),ic->key);
-           }
-
-           if (isOperandEqual(IC_LEFT(ic),src)) {
-               bitVectUnSetBit (OP_USES(IC_LEFT(ic)),ic->key);
-               if (POINTER_GET(ic) && IS_ITEMP(dest)) {
-                   IC_LEFT(ic) = operandFromOperand(dest);
-                   IC_LEFT(ic)->isaddr = 1;
-               } else {
-                   IC_LEFT(ic) = operandFromOperand(dest);
-                   IC_LEFT(ic)->isaddr = 0;
-               }
-               OP_USES(dest) = bitVectSetBit (OP_USES(dest),ic->key);                          
-           }
-
-           /* special case for pointer sets */
-           if (POINTER_SET(ic) &&
-               isOperandEqual(IC_RESULT(ic),src)) {
-               bitVectUnSetBit (OP_USES(IC_RESULT(ic)),ic->key);
-               IC_RESULT(ic) = operandFromOperand(dest);
-               IC_RESULT(ic)->isaddr = 1;
-               OP_USES(dest) = bitVectSetBit(OP_USES(dest),ic->key);
-           }
-       }
+  iCode *ic ;
+
+  rBlock = loop->item ;
+  /* for all instructions in this block do */
+  for ( ic = rBlock->sch ; ic ; ic = ic->next ) {
+
+      /* if we find usage */
+      if (ic->op == IFX && isOperandEqual(src,IC_COND(ic))) {
+    bitVectUnSetBit (OP_USES(IC_COND(ic)),ic->key);
+    IC_COND(ic) = operandFromOperand(dest);
+    OP_USES(dest) = bitVectSetBit (OP_USES(dest),ic->key);
+    continue ;
+      }
+
+      if (isOperandEqual(IC_RIGHT(ic),src)) {
+    bitVectUnSetBit (OP_USES(IC_RIGHT(ic)),ic->key);
+    IC_RIGHT(ic) = operandFromOperand(dest);
+    IC_RIGHT(ic)->isaddr = 0;
+    OP_USES(dest) = bitVectSetBit (OP_USES(dest),ic->key);
+      }
+
+      if (isOperandEqual(IC_LEFT(ic),src)) {
+    bitVectUnSetBit (OP_USES(IC_LEFT(ic)),ic->key);
+    if (POINTER_GET(ic) && IS_ITEMP(dest)) {
+        IC_LEFT(ic) = operandFromOperand(dest);
+        IC_LEFT(ic)->isaddr = 1;
+    } else {
+        IC_LEFT(ic) = operandFromOperand(dest);
+        IC_LEFT(ic)->isaddr = 0;
+    }
+    OP_USES(dest) = bitVectSetBit (OP_USES(dest),ic->key);
+      }
+
+      /* special case for pointer sets */
+      if (POINTER_SET(ic) &&
+    isOperandEqual(IC_RESULT(ic),src)) {
+    bitVectUnSetBit (OP_USES(IC_RESULT(ic)),ic->key);
+    IC_RESULT(ic) = operandFromOperand(dest);
+    IC_RESULT(ic)->isaddr = 1;
+    OP_USES(dest) = bitVectSetBit(OP_USES(dest),ic->key);
+      }
+  }
     }
 }
 
@@ -537,32 +537,32 @@ eBBlock **iCodeBreakDown (iCode *ic, int *count)
 /* replaceLabel - replace reference to one label by another        */
 /*-----------------------------------------------------------------*/
  void replaceLabel(eBBlock *ebp, symbol *fromLbl, symbol *toLbl)
-{      
+{
     iCode *ic;
 
     if (!ebp)
-       return ;
+  return ;
 
     for (ic = ebp->sch ; ic ; ic = ic->next ) {
-       switch (ic->op) { 
-           
-       case GOTO :
-           if (isSymbolEqual(IC_LABEL(ic),fromLbl))
-               IC_LABEL(ic) = toLbl;
-           break;
-
-       case IFX:
-           if (IC_TRUE(ic) && isSymbolEqual(IC_TRUE(ic),fromLbl))
-               IC_TRUE(ic) = toLbl ;
-           else
-               if (isSymbolEqual(IC_FALSE(ic),fromLbl))
-                   IC_FALSE(ic) = toLbl;
-           break;
-       }
+  switch (ic->op) {
+
+  case GOTO :
+      if (isSymbolEqual(IC_LABEL(ic),fromLbl))
+    IC_LABEL(ic) = toLbl;
+      break;
+
+  case IFX:
+      if (IC_TRUE(ic) && isSymbolEqual(IC_TRUE(ic),fromLbl))
+    IC_TRUE(ic) = toLbl ;
+      else
+    if (isSymbolEqual(IC_FALSE(ic),fromLbl))
+        IC_FALSE(ic) = toLbl;
+      break;
+  }
     }
 
     return;
-    
+
 }
 
 
@@ -576,19 +576,19 @@ iCode *iCodeFromeBBlock ( eBBlock **ebbs, int count)
     iCode *lic = ebbs[0]->ech ;
 
     for ( ; i < count; i++ ) {
-       if ( ebbs[i]->sch == NULL)
-           continue ;
-
-       if ( ebbs[i]->noPath &&
-            (ebbs[i]->entryLabel != entryLabel &&
-             ebbs[i]->entryLabel != returnLabel )) {
-           werror(W_CODE_UNREACH,ebbs[i]->sch->filename,ebbs[i]->sch->lineno);
-           continue ;
-       }
-
-       lic->next = ebbs[i]->sch ;
-       lic->next->prev = lic;
-       lic = ebbs[i]->ech ;
+  if ( ebbs[i]->sch == NULL)
+      continue ;
+
+  if ( ebbs[i]->noPath &&
+       (ebbs[i]->entryLabel != entryLabel &&
+        ebbs[i]->entryLabel != returnLabel )) {
+      werror(W_CODE_UNREACH,ebbs[i]->sch->filename,ebbs[i]->sch->lineno);
+      continue ;
+  }
+
+  lic->next = ebbs[i]->sch ;
+  lic->next->prev = lic;
+  lic = ebbs[i]->ech ;
     }
 
     return ric;
@@ -604,26 +604,26 @@ int otherPathsPresent (eBBlock **ebbs, eBBlock *this)
 
     /* for all blocks preceding this block */
     for ( i = 0 ; i < this->bbnum ; i++ ) {
-       iCode *ic ;
-
-       /* if there is a reference to the entry label of this block */
-       for ( ic = ebbs[i]->sch ; ic ; ic = ic->next ) {
-           switch (ic->op) {
-           case GOTO :
-               if (IC_LABEL(ic)->key == this->entryLabel->key)
-                   return 1;
-               break;
-               
-           case IFX :
-               if (IC_TRUE(ic)) {
-                   if (IC_TRUE(ic)->key == this->entryLabel->key)
-                       return 1;
-               } else
-                   if (IC_FALSE(ic)->key == this->entryLabel->key)
-                       return 1 ;
-               break;
-           }       
-       }
+  iCode *ic ;
+
+  /* if there is a reference to the entry label of this block */
+  for ( ic = ebbs[i]->sch ; ic ; ic = ic->next ) {
+      switch (ic->op) {
+      case GOTO :
+    if (IC_LABEL(ic)->key == this->entryLabel->key)
+        return 1;
+    break;
+
+      case IFX :
+    if (IC_TRUE(ic)) {
+        if (IC_TRUE(ic)->key == this->entryLabel->key)
+      return 1;
+    } else
+        if (IC_FALSE(ic)->key == this->entryLabel->key)
+      return 1 ;
+    break;
+      }
+  }
     }
 
     /* comes here means we have not found it yet */
@@ -631,9 +631,9 @@ int otherPathsPresent (eBBlock **ebbs, eBBlock *this)
     /* ends in a goto if it does then we have no */
     /* path else we have a path                  */
     if (this->bbnum && ebbs[this->bbnum - 1]->ech &&
-       ebbs[this->bbnum - 1]->ech->op == GOTO )
-       return 0;
+  ebbs[this->bbnum - 1]->ech->op == GOTO )
+  return 0;
     else
-       return 1;
+  return 1;
 }
 
index 230be7ec9b76b555dce5b1e6bcd470524c422b57..53702f36dc4c8e10a743b100daa69b1c50d1f397 100644 (file)
@@ -7,19 +7,19 @@
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "common.h"
@@ -61,7 +61,7 @@ int ptt(ast *tree) {
     printTypeChain(tree->ftype,stdout);
     return 0;
 }
-     
+
 
 /*-----------------------------------------------------------------*/
 /* newAst - creates a fresh node for an expression tree           */
@@ -72,9 +72,9 @@ ast  *newAst (int  type, void *op )
     ast  *ex ;
     static int oldLineno = 0 ;
 
-    Safe_calloc(ex,sizeof(ast));    
-    
-    ex->type = type ;          
+    Safe_calloc(1,ex,sizeof(ast));
+
+    ex->type = type ;
     ex->lineno = (noLineno ? oldLineno : yylineno);
     ex->filename = currFname ;
     ex->level = NestLevel ;
@@ -84,18 +84,18 @@ ast  *newAst (int  type, void *op )
     /* depending on the type */
     switch (type)   {
     case  EX_VALUE :
-       ex->opval.val = (value *) op;
-       break ;
+  ex->opval.val = (value *) op;
+  break ;
     case EX_OP     :
-       ex->opval.op   = (long) op ;
-       break ;
+  ex->opval.op   = (long) op ;
+  break ;
     case EX_LINK   :
-       ex->opval.lnk  = (sym_link *) op;
-       break ;
+  ex->opval.lnk  = (sym_link *) op;
+  break ;
     case EX_STMNT  :
-       ex->opval.stmnt= (unsigned) op;
+  ex->opval.stmnt= (unsigned) op;
     }
-    
+
     return ex;
 }
 #endif
@@ -105,9 +105,9 @@ static ast* newAst_(unsigned type)
     ast  *ex ;
     static int oldLineno = 0 ;
 
-    ex = Safe_calloc(sizeof(ast));    
-    
-    ex->type = type ;          
+    ex = Safe_calloc(1,sizeof(ast));
+
+    ex->type = type ;
     ex->lineno = (noLineno ? oldLineno : yylineno);
     ex->filename = currFname ;
     ex->level = NestLevel ;
@@ -150,11 +150,11 @@ ast* newAst_STMNT(unsigned val)
 ast  *newNode ( long op,   ast  *left, ast *right   )
 {
     ast  *ex ;
-    
+
     ex = newAst_OP(op) ;
     ex->left    = left ;
     ex->right   = right;
-        
+
     return ex ;
 }
 
@@ -164,62 +164,62 @@ ast  *newNode ( long op,   ast  *left, ast *right   )
 ast *newIfxNode (ast *condAst, symbol *trueLabel, symbol *falseLabel)
 {
     ast *ifxNode ;
-    
+
     /* if this is a literal then we already know the result */
     if (condAst->etype && IS_LITERAL(condAst->etype)) {
-       
-       /* then depending on the expression value */
-       if ( floatFromVal(condAst->opval.val) )
-             ifxNode = newNode(GOTO,
-                               newAst_VALUE(symbolVal(trueLabel)),
-                               NULL);
-       else
-             ifxNode = newNode(GOTO,
-                               newAst_VALUE(symbolVal(falseLabel)),
-                               NULL);
+
+  /* then depending on the expression value */
+  if ( floatFromVal(condAst->opval.val) )
+        ifxNode = newNode(GOTO,
+        newAst_VALUE(symbolVal(trueLabel)),
+        NULL);
+  else
+        ifxNode = newNode(GOTO,
+        newAst_VALUE(symbolVal(falseLabel)),
+        NULL);
     }
     else {
-       ifxNode = newNode(IFX,condAst,NULL);
-       ifxNode->trueLabel = trueLabel;
-       ifxNode->falseLabel= falseLabel;
+  ifxNode = newNode(IFX,condAst,NULL);
+  ifxNode->trueLabel = trueLabel;
+  ifxNode->falseLabel= falseLabel;
     }
-    
+
     return ifxNode ;
 }
 
 /*-----------------------------------------------------------------*/
-/* copyAstValues - copies value portion of ast if needed          */
+/* copyAstValues - copies value portion of ast if needed     */
 /*-----------------------------------------------------------------*/
 void copyAstValues (ast *dest,ast *src)
 {
     switch (src->opval.op) {
     case BLOCK:
-       dest->values.sym     = copySymbolChain(src->values.sym);
-       break;
-       
+  dest->values.sym     = copySymbolChain(src->values.sym);
+  break;
+
     case SWITCH:
-       dest->values.switchVals.swVals = 
-           copyValue(src->values.switchVals.swVals);
-       dest->values.switchVals.swDefault =
-           src->values.switchVals.swDefault ;
-       dest->values.switchVals.swNum  =
-           src->values.switchVals.swNum ;
-       break ;
-       
+  dest->values.switchVals.swVals =
+      copyValue(src->values.switchVals.swVals);
+  dest->values.switchVals.swDefault =
+      src->values.switchVals.swDefault ;
+  dest->values.switchVals.swNum  =
+      src->values.switchVals.swNum ;
+  break ;
+
     case INLINEASM:
-       dest->values.inlineasm = Safe_calloc(strlen(src->values.inlineasm)+1);
-       strcpy(dest->values.inlineasm,src->values.inlineasm);
+  dest->values.inlineasm = Safe_calloc(1,strlen(src->values.inlineasm)+1);
+  strcpy(dest->values.inlineasm,src->values.inlineasm);
 
     case FOR:
-        AST_FOR(dest,trueLabel) = copySymbol(AST_FOR(src,trueLabel));
-        AST_FOR(dest,continueLabel) = copySymbol(AST_FOR(src,continueLabel));
-        AST_FOR(dest,falseLabel) =  copySymbol(AST_FOR(src,falseLabel));
-        AST_FOR(dest,condLabel)  =  copySymbol(AST_FOR(src,condLabel));
-        AST_FOR(dest,initExpr)   =  copyAst (AST_FOR(src,initExpr)) ;
-        AST_FOR(dest,condExpr)   =  copyAst (AST_FOR(src,condExpr)) ;
-        AST_FOR(dest,loopExpr)   =  copyAst (AST_FOR(src,loopExpr)) ;
-    }
-    
+   AST_FOR(dest,trueLabel) = copySymbol(AST_FOR(src,trueLabel));
+   AST_FOR(dest,continueLabel) = copySymbol(AST_FOR(src,continueLabel));
+   AST_FOR(dest,falseLabel) =  copySymbol(AST_FOR(src,falseLabel));
+   AST_FOR(dest,condLabel)  =  copySymbol(AST_FOR(src,condLabel));
+   AST_FOR(dest,initExpr)   =  copyAst (AST_FOR(src,initExpr)) ;
+   AST_FOR(dest,condExpr)   =  copyAst (AST_FOR(src,condExpr)) ;
+   AST_FOR(dest,loopExpr)   =  copyAst (AST_FOR(src,loopExpr)) ;
+    }
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -228,45 +228,45 @@ void copyAstValues (ast *dest,ast *src)
 ast  *copyAst (ast   *src)
 {
     ast  *dest;
-    
+
     if (!src)  return NULL ;
-   
-    dest = Safe_calloc(sizeof(ast));
-    
+
+    dest = Safe_calloc(1,sizeof(ast));
+
     dest->type = src->type  ;
     dest->lineno = src->lineno ;
     dest->level  = src->level  ;
     dest->funcName = src->funcName;
     dest->argSym = src->argSym;
-    
-    /* if this is a leaf */   
+
+    /* if this is a leaf */
     /* if value */
     if (src->type == EX_VALUE)   {
-       dest->opval.val = copyValue(src->opval.val);
-       goto exit;
+  dest->opval.val = copyValue(src->opval.val);
+  goto exit;
     }
-    
+
     /* if link */
     if (src->type == EX_LINK)   {
-       dest->opval.lnk = copyLinkChain(src->opval.lnk);
-       goto exit ;
+  dest->opval.lnk = copyLinkChain(src->opval.lnk);
+  goto exit ;
     }
-    
+
     dest->opval.op = src->opval.op ;
-    
+
     /* if this is a node that has special values */
     copyAstValues (dest,src);
-    
-    if ( src->ftype ) 
-       dest->etype = getSpec(dest->ftype = copyLinkChain(src->ftype)) ;
-    
+
+    if ( src->ftype )
+  dest->etype = getSpec(dest->ftype = copyLinkChain(src->ftype)) ;
+
     dest->trueLabel = copySymbol (src->trueLabel);
     dest->falseLabel= copySymbol (src->falseLabel);
     dest->left = copyAst(src->left);
     dest->right= copyAst(src->right);
  exit:
     return dest ;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -275,18 +275,18 @@ ast  *copyAst (ast   *src)
 bool hasSEFcalls ( ast *tree)
 {
     if (!tree)
-       return FALSE ;
+  return FALSE ;
 
-    if (tree->type == EX_OP && 
-       ( tree->opval.op == CALL  ||
-         tree->opval.op == PCALL ||
-         tree->opval.op == '='   ||
-         tree->opval.op == INC_OP ||
-         tree->opval.op == DEC_OP ))
-       return TRUE;
+    if (tree->type == EX_OP &&
+  ( tree->opval.op == CALL  ||
+    tree->opval.op == PCALL ||
+    tree->opval.op == '='   ||
+    tree->opval.op == INC_OP ||
+    tree->opval.op == DEC_OP ))
+  return TRUE;
 
     return ( hasSEFcalls(tree->left) |
-            hasSEFcalls(tree->right));
+       hasSEFcalls(tree->right));
 }
 
 /*-----------------------------------------------------------------*/
@@ -295,43 +295,43 @@ bool hasSEFcalls ( ast *tree)
 int isAstEqual (ast *t1, ast *t2)
 {
     if (!t1 && !t2)
-       return 1;
+  return 1;
 
     if (!t1 || !t2)
-       return 0;
+  return 0;
 
     /* match type */
     if (t1->type != t2->type)
-       return 0;
+  return 0;
 
     switch (t1->type) {
     case EX_OP:
-       if (t1->opval.op != t2->opval.op)
-           return 0;
-       return ( isAstEqual(t1->left,t2->left) &&
-                isAstEqual(t1->right,t2->right));
-       break;
+  if (t1->opval.op != t2->opval.op)
+      return 0;
+  return ( isAstEqual(t1->left,t2->left) &&
+     isAstEqual(t1->right,t2->right));
+  break;
 
     case EX_VALUE:
-       if (t1->opval.val->sym) {
-           if (!t2->opval.val->sym)
-               return 0;
-           else
-               return isSymbolEqual(t1->opval.val->sym,
-                                    t2->opval.val->sym);
-       }
-       else {
-           if (t2->opval.val->sym)
-               return 0;
-           else
-               return (floatFromVal(t1->opval.val) ==
-                       floatFromVal(t2->opval.val));
-       }
-       break;
-
-       /* only compare these two types */
+  if (t1->opval.val->sym) {
+      if (!t2->opval.val->sym)
+    return 0;
+      else
+    return isSymbolEqual(t1->opval.val->sym,
+             t2->opval.val->sym);
+  }
+  else {
+      if (t2->opval.val->sym)
+    return 0;
+      else
+    return (floatFromVal(t1->opval.val) ==
+      floatFromVal(t2->opval.val));
+  }
+  break;
+
+  /* only compare these two types */
     default :
-       return 0;
+  return 0;
     }
 
     return 0;
@@ -345,102 +345,102 @@ ast *resolveSymbols (ast *tree)
     /* walk the entire tree and check for values */
     /* with symbols if we find one then replace  */
     /* symbol with that from the symbol table    */
-    
+
     if ( tree == NULL )
-       return tree ;
+  return tree ;
 
     /* print the line          */
     /* if not block & function */
-    if ( tree->type == EX_OP && 
-        ( tree->opval.op != FUNCTION  &&
-          tree->opval.op != BLOCK     &&
-          tree->opval.op != NULLOP    )) {
-       filename = tree->filename ;
-       lineno = tree->lineno ;
+    if ( tree->type == EX_OP &&
+   ( tree->opval.op != FUNCTION  &&
+     tree->opval.op != BLOCK     &&
+     tree->opval.op != NULLOP    )) {
+  filename = tree->filename ;
+  lineno = tree->lineno ;
     }
 
     /* make sure we resolve the true & false labels for ifx */
     if (tree->type == EX_OP && tree->opval.op == IFX ) {
-       symbol *csym ;
+  symbol *csym ;
 
-       if (tree->trueLabel) {
-           if (( csym = findSym(LabelTab,tree->trueLabel,
-                                tree->trueLabel->name)))
-               tree->trueLabel = csym ;
-           else
-               werror(E_LABEL_UNDEF,tree->trueLabel->name);
-       }
+  if (tree->trueLabel) {
+      if (( csym = findSym(LabelTab,tree->trueLabel,
+         tree->trueLabel->name)))
+    tree->trueLabel = csym ;
+      else
+    werror(E_LABEL_UNDEF,tree->trueLabel->name);
+  }
 
-       if (tree->falseLabel) {
-           if (( csym = findSym(LabelTab,
-                                tree->falseLabel,
-                                tree->falseLabel->name)))
-               tree->falseLabel = csym ;
-           else
-               werror(E_LABEL_UNDEF,tree->falseLabel->name);       
-       }
+  if (tree->falseLabel) {
+      if (( csym = findSym(LabelTab,
+         tree->falseLabel,
+         tree->falseLabel->name)))
+    tree->falseLabel = csym ;
+      else
+    werror(E_LABEL_UNDEF,tree->falseLabel->name);
+  }
 
     }
 
     /* if this is a label resolve it from the labelTab*/
-    if (IS_AST_VALUE(tree)   &&      
-       tree->opval.val->sym &&
-       tree->opval.val->sym->islbl) {
-       
-       symbol *csym = findSym (LabelTab, tree->opval.val->sym , 
-                               tree->opval.val->sym->name);
+    if (IS_AST_VALUE(tree)   &&
+  tree->opval.val->sym &&
+  tree->opval.val->sym->islbl) {
+
+  symbol *csym = findSym (LabelTab, tree->opval.val->sym ,
+        tree->opval.val->sym->name);
 
-       if (!csym) 
-           werror (E_LABEL_UNDEF,tree->opval.val->sym->name);
-       else        
-           tree->opval.val->sym = csym ;       
+  if (!csym)
+      werror (E_LABEL_UNDEF,tree->opval.val->sym->name);
+  else
+      tree->opval.val->sym = csym ;
 
-       goto resolveChildren ;
+  goto resolveChildren ;
     }
 
     /* do only for leafs */
-    if (IS_AST_VALUE(tree)   && 
-       tree->opval.val->sym && 
-       ! tree->opval.val->sym->implicit ) {
-
-       symbol *csym = findSymWithLevel (SymbolTab,tree->opval.val->sym);
-       
-       /* if found in the symbol table & they r not the same */
-       if (csym && tree->opval.val->sym != csym ) {      
-           tree->opval.val->sym = csym ;          
-           tree->opval.val->type = csym->type;
-           tree->opval.val->etype = csym->etype;
-       }
-       
-       /* if not found in the symbol table */
-       /* mark it as undefined assume it is*/
-       /* an integer in data space         */
-       if (!csym && !tree->opval.val->sym->implicit) {
-           
-           /* if this is a function name then */
-           /* mark it as returning an int     */
-           if (tree->funcName) {
-               tree->opval.val->sym->type = newLink();
-               DCL_TYPE(tree->opval.val->sym->type) = FUNCTION;
-               tree->opval.val->sym->type->next = 
-                   tree->opval.val->sym->etype = newIntLink();
-               tree->opval.val->etype = tree->opval.val->etype;
-               tree->opval.val->type = tree->opval.val->sym->type;
-               werror(W_IMPLICIT_FUNC,tree->opval.val->sym->name);
-           } else {
-               tree->opval.val->sym->undefined =1 ;
-               tree->opval.val->type = 
-                   tree->opval.val->etype = newIntLink();
-               tree->opval.val->sym->type = 
-                   tree->opval.val->sym->etype = newIntLink();
-           }
-       }       
-    }  
-
- resolveChildren:    
+    if (IS_AST_VALUE(tree)   &&
+  tree->opval.val->sym &&
+  ! tree->opval.val->sym->implicit ) {
+
+  symbol *csym = findSymWithLevel (SymbolTab,tree->opval.val->sym);
+
+  /* if found in the symbol table & they r not the same */
+  if (csym && tree->opval.val->sym != csym ) {
+      tree->opval.val->sym = csym ;
+      tree->opval.val->type = csym->type;
+      tree->opval.val->etype = csym->etype;
+  }
+
+  /* if not found in the symbol table */
+  /* mark it as undefined assume it is*/
+  /* an integer in data space         */
+  if (!csym && !tree->opval.val->sym->implicit) {
+
+      /* if this is a function name then */
+      /* mark it as returning an int     */
+      if (tree->funcName) {
+    tree->opval.val->sym->type = newLink();
+    DCL_TYPE(tree->opval.val->sym->type) = FUNCTION;
+    tree->opval.val->sym->type->next =
+        tree->opval.val->sym->etype = newIntLink();
+    tree->opval.val->etype = tree->opval.val->etype;
+    tree->opval.val->type = tree->opval.val->sym->type;
+    werror(W_IMPLICIT_FUNC,tree->opval.val->sym->name);
+      } else {
+    tree->opval.val->sym->undefined =1 ;
+    tree->opval.val->type =
+        tree->opval.val->etype = newIntLink();
+    tree->opval.val->sym->type =
+        tree->opval.val->sym->etype = newIntLink();
+      }
+  }
+    }
+
+ resolveChildren:
     resolveSymbols (tree->left);
     resolveSymbols (tree->right);
-    
+
     return tree;
 }
 
@@ -450,7 +450,7 @@ ast *resolveSymbols (ast *tree)
 int setAstLineno ( ast *tree, int lineno)
 {
     if (!tree)
-       return 0;
+  return 0;
 
     tree->lineno = lineno ;
     setAstLineno ( tree->left, lineno);
@@ -469,20 +469,20 @@ value *resolveFromTable (value *val)
     symbol *csym ;
 
     if (!val->sym)
-       return val;
+  return val;
 
     csym = findSymWithLevel (SymbolTab,val->sym);
-           
+
     /* if found in the symbol table & they r not the same */
-    if (csym && val->sym != csym && 
-       csym->level == val->sym->level &&
+    if (csym && val->sym != csym &&
+  csym->level == val->sym->level &&
         csym->_isparm &&
-       !csym->ismyparm) {
-      
-       val->sym = csym ;      
-       val->type = csym->type;
-       val->etype = csym->etype;
-    }  
+  !csym->ismyparm) {
+
+  val->sym = csym ;
+  val->type = csym->type;
+  val->etype = csym->etype;
+    }
 
     return val;
 }
@@ -491,44 +491,44 @@ value *resolveFromTable (value *val)
 /*-----------------------------------------------------------------*/
 /* funcOfType :- function of type with name                        */
 /*-----------------------------------------------------------------*/
-symbol *funcOfType (char *name, sym_link *type, sym_link *argType, 
-                   int nArgs , int rent)
+symbol *funcOfType (char *name, sym_link *type, sym_link *argType,
+        int nArgs , int rent)
 {
-    symbol *sym;    
-    int argStack = 0;  
+    symbol *sym;
+    int argStack = 0;
     /* create the symbol */
     sym = newSymbol (name,0);
-       
+
     /* if arguments required */
     if (nArgs) {
 
-       value *args ;
-       args = sym->args = newValue();
+  value *args ;
+  args = sym->args = newValue();
 
-       while (nArgs--) {
-           argStack += getSize(type);
-           args->type = copyLinkChain(argType);
-           args->etype = getSpec(args->type);
-           if (!nArgs)
-               break;
-           args = args->next = newValue();
-       }
+  while (nArgs--) {
+      argStack += getSize(type);
+      args->type = copyLinkChain(argType);
+      args->etype = getSpec(args->type);
+      if (!nArgs)
+    break;
+      args = args->next = newValue();
+  }
     }
-    
-    /* setup return value      */
+
+    /* setup return value */
     sym->type = newLink();
     DCL_TYPE(sym->type) = FUNCTION;
     sym->type->next = copyLinkChain(type);
-    sym->etype = getSpec(sym->type);   
+    sym->etype = getSpec(sym->type);
     SPEC_RENT(sym->etype) = rent;
-    
+
     /* save it */
     addSymChain(sym);
     sym->cdef = 1;
     sym->argStack = (rent ? argStack : 0);
     allocVariables (sym);
     return sym;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -538,15 +538,15 @@ void reverseParms (ast *ptree)
 {
     ast *ttree;
     if (!ptree)
-       return ;
+  return ;
 
     /* top down if we find a nonParm tree then quit */
     if (ptree->type == EX_OP && ptree->opval.op == PARAM ) {
-       ttree = ptree->left;
-       ptree->left = ptree->right;
-       ptree->right = ttree;
-       reverseParms(ptree->left);
-       reverseParms(ptree->right);
+  ttree = ptree->left;
+  ptree->left = ptree->right;
+  ptree->right = ttree;
+  reverseParms(ptree->left);
+  reverseParms(ptree->right);
     }
 
     return ;
@@ -556,134 +556,134 @@ void reverseParms (ast *ptree)
 /* processParms  - makes sure the parameters are okay and do some  */
 /*                 processing with them                            */
 /*-----------------------------------------------------------------*/
-int processParms (ast *func, value *defParm, 
-                 ast *actParm, 
-                 int *parmNumber)
+int processParms (ast *func, value *defParm,
+      ast *actParm,
+      int *parmNumber)
 {
     sym_link *fetype = func->etype;
 
     /* if none of them exist */
     if ( !defParm && !actParm)
-       return 0;
-     
+  return 0;
+
     /* if the function is being called via a pointer &   */
     /* it has not been defined a reentrant then we cannot*/
     /* have parameters                                   */
     if (func->type != EX_VALUE && !IS_RENT(fetype) && !options.stackAuto) {
-       werror (E_NONRENT_ARGS);  
-       return 1;
+  werror (E_NONRENT_ARGS);
+  return 1;
     }
-    
+
     /* if defined parameters ended but actual parameters */
     /* exist and this is not defined as a variable arg   */
     /* also check if statckAuto option is specified      */
-    if ((! defParm) && actParm && (!func->hasVargs ) && 
-       !options.stackAuto && !IS_RENT(fetype)) {
-       werror(E_TOO_MANY_PARMS);
-       return 1;
+    if ((! defParm) && actParm && (!func->hasVargs ) &&
+  !options.stackAuto && !IS_RENT(fetype)) {
+  werror(E_TOO_MANY_PARMS);
+  return 1;
     }
-    
+
     /* if defined parameters present but no actual parameters */
     if ( defParm && ! actParm) {
       werror(E_TOO_FEW_PARMS);
       return 1;
     }
-        
-    /* If this is a varargs function... */ 
+
+    /* If this is a varargs function... */
     if (!defParm && actParm && func->hasVargs )
     {
         ast *newType = NULL;
-      
-       if (IS_CAST_OP(actParm) 
-        || (IS_AST_LIT_VALUE(actParm) && actParm->values.literalFromCast))
-       {
-          /* Parameter was explicitly typecast; don't touch it. */
-          return 0;
-       }    
-        
+
+  if (IS_CAST_OP(actParm)
+   || (IS_AST_LIT_VALUE(actParm) && actParm->values.literalFromCast))
+  {
+     /* Parameter was explicitly typecast; don't touch it. */
+     return 0;
+  }
+
         /* If it's a small integer, upcast to int. */
-       if (IS_INTEGRAL(actParm->ftype)
+      if (IS_INTEGRAL(actParm->ftype)
          && getSize(actParm->ftype) < INTSIZE)
         {
-           newType = newAst_LINK(INTTYPE);
+      newType = newAst_LINK(INTTYPE);
         }
-        
+
         if (IS_PTR(actParm->ftype) && !IS_GENPTR(actParm->ftype))
         {
             newType = newAst_LINK(copyLinkChain(actParm->ftype));
             DCL_TYPE(newType->opval.lnk) = GPOINTER;
         }
-        
+
         if (IS_AGGREGATE(actParm->ftype))
         {
             newType = newAst_LINK(copyLinkChain(actParm->ftype));
             DCL_TYPE(newType->opval.lnk) = GPOINTER;
         }
-        
+
         if (newType)
         {
-           /* cast required; change this op to a cast. */
+          /* cast required; change this op to a cast. */
             ast *parmCopy = resolveSymbols(copyAst(actParm));
-           
-           actParm->type = EX_OP;
-           actParm->opval.op = CAST;
-           actParm->left = newType;
-           actParm->right= parmCopy;
-           decorateType(actParm);
+
+      actParm->type = EX_OP;
+      actParm->opval.op = CAST;
+      actParm->left = newType;
+      actParm->right= parmCopy;
+      decorateType(actParm);
         }
-        else if ( actParm->type == EX_OP && actParm->opval.op == PARAM) 
-       {
-           return (processParms (func,NULL,actParm->left,parmNumber) ||
-                   processParms (func,NULL,actParm->right,parmNumber) );
+        else if ( actParm->type == EX_OP && actParm->opval.op == PARAM)
+      {
+      return (processParms (func,NULL,actParm->left,parmNumber) ||
+              processParms (func,NULL,actParm->right,parmNumber) );
         }
         return 0;
-    }        
-        
+    }
+
     /* if defined parameters ended but actual has not & */
-    /* stackAuto                                               */
-    if (! defParm && actParm && 
-       (options.stackAuto || IS_RENT(fetype)))
-       return 0;
-    
+    /* stackAuto                */
+    if (! defParm && actParm &&
+  (options.stackAuto || IS_RENT(fetype)))
+  return 0;
+
     resolveSymbols(actParm);
     /* if this is a PARAM node then match left & right */
     if ( actParm->type == EX_OP && actParm->opval.op == PARAM) {
       return (processParms (func,defParm,actParm->left,parmNumber) ||
-             processParms (func,defParm->next, actParm->right,parmNumber) );
-    } 
+              processParms (func,defParm->next, actParm->right,parmNumber) );
+    }
 #if 0
     /* Pending discussion with Johan. */
     else {
       /* if more defined parameters present but no more actual parameters */
       if (defParm->next) {
-       werror(E_TOO_FEW_PARMS);
-       return 1;
+  werror(E_TOO_FEW_PARMS);
+  return 1;
       }
     }
 #endif
-       
+
     /* the parameter type must be atleast castable */
     if (checkType(defParm->type,actParm->ftype) == 0) {
-       werror(E_TYPE_MISMATCH_PARM,*parmNumber);
+  werror(E_TYPE_MISMATCH_PARM,*parmNumber);
         werror(E_CONTINUE,"defined type ");
-       printTypeChain(defParm->type,stderr);fprintf(stderr,"\n");
-       werror(E_CONTINUE,"actual type ");
-       printTypeChain(actParm->ftype,stderr);fprintf(stderr,"\n");
+  printTypeChain(defParm->type,stderr);fprintf(stderr,"\n");
+  werror(E_CONTINUE,"actual type ");
+  printTypeChain(actParm->ftype,stderr);fprintf(stderr,"\n");
     }
-    
+
     /* if the parameter is castable then add the cast */
     if ( checkType (defParm->type,actParm->ftype) < 0) {
-       ast *pTree = resolveSymbols(copyAst(actParm));
+  ast *pTree = resolveSymbols(copyAst(actParm));
 
-       /* now change the current one to a cast */      
-       actParm->type = EX_OP ;
-       actParm->opval.op = CAST ;
-       actParm->left = newAst_LINK(defParm->type);
-       actParm->right= pTree ;
-       actParm->etype= defParm->etype;
-       actParm->ftype= defParm->type;
+  /* now change the current one to a cast */
+  actParm->type = EX_OP ;
+  actParm->opval.op = CAST ;
+  actParm->left = newAst_LINK(defParm->type);
+  actParm->right= pTree ;
+  actParm->etype= defParm->etype;
+  actParm->ftype= defParm->type;
     }
-    
+
 /*    actParm->argSym = resolveFromTable(defParm)->sym ; */
 
     actParm->argSym = defParm->sym;
@@ -702,8 +702,8 @@ ast *createIvalType ( ast *sym,sym_link  *type, initList *ilist)
 
     /* if initList is deep */
     if ( ilist->type == INIT_DEEP )
-       ilist =  ilist->init.deep  ;
-    
+  ilist =  ilist->init.deep  ;
+
     iExpr = decorateType(resolveSymbols(list2expr(ilist)));
     return decorateType(newNode('=',sym,iExpr));
 }
@@ -716,25 +716,25 @@ ast *createIvalStruct (ast *sym,sym_link *type,initList *ilist)
     ast *rast = NULL ;
     symbol   *sflds  ;
     initList *iloop  ;
-    
+
     sflds = SPEC_STRUCT(type)->fields  ;
     if (ilist->type != INIT_DEEP) {
-       werror(E_INIT_STRUCT,"");
-       return NULL ;
+  werror(E_INIT_STRUCT,"");
+  return NULL ;
     }
-    
+
     iloop = ilist->init.deep;
-    
+
     for ( ; sflds ; sflds = sflds->next, iloop = (iloop ? iloop->next : NULL )) {
-       ast *lAst ;
-       
-       /* if we have come to end */
-       if (!iloop)
-           break;
-       sflds->implicit = 1;
-       lAst = newNode(PTR_OP,newNode('&',sym,NULL),newAst_VALUE(symbolVal(sflds)));
-       lAst = decorateType(resolveSymbols(lAst));
-       rast = decorateType(resolveSymbols(createIval (lAst, sflds->type, iloop,rast)));
+  ast *lAst ;
+
+  /* if we have come to end */
+  if (!iloop)
+      break;
+  sflds->implicit = 1;
+  lAst = newNode(PTR_OP,newNode('&',sym,NULL),newAst_VALUE(symbolVal(sflds)));
+  lAst = decorateType(resolveSymbols(lAst));
+  rast = decorateType(resolveSymbols(createIval (lAst, sflds->type, iloop,rast)));
     }
     return rast ;
 }
@@ -748,51 +748,51 @@ ast *createIvalArray (ast  *sym, sym_link *type, initList *ilist)
     ast *rast = NULL;
     initList *iloop ;
     int lcnt = 0, size =0 ;
-    
+
     /* take care of the special   case  */
     /* array of characters can be init  */
     /* by a string                      */
     if ( IS_CHAR(type->next) )
-       if ( (rast = createIvalCharPtr(sym,
-                                      type,
-                                      decorateType(resolveSymbols(list2expr(ilist))))))
-           
-           return decorateType(resolveSymbols(rast));
-    
+  if ( (rast = createIvalCharPtr(sym,
+               type,
+               decorateType(resolveSymbols(list2expr(ilist))))))
+
+      return decorateType(resolveSymbols(rast));
+
     /* not the special case             */
     if (ilist->type != INIT_DEEP) {
-       werror(E_INIT_STRUCT,"");
-       return NULL;
+  werror(E_INIT_STRUCT,"");
+  return NULL;
     }
-    
+
     iloop = ilist->init.deep   ;
     lcnt = DCL_ELEM(type);
-    
+
     for (;;)  {
-       ast *aSym ;
-       size++ ;
-
-       aSym = newNode('[',sym,newAst_VALUE(valueFromLit(size-1)));
-       aSym = decorateType(resolveSymbols(aSym));
-       rast = createIval (aSym,type->next,iloop,rast)   ;
-       iloop = (iloop ? iloop->next : NULL) ;
-       if (!iloop)
-           break;
-       /* if not array limits given & we */
-       /* are out of initialisers then   */
-       if (!DCL_ELEM(type) && !iloop)
-           break ;
-       
-       /* no of elements given and we    */
-       /* have generated for all of them */
-       if (!--lcnt)
-           break ;
-    }
-    
+  ast *aSym ;
+  size++ ;
+
+  aSym = newNode('[',sym,newAst_VALUE(valueFromLit(size-1)));
+  aSym = decorateType(resolveSymbols(aSym));
+  rast = createIval (aSym,type->next,iloop,rast)   ;
+  iloop = (iloop ? iloop->next : NULL) ;
+  if (!iloop)
+      break;
+  /* if not array limits given & we */
+  /* are out of initialisers then   */
+  if (!DCL_ELEM(type) && !iloop)
+      break ;
+
+  /* no of elements given and we    */
+  /* have generated for all of them */
+  if (!--lcnt)
+      break ;
+    }
+
     /* if we have not been given a size  */
     if (!DCL_ELEM(type))
-       DCL_ELEM(type) = size;
-    
+  DCL_ELEM(type) = size;
+
     return decorateType(resolveSymbols(rast));
 }
 
@@ -801,44 +801,44 @@ ast *createIvalArray (ast  *sym, sym_link *type, initList *ilist)
 /* createIvalCharPtr - generates initial values for char pointers  */
 /*-----------------------------------------------------------------*/
 ast *createIvalCharPtr (ast *sym, sym_link *type, ast *iexpr)
-{      
+{
     ast *rast = NULL ;
 
     /* if this is a pointer & right is a literal array then */
     /* just assignment will do                              */
-    if ( IS_PTR(type) && (( IS_LITERAL(iexpr->etype) || 
-         SPEC_SCLS(iexpr->etype) == S_CODE )
-                         && IS_ARRAY(iexpr->ftype))) 
-       return newNode('=',sym,iexpr);
+    if ( IS_PTR(type) && (( IS_LITERAL(iexpr->etype) ||
+    SPEC_SCLS(iexpr->etype) == S_CODE )
+        && IS_ARRAY(iexpr->ftype)))
+  return newNode('=',sym,iexpr);
 
     /* left side is an array so we have to assign each */
     /* element                                         */
-    if (( IS_LITERAL(iexpr->etype) || 
-         SPEC_SCLS(iexpr->etype) == S_CODE )
-       && IS_ARRAY(iexpr->ftype))  {
-
-       /* for each character generate an assignment */
-       /* to the array element */
-       char *s = SPEC_CVAL(iexpr->etype).v_char ;
-       int i = 0 ;
-       
-       while (*s) {        
-           rast = newNode(NULLOP,
-                          rast,
-                          newNode('=',
-                                  newNode('[', sym,
-                                          newAst_VALUE(valueFromLit(i))),
-                                  newAst_VALUE(valueFromLit(*s))));
-           i++;
-           s++;
-       }
-       rast = newNode(NULLOP,
-                          rast,
-                          newNode('=',
-                                  newNode('[', sym,
-                                          newAst_VALUE(valueFromLit(i))),
-                                  newAst_VALUE(valueFromLit(*s))));
-       return decorateType(resolveSymbols(rast));
+    if (( IS_LITERAL(iexpr->etype) ||
+    SPEC_SCLS(iexpr->etype) == S_CODE )
+  && IS_ARRAY(iexpr->ftype))  {
+
+  /* for each character generate an assignment */
+  /* to the array element */
+  char *s = SPEC_CVAL(iexpr->etype).v_char ;
+  int i = 0 ;
+
+  while (*s) {
+      rast = newNode(NULLOP,
+         rast,
+         newNode('=',
+           newNode('[', sym,
+             newAst_VALUE(valueFromLit(i))),
+           newAst_VALUE(valueFromLit(*s))));
+      i++;
+      s++;
+  }
+  rast = newNode(NULLOP,
+         rast,
+         newNode('=',
+           newNode('[', sym,
+             newAst_VALUE(valueFromLit(i))),
+           newAst_VALUE(valueFromLit(*s))));
+  return decorateType(resolveSymbols(rast));
     }
 
     return NULL ;
@@ -848,22 +848,22 @@ ast *createIvalCharPtr (ast *sym, sym_link *type, ast *iexpr)
 /* createIvalPtr - generates initial value for pointers            */
 /*-----------------------------------------------------------------*/
 ast *createIvalPtr (ast *sym,sym_link *type,initList *ilist)
-{    
+{
     ast *rast;
     ast *iexpr ;
 
     /* if deep then   */
     if ( ilist->type == INIT_DEEP )
-       ilist = ilist->init.deep   ;
-           
+  ilist = ilist->init.deep   ;
+
     iexpr = decorateType(resolveSymbols(list2expr(ilist)));
 
     /* if character pointer */
     if (IS_CHAR(type->next))
-       if ((rast = createIvalCharPtr (sym,type,iexpr)))
-           return rast;   
+  if ((rast = createIvalCharPtr (sym,type,iexpr)))
+      return rast;
 
-    return newNode('=',sym,iexpr);         
+    return newNode('=',sym,iexpr);
 }
 
 /*-----------------------------------------------------------------*/
@@ -871,30 +871,30 @@ ast *createIvalPtr (ast *sym,sym_link *type,initList *ilist)
 /*-----------------------------------------------------------------*/
 ast  *createIval  (ast *sym, sym_link *type, initList *ilist, ast *wid)
 {
-    ast *rast = NULL;  
+    ast *rast = NULL;
 
     if (!ilist)
-       return NULL ;   
-    
+  return NULL ;
+
     /* if structure then    */
-    if (IS_STRUCT(type)) 
-       rast =  createIvalStruct(sym, type,ilist);
+    if (IS_STRUCT(type))
+  rast =  createIvalStruct(sym, type,ilist);
     else
-       /* if this is a pointer */
-       if (IS_PTR(type)) 
-           rast = createIvalPtr(sym, type,ilist);
-       else
-           /* if this is an array   */
-           if (IS_ARRAY(type))  
-               rast = createIvalArray(sym, type,ilist); 
-           else
-               /* if type is SPECIFIER */
-               if (IS_SPEC(type))
-                   rast =  createIvalType (sym,type,ilist);
+  /* if this is a pointer */
+  if (IS_PTR(type))
+      rast = createIvalPtr(sym, type,ilist);
+  else
+      /* if this is an array   */
+      if (IS_ARRAY(type))
+    rast = createIvalArray(sym, type,ilist);
+      else
+    /* if type is SPECIFIER */
+    if (IS_SPEC(type))
+        rast =  createIvalType (sym,type,ilist);
     if ( wid )
-       return decorateType(resolveSymbols(newNode(NULLOP,wid,rast)));
+  return decorateType(resolveSymbols(newNode(NULLOP,wid,rast)));
     else
-       return decorateType(resolveSymbols(rast)) ;
+  return decorateType(resolveSymbols(rast)) ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -906,68 +906,68 @@ ast *initAggregates ( symbol *sym, initList *ival, ast *wid)
 }
 
 /*-----------------------------------------------------------------*/
-/* gatherAutoInit - creates assignment expressions for initial    */
-/*     values                                                     */
+/* gatherAutoInit - creates assignment expressions for initial     */
+/*    values                 */
 /*-----------------------------------------------------------------*/
-ast    *gatherAutoInit ( symbol *autoChain )
+ast *gatherAutoInit ( symbol *autoChain )
 {
-    ast        *init = NULL ;
-    ast        *work ;
-    symbol     *sym;
-    
+    ast *init = NULL ;
+    ast *work ;
+    symbol  *sym;
+
     inInitMode =1;
     for ( sym = autoChain ; sym ; sym = sym->next ) {
-       
-       /* resolve the symbols in the ival */
-       if (sym->ival)
-           resolveIvalSym(sym->ival);
-
-       /* if this is a static variable & has an */
-       /* initial value the code needs to be lifted */
-       /* here to the main portion since they can be */
-       /* initialised only once at the start    */
-       if ( IS_STATIC(sym->etype) && sym->ival &&
-            SPEC_SCLS(sym->etype) != S_CODE) {
-           symbol *newSym ;
-
-           /* insert the symbol into the symbol table */
-           /* with level = 0 & name = rname               */
-           newSym = copySymbol (sym);                      
-           addSym (SymbolTab,newSym,newSym->name,0,0);
-           
-           /* now lift the code to main */
-           if (IS_AGGREGATE(sym->type))
-               work = initAggregates (sym, sym->ival,NULL);
-           else
-               work = newNode('=' ,newAst_VALUE(symbolVal(newSym)),
-                              list2expr(sym->ival));
-           
-           setAstLineno(work,sym->lineDef);
-
-           sym->ival = NULL ;
-           if ( staticAutos )
-               staticAutos = newNode(NULLOP,staticAutos,work);
-           else
-               staticAutos = work ;
-           
-           continue;
-       }
-       
-       /* if there is an initial value */
-       if ( sym->ival && SPEC_SCLS(sym->etype)!=S_CODE) {
-           if (IS_AGGREGATE(sym->type)) 
-               work = initAggregates (sym,sym->ival,NULL);
-           else
-               work = newNode('=' ,newAst_VALUE(symbolVal(sym)),
-                              list2expr(sym->ival));
-           
-           setAstLineno (work,sym->lineDef);
-           sym->ival = NULL ;
-           if ( init )
-               init = newNode(NULLOP,init,work);
-           else
-               init = work ;
-       }
+
+  /* resolve the symbols in the ival */
+  if (sym->ival)
+      resolveIvalSym(sym->ival);
+
+  /* if this is a static variable & has an */
+  /* initial value the code needs to be lifted */
+  /* here to the main portion since they can be */
+  /* initialised only once at the start    */
+  if ( IS_STATIC(sym->etype) && sym->ival &&
+       SPEC_SCLS(sym->etype) != S_CODE) {
+      symbol *newSym ;
+
+      /* insert the symbol into the symbol table */
+      /* with level = 0 & name = rname       */
+      newSym = copySymbol (sym);
+      addSym (SymbolTab,newSym,newSym->name,0,0);
+
+      /* now lift the code to main */
+      if (IS_AGGREGATE(sym->type))
+    work = initAggregates (sym, sym->ival,NULL);
+      else
+    work = newNode('=' ,newAst_VALUE(symbolVal(newSym)),
+             list2expr(sym->ival));
+
+      setAstLineno(work,sym->lineDef);
+
+      sym->ival = NULL ;
+      if ( staticAutos )
+    staticAutos = newNode(NULLOP,staticAutos,work);
+      else
+    staticAutos = work ;
+
+      continue;
+  }
+
+  /* if there is an initial value */
+  if ( sym->ival && SPEC_SCLS(sym->etype)!=S_CODE) {
+      if (IS_AGGREGATE(sym->type))
+    work = initAggregates (sym,sym->ival,NULL);
+      else
+    work = newNode('=' ,newAst_VALUE(symbolVal(sym)),
+             list2expr(sym->ival));
+
+      setAstLineno (work,sym->lineDef);
+      sym->ival = NULL ;
+      if ( init )
+    init = newNode(NULLOP,init,work);
+      else
+    init = work ;
+  }
     }
     inInitMode = 0;
     return init ;
@@ -981,12 +981,12 @@ static value *stringToSymbol (value *val)
     char name[SDCC_NAME_MAX+1];
     static int charLbl = 0;
     symbol *sym ;
-    
+
     sprintf(name,"_str_%d",charLbl++);
     sym = newSymbol(name,0); /* make it @ level 0 */
     strcpy(sym->rname,name);
-    
-    /* copy the type from the value passed */   
+
+    /* copy the type from the value passed */
     sym->type = copyLinkChain(val->type);
     sym->etype = getSpec(sym->type);
     /* change to storage class & output class */
@@ -999,13 +999,13 @@ static value *stringToSymbol (value *val)
     /* create an ival */
     sym->ival = newiList(INIT_NODE,newAst_VALUE(val));
     if (noAlloc == 0) {
-       /* allocate it */
-       addSymChain(sym);
-       allocVariables(sym);
+  /* allocate it */
+  addSymChain(sym);
+  allocVariables(sym);
     }
     sym->ival = NULL;
     return symbolVal(sym);
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -1016,23 +1016,23 @@ static value *stringToSymbol (value *val)
 ast *processBlockVars ( ast *tree , int *stack, int action)
 {
     if (! tree)
-       return NULL ;
-    
+  return NULL ;
+
     /* if this is a block */
     if (tree->type == EX_OP && tree->opval.op == BLOCK ) {
-       ast *autoInit ;
-       
-       if (action == ALLOCATE) {
-           autoInit = gatherAutoInit (tree->values.sym);
-           *stack += allocVariables (tree->values.sym);
-           
-           /* if there are auto inits then do them */
-           if (autoInit)
-               tree->left = newNode(NULLOP,autoInit,tree->left);
-       } else /* action is deallocate */
-           deallocLocal (tree->values.sym) ;
-    }
-    
+  ast *autoInit ;
+
+  if (action == ALLOCATE) {
+      autoInit = gatherAutoInit (tree->values.sym);
+      *stack += allocVariables (tree->values.sym);
+
+      /* if there are auto inits then do them */
+      if (autoInit)
+    tree->left = newNode(NULLOP,autoInit,tree->left);
+  } else /* action is deallocate */
+      deallocLocal (tree->values.sym) ;
+    }
+
     processBlockVars (tree->left, stack, action);
     processBlockVars (tree->right, stack, action);
     return tree ;
@@ -1047,39 +1047,39 @@ value *constExprValue (ast *cexpr, int check)
 
     /* if this is not a constant then */
     if (!IS_LITERAL(cexpr->ftype)) {
-       /* then check if this is a literal array
-          in code segment */
-       if (SPEC_SCLS(cexpr->etype) == S_CODE &&
-           SPEC_CVAL(cexpr->etype).v_char    &&
-           IS_ARRAY(cexpr->ftype)) {
-           value *val = valFromType(cexpr->ftype);
-           SPEC_SCLS(val->etype) = S_LITERAL;
-           val->sym =cexpr->opval.val->sym ; 
-           val->sym->type = copyLinkChain(cexpr->ftype);
-           val->sym->etype = getSpec(val->sym->type);
-           strcpy(val->name,cexpr->opval.val->sym->rname);
-           return val;
-       }
-       
-       /* if we are casting a literal value then */
-       if (IS_AST_OP(cexpr)        &&
-           cexpr->opval.op == CAST &&
-           IS_LITERAL(cexpr->left->ftype))
-           return valCastLiteral(cexpr->ftype,
-                                 floatFromVal(cexpr->left->opval.val));
-
-       if (IS_AST_VALUE(cexpr))
-           return cexpr->opval.val;
-       
-       if (check)         
-           werror(E_CONST_EXPECTED,"found expression");
-
-       return NULL ;
-    }
-    
+  /* then check if this is a literal array
+     in code segment */
+  if (SPEC_SCLS(cexpr->etype) == S_CODE &&
+      SPEC_CVAL(cexpr->etype).v_char    &&
+      IS_ARRAY(cexpr->ftype)) {
+      value *val = valFromType(cexpr->ftype);
+      SPEC_SCLS(val->etype) = S_LITERAL;
+      val->sym =cexpr->opval.val->sym ;
+      val->sym->type = copyLinkChain(cexpr->ftype);
+      val->sym->etype = getSpec(val->sym->type);
+      strcpy(val->name,cexpr->opval.val->sym->rname);
+      return val;
+  }
+
+  /* if we are casting a literal value then */
+  if (IS_AST_OP(cexpr)        &&
+      cexpr->opval.op == CAST &&
+      IS_LITERAL(cexpr->left->ftype))
+      return valCastLiteral(cexpr->ftype,
+          floatFromVal(cexpr->left->opval.val));
+
+  if (IS_AST_VALUE(cexpr))
+      return cexpr->opval.val;
+
+  if (check)
+      werror(E_CONST_EXPECTED,"found expression");
+
+  return NULL ;
+    }
+
     /* return the value */
     return cexpr->opval.val ;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -1088,16 +1088,16 @@ value *constExprValue (ast *cexpr, int check)
 bool isLabelInAst (symbol *label, ast *tree)
 {
     if (!tree  || IS_AST_VALUE(tree) || IS_AST_LINK(tree))
-       return FALSE ;
+  return FALSE ;
 
     if (IS_AST_OP(tree) &&
-       tree->opval.op == LABEL &&
-       isSymbolEqual(AST_SYMBOL(tree->left),label))
-       return TRUE;
+  tree->opval.op == LABEL &&
+  isSymbolEqual(AST_SYMBOL(tree->left),label))
+  return TRUE;
 
     return isLabelInAst(label,tree->right) &&
-       isLabelInAst(label,tree->left);
-       
+  isLabelInAst(label,tree->left);
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -1105,98 +1105,98 @@ bool isLabelInAst (symbol *label, ast *tree)
 /* -ned at compile time .                                          */
 /*-----------------------------------------------------------------*/
 bool isLoopCountable (ast *initExpr, ast *condExpr, ast *loopExpr,
-                     symbol **sym,ast **init, ast **end) 
+          symbol **sym,ast **init, ast **end)
 {
-    
+
     /* the loop is considered countable if the following
        conditions are true :-
 
        a) initExpr :- <sym> = <const>
        b) condExpr :- <sym> < <const1>
-       c) loopExpr :- <sym> ++ 
+       c) loopExpr :- <sym> ++
     */
 
     /* first check the initExpr */
     if ( IS_AST_OP(initExpr)       &&
-        initExpr->opval.op == '=' && /* is assignment */
-        IS_AST_SYM_VALUE(initExpr->left)) { /* left is a symbol */     
-       
-       *sym = AST_SYMBOL(initExpr->left);
-       *init= initExpr->right;
+   initExpr->opval.op == '=' && /* is assignment */
+   IS_AST_SYM_VALUE(initExpr->left)) { /* left is a symbol */
+
+  *sym = AST_SYMBOL(initExpr->left);
+  *init= initExpr->right;
     }
     else
-       return FALSE;
-    
+  return FALSE;
+
     /* for now the symbol has to be of
        integral type */
     if (!IS_INTEGRAL((*sym)->type))
-       return FALSE;
+  return FALSE;
 
     /* now check condExpr */
     if (IS_AST_OP(condExpr)) {
 
-       switch (condExpr->opval.op) {
-       case '<':
-           if (IS_AST_SYM_VALUE(condExpr->left) &&
-               isSymbolEqual (*sym,AST_SYMBOL(condExpr->left)) &&
-               IS_AST_LIT_VALUE(condExpr->right)) {
-               *end = condExpr->right;
-               break;
-           }
-           return FALSE;
-           
-       case '!':
-           if (IS_AST_OP(condExpr->left) &&
-               condExpr->left->opval.op == '>' &&
-               IS_AST_LIT_VALUE(condExpr->left->right) &&
-               IS_AST_SYM_VALUE(condExpr->left->left)&&
-               isSymbolEqual (*sym,AST_SYMBOL(condExpr->left->left))) {
-               
-               *end = newNode('+', condExpr->left->right,
-                              newAst_VALUE(constVal("1")));
-               break;
-           }
-           return FALSE ;
-           
-       default:
-           return FALSE ;
-       }       
-       
-    }         
+  switch (condExpr->opval.op) {
+  case '<':
+      if (IS_AST_SYM_VALUE(condExpr->left) &&
+    isSymbolEqual (*sym,AST_SYMBOL(condExpr->left)) &&
+    IS_AST_LIT_VALUE(condExpr->right)) {
+    *end = condExpr->right;
+    break;
+      }
+      return FALSE;
+
+  case '!':
+      if (IS_AST_OP(condExpr->left) &&
+    condExpr->left->opval.op == '>' &&
+    IS_AST_LIT_VALUE(condExpr->left->right) &&
+    IS_AST_SYM_VALUE(condExpr->left->left)&&
+    isSymbolEqual (*sym,AST_SYMBOL(condExpr->left->left))) {
+
+    *end = newNode('+', condExpr->left->right,
+             newAst_VALUE(constVal("1")));
+    break;
+      }
+      return FALSE ;
+
+  default:
+      return FALSE ;
+  }
+
+    }
 
     /* check loop expression is of the form <sym>++ */
     if (!IS_AST_OP(loopExpr))
-       return FALSE ;
+  return FALSE ;
 
     /* check if <sym> ++ */
     if (loopExpr->opval.op == INC_OP) {
-               
-       if (loopExpr->left) {
-           /* pre */
-           if (IS_AST_SYM_VALUE(loopExpr->left) &&
-               isSymbolEqual(*sym,AST_SYMBOL(loopExpr->left)))
-               return TRUE ;      
-               
-       } else {
-           /* post */
-           if (IS_AST_SYM_VALUE(loopExpr->right) &&
-               isSymbolEqual(*sym,AST_SYMBOL(loopExpr->right)))
-               return TRUE ; 
-       }
-           
-    } 
+
+  if (loopExpr->left) {
+      /* pre */
+      if (IS_AST_SYM_VALUE(loopExpr->left) &&
+    isSymbolEqual(*sym,AST_SYMBOL(loopExpr->left)))
+    return TRUE ;
+
+  } else {
+      /* post */
+      if (IS_AST_SYM_VALUE(loopExpr->right) &&
+    isSymbolEqual(*sym,AST_SYMBOL(loopExpr->right)))
+    return TRUE ;
+  }
+
+    }
     else {
-       /* check for += */
-       if ( loopExpr->opval.op == ADD_ASSIGN ) {
+  /* check for += */
+  if ( loopExpr->opval.op == ADD_ASSIGN ) {
 
-           if (IS_AST_SYM_VALUE(loopExpr->left) &&
-               isSymbolEqual(*sym,AST_SYMBOL(loopExpr->left)) &&
-               IS_AST_LIT_VALUE(loopExpr->right) &&
-               (int)AST_LIT_VALUE(loopExpr->right) != 1)
-               return TRUE ;
-       }               
+      if (IS_AST_SYM_VALUE(loopExpr->left) &&
+    isSymbolEqual(*sym,AST_SYMBOL(loopExpr->left)) &&
+    IS_AST_LIT_VALUE(loopExpr->right) &&
+    (int)AST_LIT_VALUE(loopExpr->right) != 1)
+    return TRUE ;
+  }
     }
-    
+
     return FALSE;
 }
 
@@ -1206,16 +1206,16 @@ bool isLoopCountable (ast *initExpr, ast *condExpr, ast *loopExpr,
 bool astHasVolatile (ast *tree)
 {
     if (!tree)
-       return FALSE ;
+  return FALSE ;
 
     if (TETYPE(tree) && IS_VOLATILE(TETYPE(tree)))
-       return TRUE;
+  return TRUE;
 
     if (IS_AST_OP(tree))
-       return astHasVolatile(tree->left) ||
-           astHasVolatile(tree->right);
+  return astHasVolatile(tree->left) ||
+      astHasVolatile(tree->right);
     else
-       return FALSE ;
+  return FALSE ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -1224,22 +1224,22 @@ bool astHasVolatile (ast *tree)
 bool astHasPointer (ast *tree)
 {
     if (!tree)
-       return FALSE ;
+  return FALSE ;
 
     if (IS_AST_LINK(tree))
-       return TRUE;
+  return TRUE;
 
     /* if we hit an array expression then check
        only the left side */
     if (IS_AST_OP(tree) && tree->opval.op == '[')
-       return astHasPointer(tree->left);
+  return astHasPointer(tree->left);
 
     if (IS_AST_VALUE(tree))
-           return IS_PTR(tree->ftype) || IS_ARRAY(tree->ftype);
+      return IS_PTR(tree->ftype) || IS_ARRAY(tree->ftype);
 
     return astHasPointer(tree->left) ||
-       astHasPointer(tree->right);
-       
+  astHasPointer(tree->right);
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -1248,17 +1248,17 @@ bool astHasPointer (ast *tree)
 bool astHasSymbol (ast *tree, symbol *sym)
 {
     if (!tree || IS_AST_LINK(tree))
-       return FALSE ;   
+  return FALSE ;
 
     if (IS_AST_VALUE(tree)) {
-       if (IS_AST_SYM_VALUE(tree)) 
-           return isSymbolEqual(AST_SYMBOL(tree),sym);
-       else
-           return FALSE;
+  if (IS_AST_SYM_VALUE(tree))
+      return isSymbolEqual(AST_SYMBOL(tree),sym);
+  else
+      return FALSE;
     }
-    
+
     return astHasSymbol(tree->left,sym) ||
-       astHasSymbol(tree->right,sym);
+  astHasSymbol(tree->right,sym);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1267,112 +1267,112 @@ bool astHasSymbol (ast *tree, symbol *sym)
 /*-----------------------------------------------------------------*/
 bool isConformingBody (ast *pbody, symbol *sym, ast *body)
 {
-    
+
     /* we are going to do a pre-order traversal of the
        tree && check for the following conditions. (essentially
        a set of very shallow tests )
        a) the sym passed does not participate in
           any arithmetic operation
        b) There are no function calls
-       c) all jumps are within the body 
-       d) address of loop control variable not taken 
+       c) all jumps are within the body
+       d) address of loop control variable not taken
        e) if an assignment has a pointer on the
           left hand side make sure right does not have
-         loop control variable */
+    loop control variable */
 
     /* if we reach the end or a leaf then true */
     if (!pbody ||  IS_AST_LINK(pbody) || IS_AST_VALUE(pbody))
-       return TRUE ;
+  return TRUE ;
 
 
     /* if anything else is "volatile" */
     if (IS_VOLATILE(TETYPE(pbody)))
-       return FALSE;
+  return FALSE;
 
     /* we will walk the body in a pre-order traversal for
        efficiency sake */
     switch (pbody->opval.op) {
-       /*------------------------------------------------------------------*/
-    case  '['   :      
-       return isConformingBody (pbody->right,sym,body);
+    /*------------------------------------------------------------------*/
+    case  '['   :
+  return isConformingBody (pbody->right,sym,body);
 
-       /*------------------------------------------------------------------*/
-    case  PTR_OP:  
-    case  '.'   :  
-       return TRUE;
+  /*------------------------------------------------------------------*/
+    case  PTR_OP:
+    case  '.'   :
+  return TRUE;
 
-       /*------------------------------------------------------------------*/
+  /*------------------------------------------------------------------*/
     case  INC_OP:  /* incerement operator unary so left only */
     case  DEC_OP:
-       
-       /* sure we are not sym is not modified */
-       if (pbody->left                &&
-           IS_AST_SYM_VALUE(pbody->left) &&
-           isSymbolEqual(AST_SYMBOL(pbody->left),sym))
-           return FALSE;
 
-       if (pbody->right                &&
-           IS_AST_SYM_VALUE(pbody->right) &&
-           isSymbolEqual(AST_SYMBOL(pbody->right),sym))
-           return FALSE;
+  /* sure we are not sym is not modified */
+  if (pbody->left                &&
+      IS_AST_SYM_VALUE(pbody->left) &&
+      isSymbolEqual(AST_SYMBOL(pbody->left),sym))
+      return FALSE;
+
+  if (pbody->right                &&
+      IS_AST_SYM_VALUE(pbody->right) &&
+      isSymbolEqual(AST_SYMBOL(pbody->right),sym))
+      return FALSE;
 
-       return TRUE;
+  return TRUE;
 
-       /*------------------------------------------------------------------*/
+  /*------------------------------------------------------------------*/
 
     case '*' :  /* can be unary  : if right is null then unary operation */
-    case '+' :  
-    case '-' :  
-    case  '&':     
-       
-       /* if right is NULL then unary operation  */
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*  address of                */
-       /*----------------------------*/    
-       if ( ! pbody->right ) { 
-           if (IS_AST_SYM_VALUE(pbody->left) &&
-               isSymbolEqual(AST_SYMBOL(pbody->left),sym))
-               return FALSE;
-           else
-               return isConformingBody(pbody->left,sym,body) ;
-       } else {
-           if (astHasSymbol(pbody->left,sym) ||
-               astHasSymbol(pbody->right,sym))
-               return FALSE;
-       }
-
-       
-       /*------------------------------------------------------------------*/
+    case '+' :
+    case '-' :
+    case  '&':
+
+  /* if right is NULL then unary operation  */
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*  address of                */
+  /*----------------------------*/
+  if ( ! pbody->right ) {
+      if (IS_AST_SYM_VALUE(pbody->left) &&
+    isSymbolEqual(AST_SYMBOL(pbody->left),sym))
+    return FALSE;
+      else
+    return isConformingBody(pbody->left,sym,body) ;
+  } else {
+      if (astHasSymbol(pbody->left,sym) ||
+    astHasSymbol(pbody->right,sym))
+    return FALSE;
+  }
+
+
+  /*------------------------------------------------------------------*/
     case  '|':
     case  '^':
     case  '/':
     case  '%':
     case LEFT_OP:
     case RIGHT_OP:
-       
-       if (IS_AST_SYM_VALUE(pbody->left) &&
-           isSymbolEqual(AST_SYMBOL(pbody->left),sym))
-           return FALSE ;
-
-       if (IS_AST_SYM_VALUE(pbody->right) &&
-           isSymbolEqual(AST_SYMBOL(pbody->right),sym))
-           return FALSE ;
-       
-       return isConformingBody(pbody->left,sym,body) &&
-           isConformingBody(pbody->right,sym,body);
-       
+
+  if (IS_AST_SYM_VALUE(pbody->left) &&
+      isSymbolEqual(AST_SYMBOL(pbody->left),sym))
+      return FALSE ;
+
+  if (IS_AST_SYM_VALUE(pbody->right) &&
+      isSymbolEqual(AST_SYMBOL(pbody->right),sym))
+      return FALSE ;
+
+  return isConformingBody(pbody->left,sym,body) &&
+      isConformingBody(pbody->right,sym,body);
+
     case '~' :
     case '!' :
     case RRC:
     case RLC:
     case GETHBIT:
-       if (IS_AST_SYM_VALUE(pbody->left) &&
-           isSymbolEqual(AST_SYMBOL(pbody->left),sym))
-           return FALSE;
-       return isConformingBody (pbody->left,sym,body);
-       
-       /*------------------------------------------------------------------*/
+  if (IS_AST_SYM_VALUE(pbody->left) &&
+      isSymbolEqual(AST_SYMBOL(pbody->left),sym))
+      return FALSE;
+  return isConformingBody (pbody->left,sym,body);
+
+  /*------------------------------------------------------------------*/
 
     case AND_OP:
     case OR_OP:
@@ -1386,29 +1386,29 @@ bool isConformingBody (ast *pbody, symbol *sym, ast *body)
     case ':' :
     case SIZEOF:  /* evaluate wihout code generation */
 
-       return isConformingBody(pbody->left,sym,body) &&
-           isConformingBody(pbody->right,sym,body);    
+  return isConformingBody(pbody->left,sym,body) &&
+      isConformingBody(pbody->right,sym,body);
 
-       /*------------------------------------------------------------------*/
+  /*------------------------------------------------------------------*/
     case '=' :
 
-       /* if left has a pointer & right has loop
-          control variable then we cannot */
-       if (astHasPointer(pbody->left) &&
-           astHasSymbol (pbody->right,sym))
-           return FALSE ;
-       if (astHasVolatile(pbody->left))
-           return FALSE ;
+  /* if left has a pointer & right has loop
+     control variable then we cannot */
+  if (astHasPointer(pbody->left) &&
+      astHasSymbol (pbody->right,sym))
+      return FALSE ;
+  if (astHasVolatile(pbody->left))
+      return FALSE ;
 
-       if (IS_AST_SYM_VALUE(pbody->left) &&
-           isSymbolEqual(AST_SYMBOL(pbody->left),sym))
-           return FALSE ;
-       
-       if (astHasVolatile(pbody->left))
-           return FALSE;
+  if (IS_AST_SYM_VALUE(pbody->left) &&
+      isSymbolEqual(AST_SYMBOL(pbody->left),sym))
+      return FALSE ;
 
-       return isConformingBody(pbody->left,sym,body) &&
-           isConformingBody(pbody->right,sym,body);    
+  if (astHasVolatile(pbody->left))
+      return FALSE;
+
+  return isConformingBody(pbody->left,sym,body) &&
+      isConformingBody(pbody->right,sym,body);
 
     case MUL_ASSIGN:
     case DIV_ASSIGN:
@@ -1419,47 +1419,47 @@ bool isConformingBody (ast *pbody, symbol *sym, ast *body)
     case LEFT_ASSIGN:
     case SUB_ASSIGN:
     case ADD_ASSIGN:
-           assert("Parser should not have generated this\n");
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*      comma operator        */
-       /*----------------------------*/        
+      assert("Parser should not have generated this\n");
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*      comma operator        */
+  /*----------------------------*/
     case ',' :
-       return isConformingBody(pbody->left,sym,body) &&
-           isConformingBody(pbody->right,sym,body);    
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*       function call        */
-       /*----------------------------*/        
+  return isConformingBody(pbody->left,sym,body) &&
+      isConformingBody(pbody->right,sym,body);
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*       function call        */
+  /*----------------------------*/
     case CALL:
-       return FALSE;
+  return FALSE;
 
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*     return statement       */
-       /*----------------------------*/        
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*     return statement       */
+  /*----------------------------*/
     case RETURN:
-       return FALSE ;
+  return FALSE ;
 
     case GOTO:
-       if (isLabelInAst (AST_SYMBOL(pbody->left),body))
-           return TRUE ;
-       else
-           return FALSE;
+  if (isLabelInAst (AST_SYMBOL(pbody->left),body))
+      return TRUE ;
+  else
+      return FALSE;
     case SWITCH:
-       if (astHasSymbol(pbody->left,sym))
-           return FALSE ;
+  if (astHasSymbol(pbody->left,sym))
+      return FALSE ;
 
     default:
-       break;
+  break;
     }
 
     return isConformingBody(pbody->left,sym,body) &&
-       isConformingBody(pbody->right,sym,body);        
-       
-    
+  isConformingBody(pbody->right,sym,body);
+
+
 
 }
 
@@ -1468,28 +1468,28 @@ bool isConformingBody (ast *pbody, symbol *sym, ast *body)
 /* if the for loop is reversible. If yes will set the value of     */
 /* the loop control var & init value & termination value           */
 /*-----------------------------------------------------------------*/
-bool isLoopReversible (ast *loop, symbol **loopCntrl, 
-                      ast **init, ast **end )
+bool isLoopReversible (ast *loop, symbol **loopCntrl,
+           ast **init, ast **end )
 {
     /* if option says don't do it then don't */
     if (optimize.noLoopReverse)
-       return 0;
+  return 0;
     /* there are several tests to determine this */
-       
-    /* for loop has to be of the form 
-       for ( <sym> = <const1> ; 
+
+    /* for loop has to be of the form
+       for ( <sym> = <const1> ;
              [<sym> < <const2>]  ;
-            [<sym>++] | [<sym> += 1] | [<sym> = <sym> + 1] )
-            forBody */
+       [<sym>++] | [<sym> += 1] | [<sym> = <sym> + 1] )
+       forBody */
     if (! isLoopCountable (AST_FOR(loop,initExpr),
-                          AST_FOR(loop,condExpr),
-                          AST_FOR(loop,loopExpr),
-                          loopCntrl,init,end))
-       return 0;
+         AST_FOR(loop,condExpr),
+         AST_FOR(loop,loopExpr),
+         loopCntrl,init,end))
+  return 0;
 
     /* now do some serious checking on the body of the loop
      */
-    
+
     return isConformingBody(loop->left,*loopCntrl,loop->left);
 
 }
@@ -1501,68 +1501,68 @@ static void replLoopSym ( ast *body, symbol *sym)
 {
     /* reached end */
     if (!body || IS_AST_LINK(body))
-       return ;
+  return ;
 
     if (IS_AST_SYM_VALUE(body)) {
-       
-       if (isSymbolEqual(AST_SYMBOL(body),sym)) {
-           
-           body->type = EX_OP;
-           body->opval.op = '-';
-           body->left = newAst_VALUE(symbolVal(sym));
-           body->right= newAst_VALUE(constVal("1"));
-
-       }
-           
-       return;
-       
-    }
-       
+
+  if (isSymbolEqual(AST_SYMBOL(body),sym)) {
+
+      body->type = EX_OP;
+      body->opval.op = '-';
+      body->left = newAst_VALUE(symbolVal(sym));
+      body->right= newAst_VALUE(constVal("1"));
+
+  }
+
+  return;
+
+    }
+
     replLoopSym(body->left,sym);
     replLoopSym(body->right,sym);
-       
+
 }
 
 /*-----------------------------------------------------------------*/
 /* reverseLoop - do the actual loop reversal                       */
 /*-----------------------------------------------------------------*/
 ast *reverseLoop (ast *loop, symbol *sym, ast *init, ast *end)
-{    
-    ast *rloop ;  
-        
-    /* create the following tree 
-               <sym> = loopCount ;
-        for_continue:
-               forbody
-               <sym> -= 1;
-               if (sym) goto for_continue ; 
-               <sym> = end */
-    
+{
+    ast *rloop ;
+
+    /* create the following tree
+    <sym> = loopCount ;
+   for_continue:
+          forbody
+    <sym> -= 1;
+    if (sym) goto for_continue ;
+    <sym> = end */
+
     /* put it together piece by piece */
     rloop = newNode (NULLOP,
-                    createIf(newAst_VALUE(symbolVal(sym)),
-                             newNode(GOTO,
-                                     newAst_VALUE(symbolVal(AST_FOR(loop,continueLabel))),
-                                     NULL),NULL),
-                    newNode('=',
-                            newAst_VALUE(symbolVal(sym)),
-                            end));
+         createIf(newAst_VALUE(symbolVal(sym)),
+            newNode(GOTO,
+              newAst_VALUE(symbolVal(AST_FOR(loop,continueLabel))),
+              NULL),NULL),
+         newNode('=',
+           newAst_VALUE(symbolVal(sym)),
+           end));
 
     replLoopSym(loop->left, sym);
 
     rloop = newNode(NULLOP,
-                   newNode('=',
-                           newAst_VALUE(symbolVal(sym)),
-                           newNode('-',end,init)),
-                   createLabel(AST_FOR(loop,continueLabel),
-                               newNode(NULLOP,
-                                       loop->left,
-                                       newNode(NULLOP,
-                                               newNode(SUB_ASSIGN,
-                                                       newAst_VALUE(symbolVal(sym)),
-                                                       newAst_VALUE(constVal("1"))),
-                                               rloop ))));
-    
+        newNode('=',
+          newAst_VALUE(symbolVal(sym)),
+          newNode('-',end,init)),
+        createLabel(AST_FOR(loop,continueLabel),
+        newNode(NULLOP,
+          loop->left,
+          newNode(NULLOP,
+            newNode(SUB_ASSIGN,
+              newAst_VALUE(symbolVal(sym)),
+              newAst_VALUE(constVal("1"))),
+            rloop ))));
+
     return decorateType(rloop);
 
 }
@@ -1573,7 +1573,7 @@ ast *reverseLoop (ast *loop, symbol *sym, ast *init, ast *end)
 
 /*-----------------------------------------------------------------*/
 /* walk a tree looking for the leaves. Add a typecast to the given */
-/* type to each value leaf node.                                  */
+/* type to each value leaf node.           */
 /*-----------------------------------------------------------------*/
 void pushTypeCastToLeaves(sym_link *type, ast *node, ast **parentPtr)
 {
@@ -1582,27 +1582,27 @@ void pushTypeCastToLeaves(sym_link *type, ast *node, ast **parentPtr)
         /* WTF? We should never get here. */
         return;
     }
-    
+
     if (!node->left && !node->right)
     {
         /* We're at a leaf; if it's a value, apply the typecast */
         if (node->type == EX_VALUE && IS_INTEGRAL(TTYPE(node)))
         {
             *parentPtr = decorateType(newNode(CAST,
-                                             newAst_LINK(copyLinkChain(type)),
-                                             node));
-       }
+                            newAst_LINK(copyLinkChain(type)),
+                            node));
+  }
     }
     else
     {
-       if (node->left)
-       {
-           pushTypeCastToLeaves(type, node->left, &(node->left));
-       }
-       if (node->right)
-       {
+      if (node->left)
+      {
+          pushTypeCastToLeaves(type, node->left, &(node->left));
+      }
+      if (node->right)
+      {
             pushTypeCastToLeaves(type, node->right, &(node->right));
-       }
+      }
     }
 }
 
@@ -1610,26 +1610,26 @@ void pushTypeCastToLeaves(sym_link *type, ast *node, ast **parentPtr)
 
 /*-----------------------------------------------------------------*/
 /* Given an assignment operation in a tree, determine if the LHS   */
-/* (the result) has a different (integer) type than the RHS.      */
+/* (the result) has a different (integer) type than the RHS.     */
 /* If so, walk the RHS and add a typecast to the type of the LHS   */
-/* to all leaf nodes.                                             */
+/* to all leaf nodes.              */
 /*-----------------------------------------------------------------*/
 void propAsgType(ast *tree)
 {
 #ifdef DEMAND_INTEGER_PROMOTION
     if (!IS_INTEGRAL(LTYPE(tree)) || !IS_INTEGRAL(RTYPE(tree)))
     {
-       /* Nothing to do here... */
-       return;
+      /* Nothing to do here... */
+      return;
     }
-    
+
     if (getSize(LTYPE(tree)) > getSize(RTYPE(tree)))
     {
         pushTypeCastToLeaves(LTYPE(tree), tree->right, &(tree->right));
     }
 #else
     (void)tree;
-#endif        
+#endif
 }
 
 /*-----------------------------------------------------------------*/
@@ -1638,1264 +1638,1264 @@ void propAsgType(ast *tree)
 /*          it also does constant folding, and paramater checking  */
 /*-----------------------------------------------------------------*/
 ast *decorateType (ast *tree)
-{         
+{
     int parmNumber ;
     sym_link *p;
-    
+
     if ( ! tree )
-       return tree ;
-    
+  return tree ;
+
     /* if already has type then do nothing */
     if ( tree->decorated )
-       return tree ;
-    
+  return tree ;
+
     tree->decorated = 1;
-    
+
     /* print the line          */
     /* if not block & function */
-    if ( tree->type == EX_OP && 
-        ( tree->opval.op != FUNCTION  &&
-          tree->opval.op != BLOCK     &&
-          tree->opval.op != NULLOP    )) {
-       filename = tree->filename ;
-       lineno = tree->lineno ;
+    if ( tree->type == EX_OP &&
+   ( tree->opval.op != FUNCTION  &&
+     tree->opval.op != BLOCK     &&
+     tree->opval.op != NULLOP    )) {
+  filename = tree->filename ;
+  lineno = tree->lineno ;
     }
 
     /* if any child is an error | this one is an error do nothing */
     if ( tree->isError ||
-        ( tree->left && tree->left->isError) ||
-        ( tree->right && tree->right->isError ))
-       return tree ;
+   ( tree->left && tree->left->isError) ||
+   ( tree->right && tree->right->isError ))
+  return tree ;
 
     /*------------------------------------------------------------------*/
     /*----------------------------*/
     /*   leaf has been reached    */
-    /*----------------------------*/        
+    /*----------------------------*/
     /* if this is of type value */
     /* just get the type        */
     if ( tree->type == EX_VALUE ) {
-       
-       if ( IS_LITERAL(tree->opval.val->etype) ) {
-           
-           /* if this is a character array then declare it */
-           if (IS_ARRAY(tree->opval.val->type))
-               tree->opval.val = stringToSymbol(tree->opval.val);
-           
-           /* otherwise just copy the type information */
-           COPYTYPE(TTYPE(tree),TETYPE(tree),tree->opval.val->type);
-           if (funcInChain(tree->opval.val->type)) {
-                   tree->hasVargs = tree->opval.val->sym->hasVargs;
-                   tree->args = copyValueChain(tree->opval.val->sym->args) ;
-           }
-           return tree ;
-       }
-       
-       if ( tree->opval.val->sym ) {
-           /* if the undefined flag is set then give error message */
-               if (tree->opval.val->sym->undefined ) {
-                 werror(E_ID_UNDEF,tree->opval.val->sym->name) ;
-                 /* assume int */
-                 TTYPE(tree) = TETYPE(tree) =
-                   tree->opval.val->type = tree->opval.val->sym->type = 
-                   tree->opval.val->etype = tree->opval.val->sym->etype = 
-                   copyLinkChain(INTTYPE);
-               }
-               else {
-                 
-                 /* if impilicit i.e. struct/union member then no type */
-                 if (tree->opval.val->sym->implicit )
-                   TTYPE(tree) = TETYPE(tree) = NULL ;
-                 
-                 else { 
-                   
-                               /* else copy the type */
-                   COPYTYPE(TTYPE(tree),TETYPE(tree),tree->opval.val->type); 
-                   
-                               /* and mark it as referenced */
-                   tree->opval.val->sym->isref = 1;
-                               /* if this is of type function or function pointer */
-                   if (funcInChain(tree->opval.val->type)) {
-                     tree->hasVargs = tree->opval.val->sym->hasVargs;
-                     tree->args = copyValueChain(tree->opval.val->sym->args) ;
-                     
-                   }
-                 }
-               }
-       }
-       
-       return tree ;
-    }
-    
+
+  if ( IS_LITERAL(tree->opval.val->etype) ) {
+
+      /* if this is a character array then declare it */
+      if (IS_ARRAY(tree->opval.val->type))
+    tree->opval.val = stringToSymbol(tree->opval.val);
+
+      /* otherwise just copy the type information */
+      COPYTYPE(TTYPE(tree),TETYPE(tree),tree->opval.val->type);
+      if (funcInChain(tree->opval.val->type)) {
+        tree->hasVargs = tree->opval.val->sym->hasVargs;
+        tree->args = copyValueChain(tree->opval.val->sym->args) ;
+      }
+      return tree ;
+  }
+
+  if ( tree->opval.val->sym ) {
+      /* if the undefined flag is set then give error message */
+    if (tree->opval.val->sym->undefined ) {
+      werror(E_ID_UNDEF,tree->opval.val->sym->name) ;
+      /* assume int */
+      TTYPE(tree) = TETYPE(tree) =
+        tree->opval.val->type = tree->opval.val->sym->type =
+        tree->opval.val->etype = tree->opval.val->sym->etype =
+        copyLinkChain(INTTYPE);
+    }
+    else {
+
+      /* if impilicit i.e. struct/union member then no type */
+      if (tree->opval.val->sym->implicit )
+        TTYPE(tree) = TETYPE(tree) = NULL ;
+
+      else {
+
+        /* else copy the type */
+        COPYTYPE(TTYPE(tree),TETYPE(tree),tree->opval.val->type);
+
+        /* and mark it as referenced */
+        tree->opval.val->sym->isref = 1;
+        /* if this is of type function or function pointer */
+        if (funcInChain(tree->opval.val->type)) {
+          tree->hasVargs = tree->opval.val->sym->hasVargs;
+          tree->args = copyValueChain(tree->opval.val->sym->args) ;
+
+        }
+      }
+    }
+  }
+
+  return tree ;
+    }
+
     /* if type link for the case of cast */
     if ( tree->type == EX_LINK ) {
-       COPYTYPE(TTYPE(tree),TETYPE(tree),tree->opval.lnk);
-       return tree ;
-    } 
-    
+  COPYTYPE(TTYPE(tree),TETYPE(tree),tree->opval.lnk);
+  return tree ;
+    }
+
     {
-       ast *dtl, *dtr;
-       
-       dtl = decorateType (tree->left);
-       dtr = decorateType (tree->right);  
-
-       /* this is to take care of situations
-          when the tree gets rewritten */
-       if (dtl != tree->left)
-           tree->left = dtl;
-       if (dtr != tree->right)
-           tree->right = dtr;
-    }
-    
+  ast *dtl, *dtr;
+
+  dtl = decorateType (tree->left);
+  dtr = decorateType (tree->right);
+
+  /* this is to take care of situations
+     when the tree gets rewritten */
+  if (dtl != tree->left)
+      tree->left = dtl;
+  if (dtr != tree->right)
+      tree->right = dtr;
+    }
+
     /* depending on type of operator do */
-    
+
     switch   (tree->opval.op) {
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*        array node          */
-       /*----------------------------*/
-    case  '['   :  
-       
-       /* determine which is the array & which the index */
-       if ((IS_ARRAY(RTYPE(tree)) || IS_PTR(RTYPE(tree))) && IS_INTEGRAL(LTYPE(tree))) {
-           
-           ast *tempTree = tree->left ;
-           tree->left = tree->right ;
-           tree->right= tempTree ;
-       }
-
-       /* first check if this is a array or a pointer */
-       if ( (!IS_ARRAY(LTYPE(tree)))  && (!IS_PTR(LTYPE(tree)))) {
-           werror(E_NEED_ARRAY_PTR,"[]");
-           goto errorTreeReturn ;
-       }       
-       
-       /* check if the type of the idx */
-       if (!IS_INTEGRAL(RTYPE(tree))) {
-           werror(E_IDX_NOT_INT);
-           goto errorTreeReturn ;
-       }
-       
-       /* if the left is an rvalue then error */
-       if (LRVAL(tree)) {
-           werror(E_LVALUE_REQUIRED,"array access");
-           goto errorTreeReturn ;
-       }
-       RRVAL(tree) = 1;
-       COPYTYPE(TTYPE(tree),TETYPE(tree),LTYPE(tree)->next);
-       return tree;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*      struct/union          */
-       /*----------------------------*/   
-    case  '.'   :  
-       /* if this is not a structure */
-       if (!IS_STRUCT(LTYPE(tree))) {
-           werror(E_STRUCT_UNION,".");
-           goto errorTreeReturn ;
-       }
-       TTYPE(tree) = structElemType (LTYPE(tree), 
-                                     (tree->right->type == EX_VALUE ?
-                                      tree->right->opval.val : NULL ),&tree->args);
-       TETYPE(tree) = getSpec(TTYPE(tree));
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*    struct/union pointer    */
-       /*----------------------------*/
-    case  PTR_OP:  
-       /* if not pointer to a structure */
-       if (!IS_PTR(LTYPE(tree)))  {
-           werror(E_PTR_REQD);
-           goto errorTreeReturn ;
-       }
-       
-       if (!IS_STRUCT(LTYPE(tree)->next))  {
-           werror(E_STRUCT_UNION,"->");
-           goto errorTreeReturn ;
-       }
-       
-       TTYPE(tree) = structElemType (LTYPE(tree)->next, 
-                                     (tree->right->type == EX_VALUE ?
-                                      tree->right->opval.val : NULL ),&tree->args);
-       TETYPE(tree) = getSpec(TTYPE(tree));
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*  ++/-- operation           */
-       /*----------------------------*/
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*        array node          */
+  /*----------------------------*/
+    case  '['   :
+
+  /* determine which is the array & which the index */
+  if ((IS_ARRAY(RTYPE(tree)) || IS_PTR(RTYPE(tree))) && IS_INTEGRAL(LTYPE(tree))) {
+
+      ast *tempTree = tree->left ;
+      tree->left = tree->right ;
+      tree->right= tempTree ;
+  }
+
+  /* first check if this is a array or a pointer */
+  if ( (!IS_ARRAY(LTYPE(tree)))  && (!IS_PTR(LTYPE(tree)))) {
+      werror(E_NEED_ARRAY_PTR,"[]");
+      goto errorTreeReturn ;
+  }
+
+  /* check if the type of the idx */
+  if (!IS_INTEGRAL(RTYPE(tree))) {
+      werror(E_IDX_NOT_INT);
+      goto errorTreeReturn ;
+  }
+
+  /* if the left is an rvalue then error */
+  if (LRVAL(tree)) {
+      werror(E_LVALUE_REQUIRED,"array access");
+      goto errorTreeReturn ;
+  }
+  RRVAL(tree) = 1;
+  COPYTYPE(TTYPE(tree),TETYPE(tree),LTYPE(tree)->next);
+  return tree;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*      struct/union          */
+  /*----------------------------*/
+    case  '.'   :
+  /* if this is not a structure */
+  if (!IS_STRUCT(LTYPE(tree))) {
+      werror(E_STRUCT_UNION,".");
+      goto errorTreeReturn ;
+  }
+  TTYPE(tree) = structElemType (LTYPE(tree),
+              (tree->right->type == EX_VALUE ?
+               tree->right->opval.val : NULL ),&tree->args);
+  TETYPE(tree) = getSpec(TTYPE(tree));
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*    struct/union pointer    */
+  /*----------------------------*/
+    case  PTR_OP:
+  /* if not pointer to a structure */
+  if (!IS_PTR(LTYPE(tree)))  {
+      werror(E_PTR_REQD);
+      goto errorTreeReturn ;
+  }
+
+  if (!IS_STRUCT(LTYPE(tree)->next))  {
+      werror(E_STRUCT_UNION,"->");
+      goto errorTreeReturn ;
+  }
+
+  TTYPE(tree) = structElemType (LTYPE(tree)->next,
+              (tree->right->type == EX_VALUE ?
+               tree->right->opval.val : NULL ),&tree->args);
+  TETYPE(tree) = getSpec(TTYPE(tree));
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*  ++/-- operation           */
+  /*----------------------------*/
     case  INC_OP:  /* incerement operator unary so left only */
     case  DEC_OP:
-       {
-           sym_link *ltc = (tree->right ? RTYPE(tree) : LTYPE(tree) );
-           COPYTYPE(TTYPE(tree),TETYPE(tree),ltc);
-           if (!tree->initMode && IS_CONSTANT(TETYPE(tree)))
-               werror(E_CODE_WRITE,"++/--");
-           
-           if (tree->right)
-               RLVAL(tree) = 1;
-           else
-               LLVAL(tree) = 1;
-           return tree ;
-       }
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*  bitwise and               */
-       /*----------------------------*/
+  {
+      sym_link *ltc = (tree->right ? RTYPE(tree) : LTYPE(tree) );
+      COPYTYPE(TTYPE(tree),TETYPE(tree),ltc);
+      if (!tree->initMode && IS_CONSTANT(TETYPE(tree)))
+    werror(E_CODE_WRITE,"++/--");
+
+      if (tree->right)
+    RLVAL(tree) = 1;
+      else
+    LLVAL(tree) = 1;
+      return tree ;
+  }
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*  bitwise and               */
+  /*----------------------------*/
     case  '&':     /* can be unary   */
-       /* if right is NULL then unary operation  */
-       if ( tree->right ) /* not an unary operation */ {
-           
-           if (!IS_INTEGRAL(LTYPE(tree)) || !IS_INTEGRAL(RTYPE(tree))) {
-               werror(E_BITWISE_OP);
-               werror(E_CONTINUE,"left & right types are ");
-               printTypeChain(LTYPE(tree),stderr);
-               fprintf(stderr,",");
-               printTypeChain(RTYPE(tree),stderr);
-               fprintf(stderr,"\n");
-               goto errorTreeReturn ;
-           }
-           
-           /* if they are both literal */
-           if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
-               tree->type = EX_VALUE ;
-               tree->opval.val = valBitwise (valFromType(LETYPE(tree)),
-                                             valFromType(RETYPE(tree)),'&');
-                                      
-               tree->right = tree->left = NULL;
-               TETYPE(tree) = tree->opval.val->etype ;
-               TTYPE(tree) =  tree->opval.val->type;
-               return tree ;
-           }
-           
-           /* see if this is a GETHBIT operation if yes
-              then return that */
-           {
-               ast *otree = optimizeGetHbit(tree);
-               
-               if (otree != tree)
-                   return decorateType(otree);
-           }
-           
-           /* if right or left is literal then result of that type*/
-           if (IS_LITERAL(RTYPE(tree))) {
-               
-               TTYPE(tree) = copyLinkChain(RTYPE(tree));
-               TETYPE(tree) = getSpec(TTYPE(tree));
-               SPEC_SCLS(TETYPE(tree)) = S_AUTO;
-           }
-           else {
-               if (IS_LITERAL(LTYPE(tree))) {              
-                   TTYPE(tree) = copyLinkChain(LTYPE(tree));
-                   TETYPE(tree) = getSpec(TTYPE(tree));
-                   SPEC_SCLS(TETYPE(tree)) = S_AUTO;
-                   
-               }
-               else {
-                   TTYPE(tree) = 
-                       computeType (LTYPE(tree), RTYPE(tree));
-                   TETYPE(tree) = getSpec(TTYPE(tree));
-               }
-           }
-           LRVAL(tree) = RRVAL(tree) = 1;
-           return tree ;
-       } 
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*  address of                */
-       /*----------------------------*/    
-       p = newLink();
-       p->class = DECLARATOR;
-       /* if bit field then error */
-       if (IS_BITVAR(tree->left->etype)) {
-           werror (E_ILLEGAL_ADDR,"addrress of bit variable");
-           goto errorTreeReturn ;
-       }
-       
-       if (SPEC_SCLS(tree->left->etype)== S_REGISTER ) {
-           werror (E_ILLEGAL_ADDR,"address of register variable");
-           goto errorTreeReturn;
-       }
-       
-       if (IS_FUNC(LTYPE(tree))) {
-           werror(E_ILLEGAL_ADDR,"address of function");
-           goto errorTreeReturn ;
-       }
-       
-       if (LRVAL(tree)) {
-           werror(E_LVALUE_REQUIRED,"address of");
-           goto errorTreeReturn ;      
-       }
-       if (SPEC_SCLS(tree->left->etype) == S_CODE) {
-           DCL_TYPE(p) = CPOINTER ;
-           DCL_PTR_CONST(p) = port->mem.code_ro;
-       }
-       else
-           if (SPEC_SCLS(tree->left->etype) == S_XDATA)
-               DCL_TYPE(p) = FPOINTER;
-           else
-               if (SPEC_SCLS(tree->left->etype) == S_XSTACK )
-                   DCL_TYPE(p) = PPOINTER ;
-               else
-                   if (SPEC_SCLS(tree->left->etype) == S_IDATA)
-                       DCL_TYPE(p) = IPOINTER ;
-                   else
-                       if (SPEC_SCLS(tree->left->etype) == S_EEPROM)
-                           DCL_TYPE(p) = EEPPOINTER ;
-                       else
-                           DCL_TYPE(p) = POINTER ;
-
-       if (IS_AST_SYM_VALUE(tree->left)) {
-           AST_SYMBOL(tree->left)->addrtaken = 1;
-           AST_SYMBOL(tree->left)->allocreq = 1;
-       }
-
-       p->next = LTYPE(tree);
-       TTYPE(tree) = p;
-       TETYPE(tree) = getSpec(TTYPE(tree));
-       DCL_PTR_CONST(p) = SPEC_CONST(TETYPE(tree));
-       DCL_PTR_VOLATILE(p) = SPEC_VOLATILE(TETYPE(tree));
-       LLVAL(tree) = 1;
-       TLVAL(tree) = 1;
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*  bitwise or                */
-       /*----------------------------*/
+  /* if right is NULL then unary operation  */
+  if ( tree->right ) /* not an unary operation */ {
+
+      if (!IS_INTEGRAL(LTYPE(tree)) || !IS_INTEGRAL(RTYPE(tree))) {
+    werror(E_BITWISE_OP);
+    werror(E_CONTINUE,"left & right types are ");
+    printTypeChain(LTYPE(tree),stderr);
+    fprintf(stderr,",");
+    printTypeChain(RTYPE(tree),stderr);
+    fprintf(stderr,"\n");
+    goto errorTreeReturn ;
+      }
+
+      /* if they are both literal */
+      if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
+    tree->type = EX_VALUE ;
+    tree->opval.val = valBitwise (valFromType(LETYPE(tree)),
+                valFromType(RETYPE(tree)),'&');
+
+    tree->right = tree->left = NULL;
+    TETYPE(tree) = tree->opval.val->etype ;
+    TTYPE(tree) =  tree->opval.val->type;
+    return tree ;
+      }
+
+      /* see if this is a GETHBIT operation if yes
+         then return that */
+      {
+    ast *otree = optimizeGetHbit(tree);
+
+    if (otree != tree)
+        return decorateType(otree);
+      }
+
+      /* if right or left is literal then result of that type*/
+      if (IS_LITERAL(RTYPE(tree))) {
+
+    TTYPE(tree) = copyLinkChain(RTYPE(tree));
+    TETYPE(tree) = getSpec(TTYPE(tree));
+    SPEC_SCLS(TETYPE(tree)) = S_AUTO;
+      }
+      else {
+    if (IS_LITERAL(LTYPE(tree))) {
+        TTYPE(tree) = copyLinkChain(LTYPE(tree));
+        TETYPE(tree) = getSpec(TTYPE(tree));
+        SPEC_SCLS(TETYPE(tree)) = S_AUTO;
+
+    }
+    else {
+        TTYPE(tree) =
+      computeType (LTYPE(tree), RTYPE(tree));
+        TETYPE(tree) = getSpec(TTYPE(tree));
+    }
+      }
+      LRVAL(tree) = RRVAL(tree) = 1;
+      return tree ;
+  }
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*  address of                */
+  /*----------------------------*/
+  p = newLink();
+  p->class = DECLARATOR;
+  /* if bit field then error */
+  if (IS_BITVAR(tree->left->etype)) {
+      werror (E_ILLEGAL_ADDR,"addrress of bit variable");
+      goto errorTreeReturn ;
+  }
+
+  if (SPEC_SCLS(tree->left->etype)== S_REGISTER ) {
+      werror (E_ILLEGAL_ADDR,"address of register variable");
+      goto errorTreeReturn;
+  }
+
+  if (IS_FUNC(LTYPE(tree))) {
+      werror(E_ILLEGAL_ADDR,"address of function");
+      goto errorTreeReturn ;
+  }
+
+  if (LRVAL(tree)) {
+      werror(E_LVALUE_REQUIRED,"address of");
+      goto errorTreeReturn ;
+  }
+  if (SPEC_SCLS(tree->left->etype) == S_CODE) {
+      DCL_TYPE(p) = CPOINTER ;
+      DCL_PTR_CONST(p) = port->mem.code_ro;
+  }
+  else
+      if (SPEC_SCLS(tree->left->etype) == S_XDATA)
+    DCL_TYPE(p) = FPOINTER;
+      else
+    if (SPEC_SCLS(tree->left->etype) == S_XSTACK )
+        DCL_TYPE(p) = PPOINTER ;
+    else
+        if (SPEC_SCLS(tree->left->etype) == S_IDATA)
+      DCL_TYPE(p) = IPOINTER ;
+        else
+      if (SPEC_SCLS(tree->left->etype) == S_EEPROM)
+          DCL_TYPE(p) = EEPPOINTER ;
+      else
+          DCL_TYPE(p) = POINTER ;
+
+  if (IS_AST_SYM_VALUE(tree->left)) {
+      AST_SYMBOL(tree->left)->addrtaken = 1;
+      AST_SYMBOL(tree->left)->allocreq = 1;
+  }
+
+  p->next = LTYPE(tree);
+  TTYPE(tree) = p;
+  TETYPE(tree) = getSpec(TTYPE(tree));
+  DCL_PTR_CONST(p) = SPEC_CONST(TETYPE(tree));
+  DCL_PTR_VOLATILE(p) = SPEC_VOLATILE(TETYPE(tree));
+  LLVAL(tree) = 1;
+  TLVAL(tree) = 1;
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*  bitwise or                */
+  /*----------------------------*/
     case  '|':
-       /* if the rewrite succeeds then don't go any furthur */
-       {
-           ast *wtree = optimizeRRCRLC ( tree );
-           if (wtree != tree) 
-               return decorateType(wtree) ;
-       }
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*  bitwise xor               */
-       /*----------------------------*/
+  /* if the rewrite succeeds then don't go any furthur */
+  {
+      ast *wtree = optimizeRRCRLC ( tree );
+      if (wtree != tree)
+    return decorateType(wtree) ;
+  }
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*  bitwise xor               */
+  /*----------------------------*/
     case  '^':
-       if (!IS_INTEGRAL(LTYPE(tree)) || !IS_INTEGRAL(RTYPE(tree))) {
-           werror(E_BITWISE_OP);
-           werror(E_CONTINUE,"left & right types are ");
-           printTypeChain(LTYPE(tree),stderr);
-           fprintf(stderr,",");
-           printTypeChain(RTYPE(tree),stderr);
-           fprintf(stderr,"\n");
-           goto errorTreeReturn ;
-       }
-       
-       /* if they are both literal then */
-       /* rewrite the tree */
-       if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valBitwise (valFromType(LETYPE(tree)),
-                                         valFromType(RETYPE(tree)),
-                                         tree->opval.op);                 
-           tree->right = tree->left = NULL;
-           TETYPE(tree) = tree->opval.val->etype;
-           TTYPE(tree) = tree->opval.val->type;
-           return tree ;
-       }
-       LRVAL(tree) = RRVAL(tree) = 1;
-       TETYPE(tree) = getSpec (TTYPE(tree) = 
-                               computeType(LTYPE(tree),
-                                           RTYPE(tree)));
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*  division                  */
-       /*----------------------------*/
+  if (!IS_INTEGRAL(LTYPE(tree)) || !IS_INTEGRAL(RTYPE(tree))) {
+      werror(E_BITWISE_OP);
+      werror(E_CONTINUE,"left & right types are ");
+      printTypeChain(LTYPE(tree),stderr);
+      fprintf(stderr,",");
+      printTypeChain(RTYPE(tree),stderr);
+      fprintf(stderr,"\n");
+      goto errorTreeReturn ;
+  }
+
+  /* if they are both literal then */
+  /* rewrite the tree */
+  if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valBitwise (valFromType(LETYPE(tree)),
+            valFromType(RETYPE(tree)),
+            tree->opval.op);
+      tree->right = tree->left = NULL;
+      TETYPE(tree) = tree->opval.val->etype;
+      TTYPE(tree) = tree->opval.val->type;
+      return tree ;
+  }
+  LRVAL(tree) = RRVAL(tree) = 1;
+  TETYPE(tree) = getSpec (TTYPE(tree) =
+        computeType(LTYPE(tree),
+              RTYPE(tree)));
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*  division                  */
+  /*----------------------------*/
     case  '/':
-       if (!IS_ARITHMETIC(LTYPE(tree)) || !IS_ARITHMETIC(RTYPE(tree))) {
-           werror(E_INVALID_OP,"divide");
-           goto errorTreeReturn ;
-       }
-       /* if they are both literal then */
-       /* rewrite the tree */
-       if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valDiv (valFromType(LETYPE(tree)),
-                                     valFromType(RETYPE(tree)));
-           tree->right = tree->left = NULL;
-           TETYPE(tree) = getSpec(TTYPE(tree) = 
-                                  tree->opval.val->type);
-           return tree ;
-       }
-       LRVAL(tree) = RRVAL(tree) = 1;
-       TETYPE(tree) = getSpec (TTYPE(tree) = 
-                               computeType(LTYPE(tree),
-                                           RTYPE(tree)));
-       return tree;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*            modulus         */
-       /*----------------------------*/
+  if (!IS_ARITHMETIC(LTYPE(tree)) || !IS_ARITHMETIC(RTYPE(tree))) {
+      werror(E_INVALID_OP,"divide");
+      goto errorTreeReturn ;
+  }
+  /* if they are both literal then */
+  /* rewrite the tree */
+  if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valDiv (valFromType(LETYPE(tree)),
+              valFromType(RETYPE(tree)));
+      tree->right = tree->left = NULL;
+      TETYPE(tree) = getSpec(TTYPE(tree) =
+           tree->opval.val->type);
+      return tree ;
+  }
+  LRVAL(tree) = RRVAL(tree) = 1;
+  TETYPE(tree) = getSpec (TTYPE(tree) =
+        computeType(LTYPE(tree),
+              RTYPE(tree)));
+  return tree;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*            modulus         */
+  /*----------------------------*/
     case  '%':
-       if (!IS_INTEGRAL(LTYPE(tree)) || !IS_INTEGRAL(RTYPE(tree))) {
-           werror(E_BITWISE_OP);
-           werror(E_CONTINUE,"left & right types are ");
-           printTypeChain(LTYPE(tree),stderr);
-           fprintf(stderr,",");
-           printTypeChain(RTYPE(tree),stderr);
-           fprintf(stderr,"\n");
-           goto errorTreeReturn ;
-       }
-       /* if they are both literal then */
-       /* rewrite the tree */
-       if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valMod (valFromType(LETYPE(tree)),
-                                     valFromType(RETYPE(tree)));                 
-           tree->right = tree->left = NULL;
-           TETYPE(tree) = getSpec(TTYPE(tree) = 
-                                  tree->opval.val->type);
-           return tree ;
-       }
-       LRVAL(tree) = RRVAL(tree) = 1;
-       TETYPE(tree) = getSpec (TTYPE(tree) = 
-                               computeType(LTYPE(tree),
-                                           RTYPE(tree)));
-       return tree;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*  address dereference       */
-       /*----------------------------*/
+  if (!IS_INTEGRAL(LTYPE(tree)) || !IS_INTEGRAL(RTYPE(tree))) {
+      werror(E_BITWISE_OP);
+      werror(E_CONTINUE,"left & right types are ");
+      printTypeChain(LTYPE(tree),stderr);
+      fprintf(stderr,",");
+      printTypeChain(RTYPE(tree),stderr);
+      fprintf(stderr,"\n");
+      goto errorTreeReturn ;
+  }
+  /* if they are both literal then */
+  /* rewrite the tree */
+  if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valMod (valFromType(LETYPE(tree)),
+              valFromType(RETYPE(tree)));
+      tree->right = tree->left = NULL;
+      TETYPE(tree) = getSpec(TTYPE(tree) =
+           tree->opval.val->type);
+      return tree ;
+  }
+  LRVAL(tree) = RRVAL(tree) = 1;
+  TETYPE(tree) = getSpec (TTYPE(tree) =
+        computeType(LTYPE(tree),
+              RTYPE(tree)));
+  return tree;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*  address dereference       */
+  /*----------------------------*/
     case  '*':     /* can be unary  : if right is null then unary operation */
-       if ( ! tree->right ) {
-           if (!IS_PTR(LTYPE(tree)) && !IS_ARRAY(LTYPE(tree))) {
-               werror(E_PTR_REQD);
-               goto errorTreeReturn ;
-           }
-           
-           if (LRVAL(tree)) {
-               werror(E_LVALUE_REQUIRED,"pointer deref");
-               goto errorTreeReturn ;  
-           }
-           TTYPE(tree) = copyLinkChain ((IS_PTR(LTYPE(tree)) || IS_ARRAY(LTYPE(tree))) ? 
-                                        LTYPE(tree)->next : NULL );
-           TETYPE(tree) = getSpec(TTYPE(tree));
-           tree->args = tree->left->args ;
-           tree->hasVargs = tree->left->hasVargs ;
-           SPEC_CONST(TETYPE(tree)) = DCL_PTR_CONST(LTYPE(tree));
-           return tree ;
-       }
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*      multiplication        */
-       /*----------------------------*/
-       if (!IS_ARITHMETIC(LTYPE(tree)) || !IS_ARITHMETIC(RTYPE(tree))) {
-           werror(E_INVALID_OP,"multiplication");
-           goto errorTreeReturn ;
-       }
-       
-       /* if they are both literal then */
-       /* rewrite the tree */
-       if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valMult (valFromType(LETYPE(tree)),
-                                      valFromType(RETYPE(tree)));                 
-           tree->right = tree->left = NULL;
-           TETYPE(tree) = getSpec(TTYPE(tree) = 
-                                  tree->opval.val->type);
-           return tree ;
-       }
-
-       /* if left is a literal exchange left & right */
-       if (IS_LITERAL(LTYPE(tree))) {
-           ast *tTree = tree->left ;
-           tree->left = tree->right ;
-           tree->right= tTree ;
-       }
-               
-       LRVAL(tree) = RRVAL(tree) = 1;
-       TETYPE(tree) = getSpec (TTYPE(tree) = 
-                               computeType(LTYPE(tree),
-                                           RTYPE(tree)));                        
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*    unary '+' operator      */
-       /*----------------------------*/
-    case '+' :  
-       /* if unary plus */
-       if ( ! tree->right ) {
-           if (!IS_INTEGRAL(LTYPE(tree))) {
-               werror(E_UNARY_OP,'+');
-               goto errorTreeReturn ;
-           }
-           
-           /* if left is a literal then do it */
-           if (IS_LITERAL(LTYPE(tree))) {
-               tree->type = EX_VALUE ;
-               tree->opval.val = valFromType(LETYPE(tree));          
-               tree->left = NULL ;
-               TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
-               return tree ;
-           }
-           LRVAL(tree) = 1;
-           COPYTYPE(TTYPE(tree),TETYPE(tree),LTYPE(tree)); 
-           return tree ;
-       }
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*      addition              */
-       /*----------------------------*/
-       
-       /* this is not a unary operation */
-       /* if both pointers then problem */
-       if ((IS_PTR(LTYPE(tree)) || IS_ARRAY(LTYPE(tree))) &&
-           (IS_PTR(RTYPE(tree)) || IS_ARRAY(RTYPE(tree)))) {
-           werror(E_PTR_PLUS_PTR);
-           goto errorTreeReturn ;
-       }       
-
-       if (!IS_ARITHMETIC(LTYPE(tree)) && 
-           !IS_PTR(LTYPE(tree)) && !IS_ARRAY(LTYPE(tree))) {
-           werror(E_PLUS_INVALID,"+");
-           goto errorTreeReturn ;
-       }
-       
-       if (!IS_ARITHMETIC(RTYPE(tree)) && 
-           !IS_PTR(RTYPE(tree)) && !IS_ARRAY(RTYPE(tree))) {
-           werror(E_PLUS_INVALID,"+");
-           goto errorTreeReturn;
-       }
-       /* if they are both literal then */
-       /* rewrite the tree */
-       if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valPlus (valFromType(LETYPE(tree)),
-                                      valFromType(RETYPE(tree))); 
-           tree->right = tree->left = NULL;
-           TETYPE(tree) = getSpec(TTYPE(tree) = 
-                                  tree->opval.val->type);
-           return tree ;
-       }
-       
-       /* if the right is a pointer or left is a literal 
-          xchange left & right */
-       if (IS_ARRAY(RTYPE(tree)) || 
-           IS_PTR(RTYPE(tree))   || 
-           IS_LITERAL(LTYPE(tree))) {
-           ast *tTree = tree->left ;
-           tree->left = tree->right ;
-           tree->right= tTree ;
-       }
-
-       LRVAL(tree) = RRVAL(tree) = 1;  
-       /* if the left is a pointer */
-       if (IS_PTR(LTYPE(tree)))      
-           TETYPE(tree) = getSpec(TTYPE(tree) =
-                                  LTYPE(tree));
-       else
-           TETYPE(tree) = getSpec(TTYPE(tree) = 
-                                  computeType(LTYPE(tree),
-                                              RTYPE(tree)));
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*      unary '-'             */
-       /*----------------------------*/
+  if ( ! tree->right ) {
+      if (!IS_PTR(LTYPE(tree)) && !IS_ARRAY(LTYPE(tree))) {
+    werror(E_PTR_REQD);
+    goto errorTreeReturn ;
+      }
+
+      if (LRVAL(tree)) {
+    werror(E_LVALUE_REQUIRED,"pointer deref");
+    goto errorTreeReturn ;
+      }
+      TTYPE(tree) = copyLinkChain ((IS_PTR(LTYPE(tree)) || IS_ARRAY(LTYPE(tree))) ?
+           LTYPE(tree)->next : NULL );
+      TETYPE(tree) = getSpec(TTYPE(tree));
+      tree->args = tree->left->args ;
+      tree->hasVargs = tree->left->hasVargs ;
+      SPEC_CONST(TETYPE(tree)) = DCL_PTR_CONST(LTYPE(tree));
+      return tree ;
+  }
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*      multiplication        */
+  /*----------------------------*/
+  if (!IS_ARITHMETIC(LTYPE(tree)) || !IS_ARITHMETIC(RTYPE(tree))) {
+      werror(E_INVALID_OP,"multiplication");
+      goto errorTreeReturn ;
+  }
+
+  /* if they are both literal then */
+  /* rewrite the tree */
+  if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valMult (valFromType(LETYPE(tree)),
+               valFromType(RETYPE(tree)));
+      tree->right = tree->left = NULL;
+      TETYPE(tree) = getSpec(TTYPE(tree) =
+           tree->opval.val->type);
+      return tree ;
+  }
+
+  /* if left is a literal exchange left & right */
+  if (IS_LITERAL(LTYPE(tree))) {
+      ast *tTree = tree->left ;
+      tree->left = tree->right ;
+      tree->right= tTree ;
+  }
+
+  LRVAL(tree) = RRVAL(tree) = 1;
+  TETYPE(tree) = getSpec (TTYPE(tree) =
+        computeType(LTYPE(tree),
+              RTYPE(tree)));
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*    unary '+' operator      */
+  /*----------------------------*/
+    case '+' :
+  /* if unary plus */
+  if ( ! tree->right ) {
+      if (!IS_INTEGRAL(LTYPE(tree))) {
+    werror(E_UNARY_OP,'+');
+    goto errorTreeReturn ;
+      }
+
+      /* if left is a literal then do it */
+      if (IS_LITERAL(LTYPE(tree))) {
+    tree->type = EX_VALUE ;
+    tree->opval.val = valFromType(LETYPE(tree));
+    tree->left = NULL ;
+    TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
+    return tree ;
+      }
+      LRVAL(tree) = 1;
+      COPYTYPE(TTYPE(tree),TETYPE(tree),LTYPE(tree));
+      return tree ;
+  }
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*      addition              */
+  /*----------------------------*/
+
+  /* this is not a unary operation */
+  /* if both pointers then problem */
+  if ((IS_PTR(LTYPE(tree)) || IS_ARRAY(LTYPE(tree))) &&
+      (IS_PTR(RTYPE(tree)) || IS_ARRAY(RTYPE(tree)))) {
+      werror(E_PTR_PLUS_PTR);
+      goto errorTreeReturn ;
+  }
+
+  if (!IS_ARITHMETIC(LTYPE(tree)) &&
+      !IS_PTR(LTYPE(tree)) && !IS_ARRAY(LTYPE(tree))) {
+      werror(E_PLUS_INVALID,"+");
+      goto errorTreeReturn ;
+  }
+
+  if (!IS_ARITHMETIC(RTYPE(tree)) &&
+      !IS_PTR(RTYPE(tree)) && !IS_ARRAY(RTYPE(tree))) {
+      werror(E_PLUS_INVALID,"+");
+      goto errorTreeReturn;
+  }
+  /* if they are both literal then */
+  /* rewrite the tree */
+  if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valPlus (valFromType(LETYPE(tree)),
+               valFromType(RETYPE(tree)));
+      tree->right = tree->left = NULL;
+      TETYPE(tree) = getSpec(TTYPE(tree) =
+           tree->opval.val->type);
+      return tree ;
+  }
+
+  /* if the right is a pointer or left is a literal
+     xchange left & right */
+  if (IS_ARRAY(RTYPE(tree)) ||
+      IS_PTR(RTYPE(tree))   ||
+      IS_LITERAL(LTYPE(tree))) {
+      ast *tTree = tree->left ;
+      tree->left = tree->right ;
+      tree->right= tTree ;
+  }
+
+  LRVAL(tree) = RRVAL(tree) = 1;
+  /* if the left is a pointer */
+  if (IS_PTR(LTYPE(tree)))
+      TETYPE(tree) = getSpec(TTYPE(tree) =
+           LTYPE(tree));
+  else
+      TETYPE(tree) = getSpec(TTYPE(tree) =
+           computeType(LTYPE(tree),
+                 RTYPE(tree)));
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*      unary '-'             */
+  /*----------------------------*/
     case '-' :  /* can be unary   */
-       /* if right is null then unary */
-       if ( ! tree->right ) {
-           
-           if (!IS_ARITHMETIC(LTYPE(tree))) {
-               werror(E_UNARY_OP,tree->opval.op);
-               goto errorTreeReturn ;
-           }
-           
-           /* if left is a literal then do it */
-           if (IS_LITERAL(LTYPE(tree))) {
-               tree->type = EX_VALUE ;
-               tree->opval.val = valUnaryPM(valFromType(LETYPE(tree)));
-               tree->left = NULL ;
-               TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
-               return tree ;
-           }
-           LRVAL(tree) = 1;
-           TTYPE(tree) =  LTYPE(tree); 
-           return tree ;
-       }
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*    subtraction             */
-       /*----------------------------*/
-       
-       if (!(IS_PTR(LTYPE(tree)) || 
-             IS_ARRAY(LTYPE(tree)) || 
-             IS_ARITHMETIC(LTYPE(tree)))) {
-           werror(E_PLUS_INVALID,"-");
-           goto errorTreeReturn ;
-       }
-       
-       if (!(IS_PTR(RTYPE(tree)) || 
-             IS_ARRAY(RTYPE(tree)) || 
-             IS_ARITHMETIC(RTYPE(tree)))) {
-           werror(E_PLUS_INVALID,"-");
-           goto errorTreeReturn ;
-       }
-       
-       if ( (IS_PTR(LTYPE(tree)) || IS_ARRAY(LTYPE(tree))) &&
-           ! (IS_PTR(RTYPE(tree)) || IS_ARRAY(RTYPE(tree)) || 
-              IS_INTEGRAL(RTYPE(tree)))   ) {
-           werror(E_PLUS_INVALID,"-");
-           goto errorTreeReturn ;
-       }
-
-       /* if they are both literal then */
-       /* rewrite the tree */
-       if (IS_LITERAL(RTYPE(tree)) &&  IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valMinus (valFromType(LETYPE(tree)),
-                                       valFromType(RETYPE(tree)));  
-           tree->right = tree->left = NULL;
-           TETYPE(tree) = getSpec(TTYPE(tree) = 
-                                  tree->opval.val->type);
-           return tree ;
-       }
-       
-       /* if the left & right are equal then zero */
-       if (isAstEqual(tree->left,tree->right)) {
-           tree->type = EX_VALUE;
-           tree->left = tree->right = NULL;
-           tree->opval.val = constVal("0");
-           TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
-           return tree;
-       }
-
-       /* if both of them are pointers or arrays then */
-       /* the result is going to be an integer        */
-       if (( IS_ARRAY(LTYPE(tree)) || IS_PTR(LTYPE(tree))) &&
-           ( IS_ARRAY(RTYPE(tree)) || IS_PTR(RTYPE(tree)))) 
-           TETYPE(tree) = TTYPE(tree) = newIntLink();
-       else 
-           /* if only the left is a pointer */
-           /* then result is a pointer      */
-           if (IS_PTR(LTYPE(tree)) || IS_ARRAY(LTYPE(tree))) 
-               TETYPE(tree) = getSpec(TTYPE(tree) =
-                                      LTYPE(tree));
-           else
-               TETYPE(tree) = getSpec (TTYPE(tree) = 
-                                       computeType(LTYPE(tree),
-                                                   RTYPE(tree))); 
-       LRVAL(tree) = RRVAL(tree) = 1;
-       return tree ;  
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*    compliment              */
-       /*----------------------------*/
+  /* if right is null then unary */
+  if ( ! tree->right ) {
+
+      if (!IS_ARITHMETIC(LTYPE(tree))) {
+    werror(E_UNARY_OP,tree->opval.op);
+    goto errorTreeReturn ;
+      }
+
+      /* if left is a literal then do it */
+      if (IS_LITERAL(LTYPE(tree))) {
+    tree->type = EX_VALUE ;
+    tree->opval.val = valUnaryPM(valFromType(LETYPE(tree)));
+    tree->left = NULL ;
+    TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
+    return tree ;
+      }
+      LRVAL(tree) = 1;
+      TTYPE(tree) =  LTYPE(tree);
+      return tree ;
+  }
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*    subtraction             */
+  /*----------------------------*/
+
+  if (!(IS_PTR(LTYPE(tree)) ||
+        IS_ARRAY(LTYPE(tree)) ||
+        IS_ARITHMETIC(LTYPE(tree)))) {
+      werror(E_PLUS_INVALID,"-");
+      goto errorTreeReturn ;
+  }
+
+  if (!(IS_PTR(RTYPE(tree)) ||
+        IS_ARRAY(RTYPE(tree)) ||
+        IS_ARITHMETIC(RTYPE(tree)))) {
+      werror(E_PLUS_INVALID,"-");
+      goto errorTreeReturn ;
+  }
+
+  if ( (IS_PTR(LTYPE(tree)) || IS_ARRAY(LTYPE(tree))) &&
+      ! (IS_PTR(RTYPE(tree)) || IS_ARRAY(RTYPE(tree)) ||
+         IS_INTEGRAL(RTYPE(tree)))   ) {
+      werror(E_PLUS_INVALID,"-");
+      goto errorTreeReturn ;
+  }
+
+  /* if they are both literal then */
+  /* rewrite the tree */
+  if (IS_LITERAL(RTYPE(tree)) &&  IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valMinus (valFromType(LETYPE(tree)),
+          valFromType(RETYPE(tree)));
+      tree->right = tree->left = NULL;
+      TETYPE(tree) = getSpec(TTYPE(tree) =
+           tree->opval.val->type);
+      return tree ;
+  }
+
+  /* if the left & right are equal then zero */
+  if (isAstEqual(tree->left,tree->right)) {
+      tree->type = EX_VALUE;
+      tree->left = tree->right = NULL;
+      tree->opval.val = constVal("0");
+      TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
+      return tree;
+  }
+
+  /* if both of them are pointers or arrays then */
+  /* the result is going to be an integer        */
+  if (( IS_ARRAY(LTYPE(tree)) || IS_PTR(LTYPE(tree))) &&
+      ( IS_ARRAY(RTYPE(tree)) || IS_PTR(RTYPE(tree))))
+      TETYPE(tree) = TTYPE(tree) = newIntLink();
+  else
+      /* if only the left is a pointer */
+      /* then result is a pointer      */
+      if (IS_PTR(LTYPE(tree)) || IS_ARRAY(LTYPE(tree)))
+    TETYPE(tree) = getSpec(TTYPE(tree) =
+               LTYPE(tree));
+      else
+    TETYPE(tree) = getSpec (TTYPE(tree) =
+          computeType(LTYPE(tree),
+                RTYPE(tree)));
+  LRVAL(tree) = RRVAL(tree) = 1;
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*    compliment              */
+  /*----------------------------*/
     case '~' :
-       /* can be only integral type */
-       if (!IS_INTEGRAL(LTYPE(tree))) {
-           werror(E_UNARY_OP,tree->opval.op);
-           goto errorTreeReturn ;
-       } 
-       
-       /* if left is a literal then do it */
-       if (IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valComplement(valFromType(LETYPE(tree)));     
-           tree->left = NULL ;
-           TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
-           return tree ;
-       }
-       LRVAL(tree) = 1;
-       COPYTYPE(TTYPE(tree),TETYPE(tree),LTYPE(tree));
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*           not              */
-       /*----------------------------*/
+  /* can be only integral type */
+  if (!IS_INTEGRAL(LTYPE(tree))) {
+      werror(E_UNARY_OP,tree->opval.op);
+      goto errorTreeReturn ;
+  }
+
+  /* if left is a literal then do it */
+  if (IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valComplement(valFromType(LETYPE(tree)));
+      tree->left = NULL ;
+      TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
+      return tree ;
+  }
+  LRVAL(tree) = 1;
+  COPYTYPE(TTYPE(tree),TETYPE(tree),LTYPE(tree));
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*           not              */
+  /*----------------------------*/
     case '!' :
-       /* can be pointer */
-       if (!IS_ARITHMETIC(LTYPE(tree)) && 
-           !IS_PTR(LTYPE(tree))        && 
-           !IS_ARRAY(LTYPE(tree))) {
-           werror(E_UNARY_OP,tree->opval.op);
-           goto errorTreeReturn ;
-       }
-       
-       /* if left is a literal then do it */
-       if (IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valNot(valFromType(LETYPE(tree)));           
-           tree->left = NULL ;
-           TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
-           return tree ;
-       }
-       LRVAL(tree) = 1;
-       TTYPE(tree) = TETYPE(tree) = newCharLink();
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*           shift            */
-       /*----------------------------*/
+  /* can be pointer */
+  if (!IS_ARITHMETIC(LTYPE(tree)) &&
+      !IS_PTR(LTYPE(tree))        &&
+      !IS_ARRAY(LTYPE(tree))) {
+      werror(E_UNARY_OP,tree->opval.op);
+      goto errorTreeReturn ;
+  }
+
+  /* if left is a literal then do it */
+  if (IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valNot(valFromType(LETYPE(tree)));
+      tree->left = NULL ;
+      TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
+      return tree ;
+  }
+  LRVAL(tree) = 1;
+  TTYPE(tree) = TETYPE(tree) = newCharLink();
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*           shift            */
+  /*----------------------------*/
     case RRC:
     case RLC:
-       TTYPE(tree) = LTYPE(tree);
-       TETYPE(tree) = LETYPE(tree);
-       return tree ;
-       
+  TTYPE(tree) = LTYPE(tree);
+  TETYPE(tree) = LETYPE(tree);
+  return tree ;
+
     case GETHBIT:
-       TTYPE(tree) = TETYPE(tree) = newCharLink();       
-       return tree;
+  TTYPE(tree) = TETYPE(tree) = newCharLink();
+  return tree;
 
     case LEFT_OP:
     case RIGHT_OP:
-       if (!IS_INTEGRAL(LTYPE(tree)) || !IS_INTEGRAL(tree->left->etype)) {  
-           werror(E_SHIFT_OP_INVALID);
-           werror(E_CONTINUE,"left & right types are ");
-           printTypeChain(LTYPE(tree),stderr);
-           fprintf(stderr,",");
-           printTypeChain(RTYPE(tree),stderr);
-           fprintf(stderr,"\n");
-           goto errorTreeReturn ;
-       }
-
-       /* if they are both literal then */
-       /* rewrite the tree */
-       if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valShift (valFromType(LETYPE(tree)),
-                                       valFromType(RETYPE(tree)),
-                                       (tree->opval.op == LEFT_OP ? 1 : 0));             
-           tree->right = tree->left = NULL;
-           TETYPE(tree) = getSpec(TTYPE(tree) = 
-                                  tree->opval.val->type);
-           return tree ;
-       }
-       /* if only the right side is a literal & we are
-          shifting more than size of the left operand then zero */
-       if (IS_LITERAL(RTYPE(tree)) && 
-           ((int)floatFromVal( valFromType(RETYPE(tree)))) >=
-           (getSize(LTYPE(tree))*8)) {
-           werror(W_SHIFT_CHANGED, 
-                  (tree->opval.op == LEFT_OP ? "left" : "right"));
-           tree->type = EX_VALUE;
-           tree->left = tree->right = NULL;
-           tree->opval.val = constVal("0");
-           TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
-           return tree;
-       }
-       LRVAL(tree) = RRVAL(tree) = 1;
-       if (IS_LITERAL(LTYPE(tree)) && !IS_LITERAL(RTYPE(tree))) {          
-           COPYTYPE(TTYPE(tree),TETYPE(tree),RTYPE(tree));     
-       } else {
-           COPYTYPE(TTYPE(tree),TETYPE(tree),LTYPE(tree));
-       }
-       return tree ;
-        
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*         casting            */
-       /*----------------------------*/
+  if (!IS_INTEGRAL(LTYPE(tree)) || !IS_INTEGRAL(tree->left->etype)) {
+      werror(E_SHIFT_OP_INVALID);
+      werror(E_CONTINUE,"left & right types are ");
+      printTypeChain(LTYPE(tree),stderr);
+      fprintf(stderr,",");
+      printTypeChain(RTYPE(tree),stderr);
+      fprintf(stderr,"\n");
+      goto errorTreeReturn ;
+  }
+
+  /* if they are both literal then */
+  /* rewrite the tree */
+  if (IS_LITERAL(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valShift (valFromType(LETYPE(tree)),
+          valFromType(RETYPE(tree)),
+          (tree->opval.op == LEFT_OP ? 1 : 0));
+      tree->right = tree->left = NULL;
+      TETYPE(tree) = getSpec(TTYPE(tree) =
+           tree->opval.val->type);
+      return tree ;
+  }
+  /* if only the right side is a literal & we are
+     shifting more than size of the left operand then zero */
+  if (IS_LITERAL(RTYPE(tree)) &&
+      ((int)floatFromVal( valFromType(RETYPE(tree)))) >=
+      (getSize(LTYPE(tree))*8)) {
+      werror(W_SHIFT_CHANGED,
+       (tree->opval.op == LEFT_OP ? "left" : "right"));
+      tree->type = EX_VALUE;
+      tree->left = tree->right = NULL;
+      tree->opval.val = constVal("0");
+      TETYPE(tree) = TTYPE(tree) = tree->opval.val->type;
+      return tree;
+  }
+  LRVAL(tree) = RRVAL(tree) = 1;
+  if (IS_LITERAL(LTYPE(tree)) && !IS_LITERAL(RTYPE(tree))) {
+      COPYTYPE(TTYPE(tree),TETYPE(tree),RTYPE(tree));
+  } else {
+      COPYTYPE(TTYPE(tree),TETYPE(tree),LTYPE(tree));
+  }
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*         casting            */
+  /*----------------------------*/
     case CAST:  /* change the type   */
-       /* cannot cast to an aggregate type */
-       if (IS_AGGREGATE(LTYPE(tree))) {
-           werror(E_CAST_ILLEGAL);
-           goto errorTreeReturn ;
-       }
-       
-       /* if the right is a literal replace the tree */
-       if (IS_LITERAL(RETYPE(tree)) && !IS_PTR(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = 
-               valCastLiteral(LTYPE(tree),
-                              floatFromVal(valFromType(RETYPE(tree))));
-           tree->left = NULL;
-           tree->right = NULL;
-           TTYPE(tree) = tree->opval.val->type;            
-           tree->values.literalFromCast = 1;
-       }
-       else {
-           TTYPE(tree) = LTYPE(tree);
-           LRVAL(tree) = 1;
-       }
-
-       TETYPE(tree) = getSpec(TTYPE(tree)); 
-       
-       return tree;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*       logical &&, ||       */
-       /*----------------------------*/
+  /* cannot cast to an aggregate type */
+  if (IS_AGGREGATE(LTYPE(tree))) {
+      werror(E_CAST_ILLEGAL);
+      goto errorTreeReturn ;
+  }
+
+  /* if the right is a literal replace the tree */
+  if (IS_LITERAL(RETYPE(tree)) && !IS_PTR(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val =
+    valCastLiteral(LTYPE(tree),
+             floatFromVal(valFromType(RETYPE(tree))));
+      tree->left = NULL;
+      tree->right = NULL;
+      TTYPE(tree) = tree->opval.val->type;
+      tree->values.literalFromCast = 1;
+  }
+  else {
+      TTYPE(tree) = LTYPE(tree);
+      LRVAL(tree) = 1;
+  }
+
+  TETYPE(tree) = getSpec(TTYPE(tree));
+
+  return tree;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*       logical &&, ||       */
+  /*----------------------------*/
     case AND_OP:
     case OR_OP:
-       /* each must me arithmetic type or be a pointer */
-       if (!IS_PTR(LTYPE(tree)) && 
-           !IS_ARRAY(LTYPE(tree)) && 
-           !IS_INTEGRAL(LTYPE(tree))) {
-           werror(E_COMPARE_OP);
-           goto errorTreeReturn ;
-       }
-       
-       if (!IS_PTR(RTYPE(tree)) &&     
-           !IS_ARRAY(RTYPE(tree)) && 
-           !IS_INTEGRAL(RTYPE(tree))) {
-           werror(E_COMPARE_OP);
-           goto errorTreeReturn ;
-       }
-       /* if they are both literal then */
-       /* rewrite the tree */
-       if (IS_LITERAL(RTYPE(tree)) &&
-           IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valLogicAndOr (valFromType(LETYPE(tree)),
-                                            valFromType(RETYPE(tree)),
-                                            tree->opval.op);               
-           tree->right = tree->left = NULL;
-           TETYPE(tree) = getSpec(TTYPE(tree) = 
-                                  tree->opval.val->type);
-           return tree ;
-       }
-       LRVAL(tree) = RRVAL(tree) = 1;
-       TTYPE(tree) = TETYPE(tree) = newCharLink();
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*     comparison operators   */
-       /*----------------------------*/    
+  /* each must me arithmetic type or be a pointer */
+  if (!IS_PTR(LTYPE(tree)) &&
+      !IS_ARRAY(LTYPE(tree)) &&
+      !IS_INTEGRAL(LTYPE(tree))) {
+      werror(E_COMPARE_OP);
+      goto errorTreeReturn ;
+  }
+
+  if (!IS_PTR(RTYPE(tree)) &&
+      !IS_ARRAY(RTYPE(tree)) &&
+      !IS_INTEGRAL(RTYPE(tree))) {
+      werror(E_COMPARE_OP);
+      goto errorTreeReturn ;
+  }
+  /* if they are both literal then */
+  /* rewrite the tree */
+  if (IS_LITERAL(RTYPE(tree)) &&
+      IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valLogicAndOr (valFromType(LETYPE(tree)),
+               valFromType(RETYPE(tree)),
+               tree->opval.op);
+      tree->right = tree->left = NULL;
+      TETYPE(tree) = getSpec(TTYPE(tree) =
+           tree->opval.val->type);
+      return tree ;
+  }
+  LRVAL(tree) = RRVAL(tree) = 1;
+  TTYPE(tree) = TETYPE(tree) = newCharLink();
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*     comparison operators   */
+  /*----------------------------*/
     case '>' :
     case '<' :
     case LE_OP :
     case GE_OP :
     case EQ_OP :
     case NE_OP :
-       {
-           ast *lt = optimizeCompare(tree);
-           
-           if ( tree != lt )
-               return lt;
-       }
-
-       /* if they are pointers they must be castable */
-       if ( IS_PTR(LTYPE(tree)) && IS_PTR(RTYPE(tree))) {
-           if (checkType(LTYPE(tree),RTYPE(tree)) == 0) {
-               werror(E_COMPARE_OP);
-               fprintf(stderr,"comparing type ");
-               printTypeChain(LTYPE(tree),stderr);
-               fprintf(stderr,"to type ");
-               printTypeChain(RTYPE(tree),stderr);
-               fprintf(stderr,"\n");
-               goto errorTreeReturn ;
-           }
-       } 
-       /* else they should be promotable to one another */
-       else {
-           if (!(  ( IS_PTR(LTYPE(tree)) && IS_LITERAL(RTYPE(tree))) ||
-                   ( IS_PTR(RTYPE(tree)) && IS_LITERAL(LTYPE(tree))))) 
-               
-               if (checkType (LTYPE(tree),RTYPE(tree)) == 0 ) {
-                   werror(E_COMPARE_OP);
-                   fprintf(stderr,"comparing type ");
-                   printTypeChain(LTYPE(tree),stderr);
-                   fprintf(stderr,"to type ");
-                   printTypeChain(RTYPE(tree),stderr);
-                   fprintf(stderr,"\n");
-                   goto errorTreeReturn ;
-               }
-       }
-       
-       /* if they are both literal then */
-       /* rewrite the tree */
-       if (IS_LITERAL(RTYPE(tree)) &&
-           IS_LITERAL(LTYPE(tree))) {
-           tree->type = EX_VALUE ;
-           tree->opval.val = valCompare (valFromType(LETYPE(tree)),
-                                         valFromType(RETYPE(tree)),
-                                         tree->opval.op);                 
-           tree->right = tree->left = NULL;
-           TETYPE(tree) = getSpec(TTYPE(tree) = 
-                                  tree->opval.val->type);
-           return tree ;
-       }
-       LRVAL(tree) = RRVAL(tree) = 1;
-       TTYPE(tree) = TETYPE(tree) = newCharLink();
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*             sizeof         */
-       /*----------------------------*/    
+  {
+      ast *lt = optimizeCompare(tree);
+
+      if ( tree != lt )
+    return lt;
+  }
+
+  /* if they are pointers they must be castable */
+  if ( IS_PTR(LTYPE(tree)) && IS_PTR(RTYPE(tree))) {
+      if (checkType(LTYPE(tree),RTYPE(tree)) == 0) {
+    werror(E_COMPARE_OP);
+    fprintf(stderr,"comparing type ");
+    printTypeChain(LTYPE(tree),stderr);
+    fprintf(stderr,"to type ");
+    printTypeChain(RTYPE(tree),stderr);
+    fprintf(stderr,"\n");
+    goto errorTreeReturn ;
+      }
+  }
+  /* else they should be promotable to one another */
+  else {
+      if (!(  ( IS_PTR(LTYPE(tree)) && IS_LITERAL(RTYPE(tree))) ||
+        ( IS_PTR(RTYPE(tree)) && IS_LITERAL(LTYPE(tree)))))
+
+    if (checkType (LTYPE(tree),RTYPE(tree)) == 0 ) {
+        werror(E_COMPARE_OP);
+        fprintf(stderr,"comparing type ");
+        printTypeChain(LTYPE(tree),stderr);
+        fprintf(stderr,"to type ");
+        printTypeChain(RTYPE(tree),stderr);
+        fprintf(stderr,"\n");
+        goto errorTreeReturn ;
+    }
+  }
+
+  /* if they are both literal then */
+  /* rewrite the tree */
+  if (IS_LITERAL(RTYPE(tree)) &&
+      IS_LITERAL(LTYPE(tree))) {
+      tree->type = EX_VALUE ;
+      tree->opval.val = valCompare (valFromType(LETYPE(tree)),
+            valFromType(RETYPE(tree)),
+            tree->opval.op);
+      tree->right = tree->left = NULL;
+      TETYPE(tree) = getSpec(TTYPE(tree) =
+           tree->opval.val->type);
+      return tree ;
+  }
+  LRVAL(tree) = RRVAL(tree) = 1;
+  TTYPE(tree) = TETYPE(tree) = newCharLink();
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*             sizeof         */
+  /*----------------------------*/
     case SIZEOF :  /* evaluate wihout code generation */
-       /* change the type to a integer */
-       tree->type = EX_VALUE;
-       sprintf(buffer,"%d",(getSize(tree->right->ftype)));
-       tree->opval.val = constVal(buffer);
-       tree->right = tree->left = NULL;
-       TETYPE(tree) = getSpec(TTYPE(tree) = 
-                              tree->opval.val->type);
-       return tree;     
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /* conditional operator  '?'  */
-       /*----------------------------*/    
+  /* change the type to a integer */
+  tree->type = EX_VALUE;
+  sprintf(buffer,"%d",(getSize(tree->right->ftype)));
+  tree->opval.val = constVal(buffer);
+  tree->right = tree->left = NULL;
+  TETYPE(tree) = getSpec(TTYPE(tree) =
+             tree->opval.val->type);
+  return tree;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /* conditional operator  '?'  */
+  /*----------------------------*/
     case '?' :
-       /* the type is one on the left */
-       TTYPE(tree) = LTYPE(tree);
-       TETYPE(tree)= getSpec (TTYPE(tree));
-       return tree ;
-       
+  /* the type is one on the left */
+  TTYPE(tree) = LTYPE(tree);
+  TETYPE(tree)= getSpec (TTYPE(tree));
+  return tree ;
+
     case ':' :
-       /* if they don't match we have a problem */
-       if (checkType( LTYPE(tree), RTYPE(tree)) == 0) {
-           werror(E_TYPE_MISMATCH,"conditional operator"," ");
-           goto errorTreeReturn ;
-       }
-       
-       TTYPE(tree) = computeType(LTYPE(tree),RTYPE(tree));
-       TETYPE(tree)= getSpec(TTYPE(tree));
-       return tree ;
-       
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*    assignment operators    */
-       /*----------------------------*/    
+  /* if they don't match we have a problem */
+  if (checkType( LTYPE(tree), RTYPE(tree)) == 0) {
+      werror(E_TYPE_MISMATCH,"conditional operator"," ");
+      goto errorTreeReturn ;
+  }
+
+  TTYPE(tree) = computeType(LTYPE(tree),RTYPE(tree));
+  TETYPE(tree)= getSpec(TTYPE(tree));
+  return tree ;
+
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*    assignment operators    */
+  /*----------------------------*/
     case MUL_ASSIGN:
     case DIV_ASSIGN:
-       /* for these it must be both must be integral */
-       if (!IS_ARITHMETIC(LTYPE(tree)) ||
-           !IS_ARITHMETIC(RTYPE(tree))) {
-           werror (E_OPS_INTEGRAL);
-           goto errorTreeReturn ;
-       }
+  /* for these it must be both must be integral */
+  if (!IS_ARITHMETIC(LTYPE(tree)) ||
+      !IS_ARITHMETIC(RTYPE(tree))) {
+      werror (E_OPS_INTEGRAL);
+      goto errorTreeReturn ;
+  }
         RRVAL(tree) = 1;
-       TETYPE(tree) = getSpec(TTYPE(tree) = LTYPE(tree));
+  TETYPE(tree) = getSpec(TTYPE(tree) = LTYPE(tree));
 
-       if (!tree->initMode && IS_CONSTANT(LETYPE(tree)))
-           werror(E_CODE_WRITE," ");
+  if (!tree->initMode && IS_CONSTANT(LETYPE(tree)))
+      werror(E_CODE_WRITE," ");
 
-       if (LRVAL(tree)) {
-           werror(E_LVALUE_REQUIRED,"*= or /=");
-           goto errorTreeReturn ;      
-       }
-       LLVAL(tree) = 1;
-       
-       propAsgType(tree);
-       
-       return tree ;
+  if (LRVAL(tree)) {
+      werror(E_LVALUE_REQUIRED,"*= or /=");
+      goto errorTreeReturn ;
+  }
+  LLVAL(tree) = 1;
+
+  propAsgType(tree);
+
+  return tree ;
 
     case AND_ASSIGN:
     case OR_ASSIGN:
     case XOR_ASSIGN:
     case RIGHT_ASSIGN:
     case LEFT_ASSIGN:
-       /* for these it must be both must be integral */
-       if (!IS_INTEGRAL(LTYPE(tree)) ||
-           !IS_INTEGRAL(RTYPE(tree))) {
-           werror (E_OPS_INTEGRAL);
-           goto errorTreeReturn ;
-       }
+  /* for these it must be both must be integral */
+  if (!IS_INTEGRAL(LTYPE(tree)) ||
+      !IS_INTEGRAL(RTYPE(tree))) {
+      werror (E_OPS_INTEGRAL);
+      goto errorTreeReturn ;
+  }
         RRVAL(tree) = 1;
-       TETYPE(tree) = getSpec(TTYPE(tree) = LTYPE(tree));
-
-       if (!tree->initMode && IS_CONSTANT(LETYPE(tree)))
-           werror(E_CODE_WRITE," ");
-
-       if (LRVAL(tree)) {
-           werror(E_LVALUE_REQUIRED,"&= or |= or ^= or >>= or <<=");
-           goto errorTreeReturn ;      
-       }
-       LLVAL(tree) = 1;
-       
-       propAsgType(tree);
-       
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*    -= operator             */
-       /*----------------------------*/    
+  TETYPE(tree) = getSpec(TTYPE(tree) = LTYPE(tree));
+
+  if (!tree->initMode && IS_CONSTANT(LETYPE(tree)))
+      werror(E_CODE_WRITE," ");
+
+  if (LRVAL(tree)) {
+      werror(E_LVALUE_REQUIRED,"&= or |= or ^= or >>= or <<=");
+      goto errorTreeReturn ;
+  }
+  LLVAL(tree) = 1;
+
+  propAsgType(tree);
+
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*    -= operator             */
+  /*----------------------------*/
     case SUB_ASSIGN:
-       if (!(IS_PTR(LTYPE(tree))   ||
-             IS_ARITHMETIC(LTYPE(tree)))) {
-           werror(E_PLUS_INVALID,"-=");
-           goto errorTreeReturn ;
-       }
-       
-       if (!(IS_PTR(RTYPE(tree))   ||
-             IS_ARITHMETIC(RTYPE(tree)))) {
-           werror(E_PLUS_INVALID,"-=");
-           goto errorTreeReturn ;
-       }
-       RRVAL(tree) = 1;
-       TETYPE(tree) = getSpec (TTYPE(tree) = 
-                               computeType(LTYPE(tree),
-                                           RTYPE(tree)));  
-
-       if (!tree->initMode && IS_CONSTANT(LETYPE(tree)))
-           werror(E_CODE_WRITE," ");
-
-       if (LRVAL(tree)) {
-           werror(E_LVALUE_REQUIRED,"-=");
-           goto errorTreeReturn ;      
-       }
-       LLVAL(tree) = 1;
-       
-       propAsgType(tree);
-       
-       return tree;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*          += operator       */
-       /*----------------------------*/    
+  if (!(IS_PTR(LTYPE(tree))   ||
+        IS_ARITHMETIC(LTYPE(tree)))) {
+      werror(E_PLUS_INVALID,"-=");
+      goto errorTreeReturn ;
+  }
+
+  if (!(IS_PTR(RTYPE(tree))   ||
+        IS_ARITHMETIC(RTYPE(tree)))) {
+      werror(E_PLUS_INVALID,"-=");
+      goto errorTreeReturn ;
+  }
+  RRVAL(tree) = 1;
+  TETYPE(tree) = getSpec (TTYPE(tree) =
+        computeType(LTYPE(tree),
+              RTYPE(tree)));
+
+  if (!tree->initMode && IS_CONSTANT(LETYPE(tree)))
+      werror(E_CODE_WRITE," ");
+
+  if (LRVAL(tree)) {
+      werror(E_LVALUE_REQUIRED,"-=");
+      goto errorTreeReturn ;
+  }
+  LLVAL(tree) = 1;
+
+  propAsgType(tree);
+
+  return tree;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*          += operator       */
+  /*----------------------------*/
     case ADD_ASSIGN:
-       /* this is not a unary operation */
-       /* if both pointers then problem */
-       if (IS_PTR(LTYPE(tree)) && IS_PTR(RTYPE(tree)) ) {
-           werror(E_PTR_PLUS_PTR);
-           goto errorTreeReturn ;
-       }
-       
-       if (!IS_ARITHMETIC(LTYPE(tree)) && !IS_PTR(LTYPE(tree)))  {
-           werror(E_PLUS_INVALID,"+=");
-           goto errorTreeReturn ;
-       }
-       
-       if (!IS_ARITHMETIC(RTYPE(tree)) && !IS_PTR(RTYPE(tree)))  {
-           werror(E_PLUS_INVALID,"+=");
-           goto errorTreeReturn;
-       }
-       RRVAL(tree) = 1;
-       TETYPE(tree) = getSpec (TTYPE(tree) = 
-                               computeType(LTYPE(tree),
-                                           RTYPE(tree)));  
-
-       if (!tree->initMode && IS_CONSTANT(LETYPE(tree)))
-           werror(E_CODE_WRITE," ");
-
-       if (LRVAL(tree)) {
-           werror(E_LVALUE_REQUIRED,"+=");
-           goto errorTreeReturn ;      
-       }
-
-       tree->right = decorateType(newNode('+',copyAst(tree->left),tree->right));
-       tree->opval.op = '=';       
-       
-       propAsgType(tree);
-       
-       return tree;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*      straight assignemnt   */
-       /*----------------------------*/    
+  /* this is not a unary operation */
+  /* if both pointers then problem */
+  if (IS_PTR(LTYPE(tree)) && IS_PTR(RTYPE(tree)) ) {
+      werror(E_PTR_PLUS_PTR);
+      goto errorTreeReturn ;
+  }
+
+  if (!IS_ARITHMETIC(LTYPE(tree)) && !IS_PTR(LTYPE(tree)))  {
+      werror(E_PLUS_INVALID,"+=");
+      goto errorTreeReturn ;
+  }
+
+  if (!IS_ARITHMETIC(RTYPE(tree)) && !IS_PTR(RTYPE(tree)))  {
+      werror(E_PLUS_INVALID,"+=");
+      goto errorTreeReturn;
+  }
+  RRVAL(tree) = 1;
+  TETYPE(tree) = getSpec (TTYPE(tree) =
+        computeType(LTYPE(tree),
+              RTYPE(tree)));
+
+  if (!tree->initMode && IS_CONSTANT(LETYPE(tree)))
+      werror(E_CODE_WRITE," ");
+
+  if (LRVAL(tree)) {
+      werror(E_LVALUE_REQUIRED,"+=");
+      goto errorTreeReturn ;
+  }
+
+  tree->right = decorateType(newNode('+',copyAst(tree->left),tree->right));
+  tree->opval.op = '=';
+
+  propAsgType(tree);
+
+  return tree;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*      straight assignemnt   */
+  /*----------------------------*/
     case '=' :
-       /* cannot be an aggregate */
-       if (IS_AGGREGATE(LTYPE(tree))) {
-           werror(E_AGGR_ASSIGN);
-           goto errorTreeReturn;
-       }
-           
-       /* they should either match or be castable */
-       if (checkType (LTYPE(tree),RTYPE(tree)) == 0) {
-           werror(E_TYPE_MISMATCH,"assignment"," ");
-           fprintf(stderr,"type --> '"); 
-           printTypeChain (RTYPE(tree),stderr); fprintf(stderr,"' ");
-           fprintf(stderr,"assigned to type --> '"); 
-           printTypeChain (LTYPE(tree),stderr); fprintf(stderr,"'\n");
-           goto errorTreeReturn ;
-       }
-
-       /* if the left side of the tree is of type void
-          then report error */
-       if (IS_VOID(LTYPE(tree))) {
-           werror(E_CAST_ZERO);
-           fprintf(stderr,"type --> '"); 
-           printTypeChain (RTYPE(tree),stderr); fprintf(stderr,"' ");
-           fprintf(stderr,"assigned to type --> '"); 
-           printTypeChain (LTYPE(tree),stderr); fprintf(stderr,"'\n");
-       }
-
-       /* extra checks for pointer types */
-       if (IS_PTR(LTYPE(tree)) && IS_PTR(RTYPE(tree)) &&
-           !IS_GENPTR(LTYPE(tree))) {
-         if (DCL_TYPE(LTYPE(tree)) != DCL_TYPE(RTYPE(tree)))
-           werror(W_PTR_ASSIGN);
-       }
-
-       TETYPE(tree) = getSpec(TTYPE(tree) = 
-                              LTYPE(tree));
-       RRVAL(tree) = 1;
-       LLVAL(tree) = 1;
-       if (!tree->initMode && IS_CONSTANT(LETYPE(tree)))
-           werror(E_CODE_WRITE," ");
-
-       if (LRVAL(tree)) {
-           werror(E_LVALUE_REQUIRED,"=");
-           goto errorTreeReturn ;      
-       }
+  /* cannot be an aggregate */
+  if (IS_AGGREGATE(LTYPE(tree))) {
+      werror(E_AGGR_ASSIGN);
+      goto errorTreeReturn;
+  }
+
+  /* they should either match or be castable */
+  if (checkType (LTYPE(tree),RTYPE(tree)) == 0) {
+      werror(E_TYPE_MISMATCH,"assignment"," ");
+      fprintf(stderr,"type --> '");
+      printTypeChain (RTYPE(tree),stderr); fprintf(stderr,"' ");
+      fprintf(stderr,"assigned to type --> '");
+      printTypeChain (LTYPE(tree),stderr); fprintf(stderr,"'\n");
+      goto errorTreeReturn ;
+  }
+
+  /* if the left side of the tree is of type void
+     then report error */
+  if (IS_VOID(LTYPE(tree))) {
+      werror(E_CAST_ZERO);
+      fprintf(stderr,"type --> '");
+      printTypeChain (RTYPE(tree),stderr); fprintf(stderr,"' ");
+      fprintf(stderr,"assigned to type --> '");
+      printTypeChain (LTYPE(tree),stderr); fprintf(stderr,"'\n");
+  }
+
+  /* extra checks for pointer types */
+  if (IS_PTR(LTYPE(tree)) && IS_PTR(RTYPE(tree)) &&
+      !IS_GENPTR(LTYPE(tree))) {
+    if (DCL_TYPE(LTYPE(tree)) != DCL_TYPE(RTYPE(tree)))
+      werror(W_PTR_ASSIGN);
+  }
+
+  TETYPE(tree) = getSpec(TTYPE(tree) =
+             LTYPE(tree));
+  RRVAL(tree) = 1;
+  LLVAL(tree) = 1;
+  if (!tree->initMode && IS_CONSTANT(LETYPE(tree)))
+      werror(E_CODE_WRITE," ");
+
+  if (LRVAL(tree)) {
+      werror(E_LVALUE_REQUIRED,"=");
+      goto errorTreeReturn ;
+  }
 
         propAsgType(tree);
 
-       return tree ;
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*      comma operator        */
-       /*----------------------------*/        
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*      comma operator        */
+  /*----------------------------*/
     case ',' :
-       TETYPE(tree) = getSpec(TTYPE(tree) =  RTYPE(tree));
-       return tree ;    
-       
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*       function call        */
-       /*----------------------------*/        
+  TETYPE(tree) = getSpec(TTYPE(tree) =  RTYPE(tree));
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*       function call        */
+  /*----------------------------*/
     case CALL   :
-       parmNumber = 1;
-
-       if (processParms (tree->left,
-                         tree->left->args,
-                         tree->right,&parmNumber)) 
-           goto errorTreeReturn ;    
-
-       if (options.stackAuto || IS_RENT(LETYPE(tree))) {
-               tree->left->args = reverseVal(tree->left->args); 
-               reverseParms(tree->right);
-       }
-
-       tree->args = tree->left->args ;
-       TETYPE(tree) = getSpec (TTYPE(tree) = LTYPE(tree)->next);
-       return tree;
-
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*     return statement       */
-       /*----------------------------*/        
+  parmNumber = 1;
+
+  if (processParms (tree->left,
+        tree->left->args,
+        tree->right,&parmNumber))
+      goto errorTreeReturn ;
+
+  if (options.stackAuto || IS_RENT(LETYPE(tree))) {
+    tree->left->args = reverseVal(tree->left->args);
+    reverseParms(tree->right);
+  }
+
+  tree->args = tree->left->args ;
+  TETYPE(tree) = getSpec (TTYPE(tree) = LTYPE(tree)->next);
+  return tree;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*     return statement       */
+  /*----------------------------*/
     case RETURN :
-       if (!tree->right)
-           goto voidcheck ;
-
-       if (checkType(currFunc->type->next,RTYPE(tree)) == 0) {
-           werror(E_RETURN_MISMATCH);
-           goto errorTreeReturn ;
-       }
-
-       if (IS_VOID(currFunc->type->next) 
-           && tree->right && 
-           !IS_VOID(RTYPE(tree))) {
-           werror(E_FUNC_VOID);
-           goto errorTreeReturn ;
-       }
-       
-       /* if there is going to be a casing required then add it */
-       if (checkType(currFunc->type->next,RTYPE(tree)) < 0 ) 
-       {
-#if 0 && defined DEMAND_INTEGER_PROMOTION      
-           if (IS_INTEGRAL(currFunc->type->next))
-           {
-               pushTypeCastToLeaves(currFunc->type->next, tree->right, &(tree->right));
-           }
-           else
-#endif     
-           {
-               tree->right = 
-               decorateType(newNode(CAST,
-                                    newAst_LINK(copyLinkChain(currFunc->type->next)),
-                                    tree->right));
-           }
-       }
-       
-       RRVAL(tree) = 1;
-       return tree;
-
-       voidcheck :
-
-       if (!IS_VOID(currFunc->type->next) && tree->right == NULL ) {
-           werror(E_VOID_FUNC,currFunc->name);
-           goto errorTreeReturn ;
-       }               
-
-       TTYPE(tree) = TETYPE(tree) = NULL ;
-       return tree ;    
-
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /*     switch statement       */
-       /*----------------------------*/        
+  if (!tree->right)
+      goto voidcheck ;
+
+  if (checkType(currFunc->type->next,RTYPE(tree)) == 0) {
+      werror(E_RETURN_MISMATCH);
+      goto errorTreeReturn ;
+  }
+
+  if (IS_VOID(currFunc->type->next)
+      && tree->right &&
+      !IS_VOID(RTYPE(tree))) {
+      werror(E_FUNC_VOID);
+      goto errorTreeReturn ;
+  }
+
+  /* if there is going to be a casing required then add it */
+  if (checkType(currFunc->type->next,RTYPE(tree)) < 0 )
+  {
+#if 0 && defined DEMAND_INTEGER_PROMOTION
+      if (IS_INTEGRAL(currFunc->type->next))
+      {
+        pushTypeCastToLeaves(currFunc->type->next, tree->right, &(tree->right));
+      }
+      else
+#endif
+      {
+        tree->right =
+    decorateType(newNode(CAST,
+             newAst_LINK(copyLinkChain(currFunc->type->next)),
+             tree->right));
+      }
+  }
+
+  RRVAL(tree) = 1;
+  return tree;
+
+  voidcheck :
+
+  if (!IS_VOID(currFunc->type->next) && tree->right == NULL ) {
+      werror(E_VOID_FUNC,currFunc->name);
+      goto errorTreeReturn ;
+  }
+
+  TTYPE(tree) = TETYPE(tree) = NULL ;
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /*     switch statement       */
+  /*----------------------------*/
     case SWITCH:
-       /* the switch value must be an integer */
-       if (!IS_INTEGRAL(LTYPE(tree))) {
-           werror (E_SWITCH_NON_INTEGER);
-           goto errorTreeReturn ;
-       }
-       LRVAL(tree) = 1;
-       TTYPE(tree) = TETYPE(tree) = NULL ;
-       return tree ;
-
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /* ifx Statement              */
-       /*----------------------------*/
+  /* the switch value must be an integer */
+  if (!IS_INTEGRAL(LTYPE(tree))) {
+      werror (E_SWITCH_NON_INTEGER);
+      goto errorTreeReturn ;
+  }
+  LRVAL(tree) = 1;
+  TTYPE(tree) = TETYPE(tree) = NULL ;
+  return tree ;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /* ifx Statement              */
+  /*----------------------------*/
     case IFX:
-       tree->left = backPatchLabels(tree->left,
-                                    tree->trueLabel,
-                                    tree->falseLabel);
-       TTYPE(tree) = TETYPE(tree) = NULL;
-       return tree;
-
-       /*------------------------------------------------------------------*/
-       /*----------------------------*/
-       /* for Statement              */
-       /*----------------------------*/
-    case FOR:             
-
-       decorateType(resolveSymbols(AST_FOR(tree,initExpr)));
-       decorateType(resolveSymbols(AST_FOR(tree,condExpr)));
-       decorateType(resolveSymbols(AST_FOR(tree,loopExpr)));
-       
-       /* if the for loop is reversible then 
-          reverse it otherwise do what we normally
-          do */
-       {
-           symbol *sym ;
-           ast *init, *end;
-
-           if (isLoopReversible (tree,&sym,&init,&end))
-               return reverseLoop (tree,sym,init,end);
-           else
-               return decorateType(createFor ( AST_FOR(tree,trueLabel), 
-                                               AST_FOR(tree,continueLabel) ,
-                                               AST_FOR(tree,falseLabel) ,
-                                               AST_FOR(tree,condLabel)  ,
-                                               AST_FOR(tree,initExpr)   , 
-                                               AST_FOR(tree,condExpr)   , 
-                                               AST_FOR(tree,loopExpr),
-                                               tree->left ) );
-       }
+  tree->left = backPatchLabels(tree->left,
+             tree->trueLabel,
+             tree->falseLabel);
+  TTYPE(tree) = TETYPE(tree) = NULL;
+  return tree;
+
+  /*------------------------------------------------------------------*/
+  /*----------------------------*/
+  /* for Statement              */
+  /*----------------------------*/
+    case FOR:
+
+  decorateType(resolveSymbols(AST_FOR(tree,initExpr)));
+  decorateType(resolveSymbols(AST_FOR(tree,condExpr)));
+  decorateType(resolveSymbols(AST_FOR(tree,loopExpr)));
+
+  /* if the for loop is reversible then
+     reverse it otherwise do what we normally
+     do */
+  {
+      symbol *sym ;
+      ast *init, *end;
+
+      if (isLoopReversible (tree,&sym,&init,&end))
+    return reverseLoop (tree,sym,init,end);
+      else
+    return decorateType(createFor ( AST_FOR(tree,trueLabel),
+            AST_FOR(tree,continueLabel) ,
+            AST_FOR(tree,falseLabel) ,
+            AST_FOR(tree,condLabel)  ,
+            AST_FOR(tree,initExpr)   ,
+            AST_FOR(tree,condExpr)   ,
+            AST_FOR(tree,loopExpr),
+            tree->left ) );
+  }
     default :
-       TTYPE(tree) = TETYPE(tree) = NULL ;
-       return tree ;    
+  TTYPE(tree) = TETYPE(tree) = NULL ;
+  return tree ;
     }
-    
+
     /* some error found this tree will be killed */
-    errorTreeReturn :     
-       TTYPE(tree) = TETYPE(tree) = newCharLink();
+    errorTreeReturn :
+  TTYPE(tree) = TETYPE(tree) = newCharLink();
     tree->opval.op = NULLOP ;
     tree->isError = 1;
-    
+
     return tree ;
 }
 
@@ -2904,13 +2904,13 @@ ast *decorateType (ast *tree)
 /*-----------------------------------------------------------------*/
 value  *sizeofOp( sym_link  *type)
 {
-       char buff[10];
+  char buff[10];
 
-       /* get the size and convert it to character  */
-       sprintf (buff,"%d", getSize(type));
+  /* get the size and convert it to character  */
+  sprintf (buff,"%d", getSize(type));
 
-       /* now convert into value  */
-       return  constVal (buff);      
+  /* now convert into value  */
+  return  constVal (buff);
 }
 
 
@@ -2926,89 +2926,89 @@ value  *sizeofOp( sym_link  *type)
 /* backPatchLabels - change and or not operators to flow control    */
 /*-----------------------------------------------------------------*/
 ast *backPatchLabels (ast *tree, symbol *trueLabel, symbol *falseLabel )
-{  
-    
+{
+
     if ( ! tree )
-       return NULL ;
-    
+  return NULL ;
+
     if ( ! (IS_ANDORNOT(tree)))
-       return tree ;
-    
+  return tree ;
+
     /* if this an and */
     if (IS_AND(tree)) {
-       static int localLbl = 0 ;
-       symbol *localLabel ;
-       
-       sprintf (buffer,"_and_%d",localLbl++);
-       localLabel = newSymbol(buffer,NestLevel);
-       
-       tree->left = backPatchLabels (tree->left, localLabel,falseLabel);    
-       
-       /* if left is already a IFX then just change the if true label in that */
-       if (!IS_IFX(tree->left)) 
-           tree->left = newIfxNode(tree->left,localLabel,falseLabel);
-       
-       tree->right = backPatchLabels(tree->right,trueLabel,falseLabel);    
-       /* right is a IFX then just join */
-       if (IS_IFX(tree->right))
-           return newNode(NULLOP,tree->left,createLabel(localLabel,tree->right));
-       
-       tree->right = createLabel(localLabel,tree->right);
-       tree->right = newIfxNode(tree->right,trueLabel,falseLabel);
-       
-       return newNode(NULLOP,tree->left,tree->right);
-    }
-    
+  static int localLbl = 0 ;
+  symbol *localLabel ;
+
+  sprintf (buffer,"_and_%d",localLbl++);
+  localLabel = newSymbol(buffer,NestLevel);
+
+  tree->left = backPatchLabels (tree->left, localLabel,falseLabel);
+
+  /* if left is already a IFX then just change the if true label in that */
+  if (!IS_IFX(tree->left))
+      tree->left = newIfxNode(tree->left,localLabel,falseLabel);
+
+  tree->right = backPatchLabels(tree->right,trueLabel,falseLabel);
+  /* right is a IFX then just join */
+  if (IS_IFX(tree->right))
+      return newNode(NULLOP,tree->left,createLabel(localLabel,tree->right));
+
+  tree->right = createLabel(localLabel,tree->right);
+  tree->right = newIfxNode(tree->right,trueLabel,falseLabel);
+
+  return newNode(NULLOP,tree->left,tree->right);
+    }
+
     /* if this is an or operation */
     if (IS_OR(tree)) {
-       static int localLbl = 0 ;
-       symbol *localLabel ;
-       
-       sprintf (buffer,"_or_%d",localLbl++);
-       localLabel = newSymbol(buffer,NestLevel);
-       
-       tree->left = backPatchLabels (tree->left, trueLabel,localLabel);    
-       
-       /* if left is already a IFX then just change the if true label in that */
-       if (!IS_IFX(tree->left))                
-           tree->left = newIfxNode(tree->left,trueLabel,localLabel);
-       
-       tree->right = backPatchLabels(tree->right,trueLabel,falseLabel);    
-       /* right is a IFX then just join */
-       if (IS_IFX(tree->right))
-           return newNode(NULLOP,tree->left,createLabel(localLabel,tree->right));
-       
-       tree->right = createLabel(localLabel,tree->right);
-       tree->right = newIfxNode(tree->right,trueLabel,falseLabel);
-       
-       return newNode(NULLOP,tree->left,tree->right);
-    }
-    
+  static int localLbl = 0 ;
+  symbol *localLabel ;
+
+  sprintf (buffer,"_or_%d",localLbl++);
+  localLabel = newSymbol(buffer,NestLevel);
+
+  tree->left = backPatchLabels (tree->left, trueLabel,localLabel);
+
+  /* if left is already a IFX then just change the if true label in that */
+  if (!IS_IFX(tree->left))
+      tree->left = newIfxNode(tree->left,trueLabel,localLabel);
+
+  tree->right = backPatchLabels(tree->right,trueLabel,falseLabel);
+  /* right is a IFX then just join */
+  if (IS_IFX(tree->right))
+      return newNode(NULLOP,tree->left,createLabel(localLabel,tree->right));
+
+  tree->right = createLabel(localLabel,tree->right);
+  tree->right = newIfxNode(tree->right,trueLabel,falseLabel);
+
+  return newNode(NULLOP,tree->left,tree->right);
+    }
+
     /* change not */
     if (IS_NOT(tree)) {
-       int wasnot = IS_NOT(tree->left);
-       tree->left = backPatchLabels (tree->left,falseLabel,trueLabel);
-       
-       /* if the left is already a IFX */
-       if ( ! IS_IFX(tree->left) ) 
-           tree->left = newNode (IFX,tree->left,NULL);
-       
-       if (wasnot) {
-           tree->left->trueLabel = trueLabel ;
-           tree->left->falseLabel= falseLabel ;
-       } else {
-           tree->left->trueLabel = falseLabel ;
-           tree->left->falseLabel= trueLabel ;
-       }
-       return tree->left ;
-    }
-    
+  int wasnot = IS_NOT(tree->left);
+  tree->left = backPatchLabels (tree->left,falseLabel,trueLabel);
+
+  /* if the left is already a IFX */
+  if ( ! IS_IFX(tree->left) )
+      tree->left = newNode (IFX,tree->left,NULL);
+
+  if (wasnot) {
+      tree->left->trueLabel = trueLabel ;
+      tree->left->falseLabel= falseLabel ;
+  } else {
+      tree->left->trueLabel = falseLabel ;
+      tree->left->falseLabel= trueLabel ;
+  }
+  return tree->left ;
+    }
+
     if (IS_IFX(tree)) {
-       tree->trueLabel = trueLabel ;
-       tree->falseLabel= falseLabel;
+  tree->trueLabel = trueLabel ;
+  tree->falseLabel= falseLabel;
     }
-    
-    return tree ;    
+
+    return tree ;
 }
 
 
@@ -3018,14 +3018,14 @@ ast *backPatchLabels (ast *tree, symbol *trueLabel, symbol *falseLabel )
 ast  *createBlock   ( symbol *decl,   ast  *body )
 {
     ast *ex ;
-    
+
     /* if the block has nothing */
     if (!body)
-       return NULL;
+  return NULL;
 
     ex = newNode(BLOCK,NULL,body);
     ex->values.sym = decl ;
-    
+
     ex->right = ex->right ;
     ex->level++ ;
     ex->lineno = 0 ;
@@ -3038,32 +3038,32 @@ ast  *createBlock   ( symbol *decl,   ast  *body )
 ast  *createLabel  ( symbol  *label,  ast  *stmnt  )
 {
     symbol *csym;
-    char       name[SDCC_NAME_MAX+1];
+    char  name[SDCC_NAME_MAX+1];
     ast   *rValue ;
-    
+
     /* must create fresh symbol if the symbol name  */
     /* exists in the symbol table, since there can  */
     /* be a variable with the same name as the labl */
     if ((csym = findSym (SymbolTab,NULL,label->name)) &&
         (csym->level == label->level))
-       label = newSymbol(label->name,label->level);
-    
+  label = newSymbol(label->name,label->level);
+
     /* change the name before putting it in add _*/
     sprintf (name,"%s",label->name);
-    
+
     /* put the label in the LabelSymbol table    */
     /* but first check if a label of the same    */
     /* name exists                               */
     if ( (csym = findSym(LabelTab,NULL,name)))
-       werror(E_DUPLICATE_LABEL,label->name);
+  werror(E_DUPLICATE_LABEL,label->name);
     else
-       addSym (LabelTab, label, name,label->level,0);
-    
+  addSym (LabelTab, label, name,label->level,0);
+
     label->islbl = 1;
     label->key = labelKey++ ;
-    rValue =  newNode (LABEL,newAst_VALUE(symbolVal(label)),stmnt);  
+    rValue =  newNode (LABEL,newAst_VALUE(symbolVal(label)),stmnt);
     rValue->lineno = 0;
-    
+
     return rValue ;
 }
 
@@ -3075,63 +3075,63 @@ ast  *createCase (ast *swStat, ast *caseVal, ast *stmnt   )
     char caseLbl[SDCC_NAME_MAX+1];
     ast *rexpr;
     value *val;
-    
+
     /* if the switch statement does not exist */
     /* then case is out of context            */
     if (!swStat) {
-       werror(E_CASE_CONTEXT);
-       return NULL ;
+  werror(E_CASE_CONTEXT);
+  return NULL ;
     }
-    
+
     caseVal = decorateType(resolveSymbols(caseVal));
     /* if not a constant then error  */
     if (!IS_LITERAL(caseVal->ftype)) {
-       werror(E_CASE_CONSTANT);
-       return NULL ;
+  werror(E_CASE_CONSTANT);
+  return NULL ;
     }
-    
+
     /* if not a integer than error */
     if (!IS_INTEGRAL(caseVal->ftype)) {
-       werror(E_CASE_NON_INTEGER);
-       return NULL;
+  werror(E_CASE_NON_INTEGER);
+  return NULL;
     }
 
     /* find the end of the switch values chain   */
     if (!(val = swStat->values.switchVals.swVals))
-       swStat->values.switchVals.swVals = caseVal->opval.val ;
+  swStat->values.switchVals.swVals = caseVal->opval.val ;
     else {
-       /* also order the cases according to value */
-       value *pval = NULL;
-       int cVal = (int) floatFromVal(caseVal->opval.val);
-       while (val && (int) floatFromVal(val) < cVal) {
-           pval = val;
-           val = val->next ;
-       }
-       
-       /* if we reached the end then */
-       if (!val) {
-           pval->next =  caseVal->opval.val;
-       } else {
-           /* we found a value greater than */
-           /* the current value we must add this */
-           /* before the value */
-           caseVal->opval.val->next = val;
-
-           /* if this was the first in chain */
-           if (swStat->values.switchVals.swVals == val)
-               swStat->values.switchVals.swVals = 
-                   caseVal->opval.val;
-           else
-               pval->next =  caseVal->opval.val;
-       }
-           
-    }
-    
+  /* also order the cases according to value */
+  value *pval = NULL;
+  int cVal = (int) floatFromVal(caseVal->opval.val);
+  while (val && (int) floatFromVal(val) < cVal) {
+      pval = val;
+      val = val->next ;
+  }
+
+  /* if we reached the end then */
+  if (!val) {
+      pval->next =  caseVal->opval.val;
+  } else {
+      /* we found a value greater than */
+      /* the current value we must add this */
+      /* before the value */
+      caseVal->opval.val->next = val;
+
+      /* if this was the first in chain */
+      if (swStat->values.switchVals.swVals == val)
+    swStat->values.switchVals.swVals =
+        caseVal->opval.val;
+      else
+    pval->next =  caseVal->opval.val;
+  }
+
+    }
+
     /* create the case label   */
     sprintf(caseLbl,"_case_%d_%d",
-           swStat->values.switchVals.swNum,
-           (int) floatFromVal(caseVal->opval.val));
-    
+      swStat->values.switchVals.swNum,
+      (int) floatFromVal(caseVal->opval.val));
+
     rexpr = createLabel(newSymbol(caseLbl,0),stmnt);
     rexpr->lineno = 0;
     return rexpr;
@@ -3143,20 +3143,20 @@ ast  *createCase (ast *swStat, ast *caseVal, ast *stmnt   )
 ast  *createDefault (ast *swStat, ast *stmnt)
 {
     char  defLbl[SDCC_NAME_MAX+1];
-    
+
     /* if the switch statement does not exist */
     /* then case is out of context            */
     if (!swStat) {
-       werror(E_CASE_CONTEXT);
-       return NULL ;
+  werror(E_CASE_CONTEXT);
+  return NULL ;
     }
-    
+
     /* turn on the default flag   */
     swStat->values.switchVals.swDefault = 1   ;
-    
+
     /* create the label  */
     sprintf (defLbl,"_default_%d",swStat->values.switchVals.swNum);
-    return createLabel(newSymbol(defLbl,0),stmnt);   
+    return createLabel(newSymbol(defLbl,0),stmnt);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3167,55 +3167,55 @@ ast *createIf ( ast *condAst, ast *ifBody, ast *elseBody )
     static int Lblnum = 0 ;
     ast *ifTree ;
     symbol *ifTrue , *ifFalse, *ifEnd ;
-    
+
     /* if neither exists */
     if (! elseBody && !ifBody)
-       return condAst ;
-    
+  return condAst ;
+
     /* create the labels */
     sprintf (buffer,"_iffalse_%d",Lblnum);
     ifFalse = newSymbol (buffer,NestLevel);
     /* if no else body then end == false */
-    if ( ! elseBody ) 
-       ifEnd = ifFalse ;
+    if ( ! elseBody )
+  ifEnd = ifFalse ;
     else {
-       sprintf (buffer,"_ifend_%d",Lblnum);
-       ifEnd = newSymbol (buffer,NestLevel);
+  sprintf (buffer,"_ifend_%d",Lblnum);
+  ifEnd = newSymbol (buffer,NestLevel);
     }
 
     sprintf (buffer,"_iftrue_%d",Lblnum);
     ifTrue = newSymbol (buffer,NestLevel);
-       
+
     Lblnum++ ;
 
     /* attach the ifTrue label to the top of it body */
     ifBody = createLabel(ifTrue,ifBody);
     /* attach a goto end to the ifBody if else is present */
     if ( elseBody ) {
-       ifBody = newNode(NULLOP,ifBody,
-                        newNode(GOTO,
-                                newAst_VALUE(symbolVal(ifEnd)),
-                                NULL));
-       /* put the elseLabel on the else body */
-       elseBody = createLabel (ifFalse,elseBody);
-       /* out the end at the end of the body */
-       elseBody = newNode(NULLOP,
-                          elseBody,
-                          createLabel(ifEnd,NULL));
+  ifBody = newNode(NULLOP,ifBody,
+       newNode(GOTO,
+         newAst_VALUE(symbolVal(ifEnd)),
+         NULL));
+  /* put the elseLabel on the else body */
+  elseBody = createLabel (ifFalse,elseBody);
+  /* out the end at the end of the body */
+  elseBody = newNode(NULLOP,
+         elseBody,
+         createLabel(ifEnd,NULL));
     }
     else {
-       ifBody = newNode(NULLOP,ifBody,
-                        createLabel(ifFalse,NULL));
+  ifBody = newNode(NULLOP,ifBody,
+       createLabel(ifFalse,NULL));
     }
     condAst = backPatchLabels (condAst,ifTrue,ifFalse);
     if (IS_IFX(condAst))
-       ifTree = condAst;
-    else 
-       ifTree = newIfxNode(condAst,ifTrue,ifFalse);
-    
+  ifTree = condAst;
+    else
+  ifTree = newIfxNode(condAst,ifTrue,ifFalse);
+
     return newNode(NULLOP,ifTree,
-                  newNode(NULLOP,ifBody,elseBody));
-    
+       newNode(NULLOP,ifBody,elseBody));
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -3229,38 +3229,38 @@ ast *createIf ( ast *condAst, ast *ifBody, ast *elseBody )
 /*        _dobreak_n:                                              */
 /*-----------------------------------------------------------------*/
 ast *createDo ( symbol *trueLabel, symbol *continueLabel,
-               symbol *falseLabel, ast *condAst, ast *doBody )
+    symbol *falseLabel, ast *condAst, ast *doBody )
 {
     ast *doTree ;
-    
-    
+
+
     /* if the body does not exist then it is simple */
     if ( ! doBody ) {
-       condAst = backPatchLabels(condAst,continueLabel,NULL);
-       doTree = (IS_IFX(condAst) ? createLabel(continueLabel,condAst) 
-                 : newNode(IFX,createLabel(continueLabel,condAst),NULL));
-       doTree->trueLabel = continueLabel ;
-       doTree->falseLabel= NULL ;
-       return doTree ;
-    }
-    
+  condAst = backPatchLabels(condAst,continueLabel,NULL);
+  doTree = (IS_IFX(condAst) ? createLabel(continueLabel,condAst)
+      : newNode(IFX,createLabel(continueLabel,condAst),NULL));
+  doTree->trueLabel = continueLabel ;
+  doTree->falseLabel= NULL ;
+  return doTree ;
+    }
+
     /* otherwise we have a body */
     condAst = backPatchLabels(condAst,trueLabel,falseLabel);
-    
+
     /* attach the body label to the top */
     doBody = createLabel(trueLabel,doBody);
     /* attach the continue label to end of body */
-    doBody = newNode(NULLOP, doBody, 
-                    createLabel(continueLabel,NULL));
-    
+    doBody = newNode(NULLOP, doBody,
+         createLabel(continueLabel,NULL));
+
     /* now put the break label at the end */
     if (IS_IFX(condAst))
-       doTree = condAst;
-    else 
-       doTree = newIfxNode(condAst,trueLabel,falseLabel);
-    
+  doTree = condAst;
+    else
+  doTree = newIfxNode(condAst,trueLabel,falseLabel);
+
     doTree = newNode(NULLOP,doTree,createLabel(falseLabel,NULL));
-    
+
     /* putting it together */
     return newNode(NULLOP,doBody,doTree);
 }
@@ -3280,46 +3280,46 @@ ast *createDo ( symbol *trueLabel, symbol *continueLabel,
 /*   _forbreak_n:                                                  */
 /*-----------------------------------------------------------------*/
 ast *createFor ( symbol *trueLabel, symbol *continueLabel ,
-                symbol *falseLabel,symbol *condLabel     ,
-                ast *initExpr, ast *condExpr, ast *loopExpr,
-                ast *forBody )
+     symbol *falseLabel,symbol *condLabel     ,
+     ast *initExpr, ast *condExpr, ast *loopExpr,
+     ast *forBody )
 {
-    ast *forTree ;      
+    ast *forTree ;
 
     /* if loopexpression not present then we can generate it */
     /* the same way as a while */
-    if ( ! loopExpr ) 
-       return newNode(NULLOP,initExpr,
-                      createWhile (trueLabel, continueLabel, 
-                                   falseLabel,condExpr, forBody ));
+    if ( ! loopExpr )
+  return newNode(NULLOP,initExpr,
+           createWhile (trueLabel, continueLabel,
+            falseLabel,condExpr, forBody ));
     /* vanilla for statement */
     condExpr = backPatchLabels(condExpr,trueLabel,falseLabel);
-    
-    if (condExpr && !IS_IFX(condExpr)) 
-       condExpr = newIfxNode(condExpr,trueLabel,falseLabel);
-    
-    
+
+    if (condExpr && !IS_IFX(condExpr))
+  condExpr = newIfxNode(condExpr,trueLabel,falseLabel);
+
+
     /* attach condition label to condition */
     condExpr = createLabel(condLabel,condExpr);
-    
+
     /* attach body label to body */
     forBody = createLabel(trueLabel,forBody);
-    
+
     /* attach continue to forLoop expression & attach */
     /* goto the forcond @ and of loopExpression       */
     loopExpr = createLabel(continueLabel,
-                          newNode(NULLOP,
-                                  loopExpr,
-                                  newNode(GOTO,
-                                          newAst_VALUE(symbolVal(condLabel)),
-                                          NULL)));
+         newNode(NULLOP,
+           loopExpr,
+           newNode(GOTO,
+             newAst_VALUE(symbolVal(condLabel)),
+             NULL)));
     /* now start putting them together */
     forTree = newNode(NULLOP,initExpr,condExpr);
     forTree = newNode(NULLOP,forTree,forBody);
     forTree = newNode(NULLOP,forTree,loopExpr);
     /* finally add the break label */
     forTree = newNode(NULLOP,forTree,
-                     createLabel(falseLabel,NULL));
+          createLabel(falseLabel,NULL));
     return forTree ;
 }
 
@@ -3336,37 +3336,37 @@ ast *createFor ( symbol *trueLabel, symbol *continueLabel ,
 /*            goto _while_continue_n                               */
 /*      _while_break_n:                                            */
 /*-----------------------------------------------------------------*/
-ast *createWhile (symbol *trueLabel, symbol *continueLabel, 
-                  symbol *falseLabel,ast *condExpr, ast *whileBody )
+ast *createWhile (symbol *trueLabel, symbol *continueLabel,
+       symbol *falseLabel,ast *condExpr, ast *whileBody )
 {
     ast *whileTree ;
-        
+
     /* put the continue label */
     condExpr = backPatchLabels (condExpr,trueLabel,falseLabel);
     condExpr = createLabel(continueLabel,condExpr);
     condExpr->lineno = 0;
-    
+
     /* put the body label in front of the body */
     whileBody = createLabel(trueLabel,whileBody);
     whileBody->lineno = 0;
     /* put a jump to continue at the end of the body */
     /* and put break label at the end of the body */
     whileBody = newNode(NULLOP,
-                       whileBody,
-                       newNode(GOTO,
-                               newAst_VALUE(symbolVal(continueLabel)),
-                               createLabel(falseLabel,NULL)));
-    
+      whileBody,
+      newNode(GOTO,
+        newAst_VALUE(symbolVal(continueLabel)),
+        createLabel(falseLabel,NULL)));
+
     /* put it all together */
     if ( IS_IFX(condExpr) )
-       whileTree = condExpr ;
+  whileTree = condExpr ;
     else {
-       whileTree = newNode (IFX, condExpr,NULL );      
-       /* put the true & false labels in place */
-       whileTree->trueLabel = trueLabel ;
-       whileTree->falseLabel= falseLabel;
+  whileTree = newNode (IFX, condExpr,NULL );
+  /* put the true & false labels in place */
+  whileTree->trueLabel = trueLabel ;
+  whileTree->falseLabel= falseLabel;
     }
-    
+
     return newNode(NULLOP,whileTree,whileBody );
 }
 
@@ -3378,28 +3378,28 @@ ast *optimizeGetHbit (ast *tree)
     int i,j;
     /* if this is not a bit and */
     if (!IS_BITAND(tree))
-       return tree;
-    
+  return tree;
+
     /* will look for tree of the form
        ( expr >> ((sizeof expr) -1) ) & 1 */
     if (!IS_AST_LIT_VALUE(tree->right))
-       return tree;
+  return tree;
 
     if (AST_LIT_VALUE(tree->right) != 1)
-       return tree;
+  return tree;
 
     if (!IS_RIGHT_OP(tree->left))
-       return tree;
+  return tree;
 
     if (!IS_AST_LIT_VALUE(tree->left->right))
-       return tree;
+  return tree;
 
     if ((i = AST_LIT_VALUE(tree->left->right)) !=
-       ( j = (getSize(TTYPE(tree->left->left))*8 - 1)))
-       return tree;
+  ( j = (getSize(TTYPE(tree->left->left))*8 - 1)))
+  return tree;
 
     return decorateType(newNode(GETHBIT,tree->left->left,NULL));
-       
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -3411,133 +3411,133 @@ ast *optimizeRRCRLC ( ast *root )
        (?expr << 1) | (?expr >> 7) or
        (?expr >> 7) | (?expr << 1) will make that
        into a RLC : operation ..
-       Will also look for 
+       Will also look for
        (?expr >> 1) | (?expr << 7) or
        (?expr << 7) | (?expr >> 1) will make that
-       into a RRC operation 
+       into a RRC operation
        note : by 7 I mean (number of bits required to hold the
        variable -1 ) */
     /* if the root operations is not a | operation the not */
     if (!IS_BITOR(root))
-       return root ;
+  return root ;
 
     /* I have to think of a better way to match patterns this sucks */
     /* that aside let start looking for the first case : I use a the
        negative check a lot to improve the efficiency */
     /* (?expr << 1) | (?expr >> 7) */
-    if (IS_LEFT_OP(root->left)    && 
-       IS_RIGHT_OP(root->right)  ) {   
-       
-       if (!SPEC_USIGN(TETYPE(root->left->left)))
-           return root;
-
-       if (!IS_AST_LIT_VALUE(root->left->right) ||
-           !IS_AST_LIT_VALUE(root->right->right))
-           goto tryNext0;
-
-       /* make sure it is the same expression */
-       if (!isAstEqual(root->left->left,
-                       root->right->left))
-           goto tryNext0;
-       
-       if (AST_LIT_VALUE(root->left->right) != 1 )
-           goto tryNext0 ;
-       
-       if (AST_LIT_VALUE(root->right->right) !=
-           (getSize(TTYPE(root->left->left))*8 - 1))
-           goto tryNext0 ;
-
-       /* whew got the first case : create the AST */
-       return  newNode(RLC,root->left->left,NULL);     
+    if (IS_LEFT_OP(root->left)    &&
+  IS_RIGHT_OP(root->right)  ) {
+
+  if (!SPEC_USIGN(TETYPE(root->left->left)))
+      return root;
+
+  if (!IS_AST_LIT_VALUE(root->left->right) ||
+      !IS_AST_LIT_VALUE(root->right->right))
+      goto tryNext0;
+
+  /* make sure it is the same expression */
+  if (!isAstEqual(root->left->left,
+      root->right->left))
+      goto tryNext0;
+
+  if (AST_LIT_VALUE(root->left->right) != 1 )
+      goto tryNext0 ;
+
+  if (AST_LIT_VALUE(root->right->right) !=
+      (getSize(TTYPE(root->left->left))*8 - 1))
+      goto tryNext0 ;
+
+  /* whew got the first case : create the AST */
+  return  newNode(RLC,root->left->left,NULL);
     }
 
  tryNext0:
     /* check for second case */
     /* (?expr >> 7) | (?expr << 1) */
-    if (IS_LEFT_OP(root->right)    && 
-       IS_RIGHT_OP(root->left)  ) {     
-
-       if (!SPEC_USIGN(TETYPE(root->left->left)))
-           return root;
-       
-       if (!IS_AST_LIT_VALUE(root->left->right) ||
-           !IS_AST_LIT_VALUE(root->right->right))
-           goto tryNext1 ;
-       
-       /* make sure it is the same symbol */
-       if (!isAstEqual(root->left->left,
-                       root->right->left))
-           goto tryNext1 ;
-       
-       if (AST_LIT_VALUE(root->right->right) != 1 )
-           goto tryNext1 ;
-       
-       if (AST_LIT_VALUE(root->left->right) !=
-           (getSize(TTYPE(root->left->left))*8 - 1))
-           goto tryNext1 ;
-
-       /* whew got the first case : create the AST */
-       return  newNode(RLC,root->left->left,NULL);
-       
+    if (IS_LEFT_OP(root->right)    &&
+  IS_RIGHT_OP(root->left)  ) {
+
+  if (!SPEC_USIGN(TETYPE(root->left->left)))
+      return root;
+
+  if (!IS_AST_LIT_VALUE(root->left->right) ||
+      !IS_AST_LIT_VALUE(root->right->right))
+      goto tryNext1 ;
+
+  /* make sure it is the same symbol */
+  if (!isAstEqual(root->left->left,
+      root->right->left))
+      goto tryNext1 ;
+
+  if (AST_LIT_VALUE(root->right->right) != 1 )
+      goto tryNext1 ;
+
+  if (AST_LIT_VALUE(root->left->right) !=
+      (getSize(TTYPE(root->left->left))*8 - 1))
+      goto tryNext1 ;
+
+  /* whew got the first case : create the AST */
+  return  newNode(RLC,root->left->left,NULL);
+
     }
 
  tryNext1:
     /* third case for RRC */
     /*  (?symbol >> 1) | (?symbol << 7) */
-    if (IS_LEFT_OP(root->right)    && 
-       IS_RIGHT_OP(root->left)  ) {    
-
-       if (!SPEC_USIGN(TETYPE(root->left->left)))
-           return root;
-       
-       if (!IS_AST_LIT_VALUE(root->left->right) ||
-           !IS_AST_LIT_VALUE(root->right->right))
-           goto tryNext2;
-       
-       /* make sure it is the same symbol */
-       if (!isAstEqual(root->left->left,
-                       root->right->left))
-           goto tryNext2;
-       
-       if (AST_LIT_VALUE(root->left->right) != 1 )
-           goto tryNext2;
-       
-       if (AST_LIT_VALUE(root->right->right) !=
-           (getSize(TTYPE(root->left->left))*8 - 1))
-           goto tryNext2;
-
-       /* whew got the first case : create the AST */
-       return newNode(RRC,root->left->left,NULL);
-       
+    if (IS_LEFT_OP(root->right)    &&
+  IS_RIGHT_OP(root->left)  ) {
+
+  if (!SPEC_USIGN(TETYPE(root->left->left)))
+      return root;
+
+  if (!IS_AST_LIT_VALUE(root->left->right) ||
+      !IS_AST_LIT_VALUE(root->right->right))
+      goto tryNext2;
+
+  /* make sure it is the same symbol */
+  if (!isAstEqual(root->left->left,
+      root->right->left))
+      goto tryNext2;
+
+  if (AST_LIT_VALUE(root->left->right) != 1 )
+      goto tryNext2;
+
+  if (AST_LIT_VALUE(root->right->right) !=
+      (getSize(TTYPE(root->left->left))*8 - 1))
+      goto tryNext2;
+
+  /* whew got the first case : create the AST */
+  return newNode(RRC,root->left->left,NULL);
+
     }
  tryNext2:
     /* fourth and last case for now */
     /* (?symbol << 7) | (?symbol >> 1) */
-    if (IS_RIGHT_OP(root->right)    && 
-       IS_LEFT_OP(root->left)  ) {     
-
-       if (!SPEC_USIGN(TETYPE(root->left->left)))
-           return root;
-       
-       if (!IS_AST_LIT_VALUE(root->left->right) ||
-           !IS_AST_LIT_VALUE(root->right->right))
-           return root;
-
-       /* make sure it is the same symbol */
-       if (!isAstEqual(root->left->left,
-                       root->right->left))
-           return root;
-       
-       if (AST_LIT_VALUE(root->right->right) != 1 )
-           return root ;
-       
-       if (AST_LIT_VALUE(root->left->right) !=
-           (getSize(TTYPE(root->left->left))*8 - 1))
-           return root ;
-
-       /* whew got the first case : create the AST */
-       return  newNode(RRC,root->left->left,NULL);
-       
+    if (IS_RIGHT_OP(root->right)    &&
+  IS_LEFT_OP(root->left)  ) {
+
+  if (!SPEC_USIGN(TETYPE(root->left->left)))
+      return root;
+
+  if (!IS_AST_LIT_VALUE(root->left->right) ||
+      !IS_AST_LIT_VALUE(root->right->right))
+      return root;
+
+  /* make sure it is the same symbol */
+  if (!isAstEqual(root->left->left,
+      root->right->left))
+      return root;
+
+  if (AST_LIT_VALUE(root->right->right) != 1 )
+      return root ;
+
+  if (AST_LIT_VALUE(root->left->right) !=
+      (getSize(TTYPE(root->left->left))*8 - 1))
+      return root ;
+
+  /* whew got the first case : create the AST */
+  return  newNode(RRC,root->left->left,NULL);
+
     }
 
     /* not found return root */
@@ -3545,114 +3545,114 @@ ast *optimizeRRCRLC ( ast *root )
 }
 
 /*-----------------------------------------------------------------*/
-/* optimizeCompare - otimizes compares for bit variables          */
+/* optimizeCompare - otimizes compares for bit variables     */
 /*-----------------------------------------------------------------*/
 ast  *optimizeCompare ( ast *root )
 {
-    ast        *optExpr = NULL;
-    value      *vleft;
-    value      *vright;
+    ast *optExpr = NULL;
+    value *vleft;
+    value *vright;
     unsigned int litValue ;
-    
+
     /* if nothing then return nothing */
     if (!root)
-       return NULL ;
-    
+  return NULL ;
+
     /* if not a compare op then do leaves */
     if (!IS_COMPARE_OP(root)) {
-       root->left = optimizeCompare (root->left);
-       root->right= optimizeCompare (root->right);
-       return root ;
+  root->left = optimizeCompare (root->left);
+  root->right= optimizeCompare (root->right);
+  return root ;
     }
-    
-    /* if left & right are the same then depending 
+
+    /* if left & right are the same then depending
        of the operation do */
     if (isAstEqual(root->left,root->right)) {
-       switch (root->opval.op) {
-       case '>' :
-       case '<' :
-       case NE_OP :
-           optExpr = newAst_VALUE(constVal("0"));
-           break;
-       case GE_OP :
-       case LE_OP :
-       case EQ_OP :
-           optExpr = newAst_VALUE(constVal("1"));
-           break;
-       }
-
-       return decorateType(optExpr);
+  switch (root->opval.op) {
+  case '>' :
+  case '<' :
+  case NE_OP :
+      optExpr = newAst_VALUE(constVal("0"));
+      break;
+  case GE_OP :
+  case LE_OP :
+  case EQ_OP :
+      optExpr = newAst_VALUE(constVal("1"));
+      break;
+  }
+
+  return decorateType(optExpr);
     }
 
     vleft = (root->left->type == EX_VALUE ?
-            root->left->opval.val : NULL );
-    
+       root->left->opval.val : NULL );
+
     vright = (root->right->type == EX_VALUE ?
-             root->right->opval.val : NULL);
-    
+        root->right->opval.val : NULL);
+
     /* if left is a BITVAR in BITSPACE */
     /* and right is a LITERAL then opt-*/
-    /* imize else do nothing              */
+    /* imize else do nothing       */
     if (vleft && vright                   &&
-       IS_BITVAR(vleft->etype)           && 
-       IN_BITSPACE(SPEC_OCLS(vleft->etype))  &&
-       IS_LITERAL(vright->etype)) {
-       
-       /* if right side > 1 then comparison may never succeed */
-       if ( (litValue = (int) floatFromVal(vright)) > 1 ) {
-           werror(W_BAD_COMPARE);
-           goto noOptimize ;
-       }
-       
-       if ( litValue ) {
-           switch (root->opval.op) {
-           case '>' :  /* bit value greater than 1 cannot be */
-               werror(W_BAD_COMPARE);
-               goto noOptimize ;
-               break;
-               
-           case '<' : /* bit value < 1 means 0 */
-           case NE_OP :
-               optExpr = newNode('!',newAst_VALUE(vleft),NULL);
-               break;
-               
-           case LE_OP : /* bit value <= 1 means no check */
-               optExpr = newAst_VALUE(vright);         
-               break;
-               
-           case GE_OP : /* bit value >= 1 means only check for = */
-           case EQ_OP :
-               optExpr = newAst_VALUE(vleft);          
-               break;
-           }
-       } else { /* literal is zero */
-           switch (root->opval.op) {
-           case '<' :  /* bit value < 0 cannot be */
-               werror(W_BAD_COMPARE);
-               goto noOptimize ;
-               break;
-               
-           case '>' : /* bit value > 0 means 1 */
-           case NE_OP :
-               optExpr = newAst_VALUE(vleft);       
-               break;
-               
-           case LE_OP : /* bit value <= 0 means no check */
-           case GE_OP : /* bit value >= 0 means no check */
-               werror(W_BAD_COMPARE);
-               goto noOptimize ;
-               break;
-               
-           case EQ_OP : /* bit == 0 means ! of bit */
-               optExpr = newNode('!',newAst_VALUE(vleft),NULL);              
-               break;
-           }
-       }                      
-       return decorateType(resolveSymbols(optExpr)); 
-    }  /* end-of-if of BITVAR */
-    
+  IS_BITVAR(vleft->etype)     &&
+  IN_BITSPACE(SPEC_OCLS(vleft->etype))  &&
+  IS_LITERAL(vright->etype)) {
+
+  /* if right side > 1 then comparison may never succeed */
+  if ( (litValue = (int) floatFromVal(vright)) > 1 ) {
+      werror(W_BAD_COMPARE);
+      goto noOptimize ;
+  }
+
+  if ( litValue ) {
+      switch (root->opval.op) {
+      case '>' :  /* bit value greater than 1 cannot be */
+    werror(W_BAD_COMPARE);
+    goto noOptimize ;
+    break;
+
+      case '<' : /* bit value < 1 means 0 */
+      case NE_OP :
+    optExpr = newNode('!',newAst_VALUE(vleft),NULL);
+    break;
+
+      case LE_OP : /* bit value <= 1 means no check */
+    optExpr = newAst_VALUE(vright);
+    break;
+
+      case GE_OP : /* bit value >= 1 means only check for = */
+      case EQ_OP :
+    optExpr = newAst_VALUE(vleft);
+    break;
+      }
+  } else { /* literal is zero */
+      switch (root->opval.op) {
+      case '<' :  /* bit value < 0 cannot be */
+    werror(W_BAD_COMPARE);
+    goto noOptimize ;
+    break;
+
+      case '>' : /* bit value > 0 means 1 */
+      case NE_OP :
+    optExpr = newAst_VALUE(vleft);
+    break;
+
+      case LE_OP : /* bit value <= 0 means no check */
+      case GE_OP : /* bit value >= 0 means no check */
+    werror(W_BAD_COMPARE);
+    goto noOptimize ;
+    break;
+
+      case EQ_OP : /* bit == 0 means ! of bit */
+    optExpr = newNode('!',newAst_VALUE(vleft),NULL);
+    break;
+      }
+  }
+  return decorateType(resolveSymbols(optExpr));
+    } /* end-of-if of BITVAR */
+
     noOptimize :
-       return root;
+  return root;
 }
 /*-----------------------------------------------------------------*/
 /* addSymToBlock : adds the symbol to the first block we find      */
@@ -3661,19 +3661,19 @@ void addSymToBlock (symbol *sym, ast *tree)
 {
     /* reached end of tree or a leaf */
     if (!tree || IS_AST_LINK(tree) || IS_AST_VALUE(tree))
-       return ;
+  return ;
 
     /* found a block */
     if (IS_AST_OP(tree) &&
-       tree->opval.op == BLOCK ) {
-       
-       symbol *lsym = copySymbol(sym);
-       
-       lsym->next = AST_VALUES(tree,sym);
-       AST_VALUES(tree,sym) = lsym ;
-       return ;
-    }
-    
+  tree->opval.op == BLOCK ) {
+
+  symbol *lsym = copySymbol(sym);
+
+  lsym->next = AST_VALUES(tree,sym);
+  AST_VALUES(tree,sym) = lsym ;
+  return ;
+    }
+
     addSymToBlock(sym,tree->left);
     addSymToBlock(sym,tree->right);
 }
@@ -3684,9 +3684,9 @@ void addSymToBlock (symbol *sym, ast *tree)
 static void processRegParms (value *args, ast *body)
 {
     while (args) {
-       if (IS_REGPARM(args->etype))
-           addSymToBlock(args->sym,body);
-       args = args->next;
+  if (IS_REGPARM(args->etype))
+      addSymToBlock(args->sym,body);
+  args = args->next;
     }
 }
 
@@ -3715,114 +3715,114 @@ ast  *createFunction   (symbol  *name,   ast  *body )
     ast  *ex ;
     symbol *csym;
     int stack = 0 ;
-    sym_link *fetype;       
+    sym_link *fetype;
     iCode *piCode = NULL;
-    
+
     /* if check function return 0 then some problem */
     if (checkFunction (name) == 0)
-       return NULL;
-    
+  return NULL;
+
     /* create a dummy block if none exists */
     if (!body)
-       body = newNode(BLOCK,NULL,NULL);
+  body = newNode(BLOCK,NULL,NULL);
 
     noLineno++ ;
-   
+
     /* check if the function name already in the symbol table */
     if ((csym = findSym (SymbolTab,NULL,name->name))) {
-       name = csym ;     
-       /* special case for compiler defined functions
-          we need to add the name to the publics list : this
-          actually means we are now compiling the compiler
-          support routine */
-       if (name->cdef) {
-           addSet(&publics,name);
-       }
+  name = csym ;
+  /* special case for compiler defined functions
+     we need to add the name to the publics list : this
+     actually means we are now compiling the compiler
+     support routine */
+  if (name->cdef) {
+      addSet(&publics,name);
+  }
     }
     else {
-       addSymChain(name);
-       allocVariables(name);
+  addSymChain(name);
+  allocVariables(name);
     }
     name->lastLine = yylineno;
     currFunc = name ;
     processFuncArgs(currFunc,0);
-    
+
     /* set the stack pointer */
     /* PENDING: check this for the mcs51 */
     stackPtr = -port->stack.direction * port->stack.call_overhead;
     if (IS_ISR(name->etype))
-       stackPtr -= port->stack.direction * port->stack.isr_overhead;
+  stackPtr -= port->stack.direction * port->stack.isr_overhead;
     if (IS_RENT(name->etype) || options.stackAuto)
-       stackPtr -= port->stack.direction * port->stack.reent_overhead;
+  stackPtr -= port->stack.direction * port->stack.reent_overhead;
 
     xstackPtr = -port->stack.direction * port->stack.call_overhead;
-    
+
     fetype = getSpec(name->type); /* get the specifier for the function */
     /* if this is a reentrant function then */
     if (IS_RENT(fetype))
-       reentrant++ ;
-        
+  reentrant++ ;
+
     allocParms (name->args);           /* allocate the parameters */
 
     /* do processing for parameters that are passed in registers */
-    processRegParms (name->args,body); 
+    processRegParms (name->args,body);
 
    /* set the stack pointer */
     stackPtr = 0;
     xstackPtr= -1;
-    
+
     /* allocate & autoinit the block variables */
-    processBlockVars (body, &stack,ALLOCATE); 
-    
+    processBlockVars (body, &stack,ALLOCATE);
+
     /* save the stack information */
     if (options.useXstack)
-       name->xstack = SPEC_STAK(fetype) = stack;
+  name->xstack = SPEC_STAK(fetype) = stack;
     else
-       name->stack = SPEC_STAK(fetype) = stack;
-    
+  name->stack = SPEC_STAK(fetype) = stack;
+
     /* name needs to be mangled */
     sprintf (name->rname,"%s%s", port->fun_prefix, name->name);
-    
+
     body = resolveSymbols(body); /* resolve the symbols */
     body = decorateType (body);  /* propagateType & do semantic checks */
-    
+
     ex = newAst_VALUE(symbolVal(name));    /* create name       */
     ex = newNode (FUNCTION,ex,body);
     ex->values.args = name->args ;
-    
+
     if (fatalError) {
-       werror(E_FUNC_NO_CODE,name->name);
-       goto skipall ;
+  werror(E_FUNC_NO_CODE,name->name);
+  goto skipall ;
     }
-        
-    /* create the node & generate intermediate code */ 
+
+    /* create the node & generate intermediate code */
     codeOutFile = code->oFile;
     piCode = iCodeFromAst(ex);
 
      if (fatalError) {
-        werror(E_FUNC_NO_CODE,name->name);
-        goto skipall ;
+   werror(E_FUNC_NO_CODE,name->name);
+   goto skipall ;
      }
-     
+
      eBBlockFromiCode(piCode);
-                    
+
     /* if there are any statics then do them */
     if (staticAutos) {
-       codeOutFile = statsg->oFile;
-       eBBlockFromiCode (iCodeFromAst (decorateType(resolveSymbols(staticAutos))));
-       staticAutos = NULL;
+  codeOutFile = statsg->oFile;
+  eBBlockFromiCode (iCodeFromAst (decorateType(resolveSymbols(staticAutos))));
+  staticAutos = NULL;
     }
-    
+
  skipall:
-    
+
     /* dealloc the block variables */
     processBlockVars(body, &stack,DEALLOCATE);
     /* deallocate paramaters */
     deallocParms(name->args);
-    
+
     if (IS_RENT(fetype))
-       reentrant-- ;
-    
+  reentrant-- ;
+
     /* we are done freeup memory & cleanup */
     noLineno-- ;
     labelKey = 1 ;
@@ -3830,9 +3830,9 @@ ast  *createFunction   (symbol  *name,   ast  *body )
     name->fbody = 1;
     addSet(&operKeyReset,name);
     applyToSet(operKeyReset,resetParmKey);
-       
+
     if (options.debug && !options.nodebug)
-       cdbStructBlock(1,cdbFile);
+  cdbStructBlock(1,cdbFile);
 
     cleanUpLevel(LabelTab,0);
     cleanUpBlock(StructTab,1);
index c5ec50daa9197442c87858dd47efe9e0c2f4ad78..78b8f287a5fe391a4ae05808c1c2baad8215dd69 100644 (file)
@@ -1,25 +1,25 @@
 /*-----------------------------------------------------------------
     SDCCbitv.c - contains support routines for bitvectors
-                
+
     Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
 
     This program is free software; you can redistribute it and/or modify it
     under the terms of the GNU General Public License as published by the
     Free Software Foundation; either version 2, or (at your option) any
     later version.
-    
+
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-    
+
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-    
+
     In other words, you are welcome to use, share and improve this program.
     You are forbidden to forbid anyone else to use, share and improve
-    what you give them.   Help stamp out software-hoarding!  
+    what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "common.h"
@@ -29,8 +29,8 @@
 int bitVectDefault = 1024;
 
 /* genernal note about a bitvectors:
-   bit vectors are stored from left to right i.e. 
-   bit position 0 is the MS bit of the first byte 
+   bit vectors are stored from left to right i.e.
+   bit position 0 is the MS bit of the first byte
    this also means that bit positions must start from 0*/
 /*-----------------------------------------------------------------*/
 /* newBitVect - returns a new bitvector of size                    */
@@ -40,11 +40,11 @@ bitVect *newBitVect (int size)
     bitVect *bvp;
     int byteSize ;
 
-    bvp = Safe_calloc(sizeof (bitVect));
+    bvp = Safe_calloc(1,sizeof (bitVect));
 
-    bvp->size = size;    
+    bvp->size = size;
     bvp->bSize = byteSize = ( size / 8) + 1 ;
-    bvp->vect = Safe_calloc(byteSize);
+    bvp->vect = Safe_calloc(1,byteSize);
     return bvp;
 }
 
@@ -56,13 +56,13 @@ bitVect *bitVectResize (bitVect *bvp, int size)
     int bSize = ( size / 8) + 1  ;
 
     if (!bvp)
-       return newBitVect (size);
+  return newBitVect (size);
 
     /* if we already have enough space */
     if (bvp->bSize >= bSize ) {
-       if (size > bvp->size)
-           bvp->size = size ;
-       return bvp;
+  if (size > bvp->size)
+      bvp->size = size ;
+  return bvp;
     }
 
     bvp->vect = Clear_realloc(bvp->vect, bvp -> bSize, bSize);
@@ -82,15 +82,15 @@ bitVect *bitVectSetBit (bitVect *bvp, int pos)
 
     /* if set is null then allocate it */
     if (!bvp)
-       bvp = newBitVect(bitVectDefault) ; /* allocate for twice the size */
+  bvp = newBitVect(bitVectDefault) ; /* allocate for twice the size */
 
     if (bvp->size <= pos )
-       bvp = bitVectResize (bvp,pos+2); /* conservatively resize */
-    
+  bvp = bitVectResize (bvp,pos+2); /* conservatively resize */
+
     byteSize = pos / 8 ;
     offset = pos % 8;
-    bvp->vect[byteSize] |= (((unsigned char)1) << 
-                           (7 - offset));
+    bvp->vect[byteSize] |= (((unsigned char)1) <<
+          (7 - offset));
     return bvp;
 }
 
@@ -103,16 +103,16 @@ void bitVectUnSetBit (bitVect *bvp, int pos)
     int offset ;
 
     if (! bvp)
-       return ;
+  return ;
 
     byteSize = pos /8;
     if (bvp->bSize <= byteSize)
-       return ;
+  return ;
 
     offset = pos % 8 ;
 
-    bvp->vect[byteSize] &= ~ (((unsigned char)1) << 
-                             (7 - offset));
+    bvp->vect[byteSize] &= ~ (((unsigned char)1) <<
+            (7 - offset));
 }
 
 /*-----------------------------------------------------------------*/
@@ -121,20 +121,20 @@ void bitVectUnSetBit (bitVect *bvp, int pos)
 int bitVectBitValue (bitVect *bvp, int pos)
 {
     int byteSize;
-    int offset ;    
+    int offset ;
 
     if (! bvp)
-       return 0;
+  return 0;
 
     byteSize = pos /8;
 
     if ( bvp->bSize <= byteSize )
-       return 0;
+  return 0;
 
     offset = pos % 8 ;
-  
-    return ((bvp->vect[byteSize] >> (7-offset)) & ((unsigned char)1) ); 
-  
+
+    return ((bvp->vect[byteSize] >> (7-offset)) & ((unsigned char)1) );
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -142,33 +142,33 @@ int bitVectBitValue (bitVect *bvp, int pos)
 /*-----------------------------------------------------------------*/
 bitVect *bitVectUnion ( bitVect *bvp1, bitVect *bvp2)
 {
-    int i;    
+    int i;
     bitVect *newBvp;
-    
+
     /* if both null */
     if (!bvp1 && !bvp2)
-       return NULL ;
+  return NULL ;
 
     /* if one of them null then return the other */
     if (! bvp1 && bvp2 )
-       return bitVectCopy (bvp2);
+  return bitVectCopy (bvp2);
 
     if ( bvp1 && ! bvp2 )
-       return bitVectCopy (bvp1);
+  return bitVectCopy (bvp1);
 
     /* if they are not the same size */
     /* make them the same size */
     if (bvp1->bSize < bvp2->bSize)
-       bvp1 = bitVectResize (bvp1,bvp2->size);
+  bvp1 = bitVectResize (bvp1,bvp2->size);
     else
-       if (bvp2->bSize < bvp1->bSize)
-           bvp2 = bitVectResize (bvp2,bvp1->size);
+  if (bvp2->bSize < bvp1->bSize)
+      bvp2 = bitVectResize (bvp2,bvp1->size);
 
     newBvp = newBitVect(bvp1->size);
-       
+
     for ( i = 0 ; i < bvp1->bSize ;i++)
-       newBvp->vect[i] = bvp1->vect[i] | bvp2->vect[i];
-   
+  newBvp->vect[i] = bvp1->vect[i] | bvp2->vect[i];
+
 
     return newBvp;
 }
@@ -182,20 +182,20 @@ bitVect *bitVectIntersect ( bitVect *bvp1, bitVect *bvp2)
     bitVect *newBvp;
 
     if (! bvp2 || ! bvp1 )
-       return NULL ;
+  return NULL ;
 
     /* if they are not the same size */
     /* make them the same size */
     if (bvp1->bSize < bvp2->bSize)
-       bvp1 = bitVectResize (bvp1,bvp2->bSize);
+  bvp1 = bitVectResize (bvp1,bvp2->bSize);
     else
-       if (bvp2->size < bvp1->size)
-           bvp2 = bitVectResize (bvp2,bvp1->size);   
+  if (bvp2->size < bvp1->size)
+      bvp2 = bitVectResize (bvp2,bvp1->size);
 
     newBvp = newBitVect(bvp1->size);
 
     for ( i = 0 ; i < bvp1->bSize ;i++)
-       newBvp->vect[i] = bvp1->vect[i] & bvp2->vect[i];
+  newBvp->vect[i] = bvp1->vect[i] & bvp2->vect[i];
 
     return newBvp;
 }
@@ -209,11 +209,11 @@ int bitVectBitsInCommon ( bitVect *bvp1, bitVect *bvp2 )
     int i ;
 
     if ( ! bvp1 || ! bvp2 )
-       return 0;
-    
-    for ( i = 0 ; i < min(bvp1->bSize,bvp2->bSize) ; i ++ ) 
-       if ( bvp1->vect[i] & bvp2->vect[i] )
-           return 1;
+  return 0;
+
+    for ( i = 0 ; i < min(bvp1->bSize,bvp2->bSize) ; i ++ )
+  if ( bvp1->vect[i] & bvp2->vect[i] )
+      return 1;
 
     return 0;
 }
@@ -222,25 +222,25 @@ int bitVectBitsInCommon ( bitVect *bvp1, bitVect *bvp2 )
 /* bitVectCplAnd - complement the second & and it with the first   */
 /*-----------------------------------------------------------------*/
 bitVect *bitVectCplAnd ( bitVect *bvp1, bitVect *bvp2)
-{    
-    int i;    
+{
+    int i;
 
     if ( ! bvp2 )
-       return bvp1 ;
+  return bvp1 ;
 
     if ( ! bvp1 )
-       return bvp1 ;
+  return bvp1 ;
 
     /* if they are not the same size */
     /* make them the same size */
     if (bvp1->bSize < bvp2->bSize)
-       bvp1 = bitVectResize (bvp1,bvp2->bSize);
+  bvp1 = bitVectResize (bvp1,bvp2->bSize);
     else
-       if (bvp2->size < bvp1->size)
-           bvp2 = bitVectResize (bvp2,bvp1->size);       
+  if (bvp2->size < bvp1->size)
+      bvp2 = bitVectResize (bvp2,bvp1->size);
 
     for ( i = 0 ; i < bvp1->bSize ;i++)
-       bvp1->vect[i] = bvp1->vect[i] & (~ bvp2->vect[i]);
+  bvp1->vect[i] = bvp1->vect[i] & (~ bvp2->vect[i]);
 
     return bvp1;
 }
@@ -253,11 +253,11 @@ int bitVectIsZero (bitVect *bvp)
     int i ;
 
     if (!bvp)
-       return 1;
-    
+  return 1;
+
     for ( i = 0 ; i < bvp->bSize ; i++ )
-       if (bvp->vect[i] != 0)
-           return 0;
+  if (bvp->vect[i] != 0)
+      return 0;
 
     return 1;
 }
@@ -270,18 +270,18 @@ int bitVectEqual ( bitVect *bvp1, bitVect *bvp2)
     int i ;
 
     if ( !bvp1 || !bvp1)
-       return 0;
+  return 0;
 
     if (bvp1 == bvp2)
-       return 1;
+  return 1;
 
     if (bvp1->bSize != bvp2->bSize)
-       return 0;
+  return 0;
 
     for (i = 0 ; i < bvp1->bSize ; i++ )
-       if ( bvp1->vect[i] != bvp2->vect[i] )
-           return 0;
-    
+  if ( bvp1->vect[i] != bvp2->vect[i] )
+      return 0;
+
     return 1;
 }
 
@@ -294,12 +294,12 @@ bitVect *bitVectCopy (bitVect *bvp)
     int i;
 
     if (!bvp)
-       return NULL;
+  return NULL;
 
     newBvp = newBitVect(bvp->size);
     for ( i = 0 ; i < bvp->bSize; i++ )
-       newBvp->vect[i] = bvp->vect[i];
-    
+  newBvp->vect[i] = bvp->vect[i];
+
     return newBvp;
 }
 
@@ -308,25 +308,25 @@ bitVect *bitVectCopy (bitVect *bvp)
 /*-----------------------------------------------------------------*/
 int bitVectnBitsOn (bitVect *bvp)
 {
-    int i, j, k; 
-    unsigned char byte; 
-    int count = 0 ; 
-
-    if (!bvp) 
-       return 0; 
-  
-   /* rip through most of the data in byte sized chunks */ 
-   j = (bvp->size)/8; 
-   for (i = 0 ; i < j; i++) { 
-       byte = bvp->vect[i]; 
-       for (k=0; k<8; k++) { count += byte&1; byte = byte>>1; } 
-   } 
-    
-   /* finish up the last fractional byte, if any */ 
-   for (i = j*8 ; i < bvp->size; i++) 
-       count += bitVectBitValue(bvp,i); 
-
-   return count; 
+    int i, j, k;
+    unsigned char byte;
+    int count = 0 ;
+
+    if (!bvp)
+  return 0;
+
+   /* rip through most of the data in byte sized chunks */
+   j = (bvp->size)/8;
+   for (i = 0 ; i < j; i++) {
+       byte = bvp->vect[i];
+       for (k=0; k<8; k++) { count += byte&1; byte = byte>>1; }
+   }
+
+   /* finish up the last fractional byte, if any */
+   for (i = j*8 ; i < bvp->size; i++)
+       count += bitVectBitValue(bvp,i);
+
+   return count;
 
 }
 
@@ -338,10 +338,10 @@ int bitVectFirstBit (bitVect *bvp)
     int i;
 
     if (!bvp)
-       return -1;
+  return -1;
     for (i = 0; i < bvp->size ; i++ )
-       if (bitVectBitValue(bvp,i))
-           return i;
+  if (bitVectBitValue(bvp,i))
+      return i;
 
     return -1;
 }
@@ -351,18 +351,18 @@ int bitVectFirstBit (bitVect *bvp)
 /*-----------------------------------------------------------------*/
 void bitVectDebugOn (bitVect *bvp, FILE *of)
 {
-       int i;
-       
-       if (of == NULL)
-               of = stdout;
-       if (!bvp)
-               return;
-
-       fprintf(of,"bitvector Size = %d bSize = %d\n",bvp->size,bvp->bSize);
-       fprintf(of,"Bits on { ");
-       for (i = 0 ; i < bvp->size ; i++) {
-               if (bitVectBitValue(bvp,i))
-                       fprintf(of,"(%d) ",i);
-       }
-       fprintf(of,"}\n");
+  int i;
+
+  if (of == NULL)
+    of = stdout;
+  if (!bvp)
+    return;
+
+  fprintf(of,"bitvector Size = %d bSize = %d\n",bvp->size,bvp->bSize);
+  fprintf(of,"Bits on { ");
+  for (i = 0 ; i < bvp->size ; i++) {
+    if (bitVectBitValue(bvp,i))
+      fprintf(of,"(%d) ",i);
+  }
+  fprintf(of,"}\n");
 }
index f3ebccab594881246566b1c9b6d7cabff8d84567..e0fd0d9b01c0f3817b64731a85853f19cddf12e4 100644 (file)
@@ -7,19 +7,19 @@
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "common.h"
 cseDef *newCseDef (operand *sym, iCode *ic)
 {
     cseDef *cdp ;
-    
+
     assert (sym);
-    cdp = Safe_calloc(sizeof(cseDef));    
+    cdp = Safe_calloc(1,sizeof(cseDef));
 
     cdp->sym = sym;
     cdp->diCode = ic;
-    cdp->key = sym->key;       
-         
+    cdp->key = sym->key;
+
     return cdp;
 }
 
@@ -50,14 +50,14 @@ cseDef *newCseDef (operand *sym, iCode *ic)
 int isCseDefEqual ( void *vsrc, void *vdest)
 {
     cseDef *src = vsrc;
-    cseDef *dest = vdest;  
+    cseDef *dest = vdest;
 
     if (src == dest)
-       return 1;
-    
+  return 1;
+
     return (src->key == dest->key &&
-           src->diCode == dest->diCode ) ;
-     
+      src->diCode == dest->diCode ) ;
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -69,9 +69,9 @@ int pcseDef (void *item, va_list ap)
     iCodeTable *icTab ;
 
     (void)ap;
-    
+
     if (!cdp->sym)
-       fprintf(stdout,"**null op**");
+  fprintf(stdout,"**null op**");
     printOperand(cdp->sym,stdout);
     icTab = getTableEntry(cdp->diCode->op) ;
     icTab->iCodePrint(stdout,cdp->diCode,icTab->printName);
@@ -87,77 +87,77 @@ void replaceAllSymBySym (iCode *ic, operand *from , operand *to, bitVect **ndpse
     iCode *lic;
 
     for (lic = ic ; lic ; lic = lic->next ) {
-       int siaddr ;
-
-       /* do the special cases first */
-       if (lic->op == IFX) {
-               if (IS_SYMOP(to) &&
-                   IC_COND(lic)->key == from->key) {
-                       
-                       bitVectUnSetBit (OP_USES(from),lic->key);
-                       OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
-                       siaddr = IC_COND(lic)->isaddr ;
-                       IC_COND(lic) = operandFromOperand(to);
-                       IC_COND(lic)->isaddr = siaddr ;
-                       
-               }
-               continue ;
-       }
-
-       if (lic->op == JUMPTABLE) {
-               if (IS_SYMOP(to) &&
-                   IC_JTCOND(lic)->key == from->key) {
-                       
-                       bitVectUnSetBit (OP_USES(from),lic->key);
-                       OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
-                       siaddr = IC_COND(lic)->isaddr ;
-                       IC_JTCOND(lic) = operandFromOperand(to);
-                       IC_JTCOND(lic)->isaddr = siaddr ;
-                       
-               }
-               continue ;
-       }
-
-       if (IC_RESULT(lic) && IC_RESULT(lic)->key == from->key ) {
-           /* maintain du chains */
-           if (POINTER_SET(lic)) {
-               bitVectUnSetBit (OP_USES(from),lic->key);
-               OP_USES(to) = bitVectSetBit (OP_USES(to),lic->key);
-
-               /* also check if the "from" was in the non-dominating 
-                  pointer sets and replace it with "to" in the bitVector */
-               if (bitVectBitValue(*ndpset,from->key)) {
-                   bitVectUnSetBit(*ndpset,from->key);
-                   bitVectSetBit(*ndpset,to->key);
-               }
-
-           }
-           else {              
-               bitVectUnSetBit (OP_DEFS(from),lic->key);
-               OP_DEFS(to) = bitVectSetBit (OP_DEFS(to),lic->key);
-           }       
-           siaddr = IC_RESULT(lic)->isaddr ;       
-           IC_RESULT(lic) = operandFromOperand(to);
-           IC_RESULT(lic)->isaddr = siaddr ;
-       }
-
-       if (IS_SYMOP(to) &&
-           IC_RIGHT(lic) && IC_RIGHT(lic)->key == from->key ) {
-           bitVectUnSetBit (OP_USES(from),lic->key);
-           OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
-           siaddr = IC_RIGHT(lic)->isaddr ;
-           IC_RIGHT(lic) = operandFromOperand(to);
-           IC_RIGHT(lic)->isaddr = siaddr ;
-       }
-
-       if (IS_SYMOP(to) &&
-           IC_LEFT(lic) && IC_LEFT(lic)->key == from->key ) {
-           bitVectUnSetBit (OP_USES(from),lic->key);
-           OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
-           siaddr = IC_LEFT(lic)->isaddr ;
-           IC_LEFT(lic) = operandFromOperand(to);
-           IC_LEFT(lic)->isaddr = siaddr ;
-       }       
+  int siaddr ;
+
+  /* do the special cases first */
+  if (lic->op == IFX) {
+    if (IS_SYMOP(to) &&
+        IC_COND(lic)->key == from->key) {
+
+      bitVectUnSetBit (OP_USES(from),lic->key);
+      OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
+      siaddr = IC_COND(lic)->isaddr ;
+      IC_COND(lic) = operandFromOperand(to);
+      IC_COND(lic)->isaddr = siaddr ;
+
+    }
+    continue ;
+  }
+
+  if (lic->op == JUMPTABLE) {
+    if (IS_SYMOP(to) &&
+        IC_JTCOND(lic)->key == from->key) {
+
+      bitVectUnSetBit (OP_USES(from),lic->key);
+      OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
+      siaddr = IC_COND(lic)->isaddr ;
+      IC_JTCOND(lic) = operandFromOperand(to);
+      IC_JTCOND(lic)->isaddr = siaddr ;
+
+    }
+    continue ;
+  }
+
+  if (IC_RESULT(lic) && IC_RESULT(lic)->key == from->key ) {
+      /* maintain du chains */
+      if (POINTER_SET(lic)) {
+    bitVectUnSetBit (OP_USES(from),lic->key);
+    OP_USES(to) = bitVectSetBit (OP_USES(to),lic->key);
+
+    /* also check if the "from" was in the non-dominating
+       pointer sets and replace it with "to" in the bitVector */
+    if (bitVectBitValue(*ndpset,from->key)) {
+        bitVectUnSetBit(*ndpset,from->key);
+        bitVectSetBit(*ndpset,to->key);
+    }
+
+      }
+      else {
+    bitVectUnSetBit (OP_DEFS(from),lic->key);
+    OP_DEFS(to) = bitVectSetBit (OP_DEFS(to),lic->key);
+      }
+      siaddr = IC_RESULT(lic)->isaddr ;
+      IC_RESULT(lic) = operandFromOperand(to);
+      IC_RESULT(lic)->isaddr = siaddr ;
+  }
+
+  if (IS_SYMOP(to) &&
+      IC_RIGHT(lic) && IC_RIGHT(lic)->key == from->key ) {
+      bitVectUnSetBit (OP_USES(from),lic->key);
+      OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
+      siaddr = IC_RIGHT(lic)->isaddr ;
+      IC_RIGHT(lic) = operandFromOperand(to);
+      IC_RIGHT(lic)->isaddr = siaddr ;
+  }
+
+  if (IS_SYMOP(to) &&
+      IC_LEFT(lic) && IC_LEFT(lic)->key == from->key ) {
+      bitVectUnSetBit (OP_USES(from),lic->key);
+      OP_USES(to) = bitVectSetBit(OP_USES(to),lic->key);
+      siaddr = IC_LEFT(lic)->isaddr ;
+      IC_LEFT(lic) = operandFromOperand(to);
+      IC_LEFT(lic)->isaddr = siaddr ;
+  }
     }
 }
 
@@ -170,9 +170,9 @@ DEFSETFUNC(iCodeKeyIs)
     V_ARG(int,key);
 
     if (cdp->diCode->key == key)
-       return 1;
+  return 1;
     else
-       return 0;
+  return 0;
 }
 
 /*-----------------------------------------------------------------*/
@@ -187,12 +187,12 @@ DEFSETFUNC(removeFromInExprs)
     V_ARG(eBBlock *,cbp);
 
     if (ebp->visited)
-       return 0;
+  return 0;
 
     ebp->visited = 1;
     deleteItemIf(&ebp->inExprs,iCodeKeyIs,ic->key);
     if (ebp != cbp && !bitVectBitValue(cbp->domVect,ebp->bbnum))
-       replaceAllSymBySym(ebp->sch,from,to,&ebp->ndompset);
+  replaceAllSymBySym(ebp->sch,from,to,&ebp->ndompset);
 
     applyToSet(ebp->succList,removeFromInExprs,ic,from,to,cbp);
     return 0;
@@ -209,104 +209,104 @@ static bool isGlobalInNearSpace (operand *op)
        advantage of putting variables in near space into
        registers */
     if (isOperandGlobal(op)  && !IN_FARSPACE(SPEC_OCLS(type)) &&
-       IN_DIRSPACE(SPEC_OCLS(type)))
-       return TRUE;
+  IN_DIRSPACE(SPEC_OCLS(type)))
+  return TRUE;
     else
-       return FALSE;
+  return FALSE;
 }
 
 /*-----------------------------------------------------------------*/
 /* findCheaperOp - cseBBlock support routine, will check to see if */
 /*              we have a operand previously defined               */
 /*-----------------------------------------------------------------*/
-DEFSETFUNC(findCheaperOp) 
+DEFSETFUNC(findCheaperOp)
 {
-    cseDef *cdp = item ;   
+    cseDef *cdp = item ;
     V_ARG(operand *,cop);
     V_ARG(operand **,opp);
 
     /* if we have already found it */
-    if (*opp) 
-       return 1;
+    if (*opp)
+  return 1;
 
     /* not found it yet check if this is the one */
     /* and this is not the defining one          */
     if (cop->key == cdp->key) {
 
-       /* do a special check this will help in */
-       /* constant propagation & dead code elim*/
-       /* for assignments only                 */
-       if (cdp->diCode->op == '=') {
-           /* if the result is volatile then return result */
-           if (IS_OP_VOLATILE (IC_RESULT(cdp->diCode)))
-               *opp = IC_RESULT(cdp->diCode);
-           else
-               /* if this is a straight assignment and
-                  left is a temp then prefer the temporary to the 
-                  true symbol */
-               if (!POINTER_SET(cdp->diCode) &&
-                   IS_ITEMP(IC_RESULT(cdp->diCode)) &&
-                   IS_TRUE_SYMOP(IC_RIGHT(cdp->diCode)))
-                   *opp = IC_RESULT(cdp->diCode);
-               else
-                   /* if straight assignement && and both
-                      are temps then prefer the one that
-                      will not need extra space to spil, also
-                      take into consideration if right side
-                      an induction variable
-                   */
-                   if (!POINTER_SET(cdp->diCode) &&
-                       IS_ITEMP(IC_RESULT(cdp->diCode)) &&
-                       IS_ITEMP(IC_RIGHT(cdp->diCode))  &&
-                       !OP_SYMBOL(IC_RIGHT(cdp->diCode))->isind &&
-                       ( (!SPIL_LOC(IC_RIGHT(cdp->diCode)) &&
-                          SPIL_LOC(IC_RESULT(cdp->diCode))) ||
-                         ( SPIL_LOC(IC_RESULT(cdp->diCode)) &&
-                           SPIL_LOC(IC_RESULT(cdp->diCode)) ==
-                           SPIL_LOC(IC_RIGHT(cdp->diCode))) )
-                       )
-                       *opp = IC_RESULT(cdp->diCode);
-                   else
-                       *opp = IC_RIGHT(cdp->diCode);  
-       }
-       else        
-           *opp = IC_RESULT(cdp->diCode) ;
+  /* do a special check this will help in */
+  /* constant propagation & dead code elim*/
+  /* for assignments only                 */
+  if (cdp->diCode->op == '=') {
+      /* if the result is volatile then return result */
+      if (IS_OP_VOLATILE (IC_RESULT(cdp->diCode)))
+    *opp = IC_RESULT(cdp->diCode);
+      else
+    /* if this is a straight assignment and
+       left is a temp then prefer the temporary to the
+       true symbol */
+    if (!POINTER_SET(cdp->diCode) &&
+        IS_ITEMP(IC_RESULT(cdp->diCode)) &&
+        IS_TRUE_SYMOP(IC_RIGHT(cdp->diCode)))
+        *opp = IC_RESULT(cdp->diCode);
+    else
+        /* if straight assignement && and both
+           are temps then prefer the one that
+           will not need extra space to spil, also
+           take into consideration if right side
+           an induction variable
+        */
+        if (!POINTER_SET(cdp->diCode) &&
+      IS_ITEMP(IC_RESULT(cdp->diCode)) &&
+      IS_ITEMP(IC_RIGHT(cdp->diCode))  &&
+      !OP_SYMBOL(IC_RIGHT(cdp->diCode))->isind &&
+      ( (!SPIL_LOC(IC_RIGHT(cdp->diCode)) &&
+         SPIL_LOC(IC_RESULT(cdp->diCode))) ||
+        ( SPIL_LOC(IC_RESULT(cdp->diCode)) &&
+          SPIL_LOC(IC_RESULT(cdp->diCode)) ==
+          SPIL_LOC(IC_RIGHT(cdp->diCode))) )
+      )
+      *opp = IC_RESULT(cdp->diCode);
+        else
+      *opp = IC_RIGHT(cdp->diCode);
+  }
+  else
+      *opp = IC_RESULT(cdp->diCode) ;
     }
 
     /* if this is an assign to a temp. then check
        if the right side is this then return this */
-    if (IS_TRUE_SYMOP(cop) && 
-       cdp->diCode->op == '=' &&
-       !POINTER_SET(cdp->diCode) &&
-       cop->key == IC_RIGHT(cdp->diCode)->key &&
-       !isGlobalInNearSpace (IC_RIGHT(cdp->diCode)) &&
-       IS_ITEMP(IC_RESULT(cdp->diCode)))
-       *opp = IC_RESULT(cdp->diCode);
+    if (IS_TRUE_SYMOP(cop) &&
+  cdp->diCode->op == '=' &&
+  !POINTER_SET(cdp->diCode) &&
+  cop->key == IC_RIGHT(cdp->diCode)->key &&
+  !isGlobalInNearSpace (IC_RIGHT(cdp->diCode)) &&
+  IS_ITEMP(IC_RESULT(cdp->diCode)))
+  *opp = IC_RESULT(cdp->diCode);
 
     if (*opp) {
 
-       if ((isGlobalInNearSpace(cop) && 
-           !isOperandLiteral(*opp)) ||
-           isOperandVolatile(*opp,FALSE) 
-           ) {
-           *opp = NULL;
-           return 0;
-       }
-                   
-       if (cop->key == (*opp)->key )  {
-           *opp = NULL ;
-           return 0;       
-       }
-       
-       if ((*opp)->isaddr != cop->isaddr && IS_ITEMP(cop)) {
-           *opp = operandFromOperand(*opp);
-           (*opp)->isaddr = cop->isaddr;
-       }
-       
-       return 1;
-       
+  if ((isGlobalInNearSpace(cop) &&
+      !isOperandLiteral(*opp)) ||
+      isOperandVolatile(*opp,FALSE)
+      ) {
+      *opp = NULL;
+      return 0;
+  }
+
+  if (cop->key == (*opp)->key )  {
+      *opp = NULL ;
+      return 0;
+  }
+
+  if ((*opp)->isaddr != cop->isaddr && IS_ITEMP(cop)) {
+      *opp = operandFromOperand(*opp);
+      (*opp)->isaddr = cop->isaddr;
+  }
+
+  return 1;
+
     }
-       
+
     return 0;
 }
 
@@ -321,13 +321,13 @@ DEFSETFUNC(findPointerSet)
     V_ARG(operand *,rop);
 
     if (POINTER_SET(cdp->diCode)               &&
-       IC_RESULT(cdp->diCode)->key == op->key &&
-       !isOperandVolatile(IC_RESULT(cdp->diCode),TRUE) &&
-       !isOperandVolatile(IC_RIGHT(cdp->diCode),TRUE)  &&
-       getSize(operandType(IC_RIGHT(cdp->diCode))) ==
-       getSize(operandType(rop))) {
-       *opp = IC_RIGHT(cdp->diCode);
-       return 1;
+  IC_RESULT(cdp->diCode)->key == op->key &&
+  !isOperandVolatile(IC_RESULT(cdp->diCode),TRUE) &&
+  !isOperandVolatile(IC_RIGHT(cdp->diCode),TRUE)  &&
+  getSize(operandType(IC_RIGHT(cdp->diCode))) ==
+  getSize(operandType(rop))) {
+  *opp = IC_RIGHT(cdp->diCode);
+  return 1;
     }
 
     return 0;
@@ -339,29 +339,29 @@ DEFSETFUNC(findPointerSet)
 /*-----------------------------------------------------------------*/
 DEFSETFUNC(findPrevIc)
 {
-    cseDef *cdp = item ;    
+    cseDef *cdp = item ;
     V_ARG(iCode *,ic);
     V_ARG(iCode **,icp);
 
     /* if already found */
     if (*icp)
-       return 1;  
-   
+  return 1;
+
     /* if the iCodes are the same */
-    if (isiCodeEqual(ic,cdp->diCode) && 
-       isOperandEqual(cdp->sym,IC_RESULT(cdp->diCode))) {
-       *icp = cdp->diCode ;
-       return 1;
+    if (isiCodeEqual(ic,cdp->diCode) &&
+  isOperandEqual(cdp->sym,IC_RESULT(cdp->diCode))) {
+  *icp = cdp->diCode ;
+  return 1;
     }
 
     /* if iCodes are not the same */
     /* see the operands maybe interchanged */
     if (ic->op == cdp->diCode->op          &&
-       ( ic->op == '+' || ic->op == '*' ) &&
-       isOperandEqual(IC_LEFT(ic),IC_RIGHT(cdp->diCode)) &&
-       isOperandEqual(IC_RIGHT(ic),IC_LEFT(cdp->diCode))) {
-       *icp = cdp->diCode ;
-       return 1;
+  ( ic->op == '+' || ic->op == '*' ) &&
+  isOperandEqual(IC_LEFT(ic),IC_RIGHT(cdp->diCode)) &&
+  isOperandEqual(IC_RIGHT(ic),IC_LEFT(cdp->diCode))) {
+  *icp = cdp->diCode ;
+  return 1;
     }
 
     return 0;
@@ -373,7 +373,7 @@ DEFSETFUNC(findPrevIc)
 DEFSETFUNC(ifDefGlobal)
 {
     cseDef *cdp = item;
-    
+
     return (isOperandGlobal(cdp->sym));
 }
 
@@ -383,7 +383,7 @@ DEFSETFUNC(ifDefGlobal)
 DEFSETFUNC(ifAnyGetPointer)
 {
     cseDef *cdp = item;
-    
+
     if (cdp->diCode && POINTER_GET(cdp->diCode)) return 1;
     return 0;
 }
@@ -393,33 +393,33 @@ DEFSETFUNC(ifAnyGetPointer)
 /*-----------------------------------------------------------------*/
 DEFSETFUNC(ifOperandsHave)
 {
-    cseDef *cdp = item;    
-    V_ARG(operand *,op);    
-
-    
-    if (IC_LEFT(cdp->diCode) && 
-       IS_SYMOP(IC_LEFT(cdp->diCode)) &&
-       IC_LEFT(cdp->diCode)->key == op->key)
-       return 1;
-    
+    cseDef *cdp = item;
+    V_ARG(operand *,op);
+
+
+    if (IC_LEFT(cdp->diCode) &&
+  IS_SYMOP(IC_LEFT(cdp->diCode)) &&
+  IC_LEFT(cdp->diCode)->key == op->key)
+  return 1;
+
     if (IC_RIGHT(cdp->diCode)  &&
-       IS_SYMOP(IC_RIGHT(cdp->diCode)) &&
-       IC_RIGHT(cdp->diCode)->key == op->key)
-       return 1;
-    
+  IS_SYMOP(IC_RIGHT(cdp->diCode)) &&
+  IC_RIGHT(cdp->diCode)->key == op->key)
+  return 1;
+
     /* or if any of the operands are volatile */
-    if (IC_LEFT(cdp->diCode) && 
-       IS_OP_VOLATILE(IC_LEFT(cdp->diCode)))        
-       return 1;    
+    if (IC_LEFT(cdp->diCode) &&
+  IS_OP_VOLATILE(IC_LEFT(cdp->diCode)))
+  return 1;
+
+    if (IC_RIGHT(cdp->diCode) &&
+  IS_OP_VOLATILE(IC_RIGHT(cdp->diCode)))
+  return 1;
 
-    if (IC_RIGHT(cdp->diCode) && 
-       IS_OP_VOLATILE(IC_RIGHT(cdp->diCode))) 
-       return 1;
-    
 
-    if (IC_RESULT(cdp->diCode) && 
-       IS_OP_VOLATILE(IC_RESULT(cdp->diCode)))         
-       return 1;    
+    if (IC_RESULT(cdp->diCode) &&
+  IS_OP_VOLATILE(IC_RESULT(cdp->diCode)))
+  return 1;
 
     return 0;
 }
@@ -433,11 +433,11 @@ DEFSETFUNC(ifOperandsHave)
     set *sl ;
 
     if (!sym || !IS_SYMOP(sym))
-       return 0;  
+  return 0;
     for (sl = cseSet ; sl ; sl = sl->next ) {
-       loop = sl->item;        
-       if (loop->sym->key == sym->key )           
-           return 1;   
+  loop = sl->item;
+  if (loop->sym->key == sym->key )
+      return 1;
     }
     return 0;
 }
@@ -447,16 +447,16 @@ DEFSETFUNC(ifOperandsHave)
 /* ifDefSymIsX - will return 1 if the symbols match                */
 /*-----------------------------------------------------------------*/
 DEFSETFUNC(ifDefSymIsX)
-{     
+{
     cseDef *cdp  = item;
-    V_ARG(operand *,op);    
+    V_ARG(operand *,op);
 
     if (op && cdp->sym)
-       return cdp->sym->key == op->key ;
+  return cdp->sym->key == op->key ;
     else
-       return ( isOperandEqual(cdp->sym,op) );
-            
-} 
+  return ( isOperandEqual(cdp->sym,op) );
+
+}
 
 
 /*-----------------------------------------------------------------*/
@@ -466,17 +466,17 @@ DEFSETFUNC(ifDefSymIsX)
 {
     cseDef *loop;
     set *sl;
-    
+
     if (!ic)
-       return 0;
+  return 0;
 
     for (sl = cseSet ; sl ; sl = sl->next ) {
-       loop = sl->item ;
-       if (loop->diCode == ic)
-           return 1;
+  loop = sl->item ;
+  if (loop->diCode == ic)
+      return 1;
     }
     return 0;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -490,7 +490,7 @@ DEFSETFUNC(ifPointerGet)
     operand *left = IC_LEFT(cdp->diCode);
 
     if (POINTER_GET(dic) && left->key == op->key)
-       return 1;
+  return 1;
 
     return 0;
 }
@@ -504,8 +504,8 @@ DEFSETFUNC(ifPointerSet)
     V_ARG(operand *,op);
 
     if (POINTER_SET(cdp->diCode) &&
-       IC_RESULT(cdp->diCode)->key == op->key)
-       return 1;
+  IC_RESULT(cdp->diCode)->key == op->key)
+  return 1;
 
     return 0;
 }
@@ -514,12 +514,12 @@ DEFSETFUNC(ifPointerSet)
 /* ifDiCodeIsX - will return 1 if the symbols match                 */
 /*-----------------------------------------------------------------*/
 DEFSETFUNC(ifDiCodeIsX)
-{     
+{
     cseDef *cdp  = item;
-    V_ARG(iCode *,ic);    
+    V_ARG(iCode *,ic);
 
     return cdp->diCode == ic;
-            
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -530,260 +530,260 @@ void algebraicOpts (iCode *ic)
     /* we don't deal with the following iCodes
        here */
     if (ic->op == IFX   ||
-       ic->op == IPUSH ||
-       ic->op == IPOP  ||
-       ic->op == CALL  ||
-       ic->op == PCALL ||
-       ic->op == RETURN ||
-       POINTER_GET(ic))
-       return ;
+  ic->op == IPUSH ||
+  ic->op == IPOP  ||
+  ic->op == CALL  ||
+  ic->op == PCALL ||
+  ic->op == RETURN ||
+  POINTER_GET(ic))
+  return ;
 
     /* if both operands present & ! IFX */
     /* then if they are both literal we */
     /* perform the operation right now  */
     if (IC_RESULT(ic) &&
-       IC_RIGHT(ic)  &&
-       IC_LEFT(ic)   &&
-       IS_OP_LITERAL(IC_LEFT(ic)) &&
-       IS_OP_LITERAL(IC_RIGHT(ic))) {
-       
-       IC_RIGHT(ic) = operandOperation (IC_LEFT(ic),
-                                        IC_RIGHT(ic),
-                                        ic->op,
-                                        operandType(IC_RESULT(ic)));
-       ic->op = '=';       
-       IC_LEFT(ic) = NULL ;
-       SET_RESULT_RIGHT(ic);
-       return ;
-       
+  IC_RIGHT(ic)  &&
+  IC_LEFT(ic)   &&
+  IS_OP_LITERAL(IC_LEFT(ic)) &&
+  IS_OP_LITERAL(IC_RIGHT(ic))) {
+
+  IC_RIGHT(ic) = operandOperation (IC_LEFT(ic),
+           IC_RIGHT(ic),
+           ic->op,
+           operandType(IC_RESULT(ic)));
+  ic->op = '=';
+  IC_LEFT(ic) = NULL ;
+  SET_RESULT_RIGHT(ic);
+  return ;
+
     }
     /* if not ifx & only one operand present */
     if (IC_RESULT(ic) &&
-       IC_LEFT(ic)   &&
-       IS_OP_LITERAL(IC_LEFT(ic)) &&
-       !IC_RIGHT(ic)) {
-       
-       IC_RIGHT(ic) = operandOperation (IC_LEFT(ic),
-                                        IC_RIGHT(ic),
-                                        ic->op,
-                                        operandType(IC_RESULT(ic)));
-       ic->op = '=';
-       IC_LEFT(ic) = NULL ;
-       SET_RESULT_RIGHT(ic);
-       return ;
+  IC_LEFT(ic)   &&
+  IS_OP_LITERAL(IC_LEFT(ic)) &&
+  !IC_RIGHT(ic)) {
+
+  IC_RIGHT(ic) = operandOperation (IC_LEFT(ic),
+           IC_RIGHT(ic),
+           ic->op,
+           operandType(IC_RESULT(ic)));
+  ic->op = '=';
+  IC_LEFT(ic) = NULL ;
+  SET_RESULT_RIGHT(ic);
+  return ;
     }
 
-    
-    /* a special case : or in short a kludgy solution will think 
+
+    /* a special case : or in short a kludgy solution will think
        about a better solution over a glass of wine someday */
     if ( ic->op == GET_VALUE_AT_ADDRESS ) {
 
-       if (IS_ITEMP(IC_RESULT(ic)) &&
-           IS_TRUE_SYMOP(IC_LEFT(ic))) {
-
-           ic->op = '=' ;
-           IC_RIGHT(ic) = operandFromOperand(IC_LEFT(ic));
-           IC_RIGHT(ic)->isaddr = 0;
-           IC_LEFT(ic) = NULL;
-           IC_RESULT(ic) = operandFromOperand(IC_RESULT(ic));
-           IC_RESULT(ic)->isaddr = 0;
-           setOperandType(IC_RESULT(ic),operandType(IC_RIGHT(ic)));
-           return;
-       }
-
-       if (IS_ITEMP(IC_LEFT(ic)) &&
-           IS_ITEMP(IC_RESULT(ic)) &&
-/*         !OP_SYMBOL(IC_RESULT(ic))->isreqv && */
-/*         !OP_SYMBOL(IC_LEFT(ic))->isreqv && */
-           !IC_LEFT(ic)->isaddr ) {
-           ic->op = '=' ;
-           IC_RIGHT(ic) = operandFromOperand(IC_LEFT(ic));
-           IC_RIGHT(ic)->isaddr = 0;
-           IC_RESULT(ic) = operandFromOperand(IC_RESULT(ic));
-           IC_RESULT(ic)->isaddr = 0;
-           IC_LEFT(ic) = NULL;
-           return;
-       }
+  if (IS_ITEMP(IC_RESULT(ic)) &&
+      IS_TRUE_SYMOP(IC_LEFT(ic))) {
+
+      ic->op = '=' ;
+      IC_RIGHT(ic) = operandFromOperand(IC_LEFT(ic));
+      IC_RIGHT(ic)->isaddr = 0;
+      IC_LEFT(ic) = NULL;
+      IC_RESULT(ic) = operandFromOperand(IC_RESULT(ic));
+      IC_RESULT(ic)->isaddr = 0;
+      setOperandType(IC_RESULT(ic),operandType(IC_RIGHT(ic)));
+      return;
+  }
+
+  if (IS_ITEMP(IC_LEFT(ic)) &&
+      IS_ITEMP(IC_RESULT(ic)) &&
+/*      !OP_SYMBOL(IC_RESULT(ic))->isreqv && */
+/*      !OP_SYMBOL(IC_LEFT(ic))->isreqv && */
+      !IC_LEFT(ic)->isaddr ) {
+      ic->op = '=' ;
+      IC_RIGHT(ic) = operandFromOperand(IC_LEFT(ic));
+      IC_RIGHT(ic)->isaddr = 0;
+      IC_RESULT(ic) = operandFromOperand(IC_RESULT(ic));
+      IC_RESULT(ic)->isaddr = 0;
+      IC_LEFT(ic) = NULL;
+      return;
+  }
 
     }
-   
+
 
     /* depending on the operation */
     switch (ic->op) {
     case '+' :
-       /* if adding the same thing change to left shift by 1*/
-       if (IC_LEFT(ic)->key == IC_RIGHT(ic)->key && 
-           !IS_FLOAT(operandType(IC_RESULT(ic)))) {
-           ic->op = LEFT_OP ;
-           IC_RIGHT(ic) = operandFromLit(1);
-           return;
-       }
-       /* if addition then check if one of them is a zero */ 
-       /* if yes turn it  into assignmnt*/
-       if (IS_OP_LITERAL(IC_LEFT(ic)) &&
-           operandLitValue(IC_LEFT(ic)) == 0.0 ) {
-
-           ic->op = '=' ;         
-           IC_LEFT(ic) = NULL ;
-           SET_ISADDR(IC_RESULT(ic),0);
-           SET_ISADDR(IC_RIGHT(ic),0);
-           return ;
-       }
-       if (IS_OP_LITERAL(IC_RIGHT(ic)) &&
-           operandLitValue(IC_RIGHT(ic)) == 0.0 ) {
-
-           ic->op = '=' ;          
-           IC_RIGHT(ic) = IC_LEFT(ic) ;
-           IC_LEFT(ic) = 0;
-           SET_ISADDR(IC_RIGHT(ic),0);
-           SET_ISADDR(IC_RESULT(ic),0);
-           return ;
-       }
-       break ;
+  /* if adding the same thing change to left shift by 1*/
+  if (IC_LEFT(ic)->key == IC_RIGHT(ic)->key &&
+      !IS_FLOAT(operandType(IC_RESULT(ic)))) {
+      ic->op = LEFT_OP ;
+      IC_RIGHT(ic) = operandFromLit(1);
+      return;
+  }
+  /* if addition then check if one of them is a zero */
+  /* if yes turn it  into assignmnt*/
+  if (IS_OP_LITERAL(IC_LEFT(ic)) &&
+      operandLitValue(IC_LEFT(ic)) == 0.0 ) {
+
+      ic->op = '=' ;
+      IC_LEFT(ic) = NULL ;
+      SET_ISADDR(IC_RESULT(ic),0);
+      SET_ISADDR(IC_RIGHT(ic),0);
+      return ;
+  }
+  if (IS_OP_LITERAL(IC_RIGHT(ic)) &&
+      operandLitValue(IC_RIGHT(ic)) == 0.0 ) {
+
+      ic->op = '=' ;
+      IC_RIGHT(ic) = IC_LEFT(ic) ;
+      IC_LEFT(ic) = 0;
+      SET_ISADDR(IC_RIGHT(ic),0);
+      SET_ISADDR(IC_RESULT(ic),0);
+      return ;
+  }
+  break ;
     case '-' :
-       /* if subtracting the the same thing then zero     */
-       if ( IC_LEFT(ic)->key == IC_RIGHT(ic)->key ) {
-           ic->op = '=';
-           IC_RIGHT(ic) = operandFromLit(0);
-           IC_LEFT(ic) = NULL ;
-           IC_RESULT(ic) = operandFromOperand(IC_RESULT(ic));
-           IC_RESULT(ic)->isaddr = 0;
-           return ;
-       }           
-           
-       /* if subtraction then check if one of the operand */
-       /* is zero then depending on which operand change  */
-       /* to assignment or unary minus                    */
-       if (IS_OP_LITERAL(IC_RIGHT(ic)) &&
-           operandLitValue(IC_RIGHT(ic)) == 0.0 ) {
-           /* right size zero change to assignment */
-           ic->op = '=' ;          
-           IC_RIGHT(ic) = IC_LEFT(ic);
-           IC_LEFT(ic) = NULL;
-           SET_ISADDR(IC_RIGHT(ic),0);
-           SET_ISADDR(IC_RESULT(ic),0);
-           return ;
-       }
-       if (IS_OP_LITERAL(IC_LEFT(ic)) &&
-           operandLitValue (IC_LEFT(ic)) == 0.0) {
-           /* left zero turn into an unary minus */
-           ic->op = UNARYMINUS ;
-           IC_LEFT(ic) = IC_RIGHT(ic);
-           IC_RIGHT(ic) = NULL ;
-           return ;
-       }
-       break;
-       /* if multiplication then check if either of */
-       /* them is zero then the result is zero      */
-       /* if either of them is one then result is   */
-       /* the other one                             */
+  /* if subtracting the the same thing then zero     */
+  if ( IC_LEFT(ic)->key == IC_RIGHT(ic)->key ) {
+      ic->op = '=';
+      IC_RIGHT(ic) = operandFromLit(0);
+      IC_LEFT(ic) = NULL ;
+      IC_RESULT(ic) = operandFromOperand(IC_RESULT(ic));
+      IC_RESULT(ic)->isaddr = 0;
+      return ;
+  }
+
+  /* if subtraction then check if one of the operand */
+  /* is zero then depending on which operand change  */
+  /* to assignment or unary minus                    */
+  if (IS_OP_LITERAL(IC_RIGHT(ic)) &&
+      operandLitValue(IC_RIGHT(ic)) == 0.0 ) {
+      /* right size zero change to assignment */
+      ic->op = '=' ;
+      IC_RIGHT(ic) = IC_LEFT(ic);
+      IC_LEFT(ic) = NULL;
+      SET_ISADDR(IC_RIGHT(ic),0);
+      SET_ISADDR(IC_RESULT(ic),0);
+      return ;
+  }
+  if (IS_OP_LITERAL(IC_LEFT(ic)) &&
+      operandLitValue (IC_LEFT(ic)) == 0.0) {
+      /* left zero turn into an unary minus */
+      ic->op = UNARYMINUS ;
+      IC_LEFT(ic) = IC_RIGHT(ic);
+      IC_RIGHT(ic) = NULL ;
+      return ;
+  }
+  break;
+  /* if multiplication then check if either of */
+  /* them is zero then the result is zero      */
+  /* if either of them is one then result is   */
+  /* the other one                             */
     case '*' :
-       if (IS_OP_LITERAL(IC_LEFT(ic))) {
-           
-           if (operandLitValue(IC_LEFT(ic)) == 0.0) {      
-               ic->op = '=' ;
-               IC_RIGHT(ic) = IC_LEFT(ic);
-               IC_LEFT(ic) = NULL;
-               SET_RESULT_RIGHT(ic);
-               return ;
-           }
-           if ( operandLitValue(IC_LEFT(ic)) == 1.0) {
-               ic->op = '=' ;
-               IC_LEFT(ic) = NULL ;
-               SET_RESULT_RIGHT(ic);
-               return ;
-           }       
-       }
-       
-       if (IS_OP_LITERAL(IC_RIGHT(ic))) {
-           
-           if (operandLitValue(IC_RIGHT(ic)) == 0.0 ) {            
-               ic->op = '=';           
-               IC_LEFT(ic) = NULL ;
-               SET_RESULT_RIGHT(ic);
-               return ;
-           }
-
-           if (operandLitValue(IC_RIGHT(ic)) == 1.0) {
-               ic->op = '=' ;    
-               IC_RIGHT(ic) = IC_LEFT(ic);
-               IC_LEFT(ic) = NULL ;
-               SET_RESULT_RIGHT(ic);
-               return ;
-           }
-       }
-       break ;
+  if (IS_OP_LITERAL(IC_LEFT(ic))) {
+
+      if (operandLitValue(IC_LEFT(ic)) == 0.0) {
+    ic->op = '=' ;
+    IC_RIGHT(ic) = IC_LEFT(ic);
+    IC_LEFT(ic) = NULL;
+    SET_RESULT_RIGHT(ic);
+    return ;
+      }
+      if ( operandLitValue(IC_LEFT(ic)) == 1.0) {
+    ic->op = '=' ;
+    IC_LEFT(ic) = NULL ;
+    SET_RESULT_RIGHT(ic);
+    return ;
+      }
+  }
+
+  if (IS_OP_LITERAL(IC_RIGHT(ic))) {
+
+      if (operandLitValue(IC_RIGHT(ic)) == 0.0 ) {
+    ic->op = '=';
+    IC_LEFT(ic) = NULL ;
+    SET_RESULT_RIGHT(ic);
+    return ;
+      }
+
+      if (operandLitValue(IC_RIGHT(ic)) == 1.0) {
+    ic->op = '=' ;
+    IC_RIGHT(ic) = IC_LEFT(ic);
+    IC_LEFT(ic) = NULL ;
+    SET_RESULT_RIGHT(ic);
+    return ;
+      }
+  }
+  break ;
     case '/':
-       /* if division by self then 1 */
-       if (IC_LEFT(ic)->key == IC_RIGHT(ic)->key) {
-           ic->op = '='; 
-           IC_RIGHT(ic) = operandFromLit(1);
-           IC_LEFT(ic) = NULL;
-           IC_RESULT(ic) = operandFromOperand(IC_RESULT(ic));
-           IC_RESULT(ic)->isaddr = 0;
-       }
-       /* if this is a division then check if right */
-       /* is one then change it to an assignment    */
-       if (IS_OP_LITERAL(IC_RIGHT(ic)) &&
-           operandLitValue(IC_RIGHT(ic)) == 1.0 ) {
-
-           ic->op = '=' ;
-           IC_RIGHT(ic) = IC_LEFT(ic);
-           IC_LEFT(ic) = NULL;
-           SET_RESULT_RIGHT(ic);
-           return ;
-       }
-       break;
-       /* if both are the same for an comparison operators */
+  /* if division by self then 1 */
+  if (IC_LEFT(ic)->key == IC_RIGHT(ic)->key) {
+      ic->op = '=';
+      IC_RIGHT(ic) = operandFromLit(1);
+      IC_LEFT(ic) = NULL;
+      IC_RESULT(ic) = operandFromOperand(IC_RESULT(ic));
+      IC_RESULT(ic)->isaddr = 0;
+  }
+  /* if this is a division then check if right */
+  /* is one then change it to an assignment    */
+  if (IS_OP_LITERAL(IC_RIGHT(ic)) &&
+      operandLitValue(IC_RIGHT(ic)) == 1.0 ) {
+
+      ic->op = '=' ;
+      IC_RIGHT(ic) = IC_LEFT(ic);
+      IC_LEFT(ic) = NULL;
+      SET_RESULT_RIGHT(ic);
+      return ;
+  }
+  break;
+  /* if both are the same for an comparison operators */
     case EQ_OP :
     case LE_OP :
     case GE_OP :
-       if (isOperandEqual(IC_LEFT(ic),IC_RIGHT(ic))) {
-           ic->op = '=';
-           IC_RIGHT(ic) = operandFromLit(1);
-           IC_LEFT(ic) = NULL;
-           SET_RESULT_RIGHT(ic);
-       }
-       break;
+  if (isOperandEqual(IC_LEFT(ic),IC_RIGHT(ic))) {
+      ic->op = '=';
+      IC_RIGHT(ic) = operandFromLit(1);
+      IC_LEFT(ic) = NULL;
+      SET_RESULT_RIGHT(ic);
+  }
+  break;
     case NE_OP :
     case '>' :
     case '<' :
-       if (isOperandEqual(IC_LEFT(ic),IC_RIGHT(ic))) {
-           ic->op = '=';
-           IC_RIGHT(ic) = operandFromLit(0);
-           IC_LEFT(ic) = NULL ;
-           SET_RESULT_RIGHT(ic);
-       }
-       break ;
+  if (isOperandEqual(IC_LEFT(ic),IC_RIGHT(ic))) {
+      ic->op = '=';
+      IC_RIGHT(ic) = operandFromLit(0);
+      IC_LEFT(ic) = NULL ;
+      SET_RESULT_RIGHT(ic);
+  }
+  break ;
     case CAST :
-       /* if this is a cast of a literal value */
-       if ( IS_OP_LITERAL(IC_RIGHT(ic))) {
-           ic->op = '=' ;
-           IC_RIGHT(ic) = 
-               operandFromValue (valCastLiteral(operandType(IC_LEFT(ic)),
-                                                operandLitValue(IC_RIGHT(ic))));
-           IC_LEFT(ic) = NULL;
-           SET_ISADDR(IC_RESULT(ic),0); 
-       }
-       /* if casting to the same */
-       if ( checkType(operandType(IC_RESULT(ic)),
-                      operandType(IC_RIGHT(ic))) == 1) {
-           ic->op = '=';
-           IC_LEFT(ic) = NULL;
-           SET_ISADDR(IC_RESULT(ic),0);                
-       }
-       break;
+  /* if this is a cast of a literal value */
+  if ( IS_OP_LITERAL(IC_RIGHT(ic))) {
+      ic->op = '=' ;
+      IC_RIGHT(ic) =
+    operandFromValue (valCastLiteral(operandType(IC_LEFT(ic)),
+             operandLitValue(IC_RIGHT(ic))));
+      IC_LEFT(ic) = NULL;
+      SET_ISADDR(IC_RESULT(ic),0);
+  }
+  /* if casting to the same */
+  if ( checkType(operandType(IC_RESULT(ic)),
+           operandType(IC_RIGHT(ic))) == 1) {
+      ic->op = '=';
+      IC_LEFT(ic) = NULL;
+      SET_ISADDR(IC_RESULT(ic),0);
+  }
+  break;
     case '!' :
-       if (IS_OP_LITERAL(IC_LEFT(ic))) {
-           ic->op = '=' ;
-           IC_RIGHT(ic) = 
-              (operandLitValue(IC_LEFT(ic)) == 0 ? 
-               operandFromLit(1) : operandFromLit(0));
-           IC_LEFT(ic) = NULL;
-           SET_ISADDR(IC_RESULT(ic),0);            
-       }
+  if (IS_OP_LITERAL(IC_LEFT(ic))) {
+      ic->op = '=' ;
+      IC_RIGHT(ic) =
+         (operandLitValue(IC_LEFT(ic)) == 0 ?
+    operandFromLit(1) : operandFromLit(0));
+      IC_LEFT(ic) = NULL;
+      SET_ISADDR(IC_RESULT(ic),0);
+  }
     }
-    
+
     return ;
 }
 #define OTHERS_PARM(s) (s->_isparm && !s->ismyparm)
@@ -795,49 +795,49 @@ void updateSpillLocation ( iCode *ic)
 
     sym_link *setype;
 
-    if (POINTER_SET(ic)) 
-       return;
-    
+    if (POINTER_SET(ic))
+  return;
+
     if (ic->nosupdate)
-       return;       
+  return;
 
     /* for the form true_symbol := iTempNN */
     if (ASSIGN_ITEMP_TO_SYM(ic)
-       && !SPIL_LOC(IC_RIGHT(ic))) {
+  && !SPIL_LOC(IC_RIGHT(ic))) {
+
+  setype = getSpec(operandType(IC_RESULT(ic)));
 
-       setype = getSpec(operandType(IC_RESULT(ic)));
-       
         if (!IC_RIGHT(ic)->noSpilLoc           &&
-           !IS_VOLATILE(setype)               &&
-           !IN_FARSPACE(SPEC_OCLS(setype))    &&
-           !OTHERS_PARM(OP_SYMBOL(IC_RESULT(ic))) )
-           
-           SPIL_LOC(IC_RIGHT(ic))  =
-               IC_RESULT(ic)->operand.symOperand;   
+      !IS_VOLATILE(setype)               &&
+      !IN_FARSPACE(SPEC_OCLS(setype))    &&
+      !OTHERS_PARM(OP_SYMBOL(IC_RESULT(ic))) )
+
+      SPIL_LOC(IC_RIGHT(ic))  =
+    IC_RESULT(ic)->operand.symOperand;
     }
 
     if (ASSIGN_ITEMP_TO_ITEMP(ic) &&
-       !SPIL_LOC(IC_RIGHT(ic))   &&
+  !SPIL_LOC(IC_RIGHT(ic))   &&
         !bitVectBitsInCommon(OP_DEFS(IC_RIGHT(ic)),OP_USES(IC_RESULT(ic))) &&
-       OP_SYMBOL(IC_RESULT(ic))->isreqv) {
-       
-       setype = getSpec(operandType(IC_RESULT(ic)));
+  OP_SYMBOL(IC_RESULT(ic))->isreqv) {
+
+  setype = getSpec(operandType(IC_RESULT(ic)));
 
         if (!IC_RIGHT(ic)->noSpilLoc           &&
-           !IS_VOLATILE(setype)               &&
-           !IN_FARSPACE(SPEC_OCLS(setype))    &&
-           !OTHERS_PARM(OP_SYMBOL(IC_RESULT(ic))) )  
-           
-           SPIL_LOC(IC_RIGHT(ic)) = 
-               SPIL_LOC(IC_RESULT(ic));
+      !IS_VOLATILE(setype)               &&
+      !IN_FARSPACE(SPEC_OCLS(setype))    &&
+      !OTHERS_PARM(OP_SYMBOL(IC_RESULT(ic))) )
+
+      SPIL_LOC(IC_RIGHT(ic)) =
+    SPIL_LOC(IC_RESULT(ic));
     }
 }
 
 /*-----------------------------------------------------------------*/
 /* setUsesDef - sets the uses def bitvector for a given operand    */
 /*-----------------------------------------------------------------*/
-void setUsesDefs (operand *op, bitVect *bdefs, 
-                 bitVect *idefs, bitVect **oud)
+void setUsesDefs (operand *op, bitVect *bdefs,
+      bitVect *idefs, bitVect **oud)
 {
     /* compute the definitions alive at this point */
     bitVect *adefs = bitVectUnion(bdefs,idefs);
@@ -845,10 +845,10 @@ void setUsesDefs (operand *op, bitVect *bdefs,
     /* of these definitions find the ones that are */
     /* for this operand */
     adefs = bitVectIntersect(adefs,OP_DEFS(op));
-    
+
     /* these are the definitions that this operand can use */
     op->usesDefs = adefs;
-    
+
     /* the out defs is an union */
     *oud = bitVectUnion(*oud,adefs);
 }
@@ -856,105 +856,105 @@ void setUsesDefs (operand *op, bitVect *bdefs,
 /*-----------------------------------------------------------------*/
 /* unsetDefsAndUses - clear this operation for the operands        */
 /*-----------------------------------------------------------------*/
-void unsetDefsAndUses ( iCode *ic ) 
+void unsetDefsAndUses ( iCode *ic )
 {
     if ( ic->op == JUMPTABLE)
-       return ;
+  return ;
 
     /* take away this definition from the def chain of the */
     /* result & take away from use set of the operands */
     if (ic->op != IFX) {
-       /* turn off def set */
-       if (IS_SYMOP(IC_RESULT(ic))) {
-           if ( !POINTER_SET(ic)) 
-               bitVectUnSetBit(OP_DEFS(IC_RESULT(ic)),ic->key);
-           else
-               bitVectUnSetBit(OP_USES(IC_RESULT(ic)),ic->key);
-       }
-       /* turn off the useSet for the operands */
-       if (IS_SYMOP(IC_LEFT(ic)))
-           bitVectUnSetBit (OP_USES(IC_LEFT(ic)),ic->key);
-       
-       if (IS_SYMOP(IC_RIGHT(ic)))
-           bitVectUnSetBit (OP_USES(IC_RIGHT(ic)),ic->key);
+  /* turn off def set */
+  if (IS_SYMOP(IC_RESULT(ic))) {
+      if ( !POINTER_SET(ic))
+    bitVectUnSetBit(OP_DEFS(IC_RESULT(ic)),ic->key);
+      else
+    bitVectUnSetBit(OP_USES(IC_RESULT(ic)),ic->key);
+  }
+  /* turn off the useSet for the operands */
+  if (IS_SYMOP(IC_LEFT(ic)))
+      bitVectUnSetBit (OP_USES(IC_LEFT(ic)),ic->key);
+
+  if (IS_SYMOP(IC_RIGHT(ic)))
+      bitVectUnSetBit (OP_USES(IC_RIGHT(ic)),ic->key);
     }
     else /* must be ifx turn off the use */
-       if (IS_SYMOP(IC_COND(ic)))
-           bitVectUnSetBit (OP_USES(IC_COND(ic)),ic->key);    
+  if (IS_SYMOP(IC_COND(ic)))
+      bitVectUnSetBit (OP_USES(IC_COND(ic)),ic->key);
 }
 
 /*-----------------------------------------------------------------*/
 /* ifxOptimize - changes ifx conditions if it can                  */
 /*-----------------------------------------------------------------*/
-void ifxOptimize (iCode *ic, set *cseSet, 
-                        int computeOnly , 
-                        eBBlock *ebb, int *change,
-                        eBBlock **ebbs, int count)
+void ifxOptimize (iCode *ic, set *cseSet,
+       int computeOnly ,
+       eBBlock *ebb, int *change,
+       eBBlock **ebbs, int count)
 {
     operand *pdop ;
     symbol *label;
 
     /* if the condition can be replaced */
     if (!computeOnly) {
-       pdop = NULL ;
-       applyToSetFTrue (cseSet,findCheaperOp,IC_COND(ic),&pdop);
-       if (pdop) {
-           IC_COND(ic) = pdop ;
-           (*change)++;
-       }
+  pdop = NULL ;
+  applyToSetFTrue (cseSet,findCheaperOp,IC_COND(ic),&pdop);
+  if (pdop) {
+      IC_COND(ic) = pdop ;
+      (*change)++;
+  }
     }
-    
+
     /* if the conditional is a literal then */
-    if (IS_OP_LITERAL(IC_COND(ic))) {         
-
-       if ( (operandLitValue(IC_COND(ic)) != 0.0) && IC_TRUE(ic)) {
-           
-           /* change to a goto */
-           ic->op = GOTO ;
-           IC_LABEL(ic) = IC_TRUE(ic);
-           (*change)++;
-           
-       } else {
-           
-           if (!operandLitValue(IC_COND(ic)) && IC_FALSE(ic)) {                
-               ic->op = GOTO ;
-               IC_LABEL(ic) = IC_FALSE(ic);
-               (*change)++;
-               
-           } else {
-               /* then kill this if condition */                       
-               remiCodeFromeBBlock (ebb,ic);           
-           }       
-       }
-       
-       /* now we need to recompute the control flow */
-       /* since the control flow has changed        */
-       /* this is very expensive but it does not happen */
-       /* too often, if it does happen then the user pays */
-       /* the price */
-       computeControlFlow (ebbs,count,1);
-       werror (W_CONTROL_FLOW,ic->filename,ic->lineno);
-       return ;
+    if (IS_OP_LITERAL(IC_COND(ic))) {
+
+  if ( (operandLitValue(IC_COND(ic)) != 0.0) && IC_TRUE(ic)) {
+
+      /* change to a goto */
+      ic->op = GOTO ;
+      IC_LABEL(ic) = IC_TRUE(ic);
+      (*change)++;
+
+  } else {
+
+      if (!operandLitValue(IC_COND(ic)) && IC_FALSE(ic)) {
+    ic->op = GOTO ;
+    IC_LABEL(ic) = IC_FALSE(ic);
+    (*change)++;
+
+      } else {
+    /* then kill this if condition */
+    remiCodeFromeBBlock (ebb,ic);
+      }
+  }
+
+  /* now we need to recompute the control flow */
+  /* since the control flow has changed        */
+  /* this is very expensive but it does not happen */
+  /* too often, if it does happen then the user pays */
+  /* the price */
+  computeControlFlow (ebbs,count,1);
+  werror (W_CONTROL_FLOW,ic->filename,ic->lineno);
+  return ;
     }
-    
+
     /* if there is only one successor and that successor
        is the same one we are conditionally going to then
        we can remove this conditional statement */
     label = (IC_TRUE(ic) ? IC_TRUE(ic) : IC_FALSE(ic));
     if (elementsInSet(ebb->succList) == 1 &&
-       isinSet(ebb->succList,eBBWithEntryLabel(ebbs,label,count))) {
+  isinSet(ebb->succList,eBBWithEntryLabel(ebbs,label,count))) {
 
-       remiCodeFromeBBlock(ebb,ic);
-       computeControlFlow (ebbs,count,1);
-       werror (W_CONTROL_FLOW,ic->filename,ic->lineno);
-       return ;        
+  remiCodeFromeBBlock(ebb,ic);
+  computeControlFlow (ebbs,count,1);
+  werror (W_CONTROL_FLOW,ic->filename,ic->lineno);
+  return ;
     }
-       
-       
+
+
     /* if it remains an IFX the update the use Set */
     OP_USES(IC_COND(ic)) = bitVectSetBit(OP_USES(IC_COND(ic)),ic->key);
     setUsesDefs(IC_COND(ic),ebb->defSet,ebb->outDefs,&ebb->usesDefs);
-    return ;  
+    return ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -968,12 +968,12 @@ DEFSETFUNC(diCodeForSym)
 
     /* if already found */
     if (*dic)
-       return 0;
+  return 0;
 
     /* if not if this is the defining iCode */
     if (sym->key == cdp->key) {
-       *dic = cdp->diCode ;
-       return 1;
+  *dic = cdp->diCode ;
+  return 1;
     }
 
     return 0;
@@ -994,57 +994,57 @@ int constFold (iCode *ic, set *cseSet)
 
     /* deal with only + & - */
     if (ic->op != '+' &&
-       ic->op != '-' )
-       return 0;
+  ic->op != '-' )
+  return 0;
 
     /* this check is a hueristic to prevent live ranges
        from becoming too long */
     if (IS_PTR(operandType(IC_RESULT(ic))))
-       return 0;
+  return 0;
 
     /* check if operation with a literal */
     if (!IS_OP_LITERAL(IC_RIGHT(ic)))
-       return 0;
+  return 0;
 
     /* check if we can find a definition for the
        right hand side */
     if (!(applyToSet(cseSet,diCodeForSym,IC_LEFT(ic),&dic)))
-       return 0;
+  return 0;
 
     /* check that this is also a +/-  */
     if (dic->op != '+' && dic->op != '-')
-       return 0;
+  return 0;
 
     /* with a literal */
     if (!IS_OP_LITERAL(IC_RIGHT(dic)))
-       return 0;
+  return 0;
 
     /* find the definition of the left operand
        of dic.then check if this defined with a
        get_pointer return 0 if the pointer size is
        less than 2 (MCS51 specific) */
     if (!(applyToSet(cseSet,diCodeForSym,IC_LEFT(dic),&ldic)))
-       return 0;
+  return 0;
 
     if (POINTER_GET(ldic) && getSize(operandType(IC_LEFT(ldic))) <= 1)
-       return 0;
-    
+  return 0;
+
     /* it is if the operations are the same*/
     /* the literal parts need to be added  */
-    IC_LEFT(ic) = operandFromOperand(IC_LEFT(dic));    
+    IC_LEFT(ic) = operandFromOperand(IC_LEFT(dic));
     if (ic->op == dic->op )
-       IC_RIGHT(ic) = operandFromLit(operandLitValue(IC_RIGHT(ic))+
-                                     operandLitValue(IC_RIGHT(dic)));
+  IC_RIGHT(ic) = operandFromLit(operandLitValue(IC_RIGHT(ic))+
+              operandLitValue(IC_RIGHT(dic)));
     else
-       IC_RIGHT(ic) = operandFromLit(operandLitValue(IC_RIGHT(ic)) -
-                                     operandLitValue(IC_RIGHT(dic)));
+  IC_RIGHT(ic) = operandFromLit(operandLitValue(IC_RIGHT(ic)) -
+              operandLitValue(IC_RIGHT(dic)));
 
     if (IS_ITEMP(IC_RESULT(ic))) {
-       SPIL_LOC(IC_RESULT(ic)) = NULL;
-       IC_RESULT(ic)->noSpilLoc = 1;
+  SPIL_LOC(IC_RESULT(ic)) = NULL;
+  IC_RESULT(ic)->noSpilLoc = 1;
     }
-       
-    
+
+
     return 1;
 }
 
@@ -1058,33 +1058,33 @@ static void deleteGetPointers (set **cseSet, set **pss, operand *op,eBBlock *ebb
     set *compItems = NULL;
     cseDef *cdp ;
     operand *cop;
-    
+
     /* easy return */
     if (!*cseSet && !*pss)
-       return ;
-    
+  return ;
+
     /* first find all items computed from this operand .
        This done fairly simply go thru the list and find
        those that are computed by arthimetic with this
        op */
     for (cdp = setFirstItem(*cseSet); cdp ; cdp = setNextItem(*cseSet)) {
-       if (IS_ARITHMETIC_OP(cdp->diCode)) {
-           if (isOperandEqual(IC_LEFT(cdp->diCode),op) ||
-               isOperandEqual(IC_RIGHT(cdp->diCode),op)) {
-                               /* save it in our list of items */
-               addSet(&compItems,IC_RESULT(cdp->diCode));
-           }
-           /* also check for those computed from our computed 
-              list . This will take care of situations like
-              iTemp1 = iTemp0 + 8;
-              iTemp2 = iTemp1 + 8; */
-           if (isinSetWith(compItems,IC_LEFT(cdp->diCode),isOperandEqual) ||
-               isinSetWith(compItems,IC_RIGHT(cdp->diCode),isOperandEqual)) {
-                   addSet(&compItems,IC_RESULT(cdp->diCode));
-           }
-       }
+  if (IS_ARITHMETIC_OP(cdp->diCode)) {
+      if (isOperandEqual(IC_LEFT(cdp->diCode),op) ||
+    isOperandEqual(IC_RIGHT(cdp->diCode),op)) {
+        /* save it in our list of items */
+    addSet(&compItems,IC_RESULT(cdp->diCode));
+      }
+      /* also check for those computed from our computed
+         list . This will take care of situations like
+         iTemp1 = iTemp0 + 8;
+         iTemp2 = iTemp1 + 8; */
+      if (isinSetWith(compItems,IC_LEFT(cdp->diCode),isOperandEqual) ||
+    isinSetWith(compItems,IC_RIGHT(cdp->diCode),isOperandEqual)) {
+        addSet(&compItems,IC_RESULT(cdp->diCode));
+      }
+  }
     }
-    
+
     /* now delete all pointer gets with this op */
     deleteItemIf(cseSet,ifPointerGet,op);
     deleteItemIf(pss,ifPointerSet,op);
@@ -1093,9 +1093,9 @@ static void deleteGetPointers (set **cseSet, set **pss, operand *op,eBBlock *ebb
     ebb->ptrsSet = bitVectSetBit(ebb->ptrsSet,op->key);
     /* now for the computed items */
     for (cop = setFirstItem(compItems); cop ; cop = setNextItem(compItems)) {
-       ebb->ptrsSet = bitVectSetBit(ebb->ptrsSet,cop->key);    
-       deleteItemIf(cseSet,ifPointerGet,cop);
-       deleteItemIf(pss,ifPointerSet,cop);
+  ebb->ptrsSet = bitVectSetBit(ebb->ptrsSet,cop->key);
+  deleteItemIf(cseSet,ifPointerGet,cop);
+  deleteItemIf(pss,ifPointerSet,cop);
     }
 }
 
@@ -1110,35 +1110,35 @@ DEFSETFUNC(delGetPointerSucc)
     V_ARG(int,dfnum);
 
     if (ebp->visited)
-       return 0;
-    
+  return 0;
+
     ebp->visited = 1;
     if (ebp->dfnum > dfnum) {
-       deleteItemIf(&ebp->inExprs,ifPointerGet,op);
+  deleteItemIf(&ebp->inExprs,ifPointerGet,op);
     }
 
     return applyToSet(ebp->succList,delGetPointerSucc,op,dfnum);
-}    
+}
 
 /*-----------------------------------------------------------------*/
 /* fixUpTypes - KLUGE HACK fixup a lowering problem                */
 /*-----------------------------------------------------------------*/
 static void fixUpTypes(iCode *ic)
 {
-       sym_link *t1 = operandType(IC_LEFT(ic)) ,*t2;
-       
-       if (IS_DS390_PORT)
-       {
-           /* hack-o-matic! */
-           return;
-       }
-       
-       /* for pointer_gets if the types of result & left r the
-          same then change it type of result to next */
-       if (IS_PTR(t1) &&
-           checkType(t2=operandType(IC_RESULT(ic)),t1) == 1) {
-               setOperandType(IC_RESULT(ic),t2->next);
-       }
+  sym_link *t1 = operandType(IC_LEFT(ic)) ,*t2;
+
+  if (IS_DS390_PORT)
+  {
+      /* hack-o-matic! */
+      return;
+  }
+
+  /* for pointer_gets if the types of result & left r the
+     same then change it type of result to next */
+  if (IS_PTR(t1) &&
+      checkType(t2=operandType(IC_RESULT(ic)),t1) == 1) {
+    setOperandType(IC_RESULT(ic),t2->next);
+  }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1147,24 +1147,24 @@ static void fixUpTypes(iCode *ic)
 /*             system. also the most important, since almost all   */
 /*             data flow related information is computed by it     */
 /*-----------------------------------------------------------------*/
-int cseBBlock ( eBBlock *ebb, int computeOnly, 
-               eBBlock **ebbs, int count)
+int cseBBlock ( eBBlock *ebb, int computeOnly,
+    eBBlock **ebbs, int count)
 {
     set *cseSet ;
-    iCode *ic ;           
+    iCode *ic ;
     int change = 0 ;
-    int i;   
+    int i;
     set *ptrSetSet = NULL;
 
     /* if this block is not reachable */
     if (ebb->noPath)
-       return change;
+  return change;
+
+   /* set of common subexpressions */
+    cseSet = setFromSet (ebb->inExprs) ;
 
-   /* set of common subexpressions */   
-    cseSet = setFromSet (ebb->inExprs) ;      
-      
     /* these will be computed by this routine */
-    setToNull ((void **)&ebb->outDefs);    
+    setToNull ((void **)&ebb->outDefs);
     setToNull ((void **)&ebb->defSet);
     setToNull ((void **)&ebb->usesDefs);
     setToNull ((void **)&ebb->ptrsSet);
@@ -1178,358 +1178,358 @@ int cseBBlock ( eBBlock *ebb, int computeOnly,
 
     /* for all the instructions in this block do */
     for (ic = ebb->sch ; ic ; ic = ic->next ) {
-       
-       iCode *pdic; 
-       operand *pdop ;
-       iCode *defic;
-       
-       if (SKIP_IC2(ic))
-           continue ;
-
-       /* if this is an assignment from true symbol
-          to a temp then do pointer post inc/dec optimzation */
-       if (ic->op == '=' && !POINTER_SET(ic) &&
-           IS_PTR(operandType(IC_RESULT(ic)))) {
-           ptrPostIncDecOpt(ic);
-       }
-
-       /* clear the def & use chains for the operands involved */
-       /* in this operation . since it can change due to opts  */
-       unsetDefsAndUses (ic);
-       
-       if ( ic->op == PCALL || ic->op == CALL || ic->op == RECEIVE) {
-           /* add to defSet of the symbol */
-           OP_DEFS(IC_RESULT(ic)) = 
-               bitVectSetBit (OP_DEFS(IC_RESULT(ic)),ic->key);
-           /* add to the definition set of this block */
-           ebb->defSet = bitVectSetBit (ebb->defSet,ic->key);      
-           ebb->ldefs  = bitVectSetBit (ebb->ldefs,ic->key);
-           ebb->outDefs= bitVectCplAnd (ebb->outDefs,OP_DEFS(IC_RESULT(ic)));
-           setUsesDefs(IC_RESULT(ic),ebb->defSet,ebb->outDefs,&ebb->usesDefs);
-           /* delete global variables from the cseSet
-              since they can be modified by the function call */
-           deleteItemIf(&cseSet,ifDefGlobal);
-           /* delete all getpointer iCodes from cseSet, this should
-              be done only for global arrays & pointers but at this
-              point we don't know if globals, so to be safe do all*/
-           deleteItemIf(&cseSet,ifAnyGetPointer);
-       }
-
-       /* for pcall & ipush we need to add to the useSet */
-       if ((ic->op == PCALL || 
-            ic->op == IPUSH || 
-            ic->op == IPOP  || 
-            ic->op == SEND) && 
-           IS_SYMOP(IC_LEFT(ic))) {
-           
-           /* check if they can be replaced */
-           if ( !computeOnly ) {
-               pdop = NULL ;
-               applyToSetFTrue(cseSet,findCheaperOp,IC_LEFT(ic),&pdop);
-               if (pdop)
-                   IC_LEFT(ic) = pdop ;
-           }
-           /* the lookup could have changed it*/
-           if (IS_SYMOP(IC_LEFT(ic))) {
-               OP_USES(IC_LEFT(ic)) = 
-                   bitVectSetBit(OP_USES(IC_LEFT(ic)),ic->key);
-               setUsesDefs(IC_LEFT(ic),ebb->defSet,
-                           ebb->outDefs,&ebb->usesDefs);
-           }
-
-           
-           /* if we a sending a pointer as a parameter
-              then kill all cse since the pointed to item
-              might be changed in the function being called */
-           if ((ic->op == IPUSH || ic->op == SEND) &&
-               IS_PTR(operandType(IC_LEFT(ic)))) {
-               deleteGetPointers(&cseSet,&ptrSetSet,IC_LEFT(ic),ebb);
-               ebb->ptrsSet = bitVectSetBit(ebb->ptrsSet,IC_LEFT(ic)->key);
-               for (i = 0 ; i < count ;ebbs[i++]->visited = 0);
-               applyToSet(ebb->succList,delGetPointerSucc,
-                          IC_LEFT(ic),ebb->dfnum);
-           }
-           continue;
-       }
-
-       /* if jumptable then mark the usage */
-       if (ic->op == JUMPTABLE ) {
-           OP_USES(IC_JTCOND(ic)) = 
-               bitVectSetBit(OP_USES(IC_JTCOND(ic)),ic->key);
-           setUsesDefs(IC_JTCOND(ic),ebb->defSet,
-                       ebb->outDefs,&ebb->usesDefs);
-           continue;
-       }
-
-       if (SKIP_IC(ic))
-           continue ;
-       
-       /* do some algebraic optimizations if possible */
-       algebraicOpts (ic);
-       while (constFold(ic,cseSet));
-
-       /* small klugde */
-       if (POINTER_GET(ic) && !IS_PTR(operandType(IC_LEFT(ic)))) {
-           setOperandType(IC_LEFT(ic),
-                          aggrToPtr(operandType(IC_LEFT(ic)),FALSE));
-           fixUpTypes(ic);
-
-       }
-       if (POINTER_SET(ic) && !IS_PTR(operandType(IC_RESULT(ic)))) {
-           setOperandType(IC_RESULT(ic),
-                          aggrToPtr(operandType(IC_RESULT(ic)),FALSE));
-       }
-
-       /* if this is a condition statment then */
-       /* check if the condition can be replaced */
-       if (ic->op == IFX ) {
-           ifxOptimize (ic, cseSet, computeOnly, 
-                        ebb, &change, 
-                        ebbs, count);
-           continue ;
-       }
-           
-       /* if the assignment & result is a temp */
-       /* see if we can replace it             */
-       if (ic->op == '=') {
-           
-           /* update the spill location for this */
-           updateSpillLocation (ic);
-
-           if (POINTER_SET(ic) &&
-               !(IS_BITFIELD(OP_SYMBOL(IC_RESULT(ic))->etype))) {
-               pdop = NULL ;
-               applyToSetFTrue (cseSet,findCheaperOp,IC_RESULT(ic),&pdop);
-               if (pdop && IS_ITEMP(pdop) && !computeOnly)                 
-                   IC_RESULT(ic) = pdop;                               
-           }
-       }           
-       
-       /* do the operand lookup i.e. for both the */
-       /* right & left operand : check the cseSet */
-       /* to see if they have been replaced if yes*/
-       /* then replace them with those from cseSet*/
-       /* left operand */
-       /* and left is a symbol  */
-       if (IS_SYMOP(IC_LEFT(ic)) && 
-           !computeOnly && ic->op != ADDRESS_OF ) {  
-           
-           pdop = NULL;                
-           applyToSetFTrue (cseSet,findCheaperOp,IC_LEFT(ic),&pdop) ;
-           if (pdop)  { 
-               if (POINTER_GET(ic)) {
-                   if (IS_ITEMP(pdop) || IS_OP_LITERAL(pdop)) {
-                       IC_LEFT(ic) = pdop;
-                       change = 1;
-                   }
-                   /* check if there is a pointer set
-                      for the same pointer visible if yes
-                      then change this into an assignment */
-                   pdop = NULL;
-                   if (applyToSetFTrue(cseSet,findPointerSet,IC_LEFT(ic),&pdop,IC_RESULT(ic)) &&
-                       !bitVectBitValue(ebb->ptrsSet,pdop->key)){
-                       ic->op = '=';
-                       IC_LEFT(ic) = NULL;
-                       IC_RIGHT(ic) = pdop;
-                       SET_ISADDR(IC_RESULT(ic),0);
-                   }
-                       
-               }
-               else {
-                   IC_LEFT(ic)  = pdop ;
-                   change = 1;
-               }
-           }       
-       }
-       
-       /*right operand */
-       if (IS_SYMOP(IC_RIGHT(ic)) && !computeOnly) {
-           
-           pdop = NULL ;
-           applyToSetFTrue (cseSet,findCheaperOp,IC_RIGHT(ic),&pdop);
-           if (pdop) {
-               
-               IC_RIGHT(ic) = pdop;
-               change = 1;
-           }
-       }
-       
-       /* if left or right changed then do algebraic */
-       if (change) {
-           algebraicOpts(ic);
-           while(constFold(ic,cseSet));
-       }
-
-       /* if after all this it becomes a assignment to self 
-          then delete it and continue */
-       if (ASSIGNMENT_TO_SELF(ic)) {      
-           remiCodeFromeBBlock(ebb,ic);
-           continue;
-       }           
-       
-       /* now we will check to see if the entire */
-       /* operation has been performed before    */
-       /* and is available                       */     
-       /* don't do assignments they will be killed */
-       /* by dead code elimination if required  do */
-       /* it only if result is a temporary         */
-       pdic = NULL ;   
-       if (!( POINTER_GET(ic)                      &&
-              (IS_BITFIELD(OP_SYMBOL(IC_RESULT(ic))->etype) ||
-              isOperandVolatile(IC_LEFT(ic),TRUE)           ||
-              bitVectBitValue(ebb->ndompset,IC_LEFT(ic)->key))) &&
-           ! ASSIGNMENT(ic)                        && 
-             IS_ITEMP(IC_RESULT(ic))               &&
-           ! computeOnly) {
-           applyToSet (cseSet,findPrevIc,ic,&pdic);
-           if (pdic && checkType(operandType(IC_RESULT(pdic)),
-                                 operandType(IC_RESULT(ic))) != 1)
-                   pdic = NULL;
-       } 
-       
-       /* if found then eliminate this and add to*/
-       /* to cseSet an element containing result */
-       /* of this with previous opcode           */      
-       if (pdic) {
-
-           if (IS_ITEMP(IC_RESULT(ic))) {
-
-               /* replace in the remaining of this block */
-               replaceAllSymBySym(ic->next,IC_RESULT(ic),IC_RESULT(pdic),&ebb->ndompset);
-               /* remove this iCode from inexpressions of all
-                  its successors, it cannot be in the in expressions
-                  of any of the predecessors */        
-               for (i = 0 ; i < count ;ebbs[i++]->visited = 0);
-               applyToSet(ebb->succList,removeFromInExprs,ic,IC_RESULT(ic),
-                          IC_RESULT(pdic),ebb);
-
-               /* if this was moved from another block */
-               /* then replace in those blocks too     */
-               if ( ic->movedFrom ) {
-                   eBBlock *owner ;
-                   for (owner = setFirstItem(ic->movedFrom); owner ;
-                        owner = setNextItem(ic->movedFrom))
-                       replaceAllSymBySym(owner->sch,IC_RESULT(ic),IC_RESULT(pdic),&owner->ndompset);
-               }
-               pdic->movedFrom = unionSets(pdic->movedFrom,ic->movedFrom,THROW_NONE);
-           } 
-           else
-               addSetHead (&cseSet,newCseDef(IC_RESULT(ic),pdic));                     
-           
-           if (!computeOnly) 
-               /* eliminate this */
-               remiCodeFromeBBlock (ebb,ic);               
-                   
-           defic = pdic ;          
-           change++ ;
-
-           if (IS_ITEMP(IC_RESULT(ic)))
-               continue ;
-
-       } else {
-
-           /* just add this as a previous expression except in */
-           /* case of a pointer access in which case this is a */
-           /* usage not a definition                           */
-           if (! (POINTER_SET(ic)) && IC_RESULT(ic)){
-               deleteItemIf (&cseSet, ifDefSymIsX,IC_RESULT(ic));
-               addSetHead(&cseSet,newCseDef(IC_RESULT(ic),ic));
-           }
-           defic = ic;
-
-       }
-       
-       /* if assignment to a parameter which is not
-          mine and type is a pointer then delete
-          pointerGets to take care of aliasing */
-       if (ASSIGNMENT(ic)                        && 
-           OTHERS_PARM(OP_SYMBOL(IC_RESULT(ic))) &&
-           IS_PTR(operandType(IC_RESULT(ic)))) {
-           deleteGetPointers(&cseSet,&ptrSetSet,IC_RIGHT(ic),ebb);
-           for (i = 0 ; i < count ;ebbs[i++]->visited = 0);
-           applyToSet(ebb->succList,delGetPointerSucc,IC_RIGHT(ic),ebb->dfnum);
-           ebb->ptrsSet = bitVectSetBit(ebb->ptrsSet,IC_RIGHT(ic)->key);
-       }
-
-       /* if this is a pointerget then see if we can replace
-          this with a previously assigned pointer value */
-       if (POINTER_GET(ic) && 
-           !(IS_BITFIELD(OP_SYMBOL(IC_RESULT(ic))->etype) ||
-              isOperandVolatile(IC_LEFT(ic),TRUE))) {
-           pdop = NULL;
-           applyToSet(ptrSetSet,findPointerSet,IC_LEFT(ic),&pdop,IC_RESULT(ic));
-           /* if we find it then locally replace all
-              references to the result with what we assigned */
-           if (pdop) {
-               replaceAllSymBySym(ic->next,IC_RESULT(ic),pdop,&ebb->ndompset);
-           }
-       }
-
-       /* delete from the cseSet anything that has */
-       /* operands matching the result of this     */
-       /* except in case of pointer access         */
-       if (!(POINTER_SET(ic)) && IC_RESULT(ic)) {
-           deleteItemIf (&cseSet,ifOperandsHave,IC_RESULT(ic));            
-           /* delete any previous definitions */ 
-           ebb->defSet = bitVectCplAnd (ebb->defSet,OP_DEFS(IC_RESULT(ic)));     
-           
-       }
-       
-       /* add the left & right to the defUse set */
-       if (IC_LEFT(ic) && IS_SYMOP(IC_LEFT(ic))) {
-           OP_USES(IC_LEFT(ic)) = 
-               bitVectSetBit (OP_USES(IC_LEFT(ic)),ic->key);
-           setUsesDefs(IC_LEFT(ic),ebb->defSet,ebb->outDefs,&ebb->usesDefs);
-
-       }
-
-       if (IC_RIGHT(ic) && IS_SYMOP(IC_RIGHT(ic))) {
-           OP_USES(IC_RIGHT(ic)) = 
-               bitVectSetBit (OP_USES(IC_RIGHT(ic)),ic->key);  
-           setUsesDefs(IC_RIGHT(ic),ebb->defSet,ebb->outDefs,&ebb->usesDefs);
-
-       }
-
-       /* for the result it is special case, put the result */
-       /* in the defuseSet if it a pointer or array access  */
-       if ( POINTER_SET(defic) ) {
-           OP_USES(IC_RESULT(ic)) = 
-               bitVectSetBit (OP_USES(IC_RESULT(ic)),ic->key);
-           setUsesDefs(IC_RESULT(ic),ebb->defSet,ebb->outDefs,&ebb->usesDefs);
-           deleteItemIf(&cseSet,ifPointerGet,IC_RESULT(ic));
-           ebb->ptrsSet = bitVectSetBit(ebb->ptrsSet,IC_RESULT(ic)->key);
-           /* delete from inexpressions of all successors which
-              have dfNum > than this block */
-           for (i = 0 ; i < count ;ebbs[i++]->visited = 0);
-           applyToSet(ebb->succList,delGetPointerSucc,IC_RESULT(ic),ebb->dfnum);
-           
-           /* delete from cseSet all other pointer sets
-              for this operand */
-           deleteItemIf(&ptrSetSet,ifPointerSet,IC_RESULT(ic));
-           /* add to the local pointerset set */
-           addSetHead(&ptrSetSet,newCseDef(IC_RESULT(ic),ic));
-       }
-       else /* add the result to defintion set */
-           if (IC_RESULT(ic)) {
-               OP_DEFS(IC_RESULT(ic)) = 
-                   bitVectSetBit (OP_DEFS(IC_RESULT(ic)),ic->key);
-               ebb->defSet = bitVectSetBit (ebb->defSet,ic->key);              
-               ebb->outDefs= bitVectCplAnd (ebb->outDefs,OP_DEFS(IC_RESULT(ic))); 
-               ebb->ldefs  = bitVectSetBit (ebb->ldefs,ic->key);
-           }
-              
-
-       /* if this is an addressof instruction then */
-       /* put the symbol in the address of list &  */
-       /* delete it from the cseSet                */
-       if (defic->op == ADDRESS_OF) {
-           addSetHead (&ebb->addrOf, IC_LEFT(ic));
-           deleteItemIf(&cseSet,ifDefSymIsX,IC_LEFT(ic));
-       }
+
+  iCode *pdic;
+  operand *pdop ;
+  iCode *defic;
+
+  if (SKIP_IC2(ic))
+      continue ;
+
+  /* if this is an assignment from true symbol
+     to a temp then do pointer post inc/dec optimzation */
+  if (ic->op == '=' && !POINTER_SET(ic) &&
+      IS_PTR(operandType(IC_RESULT(ic)))) {
+      ptrPostIncDecOpt(ic);
+  }
+
+  /* clear the def & use chains for the operands involved */
+  /* in this operation . since it can change due to opts  */
+  unsetDefsAndUses (ic);
+
+      if ( ic->op == PCALL || ic->op == CALL || ic->op == RECEIVE) {
+      /* add to defSet of the symbol */
+      OP_DEFS(IC_RESULT(ic)) =
+    bitVectSetBit (OP_DEFS(IC_RESULT(ic)),ic->key);
+      /* add to the definition set of this block */
+      ebb->defSet = bitVectSetBit (ebb->defSet,ic->key);
+      ebb->ldefs  = bitVectSetBit (ebb->ldefs,ic->key);
+      ebb->outDefs= bitVectCplAnd (ebb->outDefs,OP_DEFS(IC_RESULT(ic)));
+      setUsesDefs(IC_RESULT(ic),ebb->defSet,ebb->outDefs,&ebb->usesDefs);
+      /* delete global variables from the cseSet
+         since they can be modified by the function call */
+      deleteItemIf(&cseSet,ifDefGlobal);
+      /* delete all getpointer iCodes from cseSet, this should
+         be done only for global arrays & pointers but at this
+         point we don't know if globals, so to be safe do all*/
+      deleteItemIf(&cseSet,ifAnyGetPointer);
+  }
+
+  /* for pcall & ipush we need to add to the useSet */
+  if ((ic->op == PCALL ||
+       ic->op == IPUSH ||
+       ic->op == IPOP  ||
+       ic->op == SEND) &&
+      IS_SYMOP(IC_LEFT(ic))) {
+
+      /* check if they can be replaced */
+      if ( !computeOnly ) {
+    pdop = NULL ;
+    applyToSetFTrue(cseSet,findCheaperOp,IC_LEFT(ic),&pdop);
+    if (pdop)
+        IC_LEFT(ic) = pdop ;
+      }
+      /* the lookup could have changed it*/
+      if (IS_SYMOP(IC_LEFT(ic))) {
+    OP_USES(IC_LEFT(ic)) =
+        bitVectSetBit(OP_USES(IC_LEFT(ic)),ic->key);
+    setUsesDefs(IC_LEFT(ic),ebb->defSet,
+          ebb->outDefs,&ebb->usesDefs);
+      }
+
+
+      /* if we a sending a pointer as a parameter
+         then kill all cse since the pointed to item
+         might be changed in the function being called */
+      if ((ic->op == IPUSH || ic->op == SEND) &&
+    IS_PTR(operandType(IC_LEFT(ic)))) {
+    deleteGetPointers(&cseSet,&ptrSetSet,IC_LEFT(ic),ebb);
+    ebb->ptrsSet = bitVectSetBit(ebb->ptrsSet,IC_LEFT(ic)->key);
+    for (i = 0 ; i < count ;ebbs[i++]->visited = 0);
+    applyToSet(ebb->succList,delGetPointerSucc,
+         IC_LEFT(ic),ebb->dfnum);
+      }
+      continue;
+  }
+
+  /* if jumptable then mark the usage */
+  if (ic->op == JUMPTABLE ) {
+      OP_USES(IC_JTCOND(ic)) =
+    bitVectSetBit(OP_USES(IC_JTCOND(ic)),ic->key);
+      setUsesDefs(IC_JTCOND(ic),ebb->defSet,
+      ebb->outDefs,&ebb->usesDefs);
+      continue;
+  }
+
+  if (SKIP_IC(ic))
+      continue ;
+
+  /* do some algebraic optimizations if possible */
+  algebraicOpts (ic);
+  while (constFold(ic,cseSet));
+
+  /* small klugde */
+  if (POINTER_GET(ic) && !IS_PTR(operandType(IC_LEFT(ic)))) {
+      setOperandType(IC_LEFT(ic),
+         aggrToPtr(operandType(IC_LEFT(ic)),FALSE));
+      fixUpTypes(ic);
+
+  }
+  if (POINTER_SET(ic) && !IS_PTR(operandType(IC_RESULT(ic)))) {
+      setOperandType(IC_RESULT(ic),
+         aggrToPtr(operandType(IC_RESULT(ic)),FALSE));
+  }
+
+  /* if this is a condition statment then */
+  /* check if the condition can be replaced */
+  if (ic->op == IFX ) {
+      ifxOptimize (ic, cseSet, computeOnly,
+       ebb, &change,
+       ebbs, count);
+      continue ;
+  }
+
+  /* if the assignment & result is a temp */
+  /* see if we can replace it             */
+  if (ic->op == '=') {
+
+      /* update the spill location for this */
+      updateSpillLocation (ic);
+
+      if (POINTER_SET(ic) &&
+    !(IS_BITFIELD(OP_SYMBOL(IC_RESULT(ic))->etype))) {
+    pdop = NULL ;
+    applyToSetFTrue (cseSet,findCheaperOp,IC_RESULT(ic),&pdop);
+    if (pdop && IS_ITEMP(pdop) && !computeOnly)
+        IC_RESULT(ic) = pdop;
+      }
+  }
+
+  /* do the operand lookup i.e. for both the */
+  /* right & left operand : check the cseSet */
+  /* to see if they have been replaced if yes*/
+  /* then replace them with those from cseSet*/
+  /* left operand */
+  /* and left is a symbol  */
+  if (IS_SYMOP(IC_LEFT(ic)) &&
+      !computeOnly && ic->op != ADDRESS_OF ) {
+
+      pdop = NULL;
+      applyToSetFTrue (cseSet,findCheaperOp,IC_LEFT(ic),&pdop) ;
+      if (pdop)  {
+    if (POINTER_GET(ic)) {
+        if (IS_ITEMP(pdop) || IS_OP_LITERAL(pdop)) {
+      IC_LEFT(ic) = pdop;
+      change = 1;
+        }
+        /* check if there is a pointer set
+           for the same pointer visible if yes
+           then change this into an assignment */
+        pdop = NULL;
+        if (applyToSetFTrue(cseSet,findPointerSet,IC_LEFT(ic),&pdop,IC_RESULT(ic)) &&
+      !bitVectBitValue(ebb->ptrsSet,pdop->key)){
+      ic->op = '=';
+      IC_LEFT(ic) = NULL;
+      IC_RIGHT(ic) = pdop;
+      SET_ISADDR(IC_RESULT(ic),0);
+        }
+
+    }
+    else {
+        IC_LEFT(ic)  = pdop ;
+        change = 1;
+    }
+      }
+  }
+
+  /*right operand */
+  if (IS_SYMOP(IC_RIGHT(ic)) && !computeOnly) {
+
+      pdop = NULL ;
+      applyToSetFTrue (cseSet,findCheaperOp,IC_RIGHT(ic),&pdop);
+      if (pdop) {
+
+    IC_RIGHT(ic) = pdop;
+    change = 1;
+      }
+  }
+
+  /* if left or right changed then do algebraic */
+  if (change) {
+      algebraicOpts(ic);
+      while(constFold(ic,cseSet));
+  }
+
+  /* if after all this it becomes a assignment to self
+     then delete it and continue */
+  if (ASSIGNMENT_TO_SELF(ic)) {
+      remiCodeFromeBBlock(ebb,ic);
+      continue;
+  }
+
+  /* now we will check to see if the entire */
+  /* operation has been performed before    */
+  /* and is available                       */
+  /* don't do assignments they will be killed */
+  /* by dead code elimination if required  do */
+  /* it only if result is a temporary         */
+  pdic = NULL ;
+  if (!( POINTER_GET(ic)                      &&
+         (IS_BITFIELD(OP_SYMBOL(IC_RESULT(ic))->etype) ||
+         isOperandVolatile(IC_LEFT(ic),TRUE)           ||
+         bitVectBitValue(ebb->ndompset,IC_LEFT(ic)->key))) &&
+      ! ASSIGNMENT(ic)                        &&
+        IS_ITEMP(IC_RESULT(ic))               &&
+      ! computeOnly) {
+      applyToSet (cseSet,findPrevIc,ic,&pdic);
+      if (pdic && checkType(operandType(IC_RESULT(pdic)),
+          operandType(IC_RESULT(ic))) != 1)
+        pdic = NULL;
+  }
+
+  /* if found then eliminate this and add to*/
+  /* to cseSet an element containing result */
+  /* of this with previous opcode           */
+  if (pdic) {
+
+      if (IS_ITEMP(IC_RESULT(ic))) {
+
+    /* replace in the remaining of this block */
+    replaceAllSymBySym(ic->next,IC_RESULT(ic),IC_RESULT(pdic),&ebb->ndompset);
+    /* remove this iCode from inexpressions of all
+       its successors, it cannot be in the in expressions
+       of any of the predecessors */
+    for (i = 0 ; i < count ;ebbs[i++]->visited = 0);
+    applyToSet(ebb->succList,removeFromInExprs,ic,IC_RESULT(ic),
+         IC_RESULT(pdic),ebb);
+
+    /* if this was moved from another block */
+    /* then replace in those blocks too     */
+    if ( ic->movedFrom ) {
+        eBBlock *owner ;
+        for (owner = setFirstItem(ic->movedFrom); owner ;
+       owner = setNextItem(ic->movedFrom))
+      replaceAllSymBySym(owner->sch,IC_RESULT(ic),IC_RESULT(pdic),&owner->ndompset);
+    }
+    pdic->movedFrom = unionSets(pdic->movedFrom,ic->movedFrom,THROW_NONE);
+      }
+      else
+    addSetHead (&cseSet,newCseDef(IC_RESULT(ic),pdic));
+
+      if (!computeOnly)
+    /* eliminate this */
+    remiCodeFromeBBlock (ebb,ic);
+
+      defic = pdic ;
+      change++ ;
+
+      if (IS_ITEMP(IC_RESULT(ic)))
+    continue ;
+
+  } else {
+
+      /* just add this as a previous expression except in */
+      /* case of a pointer access in which case this is a */
+      /* usage not a definition                           */
+      if (! (POINTER_SET(ic)) && IC_RESULT(ic)){
+    deleteItemIf (&cseSet, ifDefSymIsX,IC_RESULT(ic));
+    addSetHead(&cseSet,newCseDef(IC_RESULT(ic),ic));
+      }
+      defic = ic;
+
+  }
+
+  /* if assignment to a parameter which is not
+     mine and type is a pointer then delete
+     pointerGets to take care of aliasing */
+  if (ASSIGNMENT(ic)                        &&
+      OTHERS_PARM(OP_SYMBOL(IC_RESULT(ic))) &&
+      IS_PTR(operandType(IC_RESULT(ic)))) {
+      deleteGetPointers(&cseSet,&ptrSetSet,IC_RIGHT(ic),ebb);
+      for (i = 0 ; i < count ;ebbs[i++]->visited = 0);
+      applyToSet(ebb->succList,delGetPointerSucc,IC_RIGHT(ic),ebb->dfnum);
+      ebb->ptrsSet = bitVectSetBit(ebb->ptrsSet,IC_RIGHT(ic)->key);
+  }
+
+  /* if this is a pointerget then see if we can replace
+     this with a previously assigned pointer value */
+  if (POINTER_GET(ic) &&
+      !(IS_BITFIELD(OP_SYMBOL(IC_RESULT(ic))->etype) ||
+         isOperandVolatile(IC_LEFT(ic),TRUE))) {
+      pdop = NULL;
+      applyToSet(ptrSetSet,findPointerSet,IC_LEFT(ic),&pdop,IC_RESULT(ic));
+      /* if we find it then locally replace all
+         references to the result with what we assigned */
+      if (pdop) {
+    replaceAllSymBySym(ic->next,IC_RESULT(ic),pdop,&ebb->ndompset);
+      }
+  }
+
+  /* delete from the cseSet anything that has */
+  /* operands matching the result of this     */
+  /* except in case of pointer access         */
+  if (!(POINTER_SET(ic)) && IC_RESULT(ic)) {
+      deleteItemIf (&cseSet,ifOperandsHave,IC_RESULT(ic));
+      /* delete any previous definitions */
+      ebb->defSet = bitVectCplAnd (ebb->defSet,OP_DEFS(IC_RESULT(ic)));
+
+  }
+
+  /* add the left & right to the defUse set */
+  if (IC_LEFT(ic) && IS_SYMOP(IC_LEFT(ic))) {
+      OP_USES(IC_LEFT(ic)) =
+    bitVectSetBit (OP_USES(IC_LEFT(ic)),ic->key);
+      setUsesDefs(IC_LEFT(ic),ebb->defSet,ebb->outDefs,&ebb->usesDefs);
+
+  }
+
+  if (IC_RIGHT(ic) && IS_SYMOP(IC_RIGHT(ic))) {
+      OP_USES(IC_RIGHT(ic)) =
+    bitVectSetBit (OP_USES(IC_RIGHT(ic)),ic->key);
+      setUsesDefs(IC_RIGHT(ic),ebb->defSet,ebb->outDefs,&ebb->usesDefs);
+
+  }
+
+  /* for the result it is special case, put the result */
+  /* in the defuseSet if it a pointer or array access  */
+  if ( POINTER_SET(defic) ) {
+      OP_USES(IC_RESULT(ic)) =
+    bitVectSetBit (OP_USES(IC_RESULT(ic)),ic->key);
+      setUsesDefs(IC_RESULT(ic),ebb->defSet,ebb->outDefs,&ebb->usesDefs);
+      deleteItemIf(&cseSet,ifPointerGet,IC_RESULT(ic));
+      ebb->ptrsSet = bitVectSetBit(ebb->ptrsSet,IC_RESULT(ic)->key);
+      /* delete from inexpressions of all successors which
+         have dfNum > than this block */
+      for (i = 0 ; i < count ;ebbs[i++]->visited = 0);
+      applyToSet(ebb->succList,delGetPointerSucc,IC_RESULT(ic),ebb->dfnum);
+
+      /* delete from cseSet all other pointer sets
+         for this operand */
+      deleteItemIf(&ptrSetSet,ifPointerSet,IC_RESULT(ic));
+      /* add to the local pointerset set */
+      addSetHead(&ptrSetSet,newCseDef(IC_RESULT(ic),ic));
+  }
+  else /* add the result to defintion set */
+      if (IC_RESULT(ic)) {
+    OP_DEFS(IC_RESULT(ic)) =
+        bitVectSetBit (OP_DEFS(IC_RESULT(ic)),ic->key);
+    ebb->defSet = bitVectSetBit (ebb->defSet,ic->key);
+    ebb->outDefs= bitVectCplAnd (ebb->outDefs,OP_DEFS(IC_RESULT(ic)));
+    ebb->ldefs  = bitVectSetBit (ebb->ldefs,ic->key);
+      }
+
+
+  /* if this is an addressof instruction then */
+  /* put the symbol in the address of list &  */
+  /* delete it from the cseSet                */
+  if (defic->op == ADDRESS_OF) {
+      addSetHead (&ebb->addrOf, IC_LEFT(ic));
+      deleteItemIf(&cseSet,ifDefSymIsX,IC_LEFT(ic));
+  }
     }
 
     setToNull ((void **)&ebb->outExprs);
-    ebb->outExprs = cseSet;        
+    ebb->outExprs = cseSet;
     ebb->outDefs = bitVectUnion (ebb->outDefs,ebb->defSet);
     ebb->ptrsSet = bitVectUnion (ebb->ptrsSet,ebb->inPtrsSet);
     return change ;
@@ -1545,9 +1545,9 @@ int cseAllBlocks (eBBlock **ebbs,int count)
 
     /* if optimization turned off */
 
-    for (i = 0 ; i < count ;i++ ) 
-       change += cseBBlock (ebbs[i],FALSE,ebbs,count);
+    for (i = 0 ; i < count ;i++ )
+  change += cseBBlock (ebbs[i],FALSE,ebbs,count);
 
     return change;
 }
+
index 901d291136e7482890f811552a7e59218321cb5e..45ecee2f98df839f4e69386741a536f0f97327e9 100644 (file)
@@ -1,25 +1,25 @@
 /*-------------------------------------------------------------------------
 
-  SDCCglue.c - glues everything we have done together into one file.                 
+  SDCCglue.c - glues everything we have done together into one file.
                 Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
-               
+
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "common.h"
@@ -27,7 +27,7 @@
 #include <time.h>
 #include "newalloc.h"
 
-#if    !defined(__BORLANDC__) && !defined(_MSC_VER)
+#if !defined(__BORLANDC__) && !defined(_MSC_VER)
 #if 0 /* This should no longer be necessary. */
 // This is a bit messy because we define link ourself
 #define link NoLiNk
@@ -44,8 +44,8 @@
 symbol *interrupts[256];
 
 void printIval (symbol *, sym_link *, initList *, FILE *);
-set *publics = NULL;           /* public variables */
-set *externs = NULL;           /* Varibles that are declared as extern */
+set *publics = NULL;    /* public variables */
+set *externs = NULL;    /* Varibles that are declared as extern */
 
 /* TODO: this should be configurable (DS803C90 uses more than 6) */
 int maxInterrupts = 6;
@@ -64,8 +64,8 @@ DEFSETFUNC(closeTmpFiles)
     FILE *tfile = item;
 
     if (tfile)
-       fclose(tfile);
-    
+  fclose(tfile);
+
     return 0;
 }
 
@@ -78,8 +78,8 @@ DEFSETFUNC(rmTmpFiles)
     char *name = item;
 
     if (name) {
-       unlink(name);
-       free(name);
+  unlink(name);
+  free(name);
     }
     return 0;
 }
@@ -90,11 +90,11 @@ DEFSETFUNC(rmTmpFiles)
 void copyFile (FILE * dest, FILE * src)
 {
     int ch;
-    
+
     rewind (src);
     while (!feof (src))
-       if ((ch = fgetc (src)) != EOF)
-           fputc (ch, dest);
+  if ((ch = fgetc (src)) != EOF)
+      fputc (ch, dest);
 }
 
 char *aopLiteralLong(value *val, int offset, int size)
@@ -111,18 +111,18 @@ char *aopLiteralLong(value *val, int offset, int size)
         unsigned long v = floatFromVal(val);
 
         v >>= (offset * 8);
-       switch (size) {
-       case 1:
-           tsprintf(buffer, "!immedbyte", (unsigned int)v & 0xff);
-           break;
-       case 2:
-           tsprintf(buffer, "!immedword", (unsigned int)v & 0xffff);
-           break;
-       default:
-           /* Hmm.  Too big for now. */
-           assert(0);
-       }
-        rs = Safe_calloc(strlen(buffer)+1);
+  switch (size) {
+  case 1:
+      tsprintf(buffer, "!immedbyte", (unsigned int)v & 0xff);
+      break;
+  case 2:
+      tsprintf(buffer, "!immedword", (unsigned int)v & 0xffff);
+      break;
+  default:
+      /* Hmm.  Too big for now. */
+      assert(0);
+  }
+        rs = Safe_calloc(1,strlen(buffer)+1);
         return strcpy (rs,buffer);
     }
 
@@ -136,7 +136,7 @@ char *aopLiteralLong(value *val, int offset, int size)
 #else
     tsprintf(buffer, "!immedbyte", fl.c[offset]);
 #endif
-    rs = Safe_calloc(strlen(buffer)+1);
+    rs = Safe_calloc(1,strlen(buffer)+1);
     return strcpy (rs,buffer);
 }
 
@@ -154,105 +154,105 @@ char *aopLiteral (value *val, int offset)
 static void emitRegularMap (memmap * map, bool addPublics, bool arFlag)
 {
     symbol *sym;
-    
+
     if (addPublics) {
-       /* PENDING: special case here - should remove */
-       if (!strcmp(map->sname, CODE_NAME))
-           tfprintf(map->oFile, "\t!areacode\n", map->sname);
-       else if (!strcmp(map->sname, DATA_NAME)) 
-           tfprintf(map->oFile, "\t!areadata\n", map->sname);
-       else if (!strcmp(map->sname, HOME_NAME)) 
-           tfprintf(map->oFile, "\t!areahome\n", map->sname);
-       else
-           tfprintf(map->oFile, "\t!area\n", map->sname);
+  /* PENDING: special case here - should remove */
+  if (!strcmp(map->sname, CODE_NAME))
+      tfprintf(map->oFile, "\t!areacode\n", map->sname);
+  else if (!strcmp(map->sname, DATA_NAME))
+      tfprintf(map->oFile, "\t!areadata\n", map->sname);
+  else if (!strcmp(map->sname, HOME_NAME))
+      tfprintf(map->oFile, "\t!areahome\n", map->sname);
+  else
+      tfprintf(map->oFile, "\t!area\n", map->sname);
     }
-    
+
     /* print the area name */
     for (sym = setFirstItem (map->syms); sym;
-        sym = setNextItem (map->syms))  {
-       
-       /* if extern then add it into the extern list */
-       if (IS_EXTERN (sym->etype)) {
-           addSetHead (&externs, sym);
-           continue;
-       }
-       
-       /* if allocation required check is needed
-          then check if the symbol really requires
-          allocation only for local variables */
-       if (arFlag && !IS_AGGREGATE(sym->type) &&
-           !(sym->_isparm && !IS_REGPARM(sym->etype)) && 
-             !sym->allocreq && sym->level)
-           continue ;
-       
-       /* if global variable & not static or extern 
-          and addPublics allowed then add it to the public set */
-       if ((sym->level == 0 || 
-            (sym->_isparm && !IS_REGPARM(sym->etype))) &&
-           addPublics &&
-           !IS_STATIC (sym->etype) &&
-           (sym->used || sym->fbody)) {
-           addSetHead (&publics, sym);
-       }
-       
-       /* if extern then do nothing or is a function 
-          then do nothing */
-       if (IS_FUNC (sym->type))
-           continue;
-       
-       /* print extra debug info if required */
-       if ((options.debug || sym->level == 0) && !options.nodebug) {
-
-           cdbSymbol(sym,cdbFile,FALSE,FALSE);
-
-           if (!sym->level) /* global */
-               if (IS_STATIC(sym->etype))
-                   fprintf(map->oFile,"F%s$",moduleName); /* scope is file */
-               else
-                   fprintf(map->oFile,"G$"); /* scope is global */
-           else
-               /* symbol is local */
-               fprintf(map->oFile,"L%s$",(sym->localof ? sym->localof->name : "-null-"));
-           fprintf(map->oFile,"%s$%d$%d",sym->name,sym->level,sym->block);
-       }
-
-       /* if is has an absolute address then generate
-          an equate for this no need to allocate space */
-       if (SPEC_ABSA (sym->etype)) {
-           if ((options.debug || sym->level == 0) && !options.nodebug)
-               fprintf (map->oFile," == 0x%04x\n",SPEC_ADDR (sym->etype));         
-
-           fprintf (map->oFile, "%s\t=\t0x%04x\n",
-                    sym->rname,
-                    SPEC_ADDR (sym->etype));
-       }
-       else {
-           /* allocate space */
-           if ((options.debug || sym->level == 0) && !options.nodebug)
-               fprintf(map->oFile,"==.\n");
-           if (IS_STATIC(sym->etype))
-               tfprintf(map->oFile, "!slabeldef\n", sym->rname);
-           else
-               tfprintf(map->oFile, "!labeldef\n", sym->rname);
-           tfprintf(map->oFile, "\t!ds\n", (unsigned int)getSize (sym->type) & 0xffff);
-       }
-       
-       /* if it has an initial value then do it only if
-          it is a global variable */
-       if (sym->ival && sym->level == 0) {
-           ast *ival = NULL;
-           
-           if (IS_AGGREGATE (sym->type))
-               ival = initAggregates (sym, sym->ival, NULL);
-           else
-               ival = newNode ('=', newAst_VALUE(symbolVal (sym)),
-                               decorateType (resolveSymbols (list2expr (sym->ival))));
-           codeOutFile = statsg->oFile;
-           allocInfo = 0;
-           eBBlockFromiCode (iCodeFromAst (ival));
-           allocInfo = 1;
-           sym->ival = NULL;
-       }
+   sym = setNextItem (map->syms))  {
+
+  /* if extern then add it into the extern list */
+  if (IS_EXTERN (sym->etype)) {
+      addSetHead (&externs, sym);
+      continue;
+  }
+
+  /* if allocation required check is needed
+     then check if the symbol really requires
+     allocation only for local variables */
+  if (arFlag && !IS_AGGREGATE(sym->type) &&
+      !(sym->_isparm && !IS_REGPARM(sym->etype)) &&
+        !sym->allocreq && sym->level)
+      continue ;
+
+  /* if global variable & not static or extern
+     and addPublics allowed then add it to the public set */
+  if ((sym->level == 0 ||
+       (sym->_isparm && !IS_REGPARM(sym->etype))) &&
+      addPublics &&
+      !IS_STATIC (sym->etype) &&
+      (sym->used || sym->fbody)) {
+      addSetHead (&publics, sym);
+  }
+
+  /* if extern then do nothing or is a function
+     then do nothing */
+  if (IS_FUNC (sym->type))
+      continue;
+
+  /* print extra debug info if required */
+  if ((options.debug || sym->level == 0) && !options.nodebug) {
+
+      cdbSymbol(sym,cdbFile,FALSE,FALSE);
+
+      if (!sym->level) /* global */
+    if (IS_STATIC(sym->etype))
+        fprintf(map->oFile,"F%s$",moduleName); /* scope is file */
+    else
+        fprintf(map->oFile,"G$"); /* scope is global */
+      else
+    /* symbol is local */
+    fprintf(map->oFile,"L%s$",(sym->localof ? sym->localof->name : "-null-"));
+      fprintf(map->oFile,"%s$%d$%d",sym->name,sym->level,sym->block);
+  }
+
+  /* if is has an absolute address then generate
+     an equate for this no need to allocate space */
+  if (SPEC_ABSA (sym->etype)) {
+      if ((options.debug || sym->level == 0) && !options.nodebug)
+    fprintf (map->oFile," == 0x%04x\n",SPEC_ADDR (sym->etype));
+
+      fprintf (map->oFile, "%s\t=\t0x%04x\n",
+         sym->rname,
+         SPEC_ADDR (sym->etype));
+  }
+  else {
+      /* allocate space */
+      if ((options.debug || sym->level == 0) && !options.nodebug)
+    fprintf(map->oFile,"==.\n");
+      if (IS_STATIC(sym->etype))
+    tfprintf(map->oFile, "!slabeldef\n", sym->rname);
+      else
+    tfprintf(map->oFile, "!labeldef\n", sym->rname);
+      tfprintf(map->oFile, "\t!ds\n", (unsigned int)getSize (sym->type) & 0xffff);
+  }
+
+  /* if it has an initial value then do it only if
+     it is a global variable */
+  if (sym->ival && sym->level == 0) {
+      ast *ival = NULL;
+
+      if (IS_AGGREGATE (sym->type))
+    ival = initAggregates (sym, sym->ival, NULL);
+      else
+    ival = newNode ('=', newAst_VALUE(symbolVal (sym)),
+        decorateType (resolveSymbols (list2expr (sym->ival))));
+      codeOutFile = statsg->oFile;
+      allocInfo = 0;
+      eBBlockFromiCode (iCodeFromAst (ival));
+      allocInfo = 1;
+      sym->ival = NULL;
+  }
     }
 }
 
@@ -264,83 +264,83 @@ value *initPointer (initList *ilist)
     value *val;
     ast *expr = list2expr(ilist);
 
-    if (!expr) 
-       goto wrong;             
-       
+    if (!expr)
+  goto wrong;
+
     /* try it the oldway first */
     if ((val = constExprValue(expr,FALSE)))
-       return val;
+  return val;
 
     /* no then we have to do these cludgy checks */
     /* pointers can be initialized with address of
        a variable or address of an array element */
     if (IS_AST_OP(expr) && expr->opval.op == '&') {
-       /* address of symbol */
-       if (IS_AST_SYM_VALUE(expr->left)) {
-           val = copyValue(AST_VALUE(expr->left));
-           val->type = newLink();
-           if (SPEC_SCLS(expr->left->etype) == S_CODE) {
-               DCL_TYPE(val->type) = CPOINTER ;
-               DCL_PTR_CONST(val->type) = port->mem.code_ro;
-           }
-           else
-               if (SPEC_SCLS(expr->left->etype) == S_XDATA)
-                   DCL_TYPE(val->type) = FPOINTER;
-               else
-                   if (SPEC_SCLS(expr->left->etype) == S_XSTACK )
-                       DCL_TYPE(val->type) = PPOINTER ;
-                   else
-                       if (SPEC_SCLS(expr->left->etype) == S_IDATA)
-                           DCL_TYPE(val->type) = IPOINTER ;
-                       else
-                           if (SPEC_SCLS(expr->left->etype) == S_EEPROM)
-                               DCL_TYPE(val->type) = EEPPOINTER ;
-                           else
-                               DCL_TYPE(val->type) = POINTER ;
-           val->type->next = expr->left->ftype;
-           val->etype = getSpec(val->type);
-           return val;
-       }
-
-       /* if address of indexed array */
-       if (IS_AST_OP(expr->left) && expr->left->opval.op == '[')
-           return valForArray(expr->left);     
-
-       /* if address of structure element then 
-          case 1. a.b ; */
-       if (IS_AST_OP(expr->left) && 
-           expr->left->opval.op == '.' ) {
-               return valForStructElem(expr->left->left,
-                                       expr->left->right);
-       }
-
-       /* case 2. (&a)->b ; 
-          (&some_struct)->element */
-       if (IS_AST_OP(expr->left) &&
-           expr->left->opval.op == PTR_OP &&
-           IS_ADDRESS_OF_OP(expr->left->left))
-               return valForStructElem(expr->left->left->left,
-                                       expr->left->right);
+  /* address of symbol */
+  if (IS_AST_SYM_VALUE(expr->left)) {
+      val = copyValue(AST_VALUE(expr->left));
+      val->type = newLink();
+      if (SPEC_SCLS(expr->left->etype) == S_CODE) {
+    DCL_TYPE(val->type) = CPOINTER ;
+    DCL_PTR_CONST(val->type) = port->mem.code_ro;
+      }
+      else
+    if (SPEC_SCLS(expr->left->etype) == S_XDATA)
+        DCL_TYPE(val->type) = FPOINTER;
+    else
+        if (SPEC_SCLS(expr->left->etype) == S_XSTACK )
+      DCL_TYPE(val->type) = PPOINTER ;
+        else
+      if (SPEC_SCLS(expr->left->etype) == S_IDATA)
+          DCL_TYPE(val->type) = IPOINTER ;
+      else
+          if (SPEC_SCLS(expr->left->etype) == S_EEPROM)
+        DCL_TYPE(val->type) = EEPPOINTER ;
+          else
+        DCL_TYPE(val->type) = POINTER ;
+      val->type->next = expr->left->ftype;
+      val->etype = getSpec(val->type);
+      return val;
+  }
+
+  /* if address of indexed array */
+  if (IS_AST_OP(expr->left) && expr->left->opval.op == '[')
+      return valForArray(expr->left);
+
+  /* if address of structure element then
+     case 1. a.b ; */
+  if (IS_AST_OP(expr->left) &&
+      expr->left->opval.op == '.' ) {
+    return valForStructElem(expr->left->left,
+          expr->left->right);
+  }
+
+  /* case 2. (&a)->b ;
+     (&some_struct)->element */
+  if (IS_AST_OP(expr->left) &&
+      expr->left->opval.op == PTR_OP &&
+      IS_ADDRESS_OF_OP(expr->left->left))
+    return valForStructElem(expr->left->left->left,
+          expr->left->right);
 
     }
     /* case 3. (((char *) &a) +/- constant) */
-    if (IS_AST_OP(expr) && 
-       (expr->opval.op == '+' || expr->opval.op == '-') &&
-       IS_AST_OP(expr->left) && expr->left->opval.op == CAST &&
-       IS_AST_OP(expr->left->right) && 
-       expr->left->right->opval.op == '&' &&
-       IS_AST_LIT_VALUE(expr->right)) {
-       
-       return valForCastAggr(expr->left->right->left,
-                             expr->left->left->opval.lnk,
-                             expr->right,expr->opval.op);
-       
+    if (IS_AST_OP(expr) &&
+  (expr->opval.op == '+' || expr->opval.op == '-') &&
+  IS_AST_OP(expr->left) && expr->left->opval.op == CAST &&
+  IS_AST_OP(expr->left->right) &&
+  expr->left->right->opval.op == '&' &&
+  IS_AST_LIT_VALUE(expr->right)) {
+
+  return valForCastAggr(expr->left->right->left,
+            expr->left->left->opval.lnk,
+            expr->right,expr->opval.op);
+
     }
 
- wrong:    
+ wrong:
     werror(E_INIT_WRONG);
     return NULL;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -355,33 +355,33 @@ void printChar (FILE * ofile, char *s, int plen)
     char *p = buf;
 
     while (len && pplen < plen) {
-       i = 60;
-       while (i && *s && pplen < plen) {
-           if (*s < ' ' || *s == '\"') {
-               *p = '\0';
-               if (p != buf) 
-                   tfprintf(ofile, "\t!ascii\n", buf);
-               tfprintf(ofile, "\t!db !constbyte\n", *s);
-               p = buf;
-           }
-           else {
-               *p = *s;
-               p++;
-           }
-           s++;
-           pplen++;
-           i--;
-       }
-       if (p != buf) {
-           *p = '\0';
-           tfprintf(ofile, "\t!ascii\n", buf);
-           p = buf;
-       }
-       
-       if (len > 60)
-           len -= 60;
-       else
-           len = 0;
+  i = 60;
+  while (i && *s && pplen < plen) {
+      if (*s < ' ' || *s == '\"') {
+    *p = '\0';
+    if (p != buf)
+        tfprintf(ofile, "\t!ascii\n", buf);
+    tfprintf(ofile, "\t!db !constbyte\n", *s);
+    p = buf;
+      }
+      else {
+    *p = *s;
+    p++;
+      }
+      s++;
+      pplen++;
+      i--;
+  }
+  if (p != buf) {
+      *p = '\0';
+      tfprintf(ofile, "\t!ascii\n", buf);
+      p = buf;
+  }
+
+  if (len > 60)
+      len -= 60;
+  else
+      len = 0;
     }
     tfprintf(ofile, "\t!db !constbyte\n", 0);
 }
@@ -391,30 +391,30 @@ void printChar (FILE * ofile, char *s, int plen)
 /*-----------------------------------------------------------------*/
 int pointerTypeToGPByte(const int p_type)
 {
-    switch (p_type) 
+    switch (p_type)
     {
-           case IPOINTER:
-           case POINTER:
-               return 0;
-           case GPOINTER:
-               /* hack - if we get a generic pointer, we just assume
-                * it's an FPOINTER (i.e. in XDATA space).
-                */
-           case FPOINTER:
-               return 1;
-           case CPOINTER:
-               return 2;
-           case PPOINTER:
-               return 3;
-           default:
-               fprintf(stderr, "*** internal error: unknown pointer type %d in GPByte.\n",
-                       p_type);
-               break;
+      case IPOINTER:
+      case POINTER:
+    return 0;
+      case GPOINTER:
+    /* hack - if we get a generic pointer, we just assume
+     * it's an FPOINTER (i.e. in XDATA space).
+     */
+      case FPOINTER:
+    return 1;
+      case CPOINTER:
+    return 2;
+      case PPOINTER:
+    return 3;
+      default:
+          fprintf(stderr, "*** internal error: unknown pointer type %d in GPByte.\n",
+      p_type);
+    break;
     }
     return -1;
 }
-    
-    
+
+
 /*-----------------------------------------------------------------*/
 /* printPointerType - generates ival for pointer type              */
 /*-----------------------------------------------------------------*/
@@ -422,11 +422,11 @@ void _printPointerType(FILE *oFile, const char *name)
 {
     if (IS_DS390_PORT)
     {
-       fprintf(oFile, "\t.byte %s,(%s >> 8),(%s >> 16)",name,name,name);
+  fprintf(oFile, "\t.byte %s,(%s >> 8),(%s >> 16)",name,name,name);
     }
     else
     {
-       fprintf(oFile, "\t.byte %s,(%s >> 8)",name,name);
+  fprintf(oFile, "\t.byte %s,(%s >> 8)",name,name);
     }
 }
 
@@ -442,11 +442,11 @@ void printPointerType(FILE *oFile, const char *name)
 /*-----------------------------------------------------------------*/
 /* printGPointerType - generates ival for generic pointer type     */
 /*-----------------------------------------------------------------*/
-void printGPointerType(FILE *oFile, const char *name, 
-                     const unsigned int type)
+void printGPointerType(FILE *oFile, const char *name,
+          const unsigned int type)
 {
     _printPointerType(oFile,name);
-    fprintf(oFile, ",#0x%02x\n", pointerTypeToGPByte(type)); 
+    fprintf(oFile, ",#0x%02x\n", pointerTypeToGPByte(type));
 }
 
 /*-----------------------------------------------------------------*/
@@ -455,38 +455,38 @@ void printGPointerType(FILE *oFile, const char *name,
 void printIvalType (sym_link * type, initList * ilist, FILE * oFile)
 {
     value *val;
-    
+
     /* if initList is deep */
     if (ilist->type == INIT_DEEP)
-       ilist = ilist->init.deep;
-    
+  ilist = ilist->init.deep;
+
     val = list2val (ilist);
     switch (getSize (type)) {
     case 1:
-       if (!val)
-           tfprintf(oFile, "\t!db !constbyte\n", 0);
-       else
-           tfprintf(oFile, "\t!dbs\n",
-                    aopLiteral (val, 0));
-       break;
+  if (!val)
+      tfprintf(oFile, "\t!db !constbyte\n", 0);
+  else
+      tfprintf(oFile, "\t!dbs\n",
+         aopLiteral (val, 0));
+  break;
 
     case 2:
-       if (port->use_dw_for_init)
-           tfprintf(oFile, "\t!dws\n", aopLiteralLong(val, 0, 2));
-       else
-           fprintf(oFile, "\t.byte %s,%s\n", aopLiteral(val, 0),aopLiteral(val, 1));
-       break;
+  if (port->use_dw_for_init)
+      tfprintf(oFile, "\t!dws\n", aopLiteralLong(val, 0, 2));
+  else
+      fprintf(oFile, "\t.byte %s,%s\n", aopLiteral(val, 0),aopLiteral(val, 1));
+  break;
     case 4:
-       if (!val) {
-           tfprintf (oFile, "\t!dw !constword\n", 0);
-           tfprintf (oFile, "\t!dw !constword\n", 0);
-       }
-       else {
-           fprintf (oFile, "\t.byte %s,%s,%s,%s\n",
-                    aopLiteral (val, 0), aopLiteral (val, 1),
-                    aopLiteral (val, 2), aopLiteral (val, 3));
-       }
-       break;
+  if (!val) {
+      tfprintf (oFile, "\t!dw !constword\n", 0);
+      tfprintf (oFile, "\t!dw !constword\n", 0);
+  }
+  else {
+      fprintf (oFile, "\t.byte %s,%s,%s,%s\n",
+         aopLiteral (val, 0), aopLiteral (val, 1),
+         aopLiteral (val, 2), aopLiteral (val, 3));
+  }
+  break;
     }
 }
 
@@ -494,22 +494,22 @@ void printIvalType (sym_link * type, initList * ilist, FILE * oFile)
 /* printIvalStruct - generates initial value for structures        */
 /*-----------------------------------------------------------------*/
 void printIvalStruct (symbol * sym,sym_link * type,
-                     initList * ilist, FILE * oFile)
+          initList * ilist, FILE * oFile)
 {
     symbol *sflds;
     initList *iloop;
-    
+
     sflds = SPEC_STRUCT (type)->fields;
     if (ilist->type != INIT_DEEP) {
-       werror (E_INIT_STRUCT, sym->name);
-       return;
+  werror (E_INIT_STRUCT, sym->name);
+  return;
     }
-    
+
     iloop = ilist->init.deep;
-    
+
     for (; sflds; sflds = sflds->next, iloop = (iloop ? iloop->next : NULL))
-       printIval (sflds, sflds->type, iloop, oFile);
-    
+  printIval (sflds, sflds->type, iloop, oFile);
+
     return;
 }
 
@@ -520,32 +520,32 @@ int printIvalChar (sym_link * type, initList * ilist, FILE * oFile, char *s)
 {
     value *val;
     int remain;
-    
+
     if (!s) {
-       
-       val = list2val (ilist);
-       /* if the value is a character string  */
-       if (IS_ARRAY (val->type) && IS_CHAR (val->etype)) {
-           if (!DCL_ELEM (type))
-               DCL_ELEM (type) = strlen (SPEC_CVAL (val->etype).v_char) + 1;
-           
-           /* if size mismatch  */
-/*         if (DCL_ELEM (type) < ((int) strlen (SPEC_CVAL (val->etype).v_char) + 1)) */
-/*             werror (E_ARRAY_BOUND); */
-           
-           printChar (oFile, SPEC_CVAL (val->etype).v_char,DCL_ELEM(type));
-           
-           if ((remain = (DCL_ELEM (type) - strlen (SPEC_CVAL (val->etype).v_char) -1))>0)
-               while (remain--)
-                   tfprintf (oFile, "\t!db !constbyte\n", 0);
-           
-           return 1;
-       }
-       else
-           return 0;
+
+  val = list2val (ilist);
+  /* if the value is a character string  */
+  if (IS_ARRAY (val->type) && IS_CHAR (val->etype)) {
+      if (!DCL_ELEM (type))
+    DCL_ELEM (type) = strlen (SPEC_CVAL (val->etype).v_char) + 1;
+
+      /* if size mismatch  */
+/*      if (DCL_ELEM (type) < ((int) strlen (SPEC_CVAL (val->etype).v_char) + 1)) */
+/*    werror (E_ARRAY_BOUND); */
+
+      printChar (oFile, SPEC_CVAL (val->etype).v_char,DCL_ELEM(type));
+
+      if ((remain = (DCL_ELEM (type) - strlen (SPEC_CVAL (val->etype).v_char) -1))>0)
+    while (remain--)
+        tfprintf (oFile, "\t!db !constbyte\n", 0);
+
+      return 1;
+  }
+  else
+      return 0;
     }
     else
-       printChar (oFile, s,strlen(s)+1);
+  printChar (oFile, s,strlen(s)+1);
     return 1;
 }
 
@@ -553,50 +553,50 @@ int printIvalChar (sym_link * type, initList * ilist, FILE * oFile, char *s)
 /* printIvalArray - generates code for array initialization        */
 /*-----------------------------------------------------------------*/
 void printIvalArray (symbol * sym, sym_link * type, initList * ilist,
-                    FILE * oFile)
+         FILE * oFile)
 {
     initList *iloop;
     int lcnt = 0, size = 0;
-    
+
     /* take care of the special   case  */
     /* array of characters can be init  */
     /* by a string                      */
     if (IS_CHAR (type->next))
-       if (printIvalChar (type,
-                          (ilist->type == INIT_DEEP ? ilist->init.deep : ilist),
-                          oFile, SPEC_CVAL (sym->etype).v_char))
-           return;
-    
+  if (printIvalChar (type,
+         (ilist->type == INIT_DEEP ? ilist->init.deep : ilist),
+         oFile, SPEC_CVAL (sym->etype).v_char))
+      return;
+
     /* not the special case             */
     if (ilist->type != INIT_DEEP) {
-       werror (E_INIT_STRUCT, sym->name);
-       return;
+  werror (E_INIT_STRUCT, sym->name);
+  return;
     }
-    
+
     iloop = ilist->init.deep;
     lcnt = DCL_ELEM (type);
-    
+
     for (;;) {
-       size++;
-       printIval (sym, type->next, iloop, oFile);
-       iloop = (iloop ? iloop->next : NULL);
-       
-       
-       /* if not array limits given & we */
-       /* are out of initialisers then   */
-       if (!DCL_ELEM (type) && !iloop)
-           break;
-       
-       /* no of elements given and we    */
-       /* have generated for all of them */
-       if (!--lcnt)
-           break;
+  size++;
+  printIval (sym, type->next, iloop, oFile);
+  iloop = (iloop ? iloop->next : NULL);
+
+
+  /* if not array limits given & we */
+  /* are out of initialisers then   */
+  if (!DCL_ELEM (type) && !iloop)
+      break;
+
+  /* no of elements given and we    */
+  /* have generated for all of them */
+  if (!--lcnt)
+      break;
     }
-    
+
     /* if we have not been given a size  */
     if (!DCL_ELEM (type))
-       DCL_ELEM (type) = size;
-    
+  DCL_ELEM (type) = size;
+
     return;
 }
 
@@ -607,35 +607,35 @@ void printIvalFuncPtr (sym_link * type, initList * ilist, FILE * oFile)
 {
     value *val;
     int dLvl = 0;
-    
+
     val = list2val (ilist);
     /* check the types   */
     if ((dLvl = checkType (val->type, type->next)) <= 0) {
-       tfprintf(oFile, "\t!dw !constword\n", 0);
-       return;
+  tfprintf(oFile, "\t!dw !constword\n", 0);
+  return;
     }
-    
+
     /* now generate the name */
     if (!val->sym) {
         if (port->use_dw_for_init)
-       {
-           tfprintf(oFile, "\t!dws\n", val->name);
-       }
-       else  
-       {
-           printPointerType(oFile, val->name);
-       }
+  {
+      tfprintf(oFile, "\t!dws\n", val->name);
+  }
+  else
+  {
+      printPointerType(oFile, val->name);
+  }
     }
     else
-       if (port->use_dw_for_init)
-       {
-           tfprintf(oFile, "\t!dws\n", val->sym->rname);
-       }
-       else
-       {
-           printPointerType(oFile, val->sym->rname);
-       }
-    
+  if (port->use_dw_for_init)
+      {
+      tfprintf(oFile, "\t!dws\n", val->sym->rname);
+  }
+  else
+      {
+      printPointerType(oFile, val->sym->rname);
+  }
+
     return;
 }
 
@@ -645,70 +645,70 @@ void printIvalFuncPtr (sym_link * type, initList * ilist, FILE * oFile)
 int printIvalCharPtr (symbol * sym, sym_link * type, value * val, FILE * oFile)
 {
     int size = 0;
-    
+
     /* PENDING: this is _very_ mcs51 specific, including a magic
-       number... 
+       number...
        It's also endin specific.
     */
     size = getSize (type);
 
     if (val->name && strlen(val->name)) {
-       if (size == 1) /* This appears to be Z80 specific?? */
-       {
-           tfprintf(oFile,
-                   "\t!dbs\n", val->name);
-       }
-       else if (size == FPTRSIZE)
-       {
-           if (port->use_dw_for_init)
-           {
-               tfprintf(oFile, "\t!dws\n", val->name);
-           }
-           else
-           {
-               printPointerType(oFile, val->name);
-           }
-       }
-       else  if (size == GPTRSIZE)
-       {
-           /* PENDING: 0x02 or 0x%02x, CDATA? */
-           printGPointerType(oFile, val->name, 
-                             (IS_PTR(val->type) ? DCL_TYPE(val->type) :
-                             PTR_TYPE(SPEC_OCLS(val->etype))));
-       }
-       else
-       {
-           fprintf(stderr, "*** internal error: unknown size in "
-                           "printIvalCharPtr.\n");
-       }
+  if (size == 1) /* This appears to be Z80 specific?? */
+  {
+      tfprintf(oFile,
+        "\t!dbs\n", val->name);
+  }
+  else if (size == FPTRSIZE)
+  {
+      if (port->use_dw_for_init)
+      {
+        tfprintf(oFile, "\t!dws\n", val->name);
+      }
+      else
+      {
+    printPointerType(oFile, val->name);
+      }
+  }
+  else  if (size == GPTRSIZE)
+  {
+      /* PENDING: 0x02 or 0x%02x, CDATA? */
+      printGPointerType(oFile, val->name,
+                (IS_PTR(val->type) ? DCL_TYPE(val->type) :
+            PTR_TYPE(SPEC_OCLS(val->etype))));
+  }
+  else
+  {
+      fprintf(stderr, "*** internal error: unknown size in "
+              "printIvalCharPtr.\n");
+  }
     }
     else {
-       /* What is this case? Are these pointers? */
-       switch (size) {
-       case 1:
-           tfprintf(oFile, "\t!dbs\n", aopLiteral(val, 0));
-           break;
-       case 2:
-           if (port->use_dw_for_init)
-               tfprintf(oFile, "\t!dws\n", aopLiteralLong(val, 0, size));
-           else 
-               tfprintf(oFile, "\t.byte %s,%s\n", 
-                        aopLiteral(val, 0),aopLiteral(val, 1));
-           break;
-       case 3:
-           /* PENDING: 0x02 or 0x%02x, CDATA? */
-           fprintf(oFile, "\t.byte %s,%s,#0x02\n",
-                   aopLiteral (val, 0), aopLiteral (val, 1));
-           break;
-       default:
-           assert(0);
-       }
+  /* What is this case? Are these pointers? */
+  switch (size) {
+  case 1:
+      tfprintf(oFile, "\t!dbs\n", aopLiteral(val, 0));
+      break;
+  case 2:
+      if (port->use_dw_for_init)
+    tfprintf(oFile, "\t!dws\n", aopLiteralLong(val, 0, size));
+      else
+    tfprintf(oFile, "\t.byte %s,%s\n",
+       aopLiteral(val, 0),aopLiteral(val, 1));
+      break;
+  case 3:
+      /* PENDING: 0x02 or 0x%02x, CDATA? */
+      fprintf(oFile, "\t.byte %s,%s,#0x02\n",
+        aopLiteral (val, 0), aopLiteral (val, 1));
+      break;
+  default:
+      assert(0);
+  }
     }
 
 
     if (val->sym && val->sym->isstrlit)
-       addSet (&statsg->syms, val->sym);
-    
+  addSet (&statsg->syms, val->sym);
+
     return 1;
 }
 
@@ -719,64 +719,64 @@ void printIvalPtr (symbol * sym, sym_link * type, initList * ilist, FILE * oFile
 {
     value *val;
     int size;
-    
+
     /* if deep then   */
     if (ilist->type == INIT_DEEP)
-       ilist = ilist->init.deep;
-    
+  ilist = ilist->init.deep;
+
     /* function pointer     */
     if (IS_FUNC (type->next)) {
-       printIvalFuncPtr (type, ilist, oFile);
-       return;
+  printIvalFuncPtr (type, ilist, oFile);
+  return;
     }
-    
+
     if (!(val = initPointer (ilist)))
-       return ;
+  return ;
 
     /* if character pointer */
     if (IS_CHAR (type->next))
-       if (printIvalCharPtr (sym, type, val, oFile))
-           return;
-    
+  if (printIvalCharPtr (sym, type, val, oFile))
+      return;
+
     /* check the type      */
     if (checkType (type, val->type) != 1)
-       werror (E_INIT_WRONG);
-    
+  werror (E_INIT_WRONG);
+
     /* if val is literal */
     if (IS_LITERAL (val->etype)) {
-       switch (getSize (type)) {
-       case 1:
-           tfprintf(oFile, "\t!db !constbyte\n", (unsigned int)floatFromVal(val) & 0xff);
-           break;
-       case 2:
-           if (port->use_dw_for_init)
-               tfprintf(oFile, "\t!dws\n", aopLiteralLong(val, 0, 2));
-           else
-               tfprintf (oFile, "\t.byte %s,%s\n", aopLiteral(val, 0),aopLiteral(val, 1));
-           break;
-       case 3:
-           fprintf (oFile, "\t.byte %s,%s,#0x02\n",
-                    aopLiteral (val, 0), aopLiteral (val, 1));
-       }
-       return;
+  switch (getSize (type)) {
+  case 1:
+      tfprintf(oFile, "\t!db !constbyte\n", (unsigned int)floatFromVal(val) & 0xff);
+      break;
+  case 2:
+      if (port->use_dw_for_init)
+    tfprintf(oFile, "\t!dws\n", aopLiteralLong(val, 0, 2));
+      else
+    tfprintf (oFile, "\t.byte %s,%s\n", aopLiteral(val, 0),aopLiteral(val, 1));
+      break;
+  case 3:
+      fprintf (oFile, "\t.byte %s,%s,#0x02\n",
+         aopLiteral (val, 0), aopLiteral (val, 1));
+  }
+  return;
     }
-    
-    
+
+
     size = getSize (type);
-    
+
     if (size == 1)  /* Z80 specific?? */
     {
-       tfprintf (oFile, "\t!dbs\n", val->name);
+  tfprintf (oFile, "\t!dbs\n", val->name);
     }
     else if (size == FPTRSIZE)
     {
-       tfprintf (oFile, "\t!dws\n", val->name);
+  tfprintf (oFile, "\t!dws\n", val->name);
     }
     else if (size == GPTRSIZE)
     {
-       printGPointerType(oFile, val->name, 
-                     (IS_PTR(val->type) ? DCL_TYPE(val->type) :
-                     PTR_TYPE(SPEC_OCLS(val->etype))));
+  printGPointerType(oFile, val->name,
+          (IS_PTR(val->type) ? DCL_TYPE(val->type) :
+          PTR_TYPE(SPEC_OCLS(val->etype))));
     }
     return;
 }
@@ -787,30 +787,30 @@ void printIvalPtr (symbol * sym, sym_link * type, initList * ilist, FILE * oFile
 void printIval (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
 {
     if (!ilist)
-       return;    
-    
+  return;
+
     /* if structure then    */
     if (IS_STRUCT (type)) {
-       printIvalStruct (sym, type, ilist, oFile);
-       return;
+  printIvalStruct (sym, type, ilist, oFile);
+  return;
     }
-    
+
     /* if this is a pointer */
     if (IS_PTR (type)) {
-       printIvalPtr (sym, type, ilist, oFile);
-       return;
+  printIvalPtr (sym, type, ilist, oFile);
+  return;
     }
-    
+
     /* if this is an array   */
     if (IS_ARRAY (type)) {
-       printIvalArray (sym, type, ilist, oFile);
-       return;
+  printIvalArray (sym, type, ilist, oFile);
+  return;
     }
-    
+
     /* if type is SPECIFIER */
     if (IS_SPEC (type)) {
-       printIvalType (type, ilist, oFile);
-       return;
+  printIvalType (type, ilist, oFile);
+  return;
     }
 }
 
@@ -820,76 +820,76 @@ void printIval (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
 void emitStaticSeg(memmap * map, FILE *out)
 {
     symbol *sym;
-    
+
     /*     fprintf(map->oFile,"\t.area\t%s\n",map->sname); */
     if (!out)
-       out = code->oFile;
+  out = code->oFile;
 
     /* for all variables in this segment do */
     for (sym = setFirstItem (map->syms); sym;
-        sym = setNextItem (map->syms)) {
-       
-       /* if it is "extern" then do nothing */
-       if (IS_EXTERN (sym->etype))
-           continue;
-       
-       /* if it is not static add it to the public
-          table */
-       if (!IS_STATIC (sym->etype))
-           addSetHead (&publics, sym);
-
-       /* print extra debug info if required */
-       if ((options.debug || sym->level == 0) && !options.nodebug) {
-
-           cdbSymbol(sym,cdbFile,FALSE,FALSE);
-
-           if (!sym->level) { /* global */
-               if (IS_STATIC(sym->etype))
-                   fprintf(out,"F%s$",moduleName); /* scope is file */
-               else
-                   fprintf(out,"G$"); /* scope is global */
-           }
-           else
-               /* symbol is local */
-               fprintf(out,"L%s$",
-                       (sym->localof ? sym->localof->name : "-null-"));
-           fprintf(out,"%s$%d$%d",sym->name,sym->level,sym->block);
-       }
-       
-       /* if it has an absolute address */
-       if (SPEC_ABSA (sym->etype)) {
-           if ((options.debug || sym->level == 0) && !options.nodebug)
-               fprintf(out," == 0x%04x\n", SPEC_ADDR (sym->etype));
-
-           fprintf (out, "%s\t=\t0x%04x\n",
-                    sym->rname,
-                    SPEC_ADDR (sym->etype));
-       }
-       else {
-           if ((options.debug || sym->level == 0) && !options.nodebug)
-               fprintf(out," == .\n"); 
-
-           /* if it has an initial value */
-           if (sym->ival) {
-               fprintf (out, "%s:\n", sym->rname);
-               noAlloc++;
-               resolveIvalSym (sym->ival);
-               printIval (sym, sym->type, sym->ival, out);
-               noAlloc--;
-           }
-           else {
-               /* allocate space */
-               fprintf (out, "%s:\n", sym->rname);
-               /* special case for character strings */
-               if (IS_ARRAY (sym->type) && IS_CHAR (sym->type->next) &&
-                   SPEC_CVAL (sym->etype).v_char)
-                   printChar (out,
-                              SPEC_CVAL (sym->etype).v_char,
-                              strlen(SPEC_CVAL (sym->etype).v_char)+1);
-               else 
-                   tfprintf(out, "\t!ds\n", (unsigned int)getSize (sym->type)& 0xffff);
-           }
-       }
+   sym = setNextItem (map->syms)) {
+
+  /* if it is "extern" then do nothing */
+  if (IS_EXTERN (sym->etype))
+      continue;
+
+  /* if it is not static add it to the public
+     table */
+  if (!IS_STATIC (sym->etype))
+      addSetHead (&publics, sym);
+
+  /* print extra debug info if required */
+  if ((options.debug || sym->level == 0) && !options.nodebug) {
+
+      cdbSymbol(sym,cdbFile,FALSE,FALSE);
+
+      if (!sym->level) { /* global */
+    if (IS_STATIC(sym->etype))
+        fprintf(out,"F%s$",moduleName); /* scope is file */
+    else
+        fprintf(out,"G$"); /* scope is global */
+      }
+      else
+    /* symbol is local */
+    fprintf(out,"L%s$",
+      (sym->localof ? sym->localof->name : "-null-"));
+      fprintf(out,"%s$%d$%d",sym->name,sym->level,sym->block);
+  }
+
+  /* if it has an absolute address */
+  if (SPEC_ABSA (sym->etype)) {
+      if ((options.debug || sym->level == 0) && !options.nodebug)
+    fprintf(out," == 0x%04x\n", SPEC_ADDR (sym->etype));
+
+      fprintf (out, "%s\t=\t0x%04x\n",
+         sym->rname,
+         SPEC_ADDR (sym->etype));
+  }
+  else {
+      if ((options.debug || sym->level == 0) && !options.nodebug)
+    fprintf(out," == .\n");
+
+      /* if it has an initial value */
+      if (sym->ival) {
+    fprintf (out, "%s:\n", sym->rname);
+    noAlloc++;
+    resolveIvalSym (sym->ival);
+    printIval (sym, sym->type, sym->ival, out);
+    noAlloc--;
+      }
+      else {
+    /* allocate space */
+    fprintf (out, "%s:\n", sym->rname);
+    /* special case for character strings */
+    if (IS_ARRAY (sym->type) && IS_CHAR (sym->type->next) &&
+        SPEC_CVAL (sym->etype).v_char)
+        printChar (out,
+             SPEC_CVAL (sym->etype).v_char,
+             strlen(SPEC_CVAL (sym->etype).v_char)+1);
+    else
+        tfprintf(out, "\t!ds\n", (unsigned int)getSize (sym->type)& 0xffff);
+      }
+  }
     }
 }
 
@@ -930,43 +930,43 @@ void createInterruptVect (FILE * vFile)
     int i = 0;
     mainf = newSymbol ("main", 0);
     mainf->block = 0;
-    
+
     /* only if the main function exists */
     if (!(mainf = findSymWithLevel (SymbolTab, mainf))) {
-       if (!options.cc_only)
-           werror(E_NO_MAIN);
-       return;
+  if (!options.cc_only)
+      werror(E_NO_MAIN);
+  return;
     }
-    
+
     /* if the main is only a prototype ie. no body then do nothing */
     if (!mainf->fbody) {
-       /* if ! compile only then main function should be present */
-       if (!options.cc_only)
-           werror(E_NO_MAIN);
-       return;
+  /* if ! compile only then main function should be present */
+  if (!options.cc_only)
+      werror(E_NO_MAIN);
+  return;
     }
-    
+
     tfprintf(vFile, "\t!areacode\n", CODE_NAME);
     fprintf (vFile, "__interrupt_vect:\n");
 
-    
+
     if (!port->genIVT || ! (port->genIVT(vFile, interrupts, maxInterrupts)))
     {
         /* "generic" interrupt table header (if port doesn't specify one).
          *
          * Look suspiciously like 8051 code to me...
          */
-    
-       fprintf (vFile, "\tljmp\t__sdcc_gsinit_startup\n");
-    
-    
-       /* now for the other interrupts */
-       for (; i < maxInterrupts; i++) {
-               if (interrupts[i])
-                       fprintf (vFile, "\tljmp\t%s\n\t.ds\t5\n", interrupts[i]->rname);
-               else
-                       fprintf (vFile, "\treti\n\t.ds\t7\n");
-       }
+
+      fprintf (vFile, "\tljmp\t__sdcc_gsinit_startup\n");
+
+
+      /* now for the other interrupts */
+      for (; i < maxInterrupts; i++) {
+    if (interrupts[i])
+          fprintf (vFile, "\tljmp\t%s\n\t.ds\t5\n", interrupts[i]->rname);
+    else
+          fprintf (vFile, "\treti\n\t.ds\t7\n");
+      }
     }
 }
 
@@ -998,14 +998,14 @@ void initialComments (FILE * afile)
 void printPublics (FILE * afile)
 {
     symbol *sym;
-    
+
     fprintf (afile, "%s", iComments2);
     fprintf (afile, "; Public variables in this module\n");
     fprintf (afile, "%s", iComments2);
-    
+
     for (sym = setFirstItem (publics); sym;
-        sym = setNextItem (publics))
-       tfprintf(afile, "\t!global\n", sym->rname);
+   sym = setNextItem (publics))
+  tfprintf(afile, "\t!global\n", sym->rname);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1014,14 +1014,14 @@ void printPublics (FILE * afile)
 void printExterns (FILE * afile)
 {
     symbol *sym;
-    
+
     fprintf (afile, "%s", iComments2);
     fprintf (afile, "; Externals used\n");
     fprintf (afile, "%s", iComments2);
-    
+
     for (sym = setFirstItem (externs); sym;
-        sym = setNextItem (externs))
-       tfprintf(afile, "\t!global\n", sym->rname);
+   sym = setNextItem (externs))
+  tfprintf(afile, "\t!global\n", sym->rname);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1030,91 +1030,91 @@ void printExterns (FILE * afile)
 static void emitOverlay(FILE *afile)
 {
     set *ovrset;
-    
+
     if (!elementsInSet(ovrSetSets))
-       tfprintf(afile,"\t!area\n", port->mem.overlay_name);
+  tfprintf(afile,"\t!area\n", port->mem.overlay_name);
 
     /* for each of the sets in the overlay segment do */
     for (ovrset = setFirstItem(ovrSetSets); ovrset;
-        ovrset = setNextItem(ovrSetSets)) {
-
-       symbol *sym ;
-
-       if (elementsInSet(ovrset)) {
-           /* this dummy area is used to fool the assembler
-              otherwise the assembler will append each of these
-              declarations into one chunk and will not overlay 
-              sad but true */
-           fprintf(afile,"\t.area _DUMMY\n");
-           /* output the area informtion */
-           fprintf(afile,"\t.area\t%s\n", port->mem.overlay_name); /* MOF */
-       }
-       
-       for (sym = setFirstItem(ovrset); sym;
-            sym = setNextItem(ovrset)) {
-
-           /* if extern then add it to the publics tabledo nothing */
-           if (IS_EXTERN (sym->etype))
-               continue;
-           
-           /* if allocation required check is needed
-              then check if the symbol really requires
-              allocation only for local variables */
-           if (!IS_AGGREGATE(sym->type) &&
-               !(sym->_isparm && !IS_REGPARM(sym->etype))
-               && !sym->allocreq && sym->level)
-               continue ;
-           
-           /* if global variable & not static or extern 
-              and addPublics allowed then add it to the public set */
-           if ((sym->_isparm && !IS_REGPARM(sym->etype))
-               && !IS_STATIC (sym->etype))
-               addSetHead (&publics, sym);
-           
-           /* if extern then do nothing or is a function 
-              then do nothing */
-           if (IS_FUNC (sym->type))
-               continue;
-
-           /* print extra debug info if required */
-           if ((options.debug || sym->level == 0) && !options.nodebug) {
-               
-               cdbSymbol(sym,cdbFile,FALSE,FALSE);
-               
-               if (!sym->level) { /* global */
-                   if (IS_STATIC(sym->etype))
-                       fprintf(afile,"F%s$",moduleName); /* scope is file */
-                   else
-                       fprintf(afile,"G$"); /* scope is global */
-               }
-               else
-                   /* symbol is local */
-                   fprintf(afile,"L%s$",
-                           (sym->localof ? sym->localof->name : "-null-"));
-               fprintf(afile,"%s$%d$%d",sym->name,sym->level,sym->block);
-           }
-           
-           /* if is has an absolute address then generate
-              an equate for this no need to allocate space */
-           if (SPEC_ABSA (sym->etype)) {
-               
-               if ((options.debug || sym->level == 0) && !options.nodebug)
-                   fprintf (afile," == 0x%04x\n",SPEC_ADDR (sym->etype));          
-
-               fprintf (afile, "%s\t=\t0x%04x\n",
-                        sym->rname,
-                        SPEC_ADDR (sym->etype));
-           }
-           else {
-               if ((options.debug || sym->level == 0) && !options.nodebug)
-                   fprintf(afile,"==.\n");
-       
-               /* allocate space */
-               tfprintf(afile, "!labeldef\n", sym->rname);
-               tfprintf(afile, "\t!ds\n", (unsigned int)getSize (sym->type) & 0xffff);
-           }
-           
-       }
+   ovrset = setNextItem(ovrSetSets)) {
+
+  symbol *sym ;
+
+  if (elementsInSet(ovrset)) {
+      /* this dummy area is used to fool the assembler
+         otherwise the assembler will append each of these
+         declarations into one chunk and will not overlay
+         sad but true */
+      fprintf(afile,"\t.area _DUMMY\n");
+      /* output the area informtion */
+      fprintf(afile,"\t.area\t%s\n", port->mem.overlay_name); /* MOF */
+  }
+
+  for (sym = setFirstItem(ovrset); sym;
+       sym = setNextItem(ovrset)) {
+
+      /* if extern then add it to the publics tabledo nothing */
+      if (IS_EXTERN (sym->etype))
+    continue;
+
+      /* if allocation required check is needed
+         then check if the symbol really requires
+         allocation only for local variables */
+      if (!IS_AGGREGATE(sym->type) &&
+    !(sym->_isparm && !IS_REGPARM(sym->etype))
+    && !sym->allocreq && sym->level)
+    continue ;
+
+      /* if global variable & not static or extern
+         and addPublics allowed then add it to the public set */
+      if ((sym->_isparm && !IS_REGPARM(sym->etype))
+    && !IS_STATIC (sym->etype))
+    addSetHead (&publics, sym);
+
+      /* if extern then do nothing or is a function
+         then do nothing */
+      if (IS_FUNC (sym->type))
+    continue;
+
+      /* print extra debug info if required */
+      if ((options.debug || sym->level == 0) && !options.nodebug) {
+
+    cdbSymbol(sym,cdbFile,FALSE,FALSE);
+
+    if (!sym->level) { /* global */
+        if (IS_STATIC(sym->etype))
+      fprintf(afile,"F%s$",moduleName); /* scope is file */
+        else
+      fprintf(afile,"G$"); /* scope is global */
+    }
+    else
+        /* symbol is local */
+        fprintf(afile,"L%s$",
+          (sym->localof ? sym->localof->name : "-null-"));
+    fprintf(afile,"%s$%d$%d",sym->name,sym->level,sym->block);
+      }
+
+      /* if is has an absolute address then generate
+         an equate for this no need to allocate space */
+      if (SPEC_ABSA (sym->etype)) {
+
+    if ((options.debug || sym->level == 0) && !options.nodebug)
+        fprintf (afile," == 0x%04x\n",SPEC_ADDR (sym->etype));
+
+    fprintf (afile, "%s\t=\t0x%04x\n",
+       sym->rname,
+       SPEC_ADDR (sym->etype));
+      }
+      else {
+    if ((options.debug || sym->level == 0) && !options.nodebug)
+        fprintf(afile,"==.\n");
+
+    /* allocate space */
+    tfprintf(afile, "!labeldef\n", sym->rname);
+    tfprintf(afile, "\t!ds\n", (unsigned int)getSize (sym->type) & 0xffff);
+      }
+
+  }
     }
 }
 
@@ -1126,21 +1126,21 @@ void glue ()
     FILE *vFile;
     FILE *asmFile;
     FILE *ovrFile = tempfile();
-    
+
     addSetHead(&tmpfileSet,ovrFile);
     /* print the global struct definitions */
     if (options.debug && !options.nodebug)
-       cdbStructBlock (0,cdbFile);
+  cdbStructBlock (0,cdbFile);
 
     vFile = tempfile();
     /* PENDING: this isnt the best place but it will do */
     if (port->general.glue_up_main) {
-       /* create the interrupt vector table */
-       createInterruptVect (vFile);
+  /* create the interrupt vector table */
+  createInterruptVect (vFile);
     }
 
     addSetHead(&tmpfileSet,vFile);
-    
+
     /* emit code for the all the variables declared */
     emitMaps ();
     /* do the overlay segments */
@@ -1148,23 +1148,23 @@ void glue ()
 
     /* now put it all together into the assembler file */
     /* create the assembler file name */
-    
+
     if (!options.c1mode) {
-       sprintf (buffer, srcFileName);
-       strcat (buffer, ".asm");
+  sprintf (buffer, srcFileName);
+  strcat (buffer, ".asm");
     }
     else {
-       strcpy(buffer, options.out_name);
+  strcpy(buffer, options.out_name);
     }
 
     if (!(asmFile = fopen (buffer, "w"))) {
-       werror (E_FILE_OPEN_ERR, buffer);
-       exit (1);
+  werror (E_FILE_OPEN_ERR, buffer);
+  exit (1);
     }
-    
+
     /* initial comments */
     initialComments (asmFile);
-    
+
     /* print module name */
     tfprintf(asmFile, "\t!module\n", moduleName);
     tfprintf(asmFile, "\t!fileprelude\n");
@@ -1172,26 +1172,26 @@ void glue ()
     /* Let the port generate any global directives, etc. */
     if (port->genAssemblerPreamble)
     {
-       port->genAssemblerPreamble(asmFile);
+      port->genAssemblerPreamble(asmFile);
     }
-    
+
     /* print the global variables in this module */
     printPublics (asmFile);
     if (port->assembler.externGlobal)
-       printExterns (asmFile);
+  printExterns (asmFile);
 
     /* copy the sfr segment */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; special function registers\n");
     fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, sfr->oFile);
-    
+
     /* copy the sbit segment */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; special function bits \n");
     fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, sfrbit->oFile);
-    
+
     /* copy the data segment */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; internal ram data\n");
@@ -1202,16 +1202,16 @@ void glue ()
     /* create the overlay segments */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; overlayable items in internal ram \n");
-    fprintf (asmFile, "%s", iComments2);    
+    fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, ovrFile);
 
     /* create the stack segment MOF */
     if (mainf && mainf->fbody) {
-       fprintf (asmFile, "%s", iComments2);
-       fprintf (asmFile, "; Stack segment in internal ram \n");
-       fprintf (asmFile, "%s", iComments2);
-       fprintf (asmFile, "\t.area\tSSEG\t(DATA)\n"
-                "__start__stack:\n\t.ds\t1\n\n");
+  fprintf (asmFile, "%s", iComments2);
+  fprintf (asmFile, "; Stack segment in internal ram \n");
+  fprintf (asmFile, "%s", iComments2);
+  fprintf (asmFile, "\t.area\tSSEG\t(DATA)\n"
+     "__start__stack:\n\t.ds\t1\n\n");
     }
 
     /* create the idata segment */
@@ -1219,7 +1219,7 @@ void glue ()
     fprintf (asmFile, "; indirectly addressable internal ram data\n");
     fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, idata->oFile);
-    
+
     /* copy the bit segment */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; bit data\n");
@@ -1228,35 +1228,35 @@ void glue ()
 
     /* if external stack then reserve space of it */
     if (mainf && mainf->fbody && options.useXstack ) {
-       fprintf (asmFile, "%s", iComments2);
-       fprintf (asmFile, "; external stack \n");
-       fprintf (asmFile, "%s", iComments2);
-       fprintf (asmFile,"\t.area XSEG (XDATA)\n"); /* MOF */
-       fprintf (asmFile,"\t.ds 256\n");
+  fprintf (asmFile, "%s", iComments2);
+  fprintf (asmFile, "; external stack \n");
+  fprintf (asmFile, "%s", iComments2);
+  fprintf (asmFile,"\t.area XSEG (XDATA)\n"); /* MOF */
+  fprintf (asmFile,"\t.ds 256\n");
     }
-       
-       
+
+
     /* copy xtern ram data */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; external ram data\n");
     fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, xdata->oFile);
-    
+
     /* copy the interrupt vector table */
     if (mainf && mainf->fbody) {
-       fprintf (asmFile, "%s", iComments2);
-       fprintf (asmFile, "; interrupt vector \n");
-       fprintf (asmFile, "%s", iComments2);
-       copyFile (asmFile, vFile);
+  fprintf (asmFile, "%s", iComments2);
+  fprintf (asmFile, "; interrupt vector \n");
+  fprintf (asmFile, "%s", iComments2);
+  copyFile (asmFile, vFile);
     }
-    
+
     /* copy global & static initialisations */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; global & static initialisations\n");
     fprintf (asmFile, "%s", iComments2);
-    
-    /* Everywhere we generate a reference to the static_name area, 
-     * (which is currently only here), we immediately follow it with a 
+
+    /* Everywhere we generate a reference to the static_name area,
+     * (which is currently only here), we immediately follow it with a
      * definition of the post_static_name area. This guarantees that
      * the post_static_name area will immediately follow the static_name
      * area.
@@ -1264,37 +1264,37 @@ void glue ()
     tfprintf(asmFile, "\t!area\n", port->mem.static_name); /* MOF */
     tfprintf(asmFile, "\t!area\n", port->mem.post_static_name);
     tfprintf(asmFile, "\t!area\n", port->mem.static_name);
-    
+
     if (mainf && mainf->fbody) {
-       fprintf (asmFile,"__sdcc_gsinit_startup:\n");
-       /* if external stack is specified then the
-          higher order byte of the xdatalocation is
-          going into P2 and the lower order going into
-          spx */
-       if (options.useXstack) {
-           fprintf(asmFile,"\tmov\tP2,#0x%02x\n",
-                   (((unsigned int)options.xdata_loc) >> 8) & 0xff);
-           fprintf(asmFile,"\tmov\t_spx,#0x%02x\n",
-                   (unsigned int)options.xdata_loc & 0xff);
-       }
-
-       /* initialise the stack pointer */
-       /* if the user specified a value then use it */
-       if (options.stack_loc) 
-           fprintf(asmFile,"\tmov\tsp,#%d\n",options.stack_loc);
-       else 
-           /* no: we have to compute it */
-           if (!options.stackOnData && maxRegBank <= 3)
-               fprintf(asmFile,"\tmov\tsp,#%d\n",((maxRegBank + 1) * 8) -1); 
-           else
-               fprintf(asmFile,"\tmov\tsp,#__start__stack\n"); /* MOF */
-
-       fprintf (asmFile,"\tlcall\t__sdcc_external_startup\n");
-       fprintf (asmFile,"\tmov\ta,dpl\n");
-       fprintf (asmFile,"\tjz\t__sdcc_init_data\n");
-       fprintf (asmFile,"\tljmp\t__sdcc_program_startup\n");
-       fprintf (asmFile,"__sdcc_init_data:\n");
-       
+  fprintf (asmFile,"__sdcc_gsinit_startup:\n");
+  /* if external stack is specified then the
+     higher order byte of the xdatalocation is
+     going into P2 and the lower order going into
+     spx */
+  if (options.useXstack) {
+      fprintf(asmFile,"\tmov\tP2,#0x%02x\n",
+        (((unsigned int)options.xdata_loc) >> 8) & 0xff);
+      fprintf(asmFile,"\tmov\t_spx,#0x%02x\n",
+        (unsigned int)options.xdata_loc & 0xff);
+  }
+
+  /* initialise the stack pointer */
+  /* if the user specified a value then use it */
+  if (options.stack_loc)
+      fprintf(asmFile,"\tmov\tsp,#%d\n",options.stack_loc);
+  else
+      /* no: we have to compute it */
+      if (!options.stackOnData && maxRegBank <= 3)
+    fprintf(asmFile,"\tmov\tsp,#%d\n",((maxRegBank + 1) * 8) -1);
+      else
+    fprintf(asmFile,"\tmov\tsp,#__start__stack\n"); /* MOF */
+
+  fprintf (asmFile,"\tlcall\t__sdcc_external_startup\n");
+  fprintf (asmFile,"\tmov\ta,dpl\n");
+  fprintf (asmFile,"\tjz\t__sdcc_init_data\n");
+  fprintf (asmFile,"\tljmp\t__sdcc_program_startup\n");
+  fprintf (asmFile,"__sdcc_init_data:\n");
+
     }
     copyFile (asmFile, statsg->oFile);
 
@@ -1304,14 +1304,14 @@ void glue ()
          * This area is guaranteed to follow the static area
          * by the ugly shucking and jiving about 20 lines ago.
          */
-       tfprintf(asmFile, "\t!area\n", port->mem.post_static_name);
-       fprintf (asmFile,"\tljmp\t__sdcc_program_startup\n");
+      tfprintf(asmFile, "\t!area\n", port->mem.post_static_name);
+  fprintf (asmFile,"\tljmp\t__sdcc_program_startup\n");
     }
 
     fprintf (asmFile,
-            "%s"
-            "; Home\n"
-            "%s", iComments2, iComments2);
+       "%s"
+       "; Home\n"
+       "%s", iComments2, iComments2);
     tfprintf(asmFile, "\t!areahome\n", HOME_NAME);
     copyFile (asmFile, home->oFile);
 
@@ -1321,25 +1321,25 @@ void glue ()
     fprintf (asmFile, "%s", iComments2);
     tfprintf(asmFile, "\t!areacode\n", CODE_NAME);
     if (mainf && mainf->fbody) {
-       
-       /* entry point @ start of CSEG */
-       fprintf (asmFile,"__sdcc_program_startup:\n");
-       
-       /* put in the call to main */
-       fprintf(asmFile,"\tlcall\t_main\n");
-       if (options.mainreturn) {
-
-           fprintf(asmFile,";\treturn from main ; will return to caller\n");
-           fprintf(asmFile,"\tret\n");
-
-       } else {
-                  
-           fprintf(asmFile,";\treturn from main will lock up\n");
-           fprintf(asmFile,"\tsjmp     .\n");
-       }
+
+  /* entry point @ start of CSEG */
+  fprintf (asmFile,"__sdcc_program_startup:\n");
+
+  /* put in the call to main */
+  fprintf(asmFile,"\tlcall\t_main\n");
+  if (options.mainreturn) {
+
+      fprintf(asmFile,";\treturn from main ; will return to caller\n");
+      fprintf(asmFile,"\tret\n");
+
+  } else {
+
+      fprintf(asmFile,";\treturn from main will lock up\n");
+      fprintf(asmFile,"\tsjmp .\n");
+  }
     }
     copyFile (asmFile, code->oFile);
-    
+
     fclose (asmFile);
     applyToSet(tmpfileSet,closeTmpFiles);
     applyToSet(tmpfileNameSet, rmTmpFiles);
@@ -1354,22 +1354,22 @@ FILE *tempfile(void)
 #if !defined(_MSC_VER)
     const char *tmpdir = NULL;
     if (getenv("TMP"))
-       tmpdir = getenv("TMP");
+  tmpdir = getenv("TMP");
     else if (getenv("TEMP"))
-       tmpdir = getenv("TEMP");
+  tmpdir = getenv("TEMP");
     else if (getenv("TMPDIR"))
-       tmpdir = getenv("TMPDIR");
+  tmpdir = getenv("TMPDIR");
     if (tmpdir) {
-       char *name = tempnam(tmpdir, "sdcc");
-       if (name) {
-           FILE *fp = fopen(name, "w+b");
-           if (fp)
-           {
-               addSetHead(&tmpfileNameSet, name);
-           }
-           return fp;
-       }
-       return NULL;
+  char *name = tempnam(tmpdir, "sdcc");
+  if (name) {
+      FILE *fp = fopen(name, "w+b");
+      if (fp)
+      {
+    addSetHead(&tmpfileNameSet, name);
+      }
+      return fp;
+  }
+  return NULL;
     }
 #endif
     return tmpfile();
@@ -1378,7 +1378,7 @@ FILE *tempfile(void)
 char *gc_strdup(const char *s)
 {
     char *ret;
-    ret = Safe_calloc(strlen(s)+1);
+    ret = Safe_calloc(1,strlen(s)+1);
     strcpy(ret, s);
     return ret;
 }
index 22b453ce1a78cbe2ecaea84f7aff6a7f2a4c9338..80c3864a1aba486256c08ccd5a85b1e19106bb63 100644 (file)
@@ -1,25 +1,25 @@
 /*-----------------------------------------------------------------
     SDCChast.c - contains support routines for hashtables
-                
+
     Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
 
     This program is free software; you can redistribute it and/or modify it
     under the terms of the GNU General Public License as published by the
     Free Software Foundation; either version 2, or (at your option) any
     later version.
-    
+
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-    
+
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-    
+
     In other words, you are welcome to use, share and improve this program.
     You are forbidden to forbid anyone else to use, share and improve
-    what you give them.   Help stamp out software-hoarding!  
+    what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include <stdio.h>
@@ -39,8 +39,8 @@ static hashtItem *_newHashtItem (int key, void *pkey, void *item)
 {
     hashtItem *htip;
 
-    htip = Safe_calloc(sizeof(hashtItem));
-    
+    htip = Safe_calloc(1,sizeof(hashtItem));
+
     htip->key = key ;
     htip->pkey = pkey;
     htip->item = item;
@@ -53,16 +53,16 @@ static hashtItem *_newHashtItem (int key, void *pkey, void *item)
 /*-----------------------------------------------------------------*/
 hTab *newHashTable (int size)
 {
-    hTab *htab;    
-    
-    htab = Safe_calloc(sizeof(hTab));  
+    hTab *htab;
+
+    htab = Safe_calloc(1,sizeof(hTab));
 
     if (!(htab->table = calloc((size +1),  sizeof(hashtItem *)))) {
-       fprintf(stderr,"out of virtual memory %s %d\n",
-               __FILE__,(size +1)* sizeof(hashtItem *)); 
-       exit(1);
-    }    
-    htab->minKey = htab->size = size ;    
+  fprintf(stderr,"out of virtual memory %s %d\n",
+    __FILE__,(size +1)* sizeof(hashtItem *));
+  exit(1);
+    }
+    htab->minKey = htab->size = size ;
     return htab;
 }
 
@@ -73,35 +73,35 @@ void hTabAddItemLong(hTab **htab, int key, void *pkey, void *item)
     hashtItem *last ;
 
     if (!(*htab) )
-       *htab = newHashTable ( DEFAULT_HTAB_SIZE  );
-    
-    if (key > (*htab)->size ) {        
-       int i;       
-       (*htab)->table = Safe_realloc ((*htab)->table, 
-                                 (key*2 + 2)*sizeof(hashtItem *));
-       for ( i = (*htab)->size +1; i <= (key*2 + 1); i++ )
-           (*htab)->table[i] = NULL ;
-       (*htab)->size = key*2 + 1;
+  *htab = newHashTable ( DEFAULT_HTAB_SIZE  );
+
+    if (key > (*htab)->size ) {
+  int i;
+  (*htab)->table = Safe_realloc ((*htab)->table,
+          (key*2 + 2)*sizeof(hashtItem *));
+  for ( i = (*htab)->size +1; i <= (key*2 + 1); i++ )
+      (*htab)->table[i] = NULL ;
+  (*htab)->size = key*2 + 1;
     }
-  
+
     /* update the key */
     if ((*htab)->maxKey < key )
-       (*htab)->maxKey = key ;
+  (*htab)->maxKey = key ;
 
     if ((*htab)->minKey > key )
-       (*htab)->minKey = key ;
+  (*htab)->minKey = key ;
 
     /* create the item */
     htip = _newHashtItem(key, pkey, item);
 
     /* if there is a clash then goto end of chain */
     if ((last = (*htab)->table[key])) {
-       while (last->next)
-           last = last->next ;
-       last->next = htip ;
+  while (last->next)
+      last = last->next ;
+  last->next = htip ;
     } else
-       /* else just add it */
-       (*htab)->table[key] = htip ;
+  /* else just add it */
+  (*htab)->table[key] = htip ;
     (*htab)->nItems++ ;
 }
 
@@ -109,7 +109,7 @@ void hTabAddItemLong(hTab **htab, int key, void *pkey, void *item)
 /* hTabAddItem - adds an item to the hash table                    */
 /*-----------------------------------------------------------------*/
 void hTabAddItem (hTab **htab, int key, void *item )
-{   
+{
     hTabAddItemLong(htab, key, NULL, item);
 }
 
@@ -121,40 +121,40 @@ void hTabDeleteItem (hTab **htab, int key ,
                      int (*compareFunc)(const void *, const void *))
 {
     hashtItem *htip, **htipp ;
-    
+
     if (!(*htab))
         return ;
-    
+
     /* first check if anything exists in the slot */
     if (! (*htab)->table[key] )
         return ;
-    
+
     /* if delete chain */
     if ( action == DELETE_CHAIN )
         (*htab)->table[key] = NULL ;
     else {
-       
+
         /* delete specific item */
         /* if a compare function is given then use the compare */
         /* function to find the item, else just compare the items */
-       
+
         htipp = &((*htab)->table[key]);
         htip = (*htab)->table[key];
         for (; htip; htip = htip->next) {
-           
+
             if (compareFunc ? compareFunc(item,htip->item) :
-               (item == htip->item) ) {
+    (item == htip->item) ) {
                 *htipp=htip->next;
                 break;
             }
 
             htipp=&(htip->next);
         }
-       
+
     }
-    
+
     (*htab)->nItems-- ;
-    
+
     if (!(*htab)->nItems) {
         *htab = NULL;
     }
@@ -167,20 +167,20 @@ void hTabDeleteItem (hTab **htab, int key ,
 /*-----------------------------------------------------------------*/
 void hTabDeleteAll(hTab * p)
 {
-    if (p && p->table) { 
-       register int i;
-       register hashtItem *jc,*jn;
-       for (i=0;i<p->size;i++) {
-           
-           if (!(jc = p->table[i])) continue;
-           jn = jc->next; 
-           while(jc){ 
-               free(jc);
-               if((jc=jn)) jn = jc->next;
-           } 
-           p->table[i] = NULL ;
-       }     
-       free(p->table);
+    if (p && p->table) {
+  register int i;
+  register hashtItem *jc,*jn;
+  for (i=0;i<p->size;i++) {
+
+      if (!(jc = p->table[i])) continue;
+      jn = jc->next;
+      while(jc){
+    free(jc);
+    if((jc=jn)) jn = jc->next;
+      }
+      p->table[i] = NULL ;
+  }
+  free(p->table);
     }
 }
 
@@ -191,11 +191,11 @@ void hTabClearAll (hTab *htab)
 {
 
     if (!htab || !htab->table) {
-       printf("null table\n");
-       return ;
+  printf("null table\n");
+  return ;
     }
-    memset(htab->table, 0, htab->size*sizeof(hashtItem *)); 
-   
+    memset(htab->table, 0, htab->size*sizeof(hashtItem *));
+
     htab->minKey = htab->size;
     htab->currKey = htab->nItems = htab->maxKey = 0;
 }
@@ -205,12 +205,12 @@ static const hashtItem *_findItem(hTab *htab, int key, void *item, int (*compare
     hashtItem *htip;
 
     for (htip = htab->table[key] ; htip ; htip = htip->next ) {
-       /* if a compare function is given use it */
-       if (compareFunc && compareFunc(item,htip->item))
-           break;
-       else
-           if (item == htip->item)
-               break;
+  /* if a compare function is given use it */
+  if (compareFunc && compareFunc(item,htip->item))
+      break;
+  else
+      if (item == htip->item)
+    break;
     }
     return htip;
 }
@@ -222,18 +222,18 @@ static const hashtItem *_findByKey(hTab *htab, int key, const void *pkey, int (*
     assert(compare);
 
     if (!htab)
-       return NULL;
-    
+  return NULL;
+
     for (htip = htab->table[key] ; htip ; htip = htip->next) {
-       /* if a compare function is given use it */
-       if (compare && compare(pkey, htip->pkey)) {
-           break;
-       }
-       else {
-           if (pkey == htip->pkey) {
-               break;
-           }
-       }
+  /* if a compare function is given use it */
+  if (compare && compare(pkey, htip->pkey)) {
+      break;
+  }
+  else {
+      if (pkey == htip->pkey) {
+    break;
+      }
+  }
     }
     return htip;
 }
@@ -243,38 +243,38 @@ void *hTabFindByKey(hTab *h, int key, const void *pkey, int (*compare)(const voi
     const hashtItem *item;
 
     if ((item = _findByKey(h, key, pkey, compare)))
-       return item->item;
+  return item->item;
     return NULL;
 }
 
 int hTabDeleteByKey(hTab **h, int key, const void *pkey, int (*compare)(const void *, const void *))
 {
     hashtItem *htip, **htipp ;
-    
+
     if (!(*h))
         return 0;
-    
+
     /* first check if anything exists in the slot */
     if (! (*h)->table[key] )
         return 0;
-    
+
     /* delete specific item */
     /* if a compare function is given then use the compare */
     /* function to find the item, else just compare the items */
-    
+
     htipp = &((*h)->table[key]);
     htip = (*h)->table[key];
     for (; htip; htip = htip->next) {
-       if (
-           (compare && compare(pkey, htip->pkey)) ||
-           pkey == htip->pkey) {
-           *htipp=htip->next;
-           break;
-       }
-       htipp=&(htip->next);
+  if (
+      (compare && compare(pkey, htip->pkey)) ||
+      pkey == htip->pkey) {
+      *htipp=htip->next;
+      break;
+  }
+  htipp=&(htip->next);
     }
     (*h)->nItems-- ;
-    
+
     if (!(*h)->nItems) {
         *h = NULL;
     }
@@ -284,11 +284,11 @@ int hTabDeleteByKey(hTab **h, int key, const void *pkey, int (*compare)(const vo
 /*-----------------------------------------------------------------*/
 /* hTabIsInTable - will determine if an Item is in the hasht       */
 /*-----------------------------------------------------------------*/
-int hTabIsInTable (hTab *htab, int key, 
-                  void *item , int (*compareFunc)(void *,void *))
+int hTabIsInTable (hTab *htab, int key,
+       void *item , int (*compareFunc)(void *,void *))
 {
     if (_findItem(htab, key, item, compareFunc))
-       return 1;
+  return 1;
     return 0;
 }
 
@@ -296,19 +296,19 @@ int hTabIsInTable (hTab *htab, int key,
 /* hTabFirstItem - returns the first Item in the hTab              */
 /*-----------------------------------------------------------------*/
 void *hTabFirstItem (hTab *htab, int *k)
-{   
+{
     int key ;
 
     if (!htab)
-       return NULL ;
+  return NULL ;
 
     for ( key = htab->minKey ; key <= htab->maxKey ; key++ ) {
-       if (htab->table[key]) {
-           htab->currItem = htab->table[key];
-           htab->currKey  = key ;
-           *k = key ;
-           return htab->table[key]->item;
-       }
+  if (htab->table[key]) {
+      htab->currItem = htab->table[key];
+      htab->currKey  = key ;
+      *k = key ;
+      return htab->table[key]->item;
+  }
     }
     return NULL ;
 }
@@ -317,25 +317,25 @@ void *hTabFirstItem (hTab *htab, int *k)
 /* hTabNextItem - returns the next item in the hTab                */
 /*-----------------------------------------------------------------*/
 void *hTabNextItem (hTab *htab, int *k)
-{  
+{
     int key ;
 
     if (!htab)
-       return NULL;
+  return NULL;
 
     /* if this chain not ended then */
     if (htab->currItem->next) {
-       *k = htab->currItem->key ;
-       return (htab->currItem = htab->currItem->next)->item ;
+  *k = htab->currItem->key ;
+  return (htab->currItem = htab->currItem->next)->item ;
     }
 
     /* find the next chain which has something */
     for ( key = htab->currKey + 1; key <= htab->maxKey ; key++ ) {
-       if (htab->table[key]) {
-           htab->currItem = htab->table[key];
-           *k = htab->currKey  = key ;
-           return htab->table[key]->item;
-       }
+  if (htab->table[key]) {
+      htab->currItem = htab->table[key];
+      *k = htab->currKey  = key ;
+      return htab->table[key]->item;
+  }
     }
 
     return NULL ;
@@ -345,13 +345,13 @@ void *hTabNextItem (hTab *htab, int *k)
 /* hTabFirstItemWK - returns the first Item in the hTab for a key  */
 /*-----------------------------------------------------------------*/
 void *hTabFirstItemWK (hTab *htab, int wk)
-{       
+{
 
     if (!htab)
-       return NULL ;
-   
+  return NULL ;
+
     if (wk < htab->minKey || wk > htab->maxKey )
-       return NULL;
+  return NULL;
 
     htab->currItem = htab->table[wk] ;
     htab->currKey  = wk ;
@@ -363,14 +363,14 @@ void *hTabFirstItemWK (hTab *htab, int wk)
 /* hTabNextItem - returns the next item in the hTab for a key      */
 /*-----------------------------------------------------------------*/
 void *hTabNextItemWK (hTab *htab )
-{  
+{
 
     if (!htab)
-       return NULL;
+  return NULL;
 
     /* if this chain not ended then */
-    if (htab->currItem->next) {        
-       return (htab->currItem = htab->currItem->next)->item ;
+    if (htab->currItem->next) {
+  return (htab->currItem = htab->currItem->next)->item ;
     }
 
     return NULL ;
@@ -386,14 +386,14 @@ hTab *hTabFromTable (hTab *htab)
     int key ;
 
     if (!htab)
-       return NULL ;
+  return NULL ;
 
     nhtab = newHashTable(htab->size);
 
     for (key = htab->minKey; key <= htab->maxKey ; key++ ) {
-       
-       for (htip = htab->table[key] ; htip ; htip = htip->next)
-           hTabAddItem (&nhtab, htip->key, htip->item);
+
+  for (htip = htab->table[key] ; htip ; htip = htip->next)
+      hTabAddItem (&nhtab, htip->key, htip->item);
     }
 
     return nhtab ;
@@ -402,27 +402,27 @@ hTab *hTabFromTable (hTab *htab)
 /*-----------------------------------------------------------------*/
 /* isHtabsEqual - returns 1 if all items in htab1 is found in htab2*/
 /*-----------------------------------------------------------------*/
-int isHtabsEqual (hTab *htab1, hTab *htab2, 
-                 int (*compareFunc)(void *,void *))
+int isHtabsEqual (hTab *htab1, hTab *htab2,
+      int (*compareFunc)(void *,void *))
 {
     void *item;
-    int key;    
+    int key;
+
     if ( htab1 == htab2 )
-       return 1;
-    
+  return 1;
+
     if (htab1 == NULL || htab2 == NULL )
-       return 0;
+  return 0;
 
     /* if they are different sizes then */
     if ( htab1->nItems != htab2->nItems)
-       return 0;
+  return 0;
 
     /* now do an item by item check */
     for ( item = hTabFirstItem (htab1,&key) ;item;
-         item = hTabNextItem (htab1,&key))
-       if (!hTabIsInTable (htab2, key, item, compareFunc))
-           return 0;
+    item = hTabNextItem (htab1,&key))
+  if (!hTabIsInTable (htab2, key, item, compareFunc))
+      return 0;
 
     return 1;
 }
@@ -434,13 +434,13 @@ int isHtabsEqual (hTab *htab1, hTab *htab2,
 hashtItem *hTabSearch (hTab *htab, int key )
 {
     if (!htab)
-       return NULL ;
+  return NULL ;
 
-    if ((key < htab->minKey)||(key>htab->maxKey))   
-       return NULL ;
+    if ((key < htab->minKey)||(key>htab->maxKey))
+  return NULL ;
 
     if (!htab->table[key])
-       return NULL ;
+  return NULL ;
 
     return htab->table[key] ;
 }
@@ -453,7 +453,7 @@ void *hTabItemWithKey (hTab *htab, int key )
     hashtItem *htip;
 
     if (!(htip = hTabSearch(htab,key)))
-       return NULL;
+  return NULL;
 
     return htip->item;
 }
@@ -464,12 +464,12 @@ void *hTabItemWithKey (hTab *htab, int key )
 void hTabAddItemIfNotP (hTab **htab, int key, void *item)
 {
     if (!*htab) {
-       hTabAddItem (htab,key,item);
-       return;
+  hTabAddItem (htab,key,item);
+  return;
     }
 
     if (hTabItemWithKey(*htab,key))
-       return ;
+  return ;
 
     hTabAddItem(htab,key,item);
 }
index 19c833bebf3b2e2b58f417420b71fa805ee1ace8..bcfe1a2c754c15cbbc7672e90282a2a1533109c2 100644 (file)
@@ -1,25 +1,25 @@
 /*-------------------------------------------------------------------------
 
-  SDCCicode.c - intermediate code generation etc.                  
+  SDCCicode.c - intermediate code generation etc.
                 Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "common.h"
@@ -76,7 +76,7 @@ iCodeTable codeTable[] = {
   { IPUSH               ,  "push",picGenericOne    , NULL },
   { IPOP                ,  "pop", picGenericOne    , NULL },
   { CALL                ,  "call",picGenericOne    , NULL },
-  { PCALL               , "pcall",picGenericOne    , NULL }, 
+  { PCALL               , "pcall",picGenericOne    , NULL },
   { FUNCTION            , "proc", picGenericOne    , NULL },
   { ENDFUNCTION         ,"eproc", picGenericOne    , NULL },
   { RETURN              ,  "ret", picGenericOne    , NULL },
@@ -90,7 +90,7 @@ iCodeTable codeTable[] = {
   { LE_OP               ,  "<=" , picGeneric       , NULL },
   { GE_OP               ,  ">=" , picGeneric       , NULL },
   { EQ_OP               ,  "==" , picGeneric       , NULL },
-  { NE_OP               ,  "!=" , picGeneric       , NULL },  
+  { NE_OP               ,  "!=" , picGeneric       , NULL },
   { AND_OP              ,  "&&" , picGeneric       , NULL },
   { OR_OP               ,  "||" , picGeneric       , NULL },
   { '^'                 ,  "^"  , picGeneric       , NULL },
@@ -121,88 +121,88 @@ int printOperand (operand *op, FILE *file)
     int pnl = 0;
 
     if (!op)
-       return 1;
+  return 1;
 
     if (!file) {
-       file = stdout;
-       pnl = 1;
+  file = stdout;
+  pnl = 1;
     }
     switch (op->type) {
-       
+
     case VALUE:
-       opetype = getSpec (operandType(op));
-       if (SPEC_NOUN(opetype) == V_FLOAT)
-           fprintf (file,"%g {", SPEC_CVAL(opetype).v_float);
-       else 
-           fprintf (file,"0x%x {",(int) floatFromVal(op->operand.valOperand));
-       printTypeChain(operandType(op),file);
-       fprintf(file,"}");
-       break;
-       
+  opetype = getSpec (operandType(op));
+  if (SPEC_NOUN(opetype) == V_FLOAT)
+      fprintf (file,"%g {", SPEC_CVAL(opetype).v_float);
+  else
+      fprintf (file,"0x%x {",(int) floatFromVal(op->operand.valOperand));
+  printTypeChain(operandType(op),file);
+  fprintf(file,"}");
+  break;
+
     case SYMBOL :
 #define REGA 1
-#ifdef REGA    
-       fprintf (file,"%s [k%d lr%d:%d so:%d]{ ia%d re%d rm%d}",/*{ar%d rm%d ru%d p%d a%d u%d i%d au%d k%d ks%d}"  ,*/
-                (OP_SYMBOL(op)->rname[0] ? OP_SYMBOL(op)->rname : OP_SYMBOL(op)->name), 
-                op->key,
-                OP_LIVEFROM(op),OP_LIVETO(op),
-                OP_SYMBOL(op)->stack,
-                op->isaddr, OP_SYMBOL(op)->isreqv,OP_SYMBOL(op)->remat
-                );
-       {
-           fprintf(file,"{"); printTypeChain(operandType(op),file); 
-           if (SPIL_LOC(op) && IS_ITEMP(op))
-               fprintf(file,"}{ sir@ %s",SPIL_LOC(op)->rname);
-           fprintf(file,"}");
-
-       }
-       
-       /* if assigned to registers */
-       if (OP_SYMBOL(op)->nRegs) {
-           if (OP_SYMBOL(op)->isspilt) {
-               if (!OP_SYMBOL(op)->remat)
-                   if (OP_SYMBOL(op)->usl.spillLoc)
-                       fprintf(file,"[%s]",(OP_SYMBOL(op)->usl.spillLoc->rname[0] ?
-                                            OP_SYMBOL(op)->usl.spillLoc->rname :
-                                            OP_SYMBOL(op)->usl.spillLoc->name));
-                   else
-                       fprintf(file,"[err]");
-               else
-                   fprintf(file,"[remat]");
-           }
-           else {
-               int i;
-               fprintf(file,"[");
-               for(i=0;i<OP_SYMBOL(op)->nRegs;i++)
-                   fprintf(file,"%s ", port->getRegName(OP_SYMBOL(op)->regs[i]));
-               fprintf(file,"]");
-           }
-       } 
+#ifdef REGA
+  fprintf (file,"%s [k%d lr%d:%d so:%d]{ ia%d re%d rm%d}",/*{ar%d rm%d ru%d p%d a%d u%d i%d au%d k%d ks%d}"  ,*/
+     (OP_SYMBOL(op)->rname[0] ? OP_SYMBOL(op)->rname : OP_SYMBOL(op)->name),
+     op->key,
+     OP_LIVEFROM(op),OP_LIVETO(op),
+     OP_SYMBOL(op)->stack,
+     op->isaddr, OP_SYMBOL(op)->isreqv,OP_SYMBOL(op)->remat
+     );
+  {
+      fprintf(file,"{"); printTypeChain(operandType(op),file);
+      if (SPIL_LOC(op) && IS_ITEMP(op))
+    fprintf(file,"}{ sir@ %s",SPIL_LOC(op)->rname);
+      fprintf(file,"}");
+
+  }
+
+  /* if assigned to registers */
+  if (OP_SYMBOL(op)->nRegs) {
+      if (OP_SYMBOL(op)->isspilt) {
+    if (!OP_SYMBOL(op)->remat)
+        if (OP_SYMBOL(op)->usl.spillLoc)
+      fprintf(file,"[%s]",(OP_SYMBOL(op)->usl.spillLoc->rname[0] ?
+               OP_SYMBOL(op)->usl.spillLoc->rname :
+               OP_SYMBOL(op)->usl.spillLoc->name));
+        else
+      fprintf(file,"[err]");
+    else
+        fprintf(file,"[remat]");
+      }
+      else {
+    int i;
+    fprintf(file,"[");
+    for(i=0;i<OP_SYMBOL(op)->nRegs;i++)
+        fprintf(file,"%s ", port->getRegName(OP_SYMBOL(op)->regs[i]));
+    fprintf(file,"]");
+      }
+  }
 #else
-       fprintf(file,"%s",(OP_SYMBOL(op)->rname[0] ?
-                          OP_SYMBOL(op)->rname : OP_SYMBOL(op)->name));
-       /* if assigned to registers */
-       if (OP_SYMBOL(op)->nRegs && !OP_SYMBOL(op)->isspilt) {
-           int i;
-           fprintf(file,"[");
-           for(i=0;i<OP_SYMBOL(op)->nRegs;i++)
-               fprintf(file,"%s ",(OP_SYMBOL(op)->regs[i] ? 
-                                   OP_SYMBOL(op)->regs[i]->name :
-                                   "err"));
-           fprintf(file,"]");
-       } 
+  fprintf(file,"%s",(OP_SYMBOL(op)->rname[0] ?
+         OP_SYMBOL(op)->rname : OP_SYMBOL(op)->name));
+  /* if assigned to registers */
+  if (OP_SYMBOL(op)->nRegs && !OP_SYMBOL(op)->isspilt) {
+      int i;
+      fprintf(file,"[");
+      for(i=0;i<OP_SYMBOL(op)->nRegs;i++)
+    fprintf(file,"%s ",(OP_SYMBOL(op)->regs[i] ?
+            OP_SYMBOL(op)->regs[i]->name :
+            "err"));
+      fprintf(file,"]");
+  }
 #endif
-       break ;
-       
+  break ;
+
     case TYPE:
-       fprintf(file,"(");
-       printTypeChain(op->operand.typeOperand,file);
-       fprintf(file,")");
-       break;
+  fprintf(file,"(");
+  printTypeChain(op->operand.typeOperand,file);
+  fprintf(file,")");
+  break;
     }
-    
+
     if (pnl)
-       fprintf(file,"\n");
+  fprintf(file,"\n");
     return 0;
 }
 
@@ -218,7 +218,7 @@ PRINTFUNC(picGetValueAtAddr)
     fprintf (of,"@[");
     printOperand (IC_LEFT(ic), of);
     fprintf (of,"]");
-    
+
     fprintf(of,"\n");
 }
 
@@ -237,21 +237,21 @@ PRINTFUNC(picAddrOf)
     fprintf(of,"\t");
     printOperand(IC_RESULT(ic),of);
     if (IS_ITEMP(IC_LEFT(ic)))
-       fprintf(of," = ");
+  fprintf(of," = ");
     else
-       fprintf(of," = &[");
+  fprintf(of," = &[");
     printOperand(IC_LEFT(ic),of);
     if (IC_RIGHT(ic)) {
-       if (IS_ITEMP(IC_LEFT(ic)))
-           fprintf(of," offsetAdd ");
-       else
-           fprintf(of," , ");
-       printOperand(IC_RIGHT(ic),of);
+  if (IS_ITEMP(IC_LEFT(ic)))
+      fprintf(of," offsetAdd ");
+  else
+      fprintf(of," , ");
+  printOperand(IC_RIGHT(ic),of);
     }
     if (IS_ITEMP(IC_LEFT(ic)))
-       fprintf (of,"\n");
+  fprintf (of,"\n");
     else
-       fprintf (of,"]\n");
+  fprintf (of,"]\n");
 }
 
 PRINTFUNC(picJumpTable)
@@ -263,8 +263,8 @@ PRINTFUNC(picJumpTable)
     printOperand(IC_JTCOND(ic),of);
     fprintf(of,"\n");
     for ( sym = setFirstItem(IC_JTLABELS(ic)); sym;
-         sym = setNextItem(IC_JTLABELS(ic))) 
-       fprintf(of,"\t\t\t%s\n",sym->name);
+    sym = setNextItem(IC_JTLABELS(ic)))
+  fprintf(of,"\t\t\t%s\n",sym->name);
 }
 
 PRINTFUNC(picGeneric)
@@ -282,18 +282,18 @@ PRINTFUNC(picGenericOne)
 {
     fprintf(of,"\t");
     if ( IC_RESULT(ic) ) {
-       printOperand(IC_RESULT(ic),of);
-       fprintf (of," = ");
+  printOperand(IC_RESULT(ic),of);
+  fprintf (of," = ");
     }
-    
+
     if (IC_LEFT(ic)) {
-       fprintf (of,"%s ",s);
-       printOperand(IC_LEFT(ic),of);     
+  fprintf (of,"%s ",s);
+  printOperand(IC_LEFT(ic),of);
     }
-    
+
     if (! IC_RESULT(ic) && !IC_LEFT(ic))
-       fprintf (of,s);
-    
+  fprintf (of,s);
+
     fprintf(of,"\n");
 }
 
@@ -311,18 +311,18 @@ PRINTFUNC(picCast)
 PRINTFUNC(picAssign)
 {
     fprintf(of,"\t");
-    
+
     if (IC_RESULT(ic)->isaddr && IS_ITEMP(IC_RESULT(ic)))
-       fprintf(of,"*(");
-    
-    printOperand(IC_RESULT(ic),of);  
-    
+  fprintf(of,"*(");
+
+    printOperand(IC_RESULT(ic),of);
+
     if (IC_RESULT(ic)->isaddr && IS_ITEMP(IC_RESULT(ic)))
-       fprintf(of,")");
-    
+  fprintf(of,")");
+
     fprintf(of," %s ", s);
     printOperand (IC_RIGHT(ic),of);
-    
+
     fprintf(of,"\n");
 }
 
@@ -338,17 +338,17 @@ PRINTFUNC(picGoto)
 }
 
 PRINTFUNC(picIfx)
-{    
+{
     fprintf(of,"\t");
     fprintf (of,"if ");
     printOperand(IC_COND(ic),of);
-    
-    if ( ! IC_TRUE(ic) ) 
-       fprintf (of," == 0 goto %s($%d)\n",IC_FALSE(ic)->name,IC_FALSE(ic)->key);
+
+    if ( ! IC_TRUE(ic) )
+  fprintf (of," == 0 goto %s($%d)\n",IC_FALSE(ic)->name,IC_FALSE(ic)->key);
     else {
-       fprintf (of," != 0 goto %s($%d)\n",IC_TRUE(ic)->name,IC_TRUE(ic)->key);
-       if (IC_FALSE(ic))
-           fprintf (of,"\tzzgoto %s\n",IC_FALSE(ic)->name);
+  fprintf (of," != 0 goto %s($%d)\n",IC_TRUE(ic)->name,IC_TRUE(ic)->key);
+  if (IC_FALSE(ic))
+      fprintf (of,"\tzzgoto %s\n",IC_FALSE(ic)->name);
     }
 }
 
@@ -372,14 +372,14 @@ int piCode (void *item, FILE *of)
 {
     iCode *ic = item;
     iCodeTable *icTab ;
-    
+
     if (!of)
-       of = stdout;
+  of = stdout;
 
     icTab = getTableEntry(ic->op) ;
     fprintf(stdout,"%s(%d:%d:%d:%d:%d)\t",
-                   ic->filename,ic->lineno,
-                   ic->seq,ic->key,ic->depth,ic->supportRtn);
+        ic->filename,ic->lineno,
+        ic->seq,ic->key,ic->depth,ic->supportRtn);
     icTab->iCodePrint(of,ic,icTab->printName);
     return 1;
 }
@@ -393,15 +393,15 @@ void printiCChain (iCode *icChain, FILE *of)
     iCodeTable *icTab ;
 
     if (!of)
-       of = stdout;
+  of = stdout;
     for ( loop = icChain ; loop ; loop = loop->next ) {
-       if ((icTab = getTableEntry (loop->op ))) {
-           fprintf(of,"%s(%d:%d:%d:%d:%d)\t",
-                   loop->filename,loop->lineno,
-                   loop->seq,loop->key,loop->depth,loop->supportRtn);
+  if ((icTab = getTableEntry (loop->op ))) {
+      fprintf(of,"%s(%d:%d:%d:%d:%d)\t",
+        loop->filename,loop->lineno,
+        loop->seq,loop->key,loop->depth,loop->supportRtn);
 
-           icTab->iCodePrint (of,loop,icTab->printName);
-       }
+      icTab->iCodePrint (of,loop,icTab->printName);
+  }
     }
 }
 
@@ -412,9 +412,9 @@ void printiCChain (iCode *icChain, FILE *of)
 operand *newOperand ()
 {
     operand *op ;
-    
-    op = Safe_calloc(sizeof(operand));
-    
+
+    op = Safe_calloc(1,sizeof(operand));
+
     op->key = 0 ;
     return op;
 }
@@ -425,9 +425,9 @@ operand *newOperand ()
 iCode *newiCode (int op, operand *left, operand *right)
 {
     iCode *ic ;
-    
-    ic = Safe_calloc(sizeof(iCode));
-   
+
+    ic = Safe_calloc(1,sizeof(iCode));
+
     ic->lineno = lineno ;
     ic->filename= filename ;
     ic->block = block;
@@ -438,17 +438,17 @@ iCode *newiCode (int op, operand *left, operand *right)
     IC_RIGHT(ic)= right;
 
     return ic;
-}      
+}
 
 /*-----------------------------------------------------------------*/
 /* newiCode for conditional statements                             */
 /*-----------------------------------------------------------------*/
 iCode *newiCodeCondition (operand *condition,
-                         symbol  *trueLabel, 
-                         symbol  *falseLabel )
+        symbol  *trueLabel,
+        symbol  *falseLabel )
 {
     iCode *ic ;
-    
+
     ic = newiCode(IFX,NULL,NULL);
     IC_COND(ic) = condition ;
     IC_TRUE(ic) = trueLabel ;
@@ -462,7 +462,7 @@ iCode *newiCodeCondition (operand *condition,
 iCode *newiCodeLabelGoto (int op, symbol *label)
 {
     iCode *ic ;
-    
+
     ic = newiCode(op,NULL,NULL);
     ic->op = op ;
     ic->argLabel.label = label ;
@@ -476,17 +476,17 @@ iCode *newiCodeLabelGoto (int op, symbol *label)
 /* newiTemp - allocate & return a newItemp Variable                */
 /*-----------------------------------------------------------------*/
 symbol *newiTemp (char *s)
-{ 
+{
     symbol *itmp;
-    
-    if (s) 
-       sprintf(buffer,"%s",s);
+
+    if (s)
+  sprintf(buffer,"%s",s);
     else
-       sprintf (buffer,"iTemp%d",iTempNum++);  
+  sprintf (buffer,"iTemp%d",iTempNum++);
     itmp =  newSymbol (buffer,1);
     strcpy(itmp->rname,itmp->name);
     itmp->isitmp = 1;
-    
+
     return itmp;
 }
 
@@ -499,20 +499,20 @@ symbol *newiTempLabel (char *s)
 
     /* check if this alredy exists */
     if (s && (itmplbl = findSym(LabelTab, NULL, s)))
-       return itmplbl ;
+  return itmplbl ;
 
-    if (s) 
-       itmplbl = newSymbol(s,1);
+    if (s)
+  itmplbl = newSymbol(s,1);
     else {
-       sprintf(buffer,"iTempLbl%d",iTempLblNum++);
-       itmplbl = newSymbol(buffer,1);  
+  sprintf(buffer,"iTempLbl%d",iTempLblNum++);
+  itmplbl = newSymbol(buffer,1);
     }
-    
+
     itmplbl->isitmp = 1;
     itmplbl->islbl = 1;
     itmplbl->key = labelKey++ ;
     addSym (LabelTab, itmplbl, itmplbl->name,0,0);
-    return itmplbl ;  
+    return itmplbl ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -523,13 +523,13 @@ symbol *newiTempPreheaderLabel()
     symbol *itmplbl ;
 
     sprintf(buffer,"preHeaderLbl%d",iTempLblNum++);
-    itmplbl = newSymbol(buffer,1);    
-    
+    itmplbl = newSymbol(buffer,1);
+
     itmplbl->isitmp = 1;
     itmplbl->islbl = 1;
     itmplbl->key = labelKey++ ;
     addSym (LabelTab, itmplbl, itmplbl->name,0,0);
-    return itmplbl ;  
+    return itmplbl ;
 }
 
 
@@ -556,31 +556,31 @@ iCode *copyiCode (iCode *ic)
     /* deal with the special cases first */
     switch (ic->op) {
     case IFX:
-       IC_COND(nic) = operandFromOperand(IC_COND(ic));
-       IC_TRUE(nic) = IC_TRUE(ic);
-       IC_FALSE(nic)= IC_FALSE(ic);
-       break;
+  IC_COND(nic) = operandFromOperand(IC_COND(ic));
+  IC_TRUE(nic) = IC_TRUE(ic);
+  IC_FALSE(nic)= IC_FALSE(ic);
+  break;
 
     case JUMPTABLE:
-       IC_JTCOND(nic) = operandFromOperand(IC_JTCOND(ic));
-       IC_JTLABELS(nic) = IC_JTLABELS(ic);
-       break;
+  IC_JTCOND(nic) = operandFromOperand(IC_JTCOND(ic));
+  IC_JTLABELS(nic) = IC_JTLABELS(ic);
+  break;
 
     case CALL:
     case PCALL:
-       IC_RESULT(nic) = operandFromOperand(IC_RESULT(ic));
-       IC_LEFT(nic)   = operandFromOperand(IC_LEFT(ic));
-       IC_ARGS(nic)   = IC_ARGS(ic);
-       break;
+  IC_RESULT(nic) = operandFromOperand(IC_RESULT(ic));
+  IC_LEFT(nic)   = operandFromOperand(IC_LEFT(ic));
+  IC_ARGS(nic)   = IC_ARGS(ic);
+  break;
 
     case INLINEASM:
-       IC_INLINE(nic) = IC_INLINE(ic);
-       break;
-       
+  IC_INLINE(nic) = IC_INLINE(ic);
+  break;
+
     default:
-       IC_RESULT(nic) = operandFromOperand(IC_RESULT(ic));
-       IC_LEFT(nic) = operandFromOperand(IC_LEFT(ic));
-       IC_RIGHT(nic)= operandFromOperand(IC_RIGHT(ic));
+  IC_RESULT(nic) = operandFromOperand(IC_RESULT(ic));
+  IC_LEFT(nic) = operandFromOperand(IC_LEFT(ic));
+  IC_RIGHT(nic)= operandFromOperand(IC_RIGHT(ic));
     }
 
     return nic;
@@ -592,11 +592,11 @@ iCode *copyiCode (iCode *ic)
 iCodeTable *getTableEntry (int oper )
 {
     int i ;
-    
-    for ( i = 0 ; i < (sizeof(codeTable)/sizeof(iCodeTable)); i++ ) 
-       if (oper == codeTable[i].icode)
-           return &codeTable[i] ;
-    
+
+    for ( i = 0 ; i < (sizeof(codeTable)/sizeof(iCodeTable)); i++ )
+  if (oper == codeTable[i].icode)
+      return &codeTable[i] ;
+
     return NULL ;
 }
 
@@ -615,17 +615,17 @@ operand *newiTempOperand (sym_link *type, char throwType)
     etype = getSpec(type);
 
     if (IS_LITERAL(etype) )
-       throwType = 0 ;
+  throwType = 0 ;
 
     /* copy the type information */
-    if (type) 
-       itmp->etype = getSpec (itmp->type = (throwType ? type :
-                                            copyLinkChain(type)));
+    if (type)
+  itmp->etype = getSpec (itmp->type = (throwType ? type :
+               copyLinkChain(type)));
     if (IS_LITERAL(itmp->etype)) {
-       SPEC_SCLS(itmp->etype) = S_REGISTER ;
-       SPEC_OCLS(itmp->etype) = reg;
+  SPEC_SCLS(itmp->etype) = S_REGISTER ;
+  SPEC_OCLS(itmp->etype) = reg;
     }
-       
+
     op->operand.symOperand = itmp;
     op->key = itmp->key = ++operandKey ;
     return op;
@@ -634,25 +634,25 @@ operand *newiTempOperand (sym_link *type, char throwType)
 /*-----------------------------------------------------------------*/
 /* operandType - returns the type chain for an operand             */
 /*-----------------------------------------------------------------*/
-sym_link *operandType (operand *op) 
+sym_link *operandType (operand *op)
 {
     /* depending on type of operand */
     switch (op->type) {
-       
+
     case VALUE :
-       return op->operand.valOperand->type ;
-       
+  return op->operand.valOperand->type ;
+
     case SYMBOL:
-       return op->operand.symOperand->type ;
-       
+  return op->operand.symOperand->type ;
+
     case TYPE :
-       return op->operand.typeOperand ;
+  return op->operand.typeOperand ;
     default:
-       werror (E_INTERNAL_ERROR,__FILE__,__LINE__,
-               " operand type not known ");
-       assert (0) ; /* should never come here */
-       /*  Just to keep the compiler happy */
-       return (sym_link *)0;
+  werror (E_INTERNAL_ERROR,__FILE__,__LINE__,
+    " operand type not known ");
+  assert (0) ; /* should never come here */
+  /*  Just to keep the compiler happy */
+  return (sym_link *)0;
     }
 }
 
@@ -664,10 +664,10 @@ int isParameterToCall (value *args, operand *op)
     value *tval = args ;
 
     while (tval) {
-       if (tval->sym && 
-           isSymbolEqual(op->operand.symOperand,tval->sym))
-           return 1;
-       tval = tval->next ;
+  if (tval->sym &&
+      isSymbolEqual(op->operand.symOperand,tval->sym))
+      return 1;
+  tval = tval->next ;
     }
     return 0;
 }
@@ -678,18 +678,18 @@ int isParameterToCall (value *args, operand *op)
 int isOperandGlobal ( operand *op )
 {
     if (!op)
-       return 0;
+  return 0;
 
     if (IS_ITEMP(op))
-       return 0;
-
-    if (op->type == SYMBOL &&       
-        (op->operand.symOperand->level == 0 ||  
-        IS_STATIC(op->operand.symOperand->etype) ||
-        IS_EXTERN(op->operand.symOperand->etype))
-         )
-       return 1;
-    
+  return 0;
+
+    if (op->type == SYMBOL &&
+   (op->operand.symOperand->level == 0 ||
+   IS_STATIC(op->operand.symOperand->etype) ||
+   IS_EXTERN(op->operand.symOperand->etype))
+    )
+  return 1;
+
     return 0;
 }
 
@@ -702,15 +702,15 @@ int isOperandVolatile ( operand *op , bool chkTemp)
     sym_link *opetype ;
 
     if (IS_ITEMP(op) && !chkTemp)
-       return 0;
+  return 0;
 
     opetype = getSpec(optype = operandType(op));
-    
+
     if (IS_PTR(optype) && DCL_PTR_VOLATILE(optype))
-       return 1;
+  return 1;
 
     if (IS_VOLATILE(opetype))
-       return 1;
+  return 1;
     return 0;
 }
 
@@ -720,14 +720,14 @@ int isOperandVolatile ( operand *op , bool chkTemp)
 int isOperandLiteral ( operand *op )
 {
     sym_link *opetype ;
-    
+
     if (!op)
-       return 0;
-    
+  return 0;
+
     opetype = getSpec (operandType(op));
 
     if (IS_LITERAL(opetype))
-       return 1;
+  return 1;
 
     return 0;
 }
@@ -739,20 +739,20 @@ bool isOperandInFarSpace (operand *op)
     sym_link *etype;
 
     if (!op)
-       return FALSE;
+  return FALSE;
 
     if (!IS_SYMOP(op))
-       return FALSE ;
+  return FALSE ;
 
     if (!IS_TRUE_SYMOP(op)) {
-       if (SPIL_LOC(op))
-           etype = SPIL_LOC(op)->etype;
-       else            
-           return FALSE;
+  if (SPIL_LOC(op))
+      etype = SPIL_LOC(op)->etype;
+  else
+      return FALSE;
     }
     else
     {
-       etype = getSpec(operandType(op));
+      etype = getSpec(operandType(op));
     }
     return (IN_FARSPACE(SPEC_OCLS(etype)) ? TRUE : FALSE);
 }
@@ -765,10 +765,10 @@ bool isOperandOnStack(operand *op)
     sym_link *etype;
 
     if (!op)
-       return FALSE;
+  return FALSE;
 
     if (!IS_SYMOP(op))
-       return FALSE ;
+  return FALSE ;
 
     etype = getSpec(operandType(op));
 
@@ -781,145 +781,145 @@ bool isOperandOnStack(operand *op)
 double operandLitValue ( operand *op )
 {
     assert(isOperandLiteral(op));
-    
-    return floatFromVal(op->operand.valOperand);    
+
+    return floatFromVal(op->operand.valOperand);
 }
 
 /*-----------------------------------------------------------------*/
 /* operandOperation - perforoms operations on operands             */
 /*-----------------------------------------------------------------*/
 operand *operandOperation (operand *left,operand *right,
-                          int op, sym_link *type)
+         int op, sym_link *type)
 {
     operand *retval = (operand *)0;
-        
+
     assert(isOperandLiteral(left));
-    if (right) 
-       assert(isOperandLiteral(right));
-    
+    if (right)
+  assert(isOperandLiteral(right));
+
     switch (op) {
     case '+' :
-       retval =  operandFromValue (valCastLiteral(type,
-                                                  operandLitValue(left) + 
-                                                  operandLitValue(right)));
-       break ;
+  retval =  operandFromValue (valCastLiteral(type,
+               operandLitValue(left) +
+               operandLitValue(right)));
+  break ;
     case '-' :
-       retval = operandFromValue(valCastLiteral(type,
-                                                operandLitValue(left) -
-                                                operandLitValue(right)));
-       break;
+  retval = operandFromValue(valCastLiteral(type,
+             operandLitValue(left) -
+             operandLitValue(right)));
+  break;
     case '*':
-       retval = operandFromValue(valCastLiteral(type,
-                                                operandLitValue(left) *
-                                                operandLitValue(right)));
-       break;
+  retval = operandFromValue(valCastLiteral(type,
+             operandLitValue(left) *
+             operandLitValue(right)));
+  break;
     case '/':
-       if ((unsigned long) operandLitValue(right) == 0){           
-           werror(E_DIVIDE_BY_ZERO);
-           retval = right;
-           
-       }
-       else
-           retval = operandFromValue (valCastLiteral(type,
-                                                     operandLitValue(left) /
-                                                     operandLitValue(right)));
-       break;
-    case '%':      
-       if ((unsigned long) operandLitValue(right) == 0){           
-           werror(E_DIVIDE_BY_ZERO);
-           retval = right;         
-       }
-       else
-           retval = operandFromLit ((unsigned long) operandLitValue(left) %
-                                    (unsigned long) operandLitValue(right));
-       break;
+  if ((unsigned long) operandLitValue(right) == 0){
+      werror(E_DIVIDE_BY_ZERO);
+      retval = right;
+
+  }
+  else
+      retval = operandFromValue (valCastLiteral(type,
+                  operandLitValue(left) /
+                  operandLitValue(right)));
+  break;
+    case '%':
+  if ((unsigned long) operandLitValue(right) == 0){
+      werror(E_DIVIDE_BY_ZERO);
+      retval = right;
+  }
+  else
+      retval = operandFromLit ((unsigned long) operandLitValue(left) %
+             (unsigned long) operandLitValue(right));
+  break;
     case LEFT_OP :
-       retval = operandFromLit ((unsigned long) operandLitValue(left) <<
-                                (unsigned long) operandLitValue(right));
-       break;
+  retval = operandFromLit ((unsigned long) operandLitValue(left) <<
+         (unsigned long) operandLitValue(right));
+  break;
     case RIGHT_OP :
-       retval = operandFromLit ((unsigned long) operandLitValue(left) >>
-                                (unsigned long) operandLitValue(right));
-       break;
+  retval = operandFromLit ((unsigned long) operandLitValue(left) >>
+         (unsigned long) operandLitValue(right));
+  break;
     case EQ_OP :
-       retval = operandFromLit (operandLitValue(left) ==
-                                operandLitValue(right));
-       break;
+  retval = operandFromLit (operandLitValue(left) ==
+         operandLitValue(right));
+  break;
     case '<' :
-       retval = operandFromLit (operandLitValue(left) <
-                                operandLitValue(right));
-       break;
+  retval = operandFromLit (operandLitValue(left) <
+         operandLitValue(right));
+  break;
     case LE_OP :
-       retval = operandFromLit (operandLitValue(left) <=
-                                operandLitValue(right));
-       break;
+  retval = operandFromLit (operandLitValue(left) <=
+         operandLitValue(right));
+  break;
     case NE_OP :
-       retval = operandFromLit (operandLitValue(left) !=
-                                operandLitValue(right));
-       break;
+  retval = operandFromLit (operandLitValue(left) !=
+         operandLitValue(right));
+  break;
     case '>' :
-       retval = operandFromLit (operandLitValue(left) >
-                                operandLitValue(right));
-       break;
+  retval = operandFromLit (operandLitValue(left) >
+         operandLitValue(right));
+  break;
     case GE_OP :
-       retval = operandFromLit (operandLitValue(left) >=
-                                operandLitValue(right));
-       break;
+  retval = operandFromLit (operandLitValue(left) >=
+         operandLitValue(right));
+  break;
     case BITWISEAND :
-       retval = operandFromLit ((unsigned long) operandLitValue(left) &
-                                (unsigned long) operandLitValue(right));
-       break;
+  retval = operandFromLit ((unsigned long) operandLitValue(left) &
+         (unsigned long) operandLitValue(right));
+  break;
     case '|' :
-       retval = operandFromLit ((unsigned long) operandLitValue(left) |
-                                (unsigned long) operandLitValue(right));       
-       break;
+  retval = operandFromLit ((unsigned long) operandLitValue(left) |
+         (unsigned long) operandLitValue(right));
+  break;
     case '^' :
-       retval = operandFromLit ((unsigned long) operandLitValue(left) ^
-                                (unsigned long) operandLitValue(right));
-       break;
+  retval = operandFromLit ((unsigned long) operandLitValue(left) ^
+         (unsigned long) operandLitValue(right));
+  break;
     case AND_OP:
-       retval = operandFromLit (operandLitValue(left) &&
-                                operandLitValue(right));
-       break;
+  retval = operandFromLit (operandLitValue(left) &&
+         operandLitValue(right));
+  break;
     case OR_OP:
-       retval = operandFromLit (operandLitValue(left) ||
-                                operandLitValue(right));
-       break;
+  retval = operandFromLit (operandLitValue(left) ||
+         operandLitValue(right));
+  break;
     case RRC:
-       {
-           long i = operandLitValue(left);
-           
-           retval = operandFromLit ((i >> (getSize(operandType(left))*8 - 1)) |
-                                    (i << 1));
-       }
-       break;
+  {
+      long i = operandLitValue(left);
+
+      retval = operandFromLit ((i >> (getSize(operandType(left))*8 - 1)) |
+             (i << 1));
+  }
+  break;
     case RLC:
-       {
-           long i = operandLitValue(left);
-           
-           retval = operandFromLit ((i << (getSize(operandType(left))*8 - 1)) |
-                                    (i >> 1));
-       }
-       break;
-       
+  {
+      long i = operandLitValue(left);
+
+      retval = operandFromLit ((i << (getSize(operandType(left))*8 - 1)) |
+             (i >> 1));
+  }
+  break;
+
     case UNARYMINUS:
-       retval = operandFromLit(-1 * operandLitValue(left));
-       break;
-       
+  retval = operandFromLit(-1 * operandLitValue(left));
+  break;
+
     case '~':
-       retval = operandFromLit(~ ((long) operandLitValue(left)));
-       break;
+  retval = operandFromLit(~ ((long) operandLitValue(left)));
+  break;
 
     case '!':
-       retval = operandFromLit(! operandLitValue(left));
-       break;
+  retval = operandFromLit(! operandLitValue(left));
+  break;
 
     default :
-       werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-              " operandOperation invalid operator ");
-       assert (0);
+  werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+         " operandOperation invalid operator ");
+  assert (0);
     }
-    
+
     return retval;
 }
 
@@ -931,30 +931,30 @@ int isOperandEqual (operand *left, operand *right)
 {
     /* if the pointers are equal then they are equal */
     if ( left == right )
-       return 1;
-    
+  return 1;
+
     /* if either of them null then false */
     if ( !left || !right)
-       return 0;
+  return 0;
 
     if (left->type != right->type)
-       return 0;
+  return 0;
 
     if (IS_SYMOP(left) && IS_SYMOP(right))
-       return left->key == right->key ;
+  return left->key == right->key ;
 
     /* if types are the same */
     switch (left->type) {
     case SYMBOL :
-       return isSymbolEqual(left->operand.symOperand,
-                            right->operand.symOperand);
+  return isSymbolEqual(left->operand.symOperand,
+           right->operand.symOperand);
     case VALUE :
-       return (floatFromVal(left->operand.valOperand) ==
-               floatFromVal(right->operand.valOperand));
+  return (floatFromVal(left->operand.valOperand) ==
+    floatFromVal(right->operand.valOperand));
     case TYPE :
-       if (checkType(left->operand.typeOperand,
-                     right->operand.typeOperand) == 1)
-           return 1;      
+  if (checkType(left->operand.typeOperand,
+          right->operand.typeOperand) == 1)
+      return 1;
     }
 
     return 0;
@@ -967,31 +967,31 @@ int isiCodeEqual (iCode *left, iCode *right)
 {
     /* if the same pointer */
     if (left == right)
-       return 1;
-    
+  return 1;
+
     /* if either of them null */
     if (!left || !right)
-       return 0;
+  return 0;
 
     /* if operand are the same */
     if ( left->op == right->op ) {
-       
-       /* compare all the elements depending on type */
-       if (left->op != IFX ) {
-           if (!isOperandEqual(IC_LEFT(left),IC_LEFT(right)))
-               return 0;
-           if (!isOperandEqual(IC_RIGHT(left),IC_RIGHT(right)))
-               return 0;
-
-       } else {
-           if (!isOperandEqual(IC_COND(left),IC_COND(right)))
-               return 0;
-           if (!isSymbolEqual (IC_TRUE(left),IC_TRUE(right)))
-               return 0;
-           if (!isSymbolEqual(IC_FALSE(left),IC_FALSE(right)))
-               return 0;
-       }
-       return 1;
+
+  /* compare all the elements depending on type */
+  if (left->op != IFX ) {
+      if (!isOperandEqual(IC_LEFT(left),IC_LEFT(right)))
+    return 0;
+      if (!isOperandEqual(IC_RIGHT(left),IC_RIGHT(right)))
+    return 0;
+
+  } else {
+      if (!isOperandEqual(IC_COND(left),IC_COND(right)))
+    return 0;
+      if (!isSymbolEqual (IC_TRUE(left),IC_TRUE(right)))
+    return 0;
+      if (!isSymbolEqual(IC_FALSE(left),IC_FALSE(right)))
+    return 0;
+  }
+  return 1;
     }
     return 0;
 }
@@ -1004,10 +1004,10 @@ operand *newiTempFromOp (operand *op)
     operand *nop;
 
     if (!op)
-       return NULL;
-    
+  return NULL;
+
     if (!IS_ITEMP(op))
-       return op;
+  return op;
 
     nop = newiTempOperand(operandType(op),TRUE);
     nop->isaddr = op->isaddr ;
@@ -1027,9 +1027,9 @@ operand *newiTempFromOp (operand *op)
 operand *operandFromOperand (operand *op)
 {
     operand *nop ;
-    
+
     if (!op)
-       return NULL;
+  return NULL;
     nop = newOperand();
     nop->type = op->type;
     nop->isaddr = op->isaddr ;
@@ -1044,15 +1044,15 @@ operand *operandFromOperand (operand *op)
 
     switch (nop->type) {
     case SYMBOL :
-       nop->operand.symOperand = op->operand.symOperand ;      
-       break;
+  nop->operand.symOperand = op->operand.symOperand ;
+  break;
     case VALUE :
-       nop->operand.valOperand = op->operand.valOperand;
-       break;
+  nop->operand.valOperand = op->operand.valOperand;
+  break;
     case TYPE :
-       nop->operand.typeOperand = op->operand.typeOperand ;
-       break ;
-    }   
+  nop->operand.typeOperand = op->operand.typeOperand ;
+  break ;
+    }
 
     return nop;
 }
@@ -1065,8 +1065,8 @@ operand *opFromOpWithDU (operand *op, bitVect *defs, bitVect *uses)
     operand *nop = operandFromOperand(op);
 
     if (nop->type == SYMBOL) {
-       OP_SYMBOL(nop)->defs = bitVectCopy(defs);
-       OP_SYMBOL(nop)->uses = bitVectCopy(uses);
+  OP_SYMBOL(nop)->defs = bitVectCopy(defs);
+  OP_SYMBOL(nop)->uses = bitVectCopy(uses);
     }
 
     return nop;
@@ -1082,75 +1082,75 @@ operand *operandFromSymbol (symbol *sym)
     int ok =1 ;
     /* if the symbol's type is a literal */
     /* then it is an enumerator type     */
-    if (IS_LITERAL(sym->etype) && SPEC_ENUM(sym->etype)) 
-       return operandFromValue (valFromType(sym->etype));
+    if (IS_LITERAL(sym->etype) && SPEC_ENUM(sym->etype))
+  return operandFromValue (valFromType(sym->etype));
 
     if (!sym->key)
-       sym->key = ++operandKey ;
+  sym->key = ++operandKey ;
 
     /* if this an implicit variable, means struct/union */
     /* member so just return it                         */
     if (sym->implicit || IS_FUNC(sym->type)) {
-       op = newOperand();
-       op->type = SYMBOL ;
-       op->operand.symOperand = sym;
-       op->key = sym->key ;
-       op->isvolatile = isOperandVolatile(op,TRUE);
-       op->isGlobal   = isOperandGlobal(op);
-       op->parmBytes  = sym->argStack;
-       return op;
-    }
-    
+  op = newOperand();
+  op->type = SYMBOL ;
+  op->operand.symOperand = sym;
+  op->key = sym->key ;
+  op->isvolatile = isOperandVolatile(op,TRUE);
+  op->isGlobal   = isOperandGlobal(op);
+  op->parmBytes  = sym->argStack;
+  return op;
+    }
+
     /* under the following conditions create a
        register equivalent for a local symbol */
     if (sym->level && sym->etype && SPEC_OCLS(sym->etype) &&
-       (IN_FARSPACE(SPEC_OCLS(sym->etype)) && (!IS_DS390_PORT)) &&
-       options.stackAuto == 0)
-       ok =0;
+  (IN_FARSPACE(SPEC_OCLS(sym->etype)) && (!IS_DS390_PORT)) &&
+  options.stackAuto == 0)
+  ok =0;
 
     if (!IS_AGGREGATE(sym->type) &&     /* not an aggregate */
-       !IS_FUNC(sym->type)      &&     /* not a function   */
-       !sym->_isparm            &&     /* not a parameter  */
-       sym->level               &&     /* is a local variable */
-       !sym->addrtaken          &&     /* whose address has not been taken */
-       !sym->reqv               &&     /* does not already have a register euivalence */
-       !IS_VOLATILE(sym->etype) &&     /* not declared as volatile */
-       !IS_STATIC(sym->etype)   &&     /* and not declared static  */
-       !sym->islbl              &&     /* not a label */
-       ok                       &&     /* farspace check */
-       !IS_BITVAR(sym->etype)          /* not a bit variable */
-       ) {
-       
-       /* we will use it after all optimizations
-          and before liveRange calculation */
-       sym->reqv = newiTempOperand(sym->type,0);       
-       sym->reqv->key = sym->key ;
-       OP_SYMBOL(sym->reqv)->key = sym->key;
-       OP_SYMBOL(sym->reqv)->isreqv = 1;
-       OP_SYMBOL(sym->reqv)->islocal = 1;
-       SPIL_LOC(sym->reqv) = sym;
-    }
-   
+  !IS_FUNC(sym->type)      &&     /* not a function   */
+  !sym->_isparm            &&     /* not a parameter  */
+  sym->level               &&     /* is a local variable */
+  !sym->addrtaken          &&     /* whose address has not been taken */
+  !sym->reqv               &&     /* does not already have a register euivalence */
+  !IS_VOLATILE(sym->etype) &&     /* not declared as volatile */
+  !IS_STATIC(sym->etype)   &&     /* and not declared static  */
+  !sym->islbl              &&     /* not a label */
+  ok                       &&     /* farspace check */
+  !IS_BITVAR(sym->etype)          /* not a bit variable */
+  ) {
+
+  /* we will use it after all optimizations
+     and before liveRange calculation */
+  sym->reqv = newiTempOperand(sym->type,0);
+  sym->reqv->key = sym->key ;
+  OP_SYMBOL(sym->reqv)->key = sym->key;
+  OP_SYMBOL(sym->reqv)->isreqv = 1;
+  OP_SYMBOL(sym->reqv)->islocal = 1;
+  SPIL_LOC(sym->reqv) = sym;
+    }
+
     if (!IS_AGGREGATE(sym->type)) {
-       op = newOperand();
-       op->type = SYMBOL;
-       op->operand.symOperand = sym;
-       op->isaddr = 1;
-       op->key = sym->key;
-       op->isvolatile = isOperandVolatile(op,TRUE);
-       op->isGlobal   = isOperandGlobal(op);
-       op->isPtr = IS_PTR(operandType(op));
-       op->isParm = sym->_isparm ;
-       return op;
-    }
-    
+  op = newOperand();
+  op->type = SYMBOL;
+  op->operand.symOperand = sym;
+  op->isaddr = 1;
+  op->key = sym->key;
+  op->isvolatile = isOperandVolatile(op,TRUE);
+  op->isGlobal   = isOperandGlobal(op);
+  op->isPtr = IS_PTR(operandType(op));
+  op->isParm = sym->_isparm ;
+  return op;
+    }
+
     /* create :-                     */
     /*    itemp = &[_symbol]         */
-    
+
     ic = newiCode(ADDRESS_OF,newOperand(),NULL);
     IC_LEFT(ic)->type = SYMBOL ;
     IC_LEFT(ic)->operand.symOperand = sym ;
-    IC_LEFT(ic)->key = sym->key;    
+    IC_LEFT(ic)->key = sym->key;
     (IC_LEFT(ic))->isvolatile = isOperandVolatile(IC_LEFT(ic),TRUE);
     (IC_LEFT(ic))->isGlobal   = isOperandGlobal(IC_LEFT(ic));
     IC_LEFT(ic)->isPtr = IS_PTR(operandType(IC_LEFT(ic)));
@@ -1158,15 +1158,15 @@ operand *operandFromSymbol (symbol *sym)
     /* create result */
     IC_RESULT(ic) = newiTempOperand(sym->type,0);
     if (IS_ARRAY(sym->type)) {
-       IC_RESULT(ic) = geniCodeArray2Ptr (IC_RESULT(ic));
-       IC_RESULT(ic)->isaddr = 0;
+  IC_RESULT(ic) = geniCodeArray2Ptr (IC_RESULT(ic));
+  IC_RESULT(ic)->isaddr = 0;
     } else
-       IC_RESULT(ic)->isaddr = (!IS_AGGREGATE(sym->type));
+  IC_RESULT(ic)->isaddr = (!IS_AGGREGATE(sym->type));
 
     IC_RESULT(ic)->operand.symOperand->args = sym->args;
 
     ADDTOCHAIN(ic);
-    
+
     return IC_RESULT(ic) ;
 }
 
@@ -1176,11 +1176,11 @@ operand *operandFromSymbol (symbol *sym)
 operand *operandFromValue (value *val)
 {
     operand *op ;
-    
+
     /* if this is a symbol then do the symbol thing */
     if (val->sym)
-       return operandFromSymbol (val->sym);
-    
+  return operandFromSymbol (val->sym);
+
     /* this is not a symbol */
     op = newOperand();
     op->type = VALUE ;
@@ -1195,11 +1195,11 @@ operand *operandFromValue (value *val)
 operand *operandFromLink (sym_link *type)
 {
     operand *op ;
-    
+
     /* operand from sym_link */
     if ( ! type )
-       return NULL ;
-    
+  return NULL ;
+
     op = newOperand();
     op->type = TYPE ;
     op->operand.typeOperand = copyLinkChain(type);
@@ -1219,24 +1219,24 @@ operand *operandFromLit ( float i)
 /*-----------------------------------------------------------------*/
 operand *operandFromAst ( ast *tree )
 {
-    
+
     if (! tree )
-       return NULL ;
-    
+  return NULL ;
+
     /* depending on type do */
-    switch (tree->type ) {     
-    case EX_OP : 
-       return ast2iCode (tree) ;    
-       break ;
-       
+    switch (tree->type ) {
+    case EX_OP :
+  return ast2iCode (tree) ;
+  break ;
+
     case EX_VALUE :
-       return operandFromValue(tree->opval.val) ;
-       break ;
-       
+  return operandFromValue(tree->opval.val) ;
+  break ;
+
     case EX_LINK :
-       return operandFromLink (tree->opval.lnk) ; 
+  return operandFromLink (tree->opval.lnk) ;
     }
-    
+
     assert(0);
     /*  Just to keep the comiler happy */
     return (operand *)0;
@@ -1249,28 +1249,28 @@ void setOperandType (operand *op, sym_link *type)
 {
     /* depending on the type of operand */
     switch (op->type) {
-       
+
     case VALUE :
-       op->operand.valOperand->etype = 
-           getSpec( op->operand.valOperand->type = 
-                    copyLinkChain (type )) ;
-       return ;
-       
+  op->operand.valOperand->etype =
+      getSpec( op->operand.valOperand->type =
+         copyLinkChain (type )) ;
+  return ;
+
     case SYMBOL :
-       if (op->operand.symOperand->isitmp )
-           op->operand.symOperand->etype = 
-               getSpec( op->operand.symOperand->type = 
-                        copyLinkChain (type )) ;
-       else
-           werror (E_INTERNAL_ERROR,__FILE__,__LINE__,
-                   "attempt to modify type of source");
-       return;
-       
+  if (op->operand.symOperand->isitmp )
+      op->operand.symOperand->etype =
+    getSpec( op->operand.symOperand->type =
+       copyLinkChain (type )) ;
+  else
+      werror (E_INTERNAL_ERROR,__FILE__,__LINE__,
+        "attempt to modify type of source");
+  return;
+
     case TYPE:
-       op->operand.typeOperand = copyLinkChain (type);
-       return ;
+  op->operand.typeOperand = copyLinkChain (type);
+  return ;
     }
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -1280,11 +1280,11 @@ operand *usualUnaryConversions(operand *op)
 {
     if (IS_INTEGRAL(operandType(op)))
     {
-        if (getSize(operandType(op)) < INTSIZE) 
+        if (getSize(operandType(op)) < INTSIZE)
         {
             /* Widen to int. */
-           return geniCodeCast(INTTYPE,op,TRUE);           
-        }    
+      return geniCodeCast(INTTYPE,op,TRUE);
+        }
     }
     return op;
 }
@@ -1296,18 +1296,18 @@ sym_link * usualBinaryConversions(operand **op1, operand **op2)
 {
     if (!options.ANSIint)
     {
-       /* "Classic" SDCC behavior. */
-       sym_link *ctype; 
-       sym_link *rtype = operandType(*op2);
-       sym_link *ltype = operandType(*op1);
-         
-       ctype = computeType(ltype,rtype);                             
-       *op1 = geniCodeCast(ctype,*op1,TRUE);
-       *op2= geniCodeCast(ctype,*op2,TRUE);
-    
-       return ctype;
-    }
-    
+      /* "Classic" SDCC behavior. */
+      sym_link *ctype;
+      sym_link *rtype = operandType(*op2);
+      sym_link *ltype = operandType(*op1);
+
+      ctype = computeType(ltype,rtype);
+      *op1 = geniCodeCast(ctype,*op1,TRUE);
+      *op2= geniCodeCast(ctype,*op2,TRUE);
+
+      return ctype;
+    }
+
     *op1 = usualUnaryConversions(*op1);
     *op2 = usualUnaryConversions(*op2);
 
@@ -1316,19 +1316,19 @@ sym_link * usualBinaryConversions(operand **op1, operand **op2)
      *
      * NB: floating point types are not yet properly handled; we
      * follow the "classic" behavior.
-     */    
-     
+     */
+
     if (IS_FLOAT(operandType(*op1)) || IS_FLOAT(operandType(*op2)))
     {
-       return newFloatLink();     
+  return newFloatLink();
     }
-     
+
     if (!IS_INTEGRAL(operandType(*op1)) || !IS_INTEGRAL(operandType(*op2)))
     {
         /* if either is not an integer type, we're done. */
         return copyLinkChain(operandType(*op1)); /* Punt! we should never get here. */
     }
-    
+
     /* If either is an unsigned long, make sure both are. */
     if (SPEC_USIGN(operandType(*op1)) && IS_LONG(operandType(*op1)))
     {
@@ -1338,7 +1338,7 @@ sym_link * usualBinaryConversions(operand **op1, operand **op2)
         }
         return copyLinkChain(operandType(*op1));
     }
-    
+
     if (SPEC_USIGN(operandType(*op2)) && IS_LONG(operandType(*op2)))
     {
         if (!SPEC_USIGN(operandType(*op1)) || !IS_LONG(operandType(*op1)))
@@ -1346,12 +1346,12 @@ sym_link * usualBinaryConversions(operand **op1, operand **op2)
              *op1 = geniCodeCast(ULONGTYPE,*op1,TRUE);
         }
         return copyLinkChain(operandType(*op2));
-    }    
-    
-    /* Next, if one is long and the other is int (signed or un), 
+    }
+
+    /* Next, if one is long and the other is int (signed or un),
      * cast both to long.
      *
-     * Note that because in our environment a long can hold all 
+     * Note that because in our environment a long can hold all
      * the values of an unsigned int, the "long/unsigned int" pair
      * in the ANSI conversion table is unnecessary; this test
      * handles that case implicitly.
@@ -1368,20 +1368,20 @@ sym_link * usualBinaryConversions(operand **op1, operand **op2)
         }
         return copyLinkChain(operandType(*op1));
     }
-    
+
     if (IS_LONG(operandType(*op2)))
     {
         /* NB: because of the unary conversions, op2 cannot
          * be smaller than int. Therefore, if it is not
          * long, it is a regular int.
-         */    
+         */
         if (!IS_LONG(operandType(*op1)))
         {
              *op1 = geniCodeCast(LONGTYPE,*op1,TRUE);
         }
         return copyLinkChain(operandType(*op2));
-    }     
-         
+    }
+
     /* All right, neither is long; they must both be integers.
      *
      * Only remaining issue is signed vs. unsigned; if one is unsigned
@@ -1395,7 +1395,7 @@ sym_link * usualBinaryConversions(operand **op1, operand **op2)
         }
         return copyLinkChain(operandType(*op1));
     }
-    
+
     if (SPEC_USIGN(operandType(*op2)))
     {
         if (!SPEC_USIGN(operandType(*op1)))
@@ -1403,8 +1403,8 @@ sym_link * usualBinaryConversions(operand **op1, operand **op2)
              *op1 = geniCodeCast(UINTTYPE,*op1,TRUE);
         }
         return copyLinkChain(operandType(*op2));
-    }         
-    
+    }
+
     /* Done! */
     return copyLinkChain(operandType(*op1));
 }
@@ -1419,118 +1419,118 @@ operand *geniCodeRValue (operand *op, bool force)
     iCode *ic ;
     sym_link *type = operandType(op);
     sym_link *etype= getSpec(type);
-    
+
     /* if this is an array & already */
     /* an address then return this   */
-    if (IS_AGGREGATE(type) || 
-       (IS_PTR(type) && !force && !op->isaddr))
-       return operandFromOperand(op);
-        
+    if (IS_AGGREGATE(type) ||
+  (IS_PTR(type) && !force && !op->isaddr))
+  return operandFromOperand(op);
+
     /* if this is not an address then must be */
     /* rvalue already so return this one      */
     if (!op->isaddr)
-       return op ;
-    
+  return op ;
+
     /* if this is not a temp symbol then */
-    if (!IS_ITEMP(op) && 
-       !force && 
-       !IN_FARSPACE(SPEC_OCLS(etype))) {
-       op = operandFromOperand(op);
-       op->isaddr = 0;
-       return op;
-    }
-    
-    if (IS_SPEC(type) && 
-       IS_TRUE_SYMOP(op) &&
-       (!IN_FARSPACE(SPEC_OCLS(etype)) || IS_DS390_PORT)) {
-       op = operandFromOperand(op);
-       op->isaddr = 0;
-       return op;
+    if (!IS_ITEMP(op) &&
+  !force &&
+  !IN_FARSPACE(SPEC_OCLS(etype))) {
+  op = operandFromOperand(op);
+  op->isaddr = 0;
+  return op;
+    }
+
+    if (IS_SPEC(type) &&
+  IS_TRUE_SYMOP(op) &&
+  (!IN_FARSPACE(SPEC_OCLS(etype)) || IS_DS390_PORT)) {
+  op = operandFromOperand(op);
+  op->isaddr = 0;
+  return op;
     }
 
     ic = newiCode(GET_VALUE_AT_ADDRESS,op,NULL);
-    if (IS_PTR(type) && op->isaddr && force) 
-       type = type->next;
-    
+    if (IS_PTR(type) && op->isaddr && force)
+  type = type->next;
+
     type = copyLinkChain(type);
 
     IC_RESULT(ic) = newiTempOperand (type,1);
     IC_RESULT(ic)->isaddr = 0;
+
 /*     ic->supportRtn = ((IS_GENPTR(type) | op->isGptr) & op->isaddr); */
 
     /* if the right is a symbol */
     if (op->type == SYMBOL)
-       IC_RESULT(ic)->operand.symOperand->args = 
-           op->operand.symOperand->args ;
+  IC_RESULT(ic)->operand.symOperand->args =
+      op->operand.symOperand->args ;
     ADDTOCHAIN(ic);
-    
+
     return IC_RESULT(ic) ;
 }
 
 /*-----------------------------------------------------------------*/
 /* geniCodeCast - changes the value from one type to another       */
 /*-----------------------------------------------------------------*/
-operand *geniCodeCast (sym_link *type, operand *op, bool implicit) 
+operand *geniCodeCast (sym_link *type, operand *op, bool implicit)
 {
     iCode *ic ;
     sym_link *optype ;
     sym_link *opetype = getSpec(optype = operandType(op));
     sym_link *restype ;
-    
+
     /* one of them has size zero then error */
     if (IS_VOID(optype)) {
-       werror(E_CAST_ZERO);
-       return op;
+  werror(E_CAST_ZERO);
+  return op;
     }
 
     /* if the operand is already the desired type then do nothing */
-    if ( checkType (type,optype) == 1) 
-       return op;
-    
+    if ( checkType (type,optype) == 1)
+  return op;
+
     /* if this is a literal then just change the type & return */
     if (IS_LITERAL(opetype) && op->type == VALUE && !IS_PTR(type) && !IS_PTR(optype))
-       return operandFromValue(valCastLiteral(type,
-                                              operandLitValue(op)));
-          
+  return operandFromValue(valCastLiteral(type,
+                 operandLitValue(op)));
+
     /* if casting to some pointer type &&
-       the destination is not a generic pointer 
+       the destination is not a generic pointer
        then give a warning : (only for implicit casts)*/
     if (IS_PTR(optype) && implicit &&
-       (DCL_TYPE(optype) != DCL_TYPE(type)) && 
-       !IS_GENPTR(type)) {
-       werror(E_INCOMPAT_CAST);
-       werror(E_CONTINUE,"from type '");
-       printTypeChain(optype,stderr);fprintf(stderr,"' to type '");      
-       printTypeChain(type,stderr);fprintf(stderr,"'\n");
+  (DCL_TYPE(optype) != DCL_TYPE(type)) &&
+  !IS_GENPTR(type)) {
+  werror(E_INCOMPAT_CAST);
+  werror(E_CONTINUE,"from type '");
+  printTypeChain(optype,stderr);fprintf(stderr,"' to type '");
+  printTypeChain(type,stderr);fprintf(stderr,"'\n");
     }
 
     /* if they are the same size create an assignment */
-    if (getSize(type) == getSize(optype) && 
-       !IS_BITFIELD(type)               &&
-       !IS_FLOAT(type)                  &&
-       !IS_FLOAT(optype)                &&
-       ((IS_SPEC(type) && IS_SPEC(optype)) ||
-        (!IS_SPEC(type) && !IS_SPEC(optype)))) {
-
-       ic = newiCode('=',NULL,op);     
-       IC_RESULT(ic) = newiTempOperand(type,0);
-        SPIL_LOC(IC_RESULT(ic))  =
-            (IS_TRUE_SYMOP(op) ? OP_SYMBOL(op) : NULL);
-       IC_RESULT(ic)->isaddr = 0;
-    } else { 
-       ic = newiCode(CAST,operandFromLink(type),
-                     geniCodeRValue(op,FALSE));
-       
-       IC_RESULT(ic)= newiTempOperand(type,0);
-    }
-    
+    if (getSize(type) == getSize(optype) &&
+  !IS_BITFIELD(type)               &&
+  !IS_FLOAT(type)                  &&
+  !IS_FLOAT(optype)                &&
+  ((IS_SPEC(type) && IS_SPEC(optype)) ||
+   (!IS_SPEC(type) && !IS_SPEC(optype)))) {
+
+  ic = newiCode('=',NULL,op);
+  IC_RESULT(ic) = newiTempOperand(type,0);
+   SPIL_LOC(IC_RESULT(ic))  =
+       (IS_TRUE_SYMOP(op) ? OP_SYMBOL(op) : NULL);
+  IC_RESULT(ic)->isaddr = 0;
+    } else {
+  ic = newiCode(CAST,operandFromLink(type),
+          geniCodeRValue(op,FALSE));
+
+  IC_RESULT(ic)= newiTempOperand(type,0);
+    }
+
     /* preserve the storage class & output class */
     /* of the original variable                  */
     restype = getSpec(operandType(IC_RESULT(ic)));
     SPEC_SCLS(restype) = SPEC_SCLS(opetype);
     SPEC_OCLS(restype) = SPEC_OCLS(opetype);
-    
+
     ADDTOCHAIN(ic);
     return IC_RESULT(ic) ;
 }
@@ -1541,7 +1541,7 @@ operand *geniCodeCast (sym_link *type, operand *op, bool implicit)
 void geniCodeLabel (symbol *label)
 {
     iCode *ic;
-    
+
     ic = newiCodeLabelGoto(LABEL,label);
     ADDTOCHAIN(ic);
 }
@@ -1552,7 +1552,7 @@ void geniCodeLabel (symbol *label)
 void geniCodeGoto (symbol *label)
 {
     iCode *ic;
-    
+
     ic = newiCodeLabelGoto(GOTO,label);
     ADDTOCHAIN(ic);
 }
@@ -1561,33 +1561,33 @@ void geniCodeGoto (symbol *label)
 /* geniCodeMultiply - gen intermediate code for multiplication     */
 /*-----------------------------------------------------------------*/
 operand *geniCodeMultiply (operand *left, operand *right)
-{ 
+{
     iCode *ic ;
     int p2 = 0;
     sym_link *resType ;
     LRTYPE ;
-    
+
     /* if they are both literal then we know the result */
-    if (IS_LITERAL(letype) && IS_LITERAL(retype)) 
-       return operandFromValue (valMult(left->operand.valOperand,
-                                        right->operand.valOperand));
-        
+    if (IS_LITERAL(letype) && IS_LITERAL(retype))
+  return operandFromValue (valMult(left->operand.valOperand,
+           right->operand.valOperand));
+
     resType = usualBinaryConversions(&left, &right);
-    
+
     /* if the right is a literal & power of 2 */
     /* then make it a left shift              */
     if (IS_LITERAL(retype) && !IS_FLOAT(letype) &&
-       (p2 = powof2 ((unsigned long)floatFromVal(right->operand.valOperand)))) 
-       ic = newiCode(LEFT_OP, left,operandFromLit(p2)); /* left shift */
+  (p2 = powof2 ((unsigned long)floatFromVal(right->operand.valOperand))))
+  ic = newiCode(LEFT_OP, left,operandFromLit(p2)); /* left shift */
     else {
-       ic = newiCode('*',left,right);  /* normal multiplication */
-       /* if the size left or right > 1 then support routine */
-       if (getSize(ltype) > 1 || getSize(rtype) > 1)
-           ic->supportRtn = 1;
+  ic = newiCode('*',left,right);  /* normal multiplication */
+  /* if the size left or right > 1 then support routine */
+  if (getSize(ltype) > 1 || getSize(rtype) > 1)
+      ic->supportRtn = 1;
 
     }
     IC_RESULT(ic) = newiTempOperand(resType,1);
-    
+
     ADDTOCHAIN(ic);
     return IC_RESULT(ic) ;
 }
@@ -1596,7 +1596,7 @@ operand *geniCodeMultiply (operand *left, operand *right)
 /* geniCodeDivision - gen intermediate code for division           */
 /*-----------------------------------------------------------------*/
 operand *geniCodeDivision (operand *left, operand *right)
-{ 
+{
     iCode *ic ;
     int p2 = 0;
     sym_link *resType;
@@ -1604,24 +1604,24 @@ operand *geniCodeDivision (operand *left, operand *right)
     sym_link *retype= getSpec(rtype);
     sym_link *ltype = operandType(left);
     sym_link *letype= getSpec(ltype);
-    
+
     resType = usualBinaryConversions(&left, &right);
-    
+
     /* if the right is a literal & power of 2 */
     /* then make it a right shift             */
-    if (IS_LITERAL(retype) && 
-       !IS_FLOAT(letype)  &&
-       (p2 = powof2 ((unsigned long) 
-                     floatFromVal(right->operand.valOperand)))) 
-       ic = newiCode(RIGHT_OP, left,operandFromLit(p2)); /* right shift */
+    if (IS_LITERAL(retype) &&
+  !IS_FLOAT(letype)  &&
+  (p2 = powof2 ((unsigned long)
+          floatFromVal(right->operand.valOperand))))
+  ic = newiCode(RIGHT_OP, left,operandFromLit(p2)); /* right shift */
     else {
-       ic = newiCode('/',left,right);  /* normal division */
-       /* if the size left or right > 1 then support routine */
-       if (getSize(ltype) > 1 || getSize(rtype) > 1)
-           ic->supportRtn = 1;
+  ic = newiCode('/',left,right);  /* normal division */
+  /* if the size left or right > 1 then support routine */
+  if (getSize(ltype) > 1 || getSize(rtype) > 1)
+      ic->supportRtn = 1;
     }
     IC_RESULT(ic) = newiTempOperand(resType,0);
-    
+
     ADDTOCHAIN(ic);
     return IC_RESULT(ic) ;
 }
@@ -1629,26 +1629,26 @@ operand *geniCodeDivision (operand *left, operand *right)
 /* geniCodeModulus  - gen intermediate code for modulus            */
 /*-----------------------------------------------------------------*/
 operand *geniCodeModulus (operand *left, operand *right)
-{ 
+{
     iCode *ic ;
     sym_link *resType;
     LRTYPE ;
-    
+
     /* if they are both literal then we know the result */
-    if (IS_LITERAL(letype) && IS_LITERAL(retype)) 
-       return operandFromValue (valMod(left->operand.valOperand,
-                                       right->operand.valOperand));
-    
+    if (IS_LITERAL(letype) && IS_LITERAL(retype))
+  return operandFromValue (valMod(left->operand.valOperand,
+          right->operand.valOperand));
+
     resType = usualBinaryConversions(&left, &right);
-    
+
     /* now they are the same size */
     ic = newiCode('%',left,right);
 
     /* if the size left or right > 1 then support routine */
     if (getSize(ltype) > 1 || getSize(rtype) > 1)
-       ic->supportRtn = 1;
+  ic->supportRtn = 1;
     IC_RESULT(ic) = newiTempOperand(resType,0);
-    
+
     ADDTOCHAIN(ic);
     return IC_RESULT(ic) ;
 }
@@ -1661,22 +1661,22 @@ operand *geniCodePtrPtrSubtract (operand *left, operand *right)
     iCode *ic ;
     operand *result;
     LRTYPE ;
-    
+
     /* if they are both literals then */
     if (IS_LITERAL(letype) && IS_LITERAL(retype)) {
-       result = operandFromValue (valMinus(left->operand.valOperand,
-                                           right->operand.valOperand));
-       goto subtractExit;
+  result = operandFromValue (valMinus(left->operand.valOperand,
+              right->operand.valOperand));
+  goto subtractExit;
     }
-    
+
     ic = newiCode('-',left,right);
-    
+
     IC_RESULT(ic) = result = newiTempOperand(newIntLink(),1);
     ADDTOCHAIN(ic);
-    
+
  subtractExit:
     return geniCodeDivision (result,
-                            operandFromLit(getSize(ltype->next)));   
+           operandFromLit(getSize(ltype->next)));
 }
 
 /*-----------------------------------------------------------------*/
@@ -1688,37 +1688,37 @@ operand *geniCodeSubtract (operand *left, operand *right)
     int isarray= 0;
     sym_link *resType;
     LRTYPE ;
-    
+
     /* if they both pointers then */
     if ((IS_PTR(ltype) || IS_ARRAY(ltype)) &&
-       (IS_PTR(rtype) || IS_ARRAY(rtype)))
-       return geniCodePtrPtrSubtract (left,right);
-    
+  (IS_PTR(rtype) || IS_ARRAY(rtype)))
+  return geniCodePtrPtrSubtract (left,right);
+
     /* if they are both literal then we know the result */
     if (IS_LITERAL(letype) && IS_LITERAL(retype)
-       && left->isLiteral && right->isLiteral) 
-       return operandFromValue (valMinus(left->operand.valOperand,
-                                         right->operand.valOperand));
-    
+  && left->isLiteral && right->isLiteral)
+  return operandFromValue (valMinus(left->operand.valOperand,
+            right->operand.valOperand));
+
     /* if left is an array or pointer */
-    if ( IS_PTR(ltype) || IS_ARRAY(ltype) ) {    
-       isarray = left->isaddr ;    
-       right = geniCodeMultiply (right,
-                                 operandFromLit(getSize(ltype->next)));
-       resType = copyLinkChain(IS_ARRAY(ltype) ? ltype->next : ltype);
+    if ( IS_PTR(ltype) || IS_ARRAY(ltype) ) {
+  isarray = left->isaddr ;
+  right = geniCodeMultiply (right,
+          operandFromLit(getSize(ltype->next)));
+  resType = copyLinkChain(IS_ARRAY(ltype) ? ltype->next : ltype);
     }
     else { /* make them the same size */
         resType = usualBinaryConversions(&left, &right);
     }
-    
+
     ic = newiCode('-',left,right);
-    
+
     IC_RESULT(ic)= newiTempOperand(resType,1);
     IC_RESULT(ic)->isaddr = (isarray ? 1 : 0);
 
     /* if left or right is a float */
     if (IS_FLOAT(ltype) || IS_FLOAT(rtype))
-       ic->supportRtn = 1;
+  ic->supportRtn = 1;
 
     ADDTOCHAIN(ic);
     return IC_RESULT(ic) ;
@@ -1736,56 +1736,56 @@ operand *geniCodeAdd (operand *left, operand *right )
     LRTYPE ;
 
     /* if left is an array then array access */
-    if (IS_ARRAY(ltype)) 
-       return geniCodeArray (left,right);           
-    
+    if (IS_ARRAY(ltype))
+  return geniCodeArray (left,right);
+
     /* if the right side is LITERAL zero */
     /* return the left side              */
     if (IS_LITERAL(retype) && right->isLiteral && !floatFromVal(valFromType(retype)))
-       return left;
-    
+  return left;
+
     /* if left is literal zero return right */
     if (IS_LITERAL(letype) && left->isLiteral && !floatFromVal(valFromType(letype)))
-       return right ;
-    
+  return right ;
+
     /* if left is an array or pointer then size */
-    if (IS_PTR(ltype)) {    
-       
-       isarray = left->isaddr;
-       size = 
-           operandFromLit(getSize(ltype->next));
-       if (getSize(ltype) > 1 && (getSize(rtype) < INTSIZE)) 
-       {
-           right = geniCodeCast(INTTYPE,right,TRUE);       
-       }
-       right = geniCodeMultiply (right ,size);
-
-       resType = copyLinkChain(ltype);
+    if (IS_PTR(ltype)) {
+
+  isarray = left->isaddr;
+  size =
+      operandFromLit(getSize(ltype->next));
+  if (getSize(ltype) > 1 && (getSize(rtype) < INTSIZE))
+  {
+      right = geniCodeCast(INTTYPE,right,TRUE);
+  }
+  right = geniCodeMultiply (right ,size);
+
+  resType = copyLinkChain(ltype);
     }
     else { /* make them the same size */
         resType = usualBinaryConversions(&left, &right);
     }
-    
+
     /* if they are both literals then we know */
     if (IS_LITERAL(letype) && IS_LITERAL(retype)
-       && left->isLiteral && right->isLiteral)
-       return operandFromValue (valPlus(valFromType(letype),
-                                        valFromType(retype)));
-    
+  && left->isLiteral && right->isLiteral)
+  return operandFromValue (valPlus(valFromType(letype),
+           valFromType(retype)));
+
     ic = newiCode('+',left,right);
-    
+
     IC_RESULT(ic) = newiTempOperand(resType,1);
     IC_RESULT(ic)->isaddr = ( isarray ? 1 : 0);
 
     /* if left or right is a float then support
        routine */
     if (IS_FLOAT(ltype) || IS_FLOAT(rtype))
-       ic->supportRtn = 1;
+  ic->supportRtn = 1;
 
     ADDTOCHAIN(ic);
-    
+
     return IC_RESULT(ic) ;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -1796,9 +1796,9 @@ sym_link *aggrToPtr ( sym_link *type, bool force)
     sym_link *etype ;
     sym_link *ptype ;
 
-    
+
     if (IS_PTR(type) && !force)
-       return type;
+  return type;
 
     etype = getSpec(type);
     ptype = newLink();
@@ -1806,17 +1806,17 @@ sym_link *aggrToPtr ( sym_link *type, bool force)
     ptype->next = type;
     /* if the output class is generic */
     if ((DCL_TYPE(ptype) = PTR_TYPE(SPEC_OCLS(etype))) == CPOINTER)
-       DCL_PTR_CONST(ptype) = port->mem.code_ro;
+  DCL_PTR_CONST(ptype) = port->mem.code_ro;
 
     /* if the variable was declared a constant */
     /* then the pointer points to a constant */
     if (IS_CONSTANT(etype) )
-       DCL_PTR_CONST(ptype) = 1;
+  DCL_PTR_CONST(ptype) = 1;
 
     /* the variable was volatile then pointer to volatile */
     if (IS_VOLATILE(etype))
-       DCL_PTR_VOLATILE(ptype) = 1;
-    return ptype; 
+  DCL_PTR_VOLATILE(ptype) = 1;
+    return ptype;
 }
 
 /*-----------------------------------------------------------------*/
@@ -1827,19 +1827,19 @@ operand *geniCodeArray2Ptr (operand *op)
     sym_link *optype = operandType(op);
     sym_link *opetype = getSpec(optype);
 
-    /* set the pointer depending on the storage class */    
+    /* set the pointer depending on the storage class */
     if ((DCL_TYPE(optype) = PTR_TYPE(SPEC_OCLS(opetype))) == CPOINTER)
-       DCL_PTR_CONST(optype) = port->mem.code_ro;
+  DCL_PTR_CONST(optype) = port->mem.code_ro;
+
 
-    
     /* if the variable was declared a constant */
     /* then the pointer points to a constant */
     if (IS_CONSTANT(opetype) )
-       DCL_PTR_CONST(optype) = 1;
+  DCL_PTR_CONST(optype) = 1;
 
     /* the variable was volatile then pointer to volatile */
     if (IS_VOLATILE(opetype))
-       DCL_PTR_VOLATILE(optype) = 1;
+  DCL_PTR_VOLATILE(optype) = 1;
     op->isaddr = 0;
     return op;
 }
@@ -1852,35 +1852,35 @@ operand *geniCodeArray (operand *left,operand *right)
 {
     iCode *ic;
     sym_link *ltype = operandType(left);
-    
+
     if (IS_PTR(ltype)) {
-       if (IS_PTR(ltype->next) && left->isaddr)
-       {
-           left = geniCodeRValue(left,FALSE);
-       }
-       return geniCodeDerefPtr(geniCodeAdd(left,right));
+  if (IS_PTR(ltype->next) && left->isaddr)
+  {
+      left = geniCodeRValue(left,FALSE);
+  }
+  return geniCodeDerefPtr(geniCodeAdd(left,right));
     }
 
     /* array access */
     right = usualUnaryConversions(right);
     right = geniCodeMultiply(right,
-                            operandFromLit(getSize(ltype->next)));
+           operandFromLit(getSize(ltype->next)));
 
     /* we can check for limits here */
     if (isOperandLiteral(right) &&
-       IS_ARRAY(ltype)         &&
-       DCL_ELEM(ltype)         &&
-       (operandLitValue(right)/getSize(ltype->next)) >= DCL_ELEM(ltype)) {
-       werror(E_ARRAY_BOUND);
-       right = operandFromLit(0);
+  IS_ARRAY(ltype)         &&
+  DCL_ELEM(ltype)         &&
+  (operandLitValue(right)/getSize(ltype->next)) >= DCL_ELEM(ltype)) {
+  werror(E_ARRAY_BOUND);
+  right = operandFromLit(0);
     }
 
-    ic = newiCode('+',left,right);    
+    ic = newiCode('+',left,right);
 
-    IC_RESULT(ic) = newiTempOperand(((IS_PTR(ltype) && 
-                                     !IS_AGGREGATE(ltype->next) &&
-                                     !IS_PTR(ltype->next))
-                                    ? ltype : ltype->next),0);
+    IC_RESULT(ic) = newiTempOperand(((IS_PTR(ltype) &&
+              !IS_AGGREGATE(ltype->next) &&
+              !IS_PTR(ltype->next))
+             ? ltype : ltype->next),0);
 
     IC_RESULT(ic)->isaddr = (!IS_AGGREGATE(ltype->next));
     ADDTOCHAIN(ic);
@@ -1896,12 +1896,12 @@ operand *geniCodeStruct (operand *left, operand *right, bool islval)
     sym_link *type = operandType(left);
     sym_link *etype = getSpec(type);
     sym_link *retype ;
-    symbol *element = getStructElement(SPEC_STRUCT(etype), 
-                                      right->operand.symOperand);
-    
+    symbol *element = getStructElement(SPEC_STRUCT(etype),
+               right->operand.symOperand);
+
     /* add the offset */
     ic = newiCode('+',left,operandFromLit(element->offset));
-    
+
     IC_RESULT(ic) = newiTempOperand(element->type,0);
 
     /* preserve the storage & output class of the struct */
@@ -1909,14 +1909,14 @@ operand *geniCodeStruct (operand *left, operand *right, bool islval)
     retype = getSpec(operandType(IC_RESULT(ic)));
     SPEC_SCLS(retype) = SPEC_SCLS(etype);
     SPEC_OCLS(retype) = SPEC_OCLS(etype);
-    SPEC_VOLATILE(retype) |= SPEC_VOLATILE(etype);    
+    SPEC_VOLATILE(retype) |= SPEC_VOLATILE(etype);
+
+    if (IS_PTR(element->type))
+  setOperandType(IC_RESULT(ic),aggrToPtr(operandType(IC_RESULT(ic)),TRUE));
 
-    if (IS_PTR(element->type)) 
-       setOperandType(IC_RESULT(ic),aggrToPtr(operandType(IC_RESULT(ic)),TRUE));
-    
     IC_RESULT(ic)->isaddr = (!IS_AGGREGATE(element->type));
 
-    
+
     ADDTOCHAIN(ic);
     return (islval ? IC_RESULT(ic) : geniCodeRValue(IC_RESULT(ic),TRUE));
 }
@@ -1930,35 +1930,35 @@ operand *geniCodePostInc (operand *op)
     operand *rOp ;
     sym_link *optype = operandType(op);
     operand *result ;
-    operand *rv = (IS_ITEMP(op) ? 
-                  geniCodeRValue(op,(IS_PTR(optype) ? TRUE : FALSE)) :
-                  op);            
-    sym_link *rvtype = operandType(rv);    
+    operand *rv = (IS_ITEMP(op) ?
+       geniCodeRValue(op,(IS_PTR(optype) ? TRUE : FALSE)) :
+       op);
+    sym_link *rvtype = operandType(rv);
     int size = 0;
-    
+
     /* if this is not an address we have trouble */
     if ( ! op->isaddr ) {
-       werror (E_LVALUE_REQUIRED,"++");
-       return op ;
+  werror (E_LVALUE_REQUIRED,"++");
+  return op ;
     }
-    
+
     rOp = newiTempOperand(rvtype,0);
     rOp->noSpilLoc = 1;
 
     if (IS_ITEMP(rv))
-       rv->noSpilLoc = 1;
+  rv->noSpilLoc = 1;
 
     geniCodeAssign(rOp,rv,0);
-   
+
     size = (IS_PTR(rvtype) ? getSize(rvtype->next) : 1);
-    ic = newiCode('+',rv,operandFromLit(size));          
+    ic = newiCode('+',rv,operandFromLit(size));
     IC_RESULT(ic) = result =newiTempOperand(rvtype,0);
     ADDTOCHAIN(ic);
 
     geniCodeAssign(op,result,0);
-    
+
     return rOp;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -1967,17 +1967,17 @@ operand *geniCodePostInc (operand *op)
 operand *geniCodePreInc (operand *op)
 {
     iCode *ic ;
-    sym_link *optype = operandType(op);    
-    operand *rop = (IS_ITEMP(op) ? 
-                   geniCodeRValue (op,(IS_PTR(optype) ? TRUE : FALSE)) :
-                   op);
+    sym_link *optype = operandType(op);
+    operand *rop = (IS_ITEMP(op) ?
+        geniCodeRValue (op,(IS_PTR(optype) ? TRUE : FALSE)) :
+        op);
     sym_link *roptype = operandType(rop);
     operand *result;
     int size = 0;
-    
+
     if ( ! op->isaddr ) {
-       werror(E_LVALUE_REQUIRED,"++");
-       return op ;
+  werror(E_LVALUE_REQUIRED,"++");
+  return op ;
     }
 
 
@@ -1986,7 +1986,7 @@ operand *geniCodePreInc (operand *op)
     IC_RESULT(ic) = result = newiTempOperand(roptype,0) ;
     ADDTOCHAIN(ic);
 
-    
+
     return geniCodeAssign(op,result,0) ;
 }
 
@@ -1999,54 +1999,54 @@ operand *geniCodePostDec (operand *op)
     operand *rOp ;
     sym_link *optype = operandType(op);
     operand *result ;
-    operand *rv = (IS_ITEMP(op) ? 
-                  geniCodeRValue(op,(IS_PTR(optype) ? TRUE : FALSE)) :
-                  op);            
-    sym_link *rvtype = operandType(rv);    
+    operand *rv = (IS_ITEMP(op) ?
+       geniCodeRValue(op,(IS_PTR(optype) ? TRUE : FALSE)) :
+       op);
+    sym_link *rvtype = operandType(rv);
     int size = 0;
-    
+
     /* if this is not an address we have trouble */
     if ( ! op->isaddr ) {
-       werror (E_LVALUE_REQUIRED,"++");
-       return op ;
+  werror (E_LVALUE_REQUIRED,"++");
+  return op ;
     }
-    
+
     rOp = newiTempOperand(rvtype,0);
     rOp->noSpilLoc = 1;
 
     if (IS_ITEMP(rv))
-       rv->noSpilLoc = 1;
+  rv->noSpilLoc = 1;
 
     geniCodeAssign(rOp,rv,0);
-   
+
     size = (IS_PTR(rvtype) ? getSize(rvtype->next) : 1);
-    ic = newiCode('-',rv,operandFromLit(size));          
+    ic = newiCode('-',rv,operandFromLit(size));
     IC_RESULT(ic) = result =newiTempOperand(rvtype,0);
     ADDTOCHAIN(ic);
 
     geniCodeAssign(op,result,0);
-    
+
     return rOp;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
 /* geniCodePreDec - generate code for pre  decrement               */
 /*-----------------------------------------------------------------*/
 operand *geniCodePreDec (operand *op)
-{  
+{
     iCode *ic ;
-    sym_link *optype = operandType(op);    
-    operand *rop = (IS_ITEMP(op) ? 
-                   geniCodeRValue (op,(IS_PTR(optype) ? TRUE : FALSE)) :
-                   op);
+    sym_link *optype = operandType(op);
+    operand *rop = (IS_ITEMP(op) ?
+        geniCodeRValue (op,(IS_PTR(optype) ? TRUE : FALSE)) :
+        op);
     sym_link *roptype = operandType(rop);
     operand *result;
     int size = 0;
-    
+
     if ( ! op->isaddr ) {
-       werror(E_LVALUE_REQUIRED,"++");
-       return op ;
+  werror(E_LVALUE_REQUIRED,"++");
+  return op ;
     }
 
 
@@ -2055,7 +2055,7 @@ operand *geniCodePreDec (operand *op)
     IC_RESULT(ic) = result = newiTempOperand(roptype,0) ;
     ADDTOCHAIN(ic);
 
-    
+
     return geniCodeAssign(op,result,0) ;
 }
 
@@ -2063,17 +2063,17 @@ operand *geniCodePreDec (operand *op)
 /*-----------------------------------------------------------------*/
 /* geniCodeBitwise - gen int code for bitWise  operators           */
 /*-----------------------------------------------------------------*/
-operand *geniCodeBitwise (operand *left, operand *right, 
-                         int oper, sym_link *resType)
+operand *geniCodeBitwise (operand *left, operand *right,
+        int oper, sym_link *resType)
 {
-    iCode *ic;   
-    
+    iCode *ic;
+
     left = geniCodeCast(resType,left,TRUE);
     right= geniCodeCast(resType,right,TRUE);
-    
+
     ic = newiCode(oper,left,right);
     IC_RESULT(ic) = newiTempOperand(resType,0);
-    
+
     ADDTOCHAIN(ic);
     return IC_RESULT(ic) ;
 }
@@ -2081,43 +2081,43 @@ operand *geniCodeBitwise (operand *left, operand *right,
 /*-----------------------------------------------------------------*/
 /* geniCodeAddressOf - gens icode for '&' address of operator      */
 /*-----------------------------------------------------------------*/
-operand *geniCodeAddressOf (operand *op) 
+operand *geniCodeAddressOf (operand *op)
 {
     iCode *ic;
     sym_link *p ;
     sym_link *optype = operandType(op);
     sym_link *opetype= getSpec(optype);
-    
+
     /* lvalue check already done in decorateType */
     /* this must be a lvalue */
 /*     if (!op->isaddr && !IS_AGGREGATE(optype)) { */
-/*     werror (E_LVALUE_REQUIRED,"&"); */
-/*     return op; */
+/*  werror (E_LVALUE_REQUIRED,"&"); */
+/*  return op; */
 /*     } */
-    
+
     p = newLink();
     p->class = DECLARATOR ;
-    
+
     /* set the pointer depending on the storage class */
     if ((DCL_TYPE(p) = PTR_TYPE(SPEC_OCLS(opetype))) == CPOINTER)
-       DCL_PTR_CONST(p) = port->mem.code_ro;
+  DCL_PTR_CONST(p) = port->mem.code_ro;
 
     /* make sure we preserve the const & volatile */
-    if (IS_CONSTANT(opetype)) 
-       DCL_PTR_CONST(p) = 1;
+    if (IS_CONSTANT(opetype))
+  DCL_PTR_CONST(p) = 1;
 
     if (IS_VOLATILE(opetype))
-       DCL_PTR_VOLATILE(p) = 1;
-    
+  DCL_PTR_VOLATILE(p) = 1;
+
     p->next = copyLinkChain(optype);
-    
+
     /* if already a temp */
     if (IS_ITEMP(op)) {
-       setOperandType (op,p);     
-       op->isaddr= 0;
-       return op;
+  setOperandType (op,p);
+  op->isaddr= 0;
+  return op;
     }
-    
+
     /* other wise make this of the type coming in */
     ic = newiCode(ADDRESS_OF,op,NULL);
     IC_RESULT(ic) = newiTempOperand(p,1);
@@ -2132,35 +2132,35 @@ void setOClass (sym_link *ptr, sym_link *spec)
 {
     switch (DCL_TYPE(ptr)) {
     case POINTER:
-       SPEC_OCLS(spec) = data ;
-       break ;
-       
+  SPEC_OCLS(spec) = data ;
+  break ;
+
     case GPOINTER:
-       SPEC_OCLS(spec) = generic;
-       break;
-       
+  SPEC_OCLS(spec) = generic;
+  break;
+
     case FPOINTER:
-       SPEC_OCLS(spec) = xdata ;
-       break ;
-       
+  SPEC_OCLS(spec) = xdata ;
+  break ;
+
     case CPOINTER:
-       SPEC_OCLS(spec) = code ;
-       break ;  
-       
+  SPEC_OCLS(spec) = code ;
+  break ;
+
     case IPOINTER:
-       SPEC_OCLS(spec) = idata;
-       break;
+  SPEC_OCLS(spec) = idata;
+  break;
 
     case PPOINTER:
-       SPEC_OCLS(spec) = xstack;
-       break;
+  SPEC_OCLS(spec) = xstack;
+  break;
 
     case EEPPOINTER:
-       SPEC_OCLS(spec) = eeprom;
-       break;
+  SPEC_OCLS(spec) = eeprom;
+  break;
 
     default:
-       break;
+  break;
 
     }
 }
@@ -2169,53 +2169,53 @@ void setOClass (sym_link *ptr, sym_link *spec)
 /* geniCodeDerefPtr - dereference pointer with '*'                 */
 /*-----------------------------------------------------------------*/
 operand *geniCodeDerefPtr (operand *op)
-{    
+{
     sym_link *rtype , *retype ;
-    sym_link *optype = operandType(op);  
+    sym_link *optype = operandType(op);
 
     /* if this is a pointer then generate the rvalue */
     if (IS_PTR(optype)) {
-       if (IS_TRUE_SYMOP(op)) {
-           op->isaddr = 1;
-           op = geniCodeRValue(op,TRUE);
-       }
-       else    
-           op = geniCodeRValue(op,TRUE);       
-    }
-    
+  if (IS_TRUE_SYMOP(op)) {
+      op->isaddr = 1;
+      op = geniCodeRValue(op,TRUE);
+  }
+  else
+      op = geniCodeRValue(op,TRUE);
+    }
+
     /* now get rid of the pointer part */
     if (lvaluereq && IS_ITEMP(op) )
     {
-       retype = getSpec(rtype = copyLinkChain(optype)) ;
+  retype = getSpec(rtype = copyLinkChain(optype)) ;
     }
     else
     {
-       retype = getSpec(rtype = copyLinkChain(optype->next)) ;
+  retype = getSpec(rtype = copyLinkChain(optype->next)) ;
     }
-    
+
     /* if this is a pointer then outputclass needs 2b updated */
-    if (IS_PTR(optype)) 
-       setOClass(optype,retype);    
-        
+    if (IS_PTR(optype))
+  setOClass(optype,retype);
+
     op->isGptr = IS_GENPTR(optype);
 
     /* if the pointer was declared as a constant */
     /* then we cannot allow assignment to the derefed */
     if (IS_PTR_CONST(optype))
-       SPEC_CONST(retype) = 1;
-    
+  SPEC_CONST(retype) = 1;
+
     op->isaddr = (IS_PTR(rtype)    ||
-                 IS_STRUCT(rtype) || 
-                 IS_INT(rtype)    ||
-                 IS_CHAR(rtype)   ||
-                 IS_FLOAT(rtype) );
+      IS_STRUCT(rtype) ||
+      IS_INT(rtype)    ||
+      IS_CHAR(rtype)   ||
+      IS_FLOAT(rtype) );
 
     if (!lvaluereq)
-       op = geniCodeRValue(op,TRUE);
+  op = geniCodeRValue(op,TRUE);
 
     setOperandType(op,rtype);
-    
-    return op;    
+
+    return op;
 }
 
 /*-----------------------------------------------------------------*/
@@ -2225,10 +2225,10 @@ operand *geniCodeUnaryMinus (operand *op)
 {
     iCode *ic ;
     sym_link *optype = operandType(op);
-    
+
     if (IS_LITERAL(optype))
-       return operandFromLit(- floatFromVal(op->operand.valOperand));
-    
+  return operandFromLit(- floatFromVal(op->operand.valOperand));
+
     ic = newiCode(UNARYMINUS,op,NULL);
     IC_RESULT(ic) = newiTempOperand(optype,0);
     ADDTOCHAIN(ic);
@@ -2239,44 +2239,44 @@ operand *geniCodeUnaryMinus (operand *op)
 /* geniCodeLeftShift - gen i code for left shift                   */
 /*-----------------------------------------------------------------*/
 operand *geniCodeLeftShift (operand *left, operand *right)
-{ 
+{
     iCode *ic;
 
-    /* Note that we don't use the usual binary conversions for the 
+    /* Note that we don't use the usual binary conversions for the
      * shift operations, in accordance with our ANSI friends.
      */
     if (options.ANSIint)
-    { 
-       right = usualUnaryConversions(right);
-       left = usualUnaryConversions(left);
+    {
+      right = usualUnaryConversions(right);
+      left = usualUnaryConversions(left);
     }
 
     ic = newiCode(LEFT_OP,left,right);
     IC_RESULT(ic) = newiTempOperand(operandType(left),0);
     ADDTOCHAIN(ic);
-    return IC_RESULT(ic) ;  
+    return IC_RESULT(ic) ;
 }
 
 /*-----------------------------------------------------------------*/
 /* geniCodeRightShift - gen i code for right shift                 */
 /*-----------------------------------------------------------------*/
 operand *geniCodeRightShift (operand *left, operand *right)
-{ 
+{
     iCode *ic;
 
-    /* Note that we don't use the usual binary conversions for the 
+    /* Note that we don't use the usual binary conversions for the
      * shift operations, in accordance with our ANSI friends.
      */
     if (options.ANSIint)
-    { 
-       right = usualUnaryConversions(right);
-       left = usualUnaryConversions(left);
+    {
+      right = usualUnaryConversions(right);
+      left = usualUnaryConversions(left);
     }
-    
+
     ic = newiCode(RIGHT_OP,left,right);
     IC_RESULT(ic) = newiTempOperand(operandType(left),0);
     ADDTOCHAIN(ic);
-    return IC_RESULT(ic) ;  
+    return IC_RESULT(ic) ;
 }
 
 #if defined(__BORLANDC__) || defined(_MSC_VER)
@@ -2291,18 +2291,18 @@ operand *geniCodeRightShift (operand *left, operand *right)
 operand *geniCodeLogic (operand *left, operand *right, int op )
 {
     iCode *ic ;
-    sym_link *ctype; 
+    sym_link *ctype;
     sym_link *rtype = operandType(right);
     sym_link *ltype = operandType(left);
-    
+
     /* left is integral type and right is literal then
        check if the literal value is within bounds */
     if (IS_INTEGRAL(ltype) && IS_LITERAL(rtype)) {
-       int nbits = bitsForType(ltype);
-       long v = operandLitValue(right);
+  int nbits = bitsForType(ltype);
+  long v = operandLitValue(right);
 
-       if (v > ((LONG_LONG) 1 << nbits) && v > 0)
-           werror(W_CONST_RANGE," compare operation ");
+  if (v > ((LONG_LONG) 1 << nbits) && v > 0)
+      werror(W_CONST_RANGE," compare operation ");
     }
 
     ctype = usualBinaryConversions(&left, &right);
@@ -2313,12 +2313,12 @@ operand *geniCodeLogic (operand *left, operand *right, int op )
     /* if comparing anything greater than one byte
        and not a '==' || '!=' || '&&' || '||' (these
        will be inlined */
-    if (getSize(ctype) > 1 && 
-       op != EQ_OP        && 
-       op != NE_OP        &&
-       op != AND_OP       &&
-       op != OR_OP        )
-       ic->supportRtn = 1;
+    if (getSize(ctype) > 1 &&
+  op != EQ_OP        &&
+  op != NE_OP        &&
+  op != AND_OP       &&
+  op != OR_OP        )
+  ic->supportRtn = 1;
 
     ADDTOCHAIN(ic);
     return IC_RESULT(ic);
@@ -2330,7 +2330,7 @@ operand *geniCodeLogic (operand *left, operand *right, int op )
 operand *geniCodeUnary (operand *op, int oper )
 {
     iCode *ic = newiCode (oper,op,NULL);
-    
+
     IC_RESULT(ic)= newiTempOperand(operandType(op),0);
     ADDTOCHAIN(ic);
     return IC_RESULT(ic) ;
@@ -2346,29 +2346,29 @@ operand *geniCodeConditional (ast *tree)
     symbol *exitLabel  = newiTempLabel(NULL);
     operand *cond = ast2iCode(tree->left);
     operand *true, *false , *result;
-    
+
     ic = newiCodeCondition(geniCodeRValue(cond,FALSE),
-                          NULL,falseLabel);
+         NULL,falseLabel);
     ADDTOCHAIN(ic);
-    
+
     true = ast2iCode(tree->right->left);
-    
+
     /* move the value to a new Operand */
     result = newiTempOperand(operandType(true),0);
     geniCodeAssign(result,geniCodeRValue(true,FALSE),0);
-    
+
     /* generate an unconditional goto */
     geniCodeGoto(exitLabel);
-    
+
     /* now for the right side */
     geniCodeLabel(falseLabel);
-    
+
     false = ast2iCode(tree->right->right);
     geniCodeAssign(result,geniCodeRValue(false,FALSE),0);
-    
+
     /* create the exit label */
     geniCodeLabel(exitLabel);
-    
+
     return result ;
 }
 
@@ -2380,62 +2380,62 @@ operand *geniCodeAssign (operand *left, operand *right, int nosupdate)
     iCode *ic ;
     sym_link *ltype = operandType(left);
     sym_link *rtype = operandType(right);
-    
+
     if (!left->isaddr && !IS_ITEMP(left)) {
-       werror(E_LVALUE_REQUIRED,"assignment");
-       return left;
+  werror(E_LVALUE_REQUIRED,"assignment");
+  return left;
     }
-       
+
     /* left is integral type and right is literal then
        check if the literal value is within bounds */
     if (IS_INTEGRAL(ltype) && right->type == VALUE && IS_LITERAL(rtype)) {
-       int nbits = bitsForType(ltype);
-       long v = operandLitValue(right);
+  int nbits = bitsForType(ltype);
+  long v = operandLitValue(right);
 
-       if (v > ((LONG_LONG)1 << nbits) && v > 0)
-           werror(W_CONST_RANGE," = operation");
+  if (v > ((LONG_LONG)1 << nbits) && v > 0)
+      werror(W_CONST_RANGE," = operation");
     }
 
     /* if the left & right type don't exactly match */
     /* if pointer set then make sure the check is
        done with the type & not the pointer */
-    /* then cast rights type to left */   
+    /* then cast rights type to left */
 
     /* first check the type for pointer assignement */
     if (left->isaddr && IS_PTR(ltype) && IS_ITEMP(left) &&
-       checkType(ltype,rtype)<0) {
-       if (checkType(ltype->next,rtype) < 0)
-           right = geniCodeCast(ltype->next,right,TRUE);
+  checkType(ltype,rtype)<0) {
+  if (checkType(ltype->next,rtype) < 0)
+      right = geniCodeCast(ltype->next,right,TRUE);
     } else
-       if (checkType(ltype,rtype) < 0 )
-           right = geniCodeCast(ltype,right,TRUE);
+  if (checkType(ltype,rtype) < 0 )
+      right = geniCodeCast(ltype,right,TRUE);
 
-    /* if left is a true symbol & ! volatile 
+    /* if left is a true symbol & ! volatile
        create an assignment to temporary for
        the right & then assign this temporary
        to the symbol this is SSA . isn't it simple
        and folks have published mountains of paper on it */
-    if (IS_TRUE_SYMOP(left) && 
-       !isOperandVolatile(left,FALSE) &&
-       isOperandGlobal(left)) {
-       symbol *sym = NULL;
-
-       if (IS_TRUE_SYMOP(right))
-           sym = OP_SYMBOL(right);
-       ic = newiCode('=',NULL,right);
-       IC_RESULT(ic) = right = newiTempOperand(ltype,0);       
-       SPIL_LOC(right)  = sym ;
-       ADDTOCHAIN(ic);
-    }
-    
+    if (IS_TRUE_SYMOP(left) &&
+  !isOperandVolatile(left,FALSE) &&
+  isOperandGlobal(left)) {
+  symbol *sym = NULL;
+
+  if (IS_TRUE_SYMOP(right))
+      sym = OP_SYMBOL(right);
+  ic = newiCode('=',NULL,right);
+  IC_RESULT(ic) = right = newiTempOperand(ltype,0);
+  SPIL_LOC(right)  = sym ;
+  ADDTOCHAIN(ic);
+    }
+
     ic = newiCode('=',NULL,right);
     IC_RESULT(ic) = left;
-    ADDTOCHAIN(ic);    
+    ADDTOCHAIN(ic);
 
     /* if left isgptr flag is set then support
        routine will be required */
     if (left->isGptr)
-       ic->supportRtn = 1;
+  ic->supportRtn = 1;
 
     ic->nosupdate = nosupdate;
     return left;
@@ -2447,27 +2447,27 @@ operand *geniCodeAssign (operand *left, operand *right, int nosupdate)
 static void geniCodeSEParms (ast *parms)
 {
     if (!parms)
-       return ;
+  return ;
 
     if (parms->type == EX_OP && parms->opval.op == PARAM) {
-       geniCodeSEParms (parms->left) ;
-       geniCodeSEParms (parms->right);
-       return ;
+  geniCodeSEParms (parms->left) ;
+  geniCodeSEParms (parms->right);
+  return ;
     }
 
     /* hack don't like this but too lazy to think of
        something better */
     if (IS_ADDRESS_OF_OP(parms))
-       parms->left->lvalue = 1;
-    
-    if (IS_CAST_OP(parms) && 
-       IS_PTR(parms->ftype) && 
-       IS_ADDRESS_OF_OP(parms->right))
-       parms->right->left->lvalue = 1;
-
-    parms->opval.oprnd = 
-       geniCodeRValue(ast2iCode (parms),FALSE);
-   
+  parms->left->lvalue = 1;
+
+    if (IS_CAST_OP(parms) &&
+  IS_PTR(parms->ftype) &&
+  IS_ADDRESS_OF_OP(parms->right))
+  parms->right->left->lvalue = 1;
+
+    parms->opval.oprnd =
+  geniCodeRValue(ast2iCode (parms),FALSE);
+
     parms->type = EX_OPERAND ;
 }
 
@@ -2477,94 +2477,94 @@ static void geniCodeSEParms (ast *parms)
 static void geniCodeParms ( ast *parms , int *stack, sym_link *fetype, symbol *func)
 {
     iCode *ic ;
-    operand *pval ; 
-    
+    operand *pval ;
+
     if ( ! parms )
-       return ;
-    
+  return ;
+
     /* if this is a param node then do the left & right */
     if (parms->type == EX_OP && parms->opval.op == PARAM) {
-       geniCodeParms (parms->left, stack,fetype,func) ;
-       geniCodeParms (parms->right, stack,fetype,func);
-       return ;
+  geniCodeParms (parms->left, stack,fetype,func) ;
+  geniCodeParms (parms->right, stack,fetype,func);
+  return ;
     }
-    
+
     /* get the parameter value */
     if (parms->type == EX_OPERAND)
-       pval = parms->opval.oprnd ;
+  pval = parms->opval.oprnd ;
     else {
-       /* maybe this else should go away ?? */
-       /* hack don't like this but too lazy to think of
-          something better */
-       if (IS_ADDRESS_OF_OP(parms))
-           parms->left->lvalue = 1;
-    
-       if (IS_CAST_OP(parms) && 
-           IS_PTR(parms->ftype) && 
-           IS_ADDRESS_OF_OP(parms->right))
-           parms->right->left->lvalue = 1;
+  /* maybe this else should go away ?? */
+  /* hack don't like this but too lazy to think of
+     something better */
+  if (IS_ADDRESS_OF_OP(parms))
+      parms->left->lvalue = 1;
 
-       pval = geniCodeRValue(ast2iCode (parms),FALSE); 
+  if (IS_CAST_OP(parms) &&
+      IS_PTR(parms->ftype) &&
+      IS_ADDRESS_OF_OP(parms->right))
+      parms->right->left->lvalue = 1;
+
+  pval = geniCodeRValue(ast2iCode (parms),FALSE);
     }
 
     /* if register parm then make it a send */
     if (((parms->argSym && IS_REGPARM(parms->argSym->etype)) ||
-       IS_REGPARM(parms->etype)) && !func->hasVargs ) {
-       ic = newiCode(SEND,pval,NULL);
-       ADDTOCHAIN(ic);
+  IS_REGPARM(parms->etype)) && !func->hasVargs ) {
+  ic = newiCode(SEND,pval,NULL);
+  ADDTOCHAIN(ic);
     } else {
-       /* now decide whether to push or assign */
-       if (!(options.stackAuto || IS_RENT(fetype))) { 
-           
-           /* assign */
-           operand *top = operandFromSymbol(parms->argSym);
-           geniCodeAssign(top,pval,1);
-       }
-       else { 
-           sym_link *p = operandType(pval);
-           /* push */
-           ic = newiCode(IPUSH,pval,NULL);
-           ic->parmPush = 1;
-           /* update the stack adjustment */
-           *stack += getSize(IS_AGGREGATE(p)? aggrToPtr(p,FALSE):p);
-           ADDTOCHAIN(ic);
-       }
-    }
-    
+  /* now decide whether to push or assign */
+  if (!(options.stackAuto || IS_RENT(fetype))) {
+
+      /* assign */
+      operand *top = operandFromSymbol(parms->argSym);
+      geniCodeAssign(top,pval,1);
+  }
+  else {
+      sym_link *p = operandType(pval);
+      /* push */
+      ic = newiCode(IPUSH,pval,NULL);
+      ic->parmPush = 1;
+      /* update the stack adjustment */
+      *stack += getSize(IS_AGGREGATE(p)? aggrToPtr(p,FALSE):p);
+      ADDTOCHAIN(ic);
+  }
+    }
+
 }
 
 /*-----------------------------------------------------------------*/
 /* geniCodeCall - generates temp code for calling                  */
 /*-----------------------------------------------------------------*/
 operand *geniCodeCall (operand *left, ast *parms)
-{ 
+{
     iCode *ic ;
     operand *result ;
     sym_link *type, *etype;
     int stack = 0 ;
-    
+
     /* take care of parameters with side-effecting
-       function calls in them, this is required to take care 
+       function calls in them, this is required to take care
        of overlaying function parameters */
     geniCodeSEParms ( parms );
 
     /* first the parameters */
     geniCodeParms ( parms , &stack , getSpec(operandType(left)), OP_SYMBOL(left));
-    
+
     /* now call : if symbol then pcall */
-    if (IS_ITEMP(left)) 
-       ic = newiCode(PCALL,left,NULL);
+    if (IS_ITEMP(left))
+  ic = newiCode(PCALL,left,NULL);
     else
-       ic = newiCode(CALL,left,NULL);
-    
+  ic = newiCode(CALL,left,NULL);
+
     IC_ARGS(ic) = left->operand.symOperand->args ;
     type = copyLinkChain(operandType(left)->next);
     etype = getSpec(type);
     SPEC_EXTR(etype) = 0;
     IC_RESULT(ic) = result = newiTempOperand(type,1);
-    
+
     ADDTOCHAIN(ic);
-    
+
     /* stack adjustment after call */
     left->parmBytes = stack;
 
@@ -2575,41 +2575,41 @@ operand *geniCodeCall (operand *left, ast *parms)
 /* geniCodeReceive - generate intermediate code for "receive"      */
 /*-----------------------------------------------------------------*/
 static void geniCodeReceive (value *args)
-{   
+{
     /* for all arguments that are passed in registers */
     while (args) {
 
-       if (IS_REGPARM(args->etype)) {
-           operand *opr = operandFromValue(args);
-           operand *opl ;
-           symbol *sym  = OP_SYMBOL(opr);
-           iCode *ic ;
-
-           /* we will use it after all optimizations
-              and before liveRange calculation */          
-           if (!sym->addrtaken && !IS_VOLATILE(sym->etype)) {
-
-               if (IN_FARSPACE(SPEC_OCLS(sym->etype)) &&
-                  options.stackAuto == 0 &&
-                  !IS_DS390_PORT) {
-               } else {
-                   opl = newiTempOperand(args->type,0);
-                   sym->reqv = opl ;       
-                   sym->reqv->key = sym->key ;
-                   OP_SYMBOL(sym->reqv)->key = sym->key;
-                   OP_SYMBOL(sym->reqv)->isreqv = 1;
-                   OP_SYMBOL(sym->reqv)->islocal= 0;
-                   SPIL_LOC(sym->reqv) =  sym;
-               }
-           }
-
-           ic = newiCode(RECEIVE,NULL,NULL);
-           currFunc->recvSize = getSize(sym->etype);
-           IC_RESULT(ic) = opr;
-           ADDTOCHAIN(ic);
-       }
-       
-       args = args->next;
+  if (IS_REGPARM(args->etype)) {
+      operand *opr = operandFromValue(args);
+      operand *opl ;
+      symbol *sym  = OP_SYMBOL(opr);
+      iCode *ic ;
+
+      /* we will use it after all optimizations
+         and before liveRange calculation */
+      if (!sym->addrtaken && !IS_VOLATILE(sym->etype)) {
+
+    if (IN_FARSPACE(SPEC_OCLS(sym->etype)) &&
+       options.stackAuto == 0 &&
+       !IS_DS390_PORT) {
+    } else {
+        opl = newiTempOperand(args->type,0);
+        sym->reqv = opl ;
+        sym->reqv->key = sym->key ;
+        OP_SYMBOL(sym->reqv)->key = sym->key;
+        OP_SYMBOL(sym->reqv)->isreqv = 1;
+        OP_SYMBOL(sym->reqv)->islocal= 0;
+        SPIL_LOC(sym->reqv) =  sym;
+    }
+      }
+
+      ic = newiCode(RECEIVE,NULL,NULL);
+      currFunc->recvSize = getSize(sym->etype);
+      IC_RESULT(ic) = opr;
+      ADDTOCHAIN(ic);
+  }
+
+  args = args->next;
     }
 }
 
@@ -2622,20 +2622,20 @@ void geniCodeFunctionBody (ast *tree)
     operand *func ;
     sym_link *fetype  ;
     int savelineno ;
-    
+
     /* reset the auto generation */
     /* numbers */
     iTempNum = 0 ;
-    iTempLblNum = 0;   
+    iTempLblNum = 0;
     operandKey = 0 ;
     iCodeKey = 0 ;
     func  = ast2iCode(tree->left);
     fetype = getSpec(operandType(func));
-    
+
     savelineno = lineno;
     lineno = OP_SYMBOL(func)->lineDef;
     /* create an entry label */
-    geniCodeLabel(entryLabel);    
+    geniCodeLabel(entryLabel);
     lineno = savelineno;
 
     /* create a proc icode */
@@ -2645,18 +2645,18 @@ void geniCodeFunctionBody (ast *tree)
     ic->argLabel.args = tree->values.args ;
     ic->lineno = OP_SYMBOL(func)->lineDef;
 
-    ADDTOCHAIN(ic);   
-    
+    ADDTOCHAIN(ic);
+
     /* for all parameters that are passed
        on registers add a "receive" */
     geniCodeReceive( tree->values.args );
 
     /* generate code for the body */
     ast2iCode(tree->right);
-    
+
     /* create a label for return */
     geniCodeLabel(returnLabel);
-    
+
     /* now generate the end proc */
     ic = newiCode(ENDFUNCTION,func,NULL);
     ADDTOCHAIN(ic);
@@ -2669,11 +2669,11 @@ void geniCodeFunctionBody (ast *tree)
 void geniCodeReturn (operand *op)
 {
     iCode *ic;
-    
+
     /* if the operand is present force an rvalue */
-    if (op) 
-       op = geniCodeRValue(op,FALSE);    
-    
+    if (op)
+  op = geniCodeRValue(op,FALSE);
+
     ic = newiCode(RETURN,op,NULL);
     ADDTOCHAIN(ic);
 }
@@ -2685,48 +2685,48 @@ void geniCodeIfx (ast *tree)
 {
     iCode *ic;
     operand *condition = ast2iCode(tree->left);
-    sym_link *cetype; 
-    
+    sym_link *cetype;
+
     /* if condition is null then exit */
     if (!condition)
-       goto exit ;
+  goto exit ;
     else
-       condition = geniCodeRValue(condition,FALSE);
-    
+  condition = geniCodeRValue(condition,FALSE);
+
     cetype = getSpec(operandType(condition));
     /* if the condition is a literal */
     if (IS_LITERAL(cetype)) {
-       if (floatFromVal(condition->operand.valOperand)) {
-           if (tree->trueLabel)
-               geniCodeGoto(tree->trueLabel);
-           else
-               assert(1);
-       }
-       else {
-           if (tree->falseLabel)
-               geniCodeGoto (tree->falseLabel);
-           else
-               assert(1);
-       }
-       goto exit;
-    }
-    
+  if (floatFromVal(condition->operand.valOperand)) {
+      if (tree->trueLabel)
+    geniCodeGoto(tree->trueLabel);
+      else
+    assert(1);
+  }
+  else {
+      if (tree->falseLabel)
+    geniCodeGoto (tree->falseLabel);
+      else
+    assert(1);
+  }
+  goto exit;
+    }
+
     if ( tree->trueLabel ) {
-       ic = newiCodeCondition(condition,
-                              tree->trueLabel,
-                              NULL );
-       ADDTOCHAIN(ic);
-       
-       if ( tree->falseLabel) 
-           geniCodeGoto(tree->falseLabel);     
+  ic = newiCodeCondition(condition,
+             tree->trueLabel,
+             NULL );
+  ADDTOCHAIN(ic);
+
+  if ( tree->falseLabel)
+      geniCodeGoto(tree->falseLabel);
     }
     else {
-       ic = newiCodeCondition (condition,
-                               NULL,
-                               tree->falseLabel);
-       ADDTOCHAIN(ic);
+  ic = newiCodeCondition (condition,
+        NULL,
+        tree->falseLabel);
+  ADDTOCHAIN(ic);
     }
-    
+
  exit:
     ast2iCode(tree->right);
 }
@@ -2744,69 +2744,69 @@ int geniCodeJumpTable (operand *cond, value *caseVals, ast *tree)
     set *labels = NULL ;
 
     if (!tree || !caseVals)
-       return 0;
+  return 0;
 
     /* the criteria for creating a jump table is */
     /* all integer numbers between the maximum & minimum must */
     /* be present , the maximum value should not exceed 255 */
     min = max = (int)floatFromVal(vch = caseVals);
     sprintf(buffer,"_case_%d_%d",
-           tree->values.switchVals.swNum,
-           min);
+      tree->values.switchVals.swNum,
+      min);
     addSet(&labels,newiTempLabel(buffer));
 
     /* if there is only one case value then no need */
     if (!(vch = vch->next ))
-       return 0;
+  return 0;
 
     while (vch) {
-       if (((t = (int)floatFromVal(vch)) - max) != 1)
-           return 0;
-       sprintf(buffer,"_case_%d_%d",
-               tree->values.switchVals.swNum,
-               t);
-       addSet(&labels,newiTempLabel(buffer));
-       max = t;
-       cnt++ ;
-       vch = vch->next ;
-    }
-    
+  if (((t = (int)floatFromVal(vch)) - max) != 1)
+      return 0;
+  sprintf(buffer,"_case_%d_%d",
+    tree->values.switchVals.swNum,
+    t);
+  addSet(&labels,newiTempLabel(buffer));
+  max = t;
+  cnt++ ;
+  vch = vch->next ;
+    }
+
     /* if the number of case statements <= 2 then */
     /* it is not economical to create the jump table */
     /* since two compares are needed for boundary conditions */
     if ((! optimize.noJTabBoundary  && cnt <= 2) || max > (255/3))
-       return 0;
-    
+  return 0;
+
     if ( tree->values.switchVals.swDefault )
-       sprintf (buffer,"_default_%d",tree->values.switchVals.swNum);
+  sprintf (buffer,"_default_%d",tree->values.switchVals.swNum);
     else
-       sprintf (buffer,"_swBrk_%d",tree->values.switchVals.swNum  );
-    
+  sprintf (buffer,"_swBrk_%d",tree->values.switchVals.swNum  );
+
     falseLabel = newiTempLabel (buffer);
 
     /* so we can create a jumptable */
     /* first we rule out the boundary conditions */
     /* if only optimization says so */
     if ( ! optimize.noJTabBoundary ) {
-       sym_link *cetype = getSpec(operandType(cond));
-       /* no need to check the lower bound if
-          the condition is unsigned & minimum value is zero */
-       if (!( min == 0  && SPEC_USIGN(cetype))) {
-           boundary = geniCodeLogic (cond,operandFromLit(min),'<');
-           ic = newiCodeCondition (boundary,falseLabel,NULL);
-           ADDTOCHAIN(ic);
-       }
+  sym_link *cetype = getSpec(operandType(cond));
+  /* no need to check the lower bound if
+     the condition is unsigned & minimum value is zero */
+  if (!( min == 0  && SPEC_USIGN(cetype))) {
+      boundary = geniCodeLogic (cond,operandFromLit(min),'<');
+      ic = newiCodeCondition (boundary,falseLabel,NULL);
+      ADDTOCHAIN(ic);
+  }
 
-       /* now for upper bounds */
-       boundary = geniCodeLogic(cond,operandFromLit(max),'>');
-       ic = newiCodeCondition (boundary,falseLabel,NULL);
-       ADDTOCHAIN(ic);
+  /* now for upper bounds */
+  boundary = geniCodeLogic(cond,operandFromLit(max),'>');
+  ic = newiCodeCondition (boundary,falseLabel,NULL);
+  ADDTOCHAIN(ic);
     }
 
     /* if the min is not zero then we no make it zero */
     if (min) {
-       cond = geniCodeSubtract(cond,operandFromLit(min));
-       setOperandType(cond, UCHARTYPE);
+  cond = geniCodeSubtract(cond,operandFromLit(min));
+  setOperandType(cond, UCHARTYPE);
     }
 
     /* now create the jumptable */
@@ -2814,7 +2814,7 @@ int geniCodeJumpTable (operand *cond, value *caseVals, ast *tree)
     IC_JTCOND(ic) = cond;
     IC_JTLABELS(ic) = labels;
     ADDTOCHAIN(ic);
-    return 1;       
+    return 1;
 }
 
 /*-----------------------------------------------------------------*/
@@ -2826,42 +2826,42 @@ void geniCodeSwitch (ast *tree)
     operand *cond = geniCodeRValue(ast2iCode (tree->left),FALSE);
     value *caseVals = tree->values.switchVals.swVals ;
     symbol *trueLabel , *falseLabel;
-    
+
     /* if we can make this a jump table */
     if ( geniCodeJumpTable (cond,caseVals,tree) )
-       goto jumpTable ; /* no need for the comparison */
+  goto jumpTable ; /* no need for the comparison */
 
     /* for the cases defined do */
     while (caseVals) {
-       
-       operand *compare = geniCodeLogic (cond,
-                                         operandFromValue(caseVals),
-                                         EQ_OP);
-       
-       sprintf(buffer,"_case_%d_%d",
-               tree->values.switchVals.swNum,
-               (int) floatFromVal(caseVals));
-       trueLabel = newiTempLabel(buffer);
-       
-       ic = newiCodeCondition(compare,trueLabel,NULL);
-       ADDTOCHAIN(ic);
-       caseVals = caseVals->next;
-    }
-
-
-    
+
+  operand *compare = geniCodeLogic (cond,
+            operandFromValue(caseVals),
+            EQ_OP);
+
+  sprintf(buffer,"_case_%d_%d",
+    tree->values.switchVals.swNum,
+    (int) floatFromVal(caseVals));
+  trueLabel = newiTempLabel(buffer);
+
+  ic = newiCodeCondition(compare,trueLabel,NULL);
+  ADDTOCHAIN(ic);
+  caseVals = caseVals->next;
+    }
+
+
+
     /* if default is present then goto break else break */
     if ( tree->values.switchVals.swDefault )
-       sprintf (buffer,"_default_%d",tree->values.switchVals.swNum);
+  sprintf (buffer,"_default_%d",tree->values.switchVals.swNum);
     else
-       sprintf (buffer,"_swBrk_%d",tree->values.switchVals.swNum  );
-    
+  sprintf (buffer,"_swBrk_%d",tree->values.switchVals.swNum  );
+
     falseLabel = newiTempLabel (buffer);
     geniCodeGoto(falseLabel);
- jumpTable:   
+
+ jumpTable:
     ast2iCode(tree->right);
-} 
+}
 
 /*-----------------------------------------------------------------*/
 /* geniCodeInline - intermediate code for inline assembler         */
@@ -2882,187 +2882,187 @@ operand *ast2iCode (ast *tree)
 {
     operand *left = NULL;
     operand *right= NULL;
-    
+
     if (!tree)
-       return NULL ;
-    
+  return NULL ;
+
     /* set the global variables for filename & line number */
     if ( tree->filename )
-       filename =  tree->filename ;
+  filename =  tree->filename ;
     if ( tree->lineno)
-       lineno   = tree->lineno ;
+  lineno   = tree->lineno ;
     if (tree->block)
-       block = tree->block ;
+  block = tree->block ;
     if (tree->level)
-       scopeLevel = tree->level;
-    
+  scopeLevel = tree->level;
+
     if (tree->type == EX_VALUE )
-       return operandFromValue(tree->opval.val);
-    
+  return operandFromValue(tree->opval.val);
+
     if (tree->type == EX_LINK )
-       return operandFromLink (tree->opval.lnk);
-    
+  return operandFromLink (tree->opval.lnk);
+
     /* if we find a nullop */
-    if (tree->type == EX_OP && 
-       ( tree->opval.op == NULLOP || 
-         tree->opval.op == BLOCK )) {
-       ast2iCode (tree->left);
-       ast2iCode (tree->right);
-       return NULL ;
-    }
-    
+    if (tree->type == EX_OP &&
+  ( tree->opval.op == NULLOP ||
+    tree->opval.op == BLOCK )) {
+  ast2iCode (tree->left);
+  ast2iCode (tree->right);
+  return NULL ;
+    }
+
     /* special cases for not evaluating */
-    if ( tree->opval.op != ':'   && 
-        tree->opval.op != '?'   &&
-        tree->opval.op != CALL  && 
-        tree->opval.op != IFX   &&
-        tree->opval.op != LABEL &&
-        tree->opval.op != GOTO  &&     
-        tree->opval.op != SWITCH &&
-        tree->opval.op != FUNCTION &&
-        tree->opval.op != INLINEASM ) {
-
-       if (IS_ASSIGN_OP(tree->opval.op) || 
-           IS_DEREF_OP(tree)            || 
-           (tree->opval.op == '&' && !tree->right) ||
-           tree->opval.op == PTR_OP) {
-           lvaluereq++;
-           if ((IS_ARRAY_OP(tree->left) && IS_ARRAY_OP(tree->left->left)) ||
-               (IS_DEREF_OP(tree) && IS_ARRAY_OP(tree->left)))
-           {
-               int olvr = lvaluereq ;
-               lvaluereq = 0;
-               left = operandFromAst(tree->left);
-               lvaluereq = olvr - 1;
-           } else {
-               left = operandFromAst(tree->left);
-               lvaluereq--;
-           }
-           if (IS_DEREF_OP(tree) && IS_DEREF_OP(tree->left))
-                   left = geniCodeRValue(left,TRUE);
-       } else {
-           left =  operandFromAst(tree->left);
-       }
-       if (tree->opval.op == INC_OP || 
-           tree->opval.op == DEC_OP) {
-           lvaluereq++;
-           right= operandFromAst(tree->right);
-           lvaluereq--;
-       } else {
-           right= operandFromAst(tree->right);
-       }
-    }
-    
+    if ( tree->opval.op != ':'   &&
+   tree->opval.op != '?'   &&
+   tree->opval.op != CALL  &&
+   tree->opval.op != IFX   &&
+   tree->opval.op != LABEL &&
+   tree->opval.op != GOTO  &&
+   tree->opval.op != SWITCH &&
+   tree->opval.op != FUNCTION &&
+   tree->opval.op != INLINEASM ) {
+
+  if (IS_ASSIGN_OP(tree->opval.op) ||
+      IS_DEREF_OP(tree)            ||
+      (tree->opval.op == '&' && !tree->right) ||
+      tree->opval.op == PTR_OP) {
+      lvaluereq++;
+      if ((IS_ARRAY_OP(tree->left) && IS_ARRAY_OP(tree->left->left)) ||
+    (IS_DEREF_OP(tree) && IS_ARRAY_OP(tree->left)))
+      {
+    int olvr = lvaluereq ;
+    lvaluereq = 0;
+    left = operandFromAst(tree->left);
+    lvaluereq = olvr - 1;
+      } else {
+    left = operandFromAst(tree->left);
+    lvaluereq--;
+      }
+      if (IS_DEREF_OP(tree) && IS_DEREF_OP(tree->left))
+        left = geniCodeRValue(left,TRUE);
+  } else {
+      left =  operandFromAst(tree->left);
+  }
+  if (tree->opval.op == INC_OP ||
+      tree->opval.op == DEC_OP) {
+      lvaluereq++;
+      right= operandFromAst(tree->right);
+      lvaluereq--;
+  } else {
+      right= operandFromAst(tree->right);
+  }
+    }
+
     /* now depending on the type of operand */
     /* this will be a biggy                 */
     switch (tree->opval.op) {
-       
+
     case '[' :    /* array operation */
-       {
-           sym_link *ltype = operandType(left);
-           left= geniCodeRValue (left,IS_PTR(ltype->next) ? TRUE : FALSE);
-           right=geniCodeRValue (right,TRUE);             
-       }
-       
-       return geniCodeArray (left,right);
-       
+  {
+      sym_link *ltype = operandType(left);
+      left= geniCodeRValue (left,IS_PTR(ltype->next) ? TRUE : FALSE);
+      right=geniCodeRValue (right,TRUE);
+  }
+
+  return geniCodeArray (left,right);
+
     case '.' :   /* structure dereference */
-       if (IS_PTR(operandType(left)))
-           left = geniCodeRValue(left,TRUE);
-       else
-           left = geniCodeRValue(left,FALSE);            
-       
-       return geniCodeStruct (left,right,tree->lvalue);
-       
+  if (IS_PTR(operandType(left)))
+      left = geniCodeRValue(left,TRUE);
+  else
+      left = geniCodeRValue(left,FALSE);
+
+  return geniCodeStruct (left,right,tree->lvalue);
+
     case PTR_OP: /* structure pointer dereference */
-       {
-           sym_link *pType;
-           pType = operandType(left);
-           left = geniCodeRValue(left,TRUE);
-           
-           setOClass (pType,getSpec(operandType(left)));
-       }              
-       
-       return geniCodeStruct (left, right,tree->lvalue);
-       
+  {
+      sym_link *pType;
+      pType = operandType(left);
+      left = geniCodeRValue(left,TRUE);
+
+      setOClass (pType,getSpec(operandType(left)));
+  }
+
+  return geniCodeStruct (left, right,tree->lvalue);
+
     case INC_OP: /* increment operator */
-       if ( left )
-           return geniCodePostInc (left);
-       else
-           return geniCodePreInc (right);
-       
+  if ( left )
+      return geniCodePostInc (left);
+  else
+      return geniCodePreInc (right);
+
     case DEC_OP: /* decrement operator */
-       if ( left )
-           return geniCodePostDec (left);
-       else
-           return geniCodePreDec (right);
-       
+  if ( left )
+      return geniCodePostDec (left);
+  else
+      return geniCodePreDec (right);
+
     case '&' : /* bitwise and or address of operator */
-       if ( right ) { /* this is a bitwise operator   */
-           left= geniCodeRValue(left,FALSE);
-           right= geniCodeRValue(right,FALSE);     
-           return geniCodeBitwise (left,right,BITWISEAND,tree->ftype);
-       } else
-           return geniCodeAddressOf (left);
-       
+  if ( right ) { /* this is a bitwise operator   */
+      left= geniCodeRValue(left,FALSE);
+      right= geniCodeRValue(right,FALSE);
+      return geniCodeBitwise (left,right,BITWISEAND,tree->ftype);
+  } else
+      return geniCodeAddressOf (left);
+
     case '|': /* bitwise or & xor */
     case '^':
-       return geniCodeBitwise (geniCodeRValue(left,FALSE),
-                               geniCodeRValue(right,FALSE),
-                               tree->opval.op,
-                               tree->ftype);
-       
+  return geniCodeBitwise (geniCodeRValue(left,FALSE),
+        geniCodeRValue(right,FALSE),
+        tree->opval.op,
+        tree->ftype);
+
     case '/':
-       return geniCodeDivision (geniCodeRValue(left,FALSE),
-                                geniCodeRValue(right,FALSE));
-       
+  return geniCodeDivision (geniCodeRValue(left,FALSE),
+         geniCodeRValue(right,FALSE));
+
     case '%' :
-       return geniCodeModulus (geniCodeRValue(left,FALSE),
-                               geniCodeRValue(right,FALSE));
+  return geniCodeModulus (geniCodeRValue(left,FALSE),
+        geniCodeRValue(right,FALSE));
     case '*':
-       if ( right ) 
-           return geniCodeMultiply (geniCodeRValue(left,FALSE),
-                                    geniCodeRValue(right,FALSE));
-       else        
-           return geniCodeDerefPtr (geniCodeRValue(left,FALSE));
-       
+  if ( right )
+      return geniCodeMultiply (geniCodeRValue(left,FALSE),
+             geniCodeRValue(right,FALSE));
+  else
+      return geniCodeDerefPtr (geniCodeRValue(left,FALSE));
+
     case '-' :
-       if ( right ) 
-           return geniCodeSubtract (geniCodeRValue(left,FALSE),
-                                    geniCodeRValue(right,FALSE));
-       else
-           return geniCodeUnaryMinus (geniCodeRValue(left,FALSE));
-       
+  if ( right )
+      return geniCodeSubtract (geniCodeRValue(left,FALSE),
+             geniCodeRValue(right,FALSE));
+  else
+      return geniCodeUnaryMinus (geniCodeRValue(left,FALSE));
+
     case '+' :
-       if ( right ) 
-           return geniCodeAdd (geniCodeRValue(left,FALSE),
-                               geniCodeRValue(right,FALSE));
-       else
-           return geniCodeRValue(left,FALSE) ; /* unary '+' has no meaning */
-       
+  if ( right )
+      return geniCodeAdd (geniCodeRValue(left,FALSE),
+        geniCodeRValue(right,FALSE));
+  else
+      return geniCodeRValue(left,FALSE) ; /* unary '+' has no meaning */
+
     case LEFT_OP:
-       return geniCodeLeftShift (geniCodeRValue(left,FALSE),
-                                 geniCodeRValue(right,FALSE));
-       
+  return geniCodeLeftShift (geniCodeRValue(left,FALSE),
+          geniCodeRValue(right,FALSE));
+
     case RIGHT_OP:
-       return geniCodeRightShift (geniCodeRValue(left,FALSE),
-                                  geniCodeRValue(right,FALSE));
+  return geniCodeRightShift (geniCodeRValue(left,FALSE),
+           geniCodeRValue(right,FALSE));
     case CAST:
-       return geniCodeCast (operandType(left),
-                            geniCodeRValue(right,FALSE),FALSE);
-       
+  return geniCodeCast (operandType(left),
+           geniCodeRValue(right,FALSE),FALSE);
+
     case '~' :
     case '!' :
     case RRC:
-    case RLC:  
-       return geniCodeUnary (geniCodeRValue(left,FALSE),tree->opval.op);
-       
+    case RLC:
+  return geniCodeUnary (geniCodeRValue(left,FALSE),tree->opval.op);
+
     case GETHBIT:
-       {
-           operand *op = geniCodeUnary (geniCodeRValue(left,FALSE),tree->opval.op);
-           setOperandType(op, UCHARTYPE);
-           return op;
-       }
+  {
+      operand *op = geniCodeUnary (geniCodeRValue(left,FALSE),tree->opval.op);
+      setOperandType(op, UCHARTYPE);
+      return op;
+  }
     case '>' :
     case '<' :
     case LE_OP:
@@ -3071,151 +3071,151 @@ operand *ast2iCode (ast *tree)
     case NE_OP:
     case AND_OP:
     case OR_OP:
-       return geniCodeLogic (geniCodeRValue(left,FALSE),
-                             geniCodeRValue(right,FALSE),
-                             tree->opval.op);
-    case '?' : 
-       return geniCodeConditional (tree); 
-       
+  return geniCodeLogic (geniCodeRValue(left,FALSE),
+            geniCodeRValue(right,FALSE),
+            tree->opval.op);
+    case '?' :
+  return geniCodeConditional (tree);
+
     case SIZEOF:
-       return operandFromLit(getSize(tree->right->ftype));
-       
+  return operandFromLit(getSize(tree->right->ftype));
+
     case '='        :
-       {
-           sym_link *rtype = operandType(right);
-           sym_link *ltype = operandType(left);
-           if (IS_PTR(rtype) && IS_ITEMP(right) 
-               && right->isaddr && checkType(rtype->next,ltype)==1)
-               right =  geniCodeRValue(right,TRUE);
-           else
-               right = geniCodeRValue(right,FALSE);
-
-           geniCodeAssign (left,right,0);
-           return right ;
-       }              
+  {
+      sym_link *rtype = operandType(right);
+      sym_link *ltype = operandType(left);
+      if (IS_PTR(rtype) && IS_ITEMP(right)
+    && right->isaddr && checkType(rtype->next,ltype)==1)
+    right =  geniCodeRValue(right,TRUE);
+      else
+    right = geniCodeRValue(right,FALSE);
+
+      geniCodeAssign (left,right,0);
+      return right ;
+  }
     case MUL_ASSIGN:
-       return 
-           geniCodeAssign(left,
-                          geniCodeMultiply(geniCodeRValue (operandFromOperand(left),
-                                                           FALSE),
-                                           geniCodeRValue(right,FALSE)),0);
-                                               
+  return
+      geniCodeAssign(left,
+         geniCodeMultiply(geniCodeRValue (operandFromOperand(left),
+                  FALSE),
+              geniCodeRValue(right,FALSE)),0);
+
     case DIV_ASSIGN:
-       return 
-           geniCodeAssign(left,
-                          geniCodeDivision(geniCodeRValue(operandFromOperand(left),
-                                                          FALSE),
-                                           geniCodeRValue(right,FALSE)),0);
+  return
+      geniCodeAssign(left,
+         geniCodeDivision(geniCodeRValue(operandFromOperand(left),
+                 FALSE),
+              geniCodeRValue(right,FALSE)),0);
     case MOD_ASSIGN:
-       return 
-           geniCodeAssign(left,
-                          geniCodeModulus(geniCodeRValue(operandFromOperand(left),
-                                                         FALSE),
-                                          geniCodeRValue(right,FALSE)),0);
-    case ADD_ASSIGN: 
-       {
-           sym_link *rtype = operandType(right);
-           sym_link *ltype = operandType(left);
-           if (IS_PTR(rtype) && IS_ITEMP(right) 
-               && right->isaddr && checkType(rtype->next,ltype)==1)
-               right =  geniCodeRValue(right,TRUE);
-           else
-               right = geniCodeRValue(right,FALSE);
-
-          
-           return geniCodeAssign(left,
-                                 geniCodeAdd (geniCodeRValue(operandFromOperand(left),
-                                                             FALSE),
-                                              right),0);
-       }
+  return
+      geniCodeAssign(left,
+         geniCodeModulus(geniCodeRValue(operandFromOperand(left),
+                FALSE),
+             geniCodeRValue(right,FALSE)),0);
+    case ADD_ASSIGN:
+  {
+      sym_link *rtype = operandType(right);
+      sym_link *ltype = operandType(left);
+      if (IS_PTR(rtype) && IS_ITEMP(right)
+    && right->isaddr && checkType(rtype->next,ltype)==1)
+    right =  geniCodeRValue(right,TRUE);
+      else
+    right = geniCodeRValue(right,FALSE);
+
+
+      return geniCodeAssign(left,
+          geniCodeAdd (geniCodeRValue(operandFromOperand(left),
+                    FALSE),
+                 right),0);
+  }
     case SUB_ASSIGN:
-       {
-           sym_link *rtype = operandType(right);
-           sym_link *ltype = operandType(left);
-           if (IS_PTR(rtype) && IS_ITEMP(right) 
-               && right->isaddr && checkType(rtype->next,ltype)==1) {
-               right =  geniCodeRValue(right,TRUE);
-           }
-           else {
-               right = geniCodeRValue(right,FALSE);
-           }
-           return 
-               geniCodeAssign (left,
-                               geniCodeSubtract(geniCodeRValue(operandFromOperand(left),
-                                                               FALSE),
-                                                right),0);
-       }
+  {
+      sym_link *rtype = operandType(right);
+      sym_link *ltype = operandType(left);
+      if (IS_PTR(rtype) && IS_ITEMP(right)
+    && right->isaddr && checkType(rtype->next,ltype)==1) {
+    right =  geniCodeRValue(right,TRUE);
+      }
+      else {
+    right = geniCodeRValue(right,FALSE);
+      }
+      return
+    geniCodeAssign (left,
+        geniCodeSubtract(geniCodeRValue(operandFromOperand(left),
+                FALSE),
+             right),0);
+  }
     case LEFT_ASSIGN:
-       return 
-           geniCodeAssign (left,
-                           geniCodeLeftShift(geniCodeRValue(operandFromOperand(left)
-                                                            ,FALSE),
-                                             geniCodeRValue(right,FALSE)),0);
+  return
+      geniCodeAssign (left,
+          geniCodeLeftShift(geniCodeRValue(operandFromOperand(left)
+                   ,FALSE),
+                geniCodeRValue(right,FALSE)),0);
     case RIGHT_ASSIGN:
-       return 
-           geniCodeAssign(left,
-                          geniCodeRightShift(geniCodeRValue(operandFromOperand(left)
-                                                            ,FALSE),
-                                             geniCodeRValue(right,FALSE)),0);
+    return
+      geniCodeAssign(left,
+         geniCodeRightShift(geniCodeRValue(operandFromOperand(left)
+                   ,FALSE),
+                geniCodeRValue(right,FALSE)),0);
     case AND_ASSIGN:
-       return 
-           geniCodeAssign (left,
-                           geniCodeBitwise(geniCodeRValue(operandFromOperand(left),
-                                                          FALSE),
-                                           geniCodeRValue(right,FALSE),
-                                           BITWISEAND,
-                                           operandType(left)),0);
+      return
+      geniCodeAssign (left,
+          geniCodeBitwise(geniCodeRValue(operandFromOperand(left),
+                 FALSE),
+              geniCodeRValue(right,FALSE),
+              BITWISEAND,
+              operandType(left)),0);
     case XOR_ASSIGN:
-       return 
-           geniCodeAssign (left,
-                           geniCodeBitwise (geniCodeRValue(operandFromOperand(left),
-                                                           FALSE),
-                                            geniCodeRValue(right,FALSE),
-                                            '^',
-                                            operandType(left)),0);
+      return
+      geniCodeAssign (left,
+          geniCodeBitwise (geniCodeRValue(operandFromOperand(left),
+                  FALSE),
+               geniCodeRValue(right,FALSE),
+               '^',
+               operandType(left)),0);
     case OR_ASSIGN:
-       return 
-           geniCodeAssign (left,
-                           geniCodeBitwise (geniCodeRValue(operandFromOperand(left)
-                                                           ,FALSE),
-                                            geniCodeRValue(right,FALSE),
-                                            '|',
-                                            operandType(left)),0);
+      return
+      geniCodeAssign (left,
+          geniCodeBitwise (geniCodeRValue(operandFromOperand(left)
+                  ,FALSE),
+               geniCodeRValue(right,FALSE),
+               '|',
+               operandType(left)),0);
     case ',' :
-       return geniCodeRValue(right,FALSE);
-       
+  return geniCodeRValue(right,FALSE);
+
     case CALL:
-       return geniCodeCall (ast2iCode(tree->left),
-                            tree->right);
+  return geniCodeCall (ast2iCode(tree->left),
+           tree->right);
     case LABEL:
-       geniCodeLabel(ast2iCode(tree->left)->operand.symOperand);
-       return ast2iCode (tree->right);
-       
+  geniCodeLabel(ast2iCode(tree->left)->operand.symOperand);
+  return ast2iCode (tree->right);
+
     case GOTO:
-       geniCodeGoto (ast2iCode(tree->left)->operand.symOperand);
-       return ast2iCode (tree->right);
-       
+  geniCodeGoto (ast2iCode(tree->left)->operand.symOperand);
+  return ast2iCode (tree->right);
+
     case FUNCTION:
-       geniCodeFunctionBody ( tree );
-       return NULL ;
-       
+  geniCodeFunctionBody ( tree );
+  return NULL ;
+
     case RETURN:
-       geniCodeReturn (right);
-       return NULL ;
-       
+  geniCodeReturn (right);
+  return NULL ;
+
     case IFX:
-       geniCodeIfx (tree);
-       return NULL ;
-       
+  geniCodeIfx (tree);
+  return NULL ;
+
     case SWITCH:
-       geniCodeSwitch (tree);
-       return NULL;
+  geniCodeSwitch (tree);
+  return NULL;
 
     case INLINEASM:
-       geniCodeInline (tree);
-       return NULL ;
+  geniCodeInline (tree);
+  return NULL ;
     }
-    
+
     return NULL;
 }
 
@@ -3226,14 +3226,14 @@ iCode *reverseiCChain ()
 {
     iCode *loop = NULL ;
     iCode *prev = NULL ;
-    
+
     while ((loop = getSet(&iCodeChain))) {
-       loop->next = prev ;
-       if ( prev )
-           prev->prev = loop; 
-       prev = loop ;
+  loop->next = prev ;
+  if ( prev )
+      prev->prev = loop;
+  prev = loop ;
     }
-    
+
     return prev;
 }
 
index 64d3d502ad221c016cd39610d9af820481e4a816..db1188cc2cc1fae65cdd7e21eb5728179373fc3e 100644 (file)
@@ -8,19 +8,19 @@
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "common.h"
@@ -33,17 +33,17 @@ STACK_DCL(regionStack,eBBlock *, MAX_NEST_LEVEL * 10);
 /*-----------------------------------------------------------------*/
 /* newInduction - creates a new induction variable                 */
 /*-----------------------------------------------------------------*/
-induction *newInduction (operand *sym, unsigned int op, 
-                        long constVal, iCode *ic, operand *asym)
+induction *newInduction (operand *sym, unsigned int op,
+       long constVal, iCode *ic, operand *asym)
 {
     induction *ip;
 
-    ip = Safe_calloc(sizeof(induction));
+    ip = Safe_calloc(1,sizeof(induction));
 
     ip->sym = sym;
     ip->asym= asym;
     ip->op = op;
-    ip->cval = constVal;   
+    ip->cval = constVal;
     ip->ic = ic;
 
     return ip;
@@ -56,7 +56,7 @@ region *newRegion ()
 {
     region *lp ;
 
-    lp = Safe_calloc(sizeof(region));  
+    lp = Safe_calloc(1,sizeof(region));
 
     return lp;
 }
@@ -107,8 +107,8 @@ DEFSETFUNC(backEdges)
     /* to see if the 'to' is in the dominator list of the  */
     /* 'from' if yes then this is a back edge              */
     if (bitVectBitValue (ep->from->domVect,ep->to->bbnum)) {
-       addSetHead (bEdges,ep);
-       return 1;
+  addSetHead (bEdges,ep);
+  return 1;
     }
 
     return 0;
@@ -118,21 +118,21 @@ DEFSETFUNC(backEdges)
 /* intersectLoopSucc - returns intersection of loop Successors     */
 /*-----------------------------------------------------------------*/
 static bitVect *intersectLoopSucc ( set *lexits, eBBlock **ebbs)
-{    
-    bitVect *succVect = NULL;    
+{
+    bitVect *succVect = NULL;
     eBBlock *exit = setFirstItem(lexits);
-    
+
     if (!exit)
-       return NULL;
+  return NULL;
 
     succVect = bitVectCopy(exit->succVect);
 
-    for (exit = setNextItem(lexits); exit ; 
-        exit = setNextItem(lexits)) {
-       succVect = bitVectIntersect(succVect,
-                                exit->succVect);                               
+    for (exit = setNextItem(lexits); exit ;
+   exit = setNextItem(lexits)) {
+  succVect = bitVectIntersect(succVect,
+         exit->succVect);
     }
-    
+
     return succVect ;
 }
 
@@ -143,8 +143,8 @@ static bitVect *intersectLoopSucc ( set *lexits, eBBlock **ebbs)
 static void loopInsert (set **regionSet, eBBlock *block)
 {
     if (!isinSet (*regionSet,block)) {
-       addSetHead (regionSet,block);
-       STACK_PUSH(regionStack,block);
+  addSetHead (regionSet,block);
+  STACK_PUSH(regionStack,block);
     }
 }
 
@@ -155,7 +155,7 @@ DEFSETFUNC(insertIntoLoop)
 {
     eBBlock *ebp = item ;
     V_ARG(set **,regionSet);
-    
+
     loopInsert (regionSet,ebp);
     return 0;
 }
@@ -166,12 +166,12 @@ DEFSETFUNC(insertIntoLoop)
 DEFSETFUNC(isNotInBlocks)
 {
     eBBlock *ebp = item;
-    V_ARG(set *,blocks);    
+    V_ARG(set *,blocks);
 
-    if (! isinSet (blocks,ebp))                
-       return 1;    
+    if (! isinSet (blocks,ebp))
+  return 1;
 
-    return 0;  
+    return 0;
 }
 
 /*-----------------------------------------------------------------*/
@@ -183,7 +183,7 @@ int hasIncomingDefs (region *lreg, operand *op)
     eBBlock *preHdr = lreg->entry->preHeader;
 
     if (preHdr && bitVectBitsInCommon(preHdr->outDefs,OP_DEFS(op)))
-       return 1;
+  return 1;
     return 0;
 }
 
@@ -197,9 +197,9 @@ int findLoopEndSeq (region *lreg)
     eBBlock *lblock;
 
     for (block = lblock =setFirstItem(lreg->regBlocks); block;
-        block = setNextItem(lreg->regBlocks)) {
-       if (block != lblock && block->lSeq > lblock->lSeq)
-           lblock = block;
+   block = setNextItem(lreg->regBlocks)) {
+  if (block != lblock && block->lSeq > lblock->lSeq)
+      lblock = block;
     }
 
     return lblock->lSeq;
@@ -213,27 +213,27 @@ DEFSETFUNC(addToExitsMarkDepth)
 {
     eBBlock *ebp = item ;
     V_ARG(set *,loopBlocks);
-    V_ARG(set **,exits);    
+    V_ARG(set **,exits);
     V_ARG(int, depth);
     V_ARG(region *,lr);
 
     /* mark the loop depth of this block */
     if (!ebp->depth)
-       ebp->depth = depth;
+  ebp->depth = depth;
 
     /* put the loop region info in the block */
     /* NOTE: here we will update only the inner most loop
        that it is a part of */
     if (!ebp->partOfLoop)
-       ebp->partOfLoop = lr;
+  ebp->partOfLoop = lr;
 
     /* if any of the successors go out of the loop then */
     /* we add this one to the exits */
     if ( applyToSet(ebp->succList,isNotInBlocks,loopBlocks)) {
-       addSetHead (exits,ebp);
-       return 1;
+  addSetHead (exits,ebp);
+  return 1;
     }
-   
+
     return 0;
 }
 
@@ -249,21 +249,21 @@ DEFSETFUNC(createLoop)
 
     /* make sure regionStack is empty */
     while (!STACK_EMPTY(regionStack))
-       STACK_POP(regionStack);
+  STACK_POP(regionStack);
 
     /* add the entryBlock */
     addSet (&aloop->regBlocks,ep->to);
     loopInsert (&aloop->regBlocks,ep->from);
 
     while (!STACK_EMPTY(regionStack)) {
-       block = STACK_POP(regionStack);
-       /* if block != entry */
-       if (block != ep->to)
-           applyToSet(block->predList,insertIntoLoop,&aloop->regBlocks);
+  block = STACK_POP(regionStack);
+  /* if block != entry */
+  if (block != ep->to)
+      applyToSet(block->predList,insertIntoLoop,&aloop->regBlocks);
     }
 
     aloop->entry = ep->to ;
-       
+
     /* now add it to the set */
     addSetHead (allRegion,aloop);
     return 0;
@@ -272,7 +272,7 @@ DEFSETFUNC(createLoop)
 /*-----------------------------------------------------------------*/
 /* dominatedBy - will return 1 if item is dominated by block       */
 /*-----------------------------------------------------------------*/
-DEFSETFUNC(dominatedBy) 
+DEFSETFUNC(dominatedBy)
 {
     eBBlock *ebp = item;
     V_ARG(eBBlock *,block);
@@ -299,20 +299,20 @@ DEFSETFUNC(addDefInExprs)
 /* assignmentsToSym - for a set of blocks determine # time assigned*/
 /*-----------------------------------------------------------------*/
  int assignmentsToSym (set *sset, operand *sym)
-{   
+{
     eBBlock *ebp ;
     int assigns = 0;
     set *blocks = setFromSet(sset);
 
     for (ebp = setFirstItem(blocks) ; ebp ;
-        ebp = setNextItem(blocks)) {       
-       
-       /* get all the definitions for this symbol
-          in this block */
-       bitVect *defs = bitVectIntersect(ebp->ldefs,OP_DEFS(sym));
-       assigns += bitVectnBitsOn(defs);
-       setToNull((void **)&defs);
-       
+   ebp = setNextItem(blocks)) {
+
+  /* get all the definitions for this symbol
+     in this block */
+  bitVect *defs = bitVectIntersect(ebp->ldefs,OP_DEFS(sym));
+  assigns += bitVectnBitsOn(defs);
+  setToNull((void **)&defs);
+
     }
 
     return assigns;
@@ -329,26 +329,26 @@ int isOperandInvariant (operand *op, region *theLoop, set *lInvars)
     /*       a. constants .                              */
     /*       b. that have defintions reaching loop entry */
     /*       c. that are already defined as invariant    */
-    /*       d. has no assignments in the loop           */    
+    /*       d. has no assignments in the loop           */
     if (op) {
-       if (IS_OP_LITERAL(op))
-           opin = 1 ;
-       else
-           if (IS_SYMOP(op) &&
-               OP_SYMBOL(op)->addrtaken)
-               opin = 0 ;
-           else
-               if (ifDefSymIs(theLoop->entry->inExprs,op))
-                   opin = 1 ;
-               else
-                   if (ifDefSymIs(lInvars,op))
-                       opin = 1 ;              
-                   else
-                       if (IS_SYMOP(op)         &&
-                           ! IS_OP_GLOBAL(op)   &&
-                           ! IS_OP_VOLATILE(op) &&                             
-                           assignmentsToSym (theLoop->regBlocks,op) == 0 )
-                           opin = 1 ;              
+  if (IS_OP_LITERAL(op))
+      opin = 1 ;
+  else
+      if (IS_SYMOP(op) &&
+    OP_SYMBOL(op)->addrtaken)
+    opin = 0 ;
+      else
+    if (ifDefSymIs(theLoop->entry->inExprs,op))
+        opin = 1 ;
+    else
+        if (ifDefSymIs(lInvars,op))
+      opin = 1 ;
+        else
+      if (IS_SYMOP(op)         &&
+          ! IS_OP_GLOBAL(op)   &&
+          ! IS_OP_VOLATILE(op) &&
+          assignmentsToSym (theLoop->regBlocks,op) == 0 )
+          opin = 1 ;
     } else opin++ ;
 
     return opin ;
@@ -375,195 +375,195 @@ DEFSETFUNC(hasNonPtrUse)
     iCode *ic = usedInRemaining(op,ebp->sch);
 
     if (ic && !POINTER_SET(ic) && !POINTER_GET(ic))
-       return 1;
+  return 1;
 
     return 0;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
 /* loopInvariants - takes loop invariants out of region            */
 /*-----------------------------------------------------------------*/
  int loopInvariants( region *theLoop , eBBlock **ebbs, int count)
-{      
+{
     eBBlock *lBlock ;
     set *lInvars = NULL ;
-    
+
     int change = 0 ;
 
     /* if the preHeader does not exist then do nothing */
     /* or no exits then do nothing ( have to think about this situation */
     if (theLoop->entry->preHeader == NULL ||
-       theLoop->exits == NULL )
-       return 0;
+  theLoop->exits == NULL )
+  return 0;
 
     /* we will do the elimination for those blocks        */
     /* in the loop that dominates all exits from the loop */
     for (lBlock = setFirstItem(theLoop->regBlocks); lBlock;
-        lBlock = setNextItem(theLoop->regBlocks)) {
-       
-       iCode *ic;
-       int domsAllExits ;
-       int i ;
-
-       /* mark the dominates all exits flag */
-       domsAllExits = ( applyToSet (theLoop->exits,dominatedBy,lBlock) ==
-                        elementsInSet (theLoop->exits));
-       
-
-       /* now we go thru the instructions of this block and */
-       /* collect those instructions with invariant operands*/
-       for ( ic = lBlock->sch ; ic ; ic = ic->next ) {
-           
-           int lin , rin ;
-           cseDef *ivar ;
-
-           if (SKIP_IC(ic) || POINTER_SET(ic) || ic->op == IFX)
-               continue ;
-
-           /* if result is volatile then skip */
-           if (IC_RESULT(ic) &&  
-               ( isOperandVolatile(IC_RESULT(ic),TRUE) || 
-                 IS_OP_PARM(IC_RESULT(ic))))
-               continue ;
-
-           lin = rin = 0 ;
-           
-           /* special case */
-           /* if address of then it is an invariant */
-           if (ic->op == ADDRESS_OF && 
-               IS_SYMOP(IC_LEFT(ic)) &&
-               IS_AGGREGATE(operandType(IC_LEFT(ic))))
-               lin++;  
-           else
-               /* check if left operand is an invariant */
-               if ( (lin = isOperandInvariant (IC_LEFT(ic),theLoop,lInvars)))  
-                   /* if this is a pointer get then make sure
-                      that the pointer set does not exist in 
-                      any of the blocks */
-                   if (POINTER_GET(ic) && 
-                       ( applyToSet (theLoop->regBlocks,pointerAssigned,IC_LEFT(ic)) ))
-                       lin = 0;                                    
-
-           /* do the same for right */
-           rin = isOperandInvariant (IC_RIGHT(ic),theLoop, lInvars);       
-
-           /* if this is a POINTER_GET then special case, make sure all
-              usages within the loop are POINTER_GET any other usage
-              would mean that this is not an invariant , since the pointer
-              could then be passed as a parameter */
-           if (POINTER_GET(ic) &&
-               applyToSet(theLoop->regBlocks,hasNonPtrUse,IC_LEFT(ic)))
-               continue ;
-
-           /* if both the left & right are invariants : then check that*/
-           /* this definition exists in the out definition of all the  */
-           /* blocks, this will ensure that this is not assigned any   */
-           /* other value in the loop , and not used in this block     */
-           /* prior to this definition which means only this definition*/
-           /* is used in this loop                                     */
-           if (lin && rin && IC_RESULT(ic)) {
-               eBBlock *sBlock ;
-               set *lSet = setFromSet(theLoop->regBlocks);
-
-               /* if this block does not dominate all exists */
-               /* make sure this defintion is not used anywhere else */
-               if (!domsAllExits) {
-
-                   if (isOperandGlobal(IC_RESULT(ic)))
-                       continue;
-                   /* for successors for all exits */
-                   for ( sBlock = setFirstItem(theLoop->exits); sBlock; 
-                         sBlock = setNextItem(theLoop->exits)) {
-                       
-                       for(i=0; i < count; ebbs[i++]->visited = 0);
-                       lBlock->visited = 1;
-                       if ( applyToSet (sBlock->succList,isDefAlive,ic))
-                           break ;
-                   }
-
-                   /* we have found usage */
-                   if (sBlock )
-                       continue ;
-               }
-               
-               /* now make sure this is the only definition */
-               for (sBlock = setFirstItem(lSet); sBlock ;
-                    sBlock = setNextItem (lSet)) {
-                   /* if this is the block make sure the definition */
-                   /* reaches the end of the block */
-                   if (sBlock == lBlock ) {
-                       if (! ifDiCodeIs (sBlock->outExprs,ic))
-                           break;
-                   }
-                   else
-                       if (bitVectBitsInCommon (sBlock->defSet,OP_DEFS(IC_RESULT(ic))))
-                           break;
-               }
-               
-               if (sBlock)
-                   continue ; /* another definition present in the block */
-
-               /* now check if it exists in the in of this block */
-               /* if not then it was killed before this instruction */
-               if (! bitVectBitValue (lBlock->inDefs,ic->key))
-                   continue ;
-
-               /* now we know it is a true invariant */
-               /* remove it from the insts chain & put */
-               /* in the invariant set                */
-               OP_SYMBOL(IC_RESULT(ic))->isinvariant = 1;
-               remiCodeFromeBBlock (lBlock,ic);
-               
-               /* maintain the data flow */
-               /* this means removing from definition from the */
-               /* defset of this block and adding it to the    */
-               /* inexpressions of all blocks within the loop  */
-               bitVectUnSetBit (lBlock->defSet,ic->key);
-               bitVectUnSetBit (lBlock->ldefs,ic->key);
-               ivar = newCseDef(IC_RESULT(ic),ic);
-               applyToSet (theLoop->regBlocks, addDefInExprs, ivar,ebbs,count);
-               addSet(&lInvars,ivar);
-           }
-       }
+   lBlock = setNextItem(theLoop->regBlocks)) {
+
+  iCode *ic;
+  int domsAllExits ;
+  int i ;
+
+  /* mark the dominates all exits flag */
+  domsAllExits = ( applyToSet (theLoop->exits,dominatedBy,lBlock) ==
+       elementsInSet (theLoop->exits));
+
+
+  /* now we go thru the instructions of this block and */
+  /* collect those instructions with invariant operands*/
+  for ( ic = lBlock->sch ; ic ; ic = ic->next ) {
+
+      int lin , rin ;
+      cseDef *ivar ;
+
+      if (SKIP_IC(ic) || POINTER_SET(ic) || ic->op == IFX)
+    continue ;
+
+      /* if result is volatile then skip */
+      if (IC_RESULT(ic) &&
+    ( isOperandVolatile(IC_RESULT(ic),TRUE) ||
+      IS_OP_PARM(IC_RESULT(ic))))
+    continue ;
+
+      lin = rin = 0 ;
+
+      /* special case */
+      /* if address of then it is an invariant */
+      if (ic->op == ADDRESS_OF &&
+    IS_SYMOP(IC_LEFT(ic)) &&
+    IS_AGGREGATE(operandType(IC_LEFT(ic))))
+    lin++;
+      else
+    /* check if left operand is an invariant */
+    if ( (lin = isOperandInvariant (IC_LEFT(ic),theLoop,lInvars)))
+        /* if this is a pointer get then make sure
+           that the pointer set does not exist in
+           any of the blocks */
+        if (POINTER_GET(ic) &&
+      ( applyToSet (theLoop->regBlocks,pointerAssigned,IC_LEFT(ic)) ))
+      lin = 0;
+
+      /* do the same for right */
+      rin = isOperandInvariant (IC_RIGHT(ic),theLoop, lInvars);
+
+      /* if this is a POINTER_GET then special case, make sure all
+         usages within the loop are POINTER_GET any other usage
+         would mean that this is not an invariant , since the pointer
+         could then be passed as a parameter */
+      if (POINTER_GET(ic) &&
+    applyToSet(theLoop->regBlocks,hasNonPtrUse,IC_LEFT(ic)))
+    continue ;
+
+      /* if both the left & right are invariants : then check that*/
+      /* this definition exists in the out definition of all the  */
+      /* blocks, this will ensure that this is not assigned any   */
+      /* other value in the loop , and not used in this block     */
+      /* prior to this definition which means only this definition*/
+      /* is used in this loop                                     */
+      if (lin && rin && IC_RESULT(ic)) {
+    eBBlock *sBlock ;
+    set *lSet = setFromSet(theLoop->regBlocks);
+
+    /* if this block does not dominate all exists */
+    /* make sure this defintion is not used anywhere else */
+    if (!domsAllExits) {
+
+        if (isOperandGlobal(IC_RESULT(ic)))
+      continue;
+        /* for successors for all exits */
+        for ( sBlock = setFirstItem(theLoop->exits); sBlock;
+        sBlock = setNextItem(theLoop->exits)) {
+
+      for(i=0; i < count; ebbs[i++]->visited = 0);
+      lBlock->visited = 1;
+      if ( applyToSet (sBlock->succList,isDefAlive,ic))
+          break ;
+        }
+
+        /* we have found usage */
+        if (sBlock )
+      continue ;
+    }
+
+    /* now make sure this is the only definition */
+    for (sBlock = setFirstItem(lSet); sBlock ;
+         sBlock = setNextItem (lSet)) {
+        /* if this is the block make sure the definition */
+        /* reaches the end of the block */
+        if (sBlock == lBlock ) {
+      if (! ifDiCodeIs (sBlock->outExprs,ic))
+          break;
+        }
+        else
+      if (bitVectBitsInCommon (sBlock->defSet,OP_DEFS(IC_RESULT(ic))))
+          break;
+    }
+
+    if (sBlock)
+        continue ; /* another definition present in the block */
+
+    /* now check if it exists in the in of this block */
+    /* if not then it was killed before this instruction */
+    if (! bitVectBitValue (lBlock->inDefs,ic->key))
+        continue ;
+
+    /* now we know it is a true invariant */
+    /* remove it from the insts chain & put */
+    /* in the invariant set                */
+    OP_SYMBOL(IC_RESULT(ic))->isinvariant = 1;
+    remiCodeFromeBBlock (lBlock,ic);
+
+    /* maintain the data flow */
+    /* this means removing from definition from the */
+    /* defset of this block and adding it to the    */
+    /* inexpressions of all blocks within the loop  */
+    bitVectUnSetBit (lBlock->defSet,ic->key);
+    bitVectUnSetBit (lBlock->ldefs,ic->key);
+    ivar = newCseDef(IC_RESULT(ic),ic);
+    applyToSet (theLoop->regBlocks, addDefInExprs, ivar,ebbs,count);
+    addSet(&lInvars,ivar);
+      }
+  }
     } /* for all loop blocks */
 
     /* if we have some invariants then */
     if (lInvars) {
-       eBBlock *preHdr= theLoop->entry->preHeader ;
-       iCode *icFirst = NULL , *icLast = NULL ;
-       cseDef *cdp;
-
-       /* create an iCode chain from it */
-       for (cdp = setFirstItem(lInvars); cdp ; cdp = setNextItem(lInvars)) {
-
-           /* maintain data flow .. add it to the */
-           /* ldefs defSet & outExprs of the preheader  */
-           preHdr->defSet = bitVectSetBit (preHdr->defSet,cdp->diCode->key);
-           preHdr->ldefs = bitVectSetBit (preHdr->ldefs,cdp->diCode->key);
-           cdp->diCode->lineno = preHdr->ech->lineno;
-           addSetHead (&preHdr->outExprs,cdp);
-           
-
-           if (!icFirst)
-               icFirst = cdp->diCode;
-           if (icLast) {
-               icLast->next = cdp->diCode;
-               cdp->diCode->prev = icLast;
-               icLast = cdp->diCode ;
-           } else 
-               icLast = cdp->diCode;   
-           change++ ;
-       }
-       
-       /* add the instruction chain to the end of the 
-          preheader for this loop, preheaders will always
-          have atleast a label */
-       preHdr->ech->next = icFirst ;
-       icFirst->prev = preHdr->ech ;
-       preHdr->ech = icLast;
-       icLast->next = NULL;
-       
+  eBBlock *preHdr= theLoop->entry->preHeader ;
+  iCode *icFirst = NULL , *icLast = NULL ;
+  cseDef *cdp;
+
+  /* create an iCode chain from it */
+  for (cdp = setFirstItem(lInvars); cdp ; cdp = setNextItem(lInvars)) {
+
+      /* maintain data flow .. add it to the */
+      /* ldefs defSet & outExprs of the preheader  */
+      preHdr->defSet = bitVectSetBit (preHdr->defSet,cdp->diCode->key);
+      preHdr->ldefs = bitVectSetBit (preHdr->ldefs,cdp->diCode->key);
+      cdp->diCode->lineno = preHdr->ech->lineno;
+      addSetHead (&preHdr->outExprs,cdp);
+
+
+      if (!icFirst)
+    icFirst = cdp->diCode;
+      if (icLast) {
+    icLast->next = cdp->diCode;
+    cdp->diCode->prev = icLast;
+    icLast = cdp->diCode ;
+      } else
+    icLast = cdp->diCode;
+      change++ ;
+  }
+
+  /* add the instruction chain to the end of the
+     preheader for this loop, preheaders will always
+     have atleast a label */
+  preHdr->ech->next = icFirst ;
+  icFirst->prev = preHdr->ech ;
+  preHdr->ech = icLast;
+  icLast->next = NULL;
+
     }
     return change ;
 }
@@ -575,16 +575,16 @@ int addressTaken (set *sset ,operand *sym)
 {
     set *loop;
     eBBlock *ebp ;
-    set *loop2;   
+    set *loop2;
 
     for (loop = sset; loop ; loop = loop->next) {
-       ebp = loop->item;
-       loop2 = ebp->addrOf ;
-       while (loop2) {
-           if (isOperandEqual((operand *)loop2->item,sym))
-               return 1;
-           loop2 = loop2->next;
-       }
+  ebp = loop->item;
+  loop2 = ebp->addrOf ;
+  while (loop2) {
+      if (isOperandEqual((operand *)loop2->item,sym))
+    return 1;
+      loop2 = loop2->next;
+  }
     }
 
     return 0;
@@ -601,8 +601,8 @@ DEFSETFUNC(findInduction)
     V_ARG(induction **,ipp);
 
     if (isOperandEqual(ip->sym,sym)) {
-       *ipp = ip;
-       return 1;
+  *ipp = ip;
+  return 1;
     }
 
     return 0;
@@ -614,23 +614,23 @@ DEFSETFUNC(findInduction)
 iCode *findDefInRegion (set *regBlocks, operand *defOp, eBBlock **owner)
 {
     eBBlock *lBlock ;
-    
+
     /* for all blocks in the region */
     for (lBlock = setFirstItem(regBlocks); lBlock ;
-        lBlock = setNextItem(regBlocks)) {
-
-       /* if a definition for this exists */
-       if (bitVectBitsInCommon(lBlock->defSet,OP_DEFS(defOp))) {
-           iCode *ic;
-
-           /* go thru the instruction chain to find it */
-           for (ic = lBlock->sch ; ic ; ic = ic->next )                
-               if (bitVectBitValue (OP_DEFS(defOp),ic->key)) {
-                   if (owner)
-                       *owner = lBlock ;
-                   return ic;
-               }
-       }
+   lBlock = setNextItem(regBlocks)) {
+
+  /* if a definition for this exists */
+  if (bitVectBitsInCommon(lBlock->defSet,OP_DEFS(defOp))) {
+      iCode *ic;
+
+      /* go thru the instruction chain to find it */
+      for (ic = lBlock->sch ; ic ; ic = ic->next )
+    if (bitVectBitValue (OP_DEFS(defOp),ic->key)) {
+        if (owner)
+      *owner = lBlock ;
+        return ic;
+    }
+  }
     }
 
     return NULL ;
@@ -647,185 +647,185 @@ set *basicInduction (region *loopReg , eBBlock **ebbs, int count)
     /* i.e. all assignments of the form a := a +/- const*/
     /* for all blocks within the loop do */
     for ( lBlock = setFirstItem(loopReg->regBlocks); lBlock ;
-         lBlock = setNextItem(loopReg->regBlocks)) {
-       
-       iCode *ic, *dic ;
-
-       /* for all instructions in the blocks do */
-       for ( ic = lBlock->sch ; ic ; ic = ic->next ) {
-           
-           operand *aSym ;
-           unsigned long litValue ;
-           induction *ip;
-           iCode *indIc;
-           eBBlock *owner = NULL;
-           int nexits;
-
-           /* look for assignments of the form */
-           /*   symbolVar := iTempNN */
-           if ( ic->op != '=')
-               continue ;
-
-           if (!IS_TRUE_SYMOP(IC_RESULT(ic)) &&
-               !OP_SYMBOL(IC_RESULT(ic))->isreqv)
-               continue ;
-
-           if (isOperandGlobal(IC_RESULT(ic)))
-               continue ;
-
-           if (!IS_ITEMP(IC_RIGHT(ic)))
-               continue ;
-
-           /* if it has multiple assignments within the loop then skip */
-           if (assignmentsToSym (loopReg->regBlocks,IC_RESULT(ic)) > 1 )
-               continue ;
-           
-           /* if the address of this was taken inside the loop then continue */
-           if (addressTaken (loopReg->regBlocks,IC_RESULT(ic)))
-               continue ;
-
-           /* find the definition for the result in the block */
-           if (! (dic = findDefInRegion (setFromSet(loopReg->regBlocks),
-                                         IC_RIGHT(ic),&owner)))
-               continue ;
-
-           /* if not +/- continue */
-           if (dic->op != '+' && dic->op != '-')
-               continue ;
-
-           /* make sure definition is of the form  a +/- c */
-           if (!IS_OP_LITERAL(IC_LEFT(dic)) && !IS_OP_LITERAL(IC_RIGHT(dic)))
-               continue ;
-           
-           aSym = (IS_OP_LITERAL(IC_RIGHT(dic)) ? 
-                   (litValue = operandLitValue(IC_RIGHT(dic)),IC_LEFT(dic)) : 
-                   (litValue = operandLitValue(IC_LEFT(dic)),IC_RIGHT(dic)));
-           
-           if (!isOperandEqual(IC_RESULT(ic),aSym) &&
-               !isOperandEqual(IC_RIGHT(ic),aSym)) {
-               iCode *ddic ;
-               /* find the definition for this and check */
-               if (!(ddic = findDefInRegion (setFromSet(loopReg->regBlocks),
-                                             aSym,&owner)))                
-                   continue ;
-
-               if (ddic->op != '=')
-                   continue ;
-
-               if (!isOperandEqual(IC_RESULT(ddic),aSym) ||
-                   !isOperandEqual(IC_RIGHT(ddic),IC_RESULT(ic)))
-                   continue ;
-           }
-
-           /* if the right hand side has more than one usage then
-              don't make it an induction (will have to think some more) */
-           if (bitVectnBitsOn(OP_USES(IC_RIGHT(ic))) > 1)
-                   continue;
-
-           /* if the definition is volatile then it cannot be
-              an induction object */
-           if (isOperandVolatile(IC_RIGHT(ic),FALSE) ||
-               isOperandVolatile(IC_RESULT(ic),FALSE))
-               continue;
-
-           /* whew !! that was a lot of work to find the definition */
-           /* create an induction object */
-           indIc = newiCode('=',NULL,IC_RESULT(ic));
-           indIc->lineno = ic->lineno;
-           IC_RESULT(indIc) = operandFromOperand(IC_RIGHT(ic));
-           IC_RESULT(indIc)->isaddr = 0;
-           OP_SYMBOL(IC_RESULT(indIc))->isind = 1;
-           ip = newInduction (IC_RIGHT(ic),dic->op,litValue,indIc,NULL);
-           
-           /* replace the inducted variable by the iTemp */
-           replaceSymBySym (loopReg->regBlocks,IC_RESULT(ic),IC_RIGHT(ic));
-
-           /* if it has only one exit then remove it from here
-              and put it in the exit block */
-           nexits = elementsInSet (loopReg->exits);
-           if (nexits == 1) {
-               eBBlock *exit = setFirstItem(loopReg->exits);
-
-               /* if it is the same block then there is no
-                  need to move it about */
-               if ( exit != lBlock) {
-                   iCode *saveic = ic->prev;
-                   /* remove it */
-                   remiCodeFromeBBlock(lBlock,ic);
-                   /* clear the definition */
-                   bitVectUnSetBit(lBlock->defSet,ic->key);
-                   /* add it to the exit */
-                   addiCodeToeBBlock(exit,ic,NULL);
-                   /* set the definition bit */
-                   exit->defSet = bitVectSetBit(exit->defSet,ic->key);
-                   ic = saveic ;
-               }
-           }
-           
-           /* if the number of exits is greater than one then
-              we use another trick ; we will create an intersection
-              of succesors of the exits, then take those that are not
-              part of the loop and have dfNumber greater loop entry
-              and insert a new definition in them */
-           if ( nexits > 1) {
-
-               bitVect *loopSuccs = intersectLoopSucc (loopReg->exits,ebbs);
-               
-               /* loopSuccs now contains intersection
-                  of all the loops successors */
-               if (loopSuccs) {
-                   int i;
-                   for (i = 0 ; i < loopSuccs->size; i++) {
-                       if (bitVectBitValue(loopSuccs,i)) {
-
-                           eBBlock *eblock = ebbs[i];
-                           
-                           /* if the successor does not belong to the loop
-                              and will be executed after the loop : then
-                              add a definition to the block */
-                           if ( !isinSet(loopReg->regBlocks,eblock) &&
-                                eblock->dfnum > loopReg->entry->dfnum) {
-                               /* create the definition */
-                               iCode *newic = newiCode('=',NULL,
-                                                       operandFromOperand(IC_RIGHT(ic)));
-                               IC_RESULT(newic) = operandFromOperand(IC_RESULT(ic));
-                               OP_DEFS(IC_RESULT(newic)) = 
-                                   bitVectSetBit(OP_DEFS(IC_RESULT(newic)),newic->key);
-                               OP_USES(IC_RIGHT(newic)) = 
-                                   bitVectSetBit(OP_USES(IC_RIGHT(newic)),newic->key);
-                               /* and add it */
-                               if (eblock->sch && eblock->sch->op == LABEL)
-                                   addiCodeToeBBlock(eblock,newic,eblock->sch->next);
-                               else
-                                   addiCodeToeBBlock(eblock,newic,eblock->sch);
-                               /* set the definition bit */
-                               eblock->defSet = bitVectSetBit(eblock->defSet,ic->key); 
-                           }
-                       }
-                   }
-               }
-           }
-              
-           addSet (&indVars,ip);
-       }
+    lBlock = setNextItem(loopReg->regBlocks)) {
+
+  iCode *ic, *dic ;
+
+  /* for all instructions in the blocks do */
+  for ( ic = lBlock->sch ; ic ; ic = ic->next ) {
+
+      operand *aSym ;
+      unsigned long litValue ;
+      induction *ip;
+      iCode *indIc;
+      eBBlock *owner = NULL;
+      int nexits;
+
+      /* look for assignments of the form */
+      /*   symbolVar := iTempNN */
+      if ( ic->op != '=')
+    continue ;
+
+      if (!IS_TRUE_SYMOP(IC_RESULT(ic)) &&
+    !OP_SYMBOL(IC_RESULT(ic))->isreqv)
+    continue ;
+
+      if (isOperandGlobal(IC_RESULT(ic)))
+    continue ;
+
+      if (!IS_ITEMP(IC_RIGHT(ic)))
+    continue ;
+
+      /* if it has multiple assignments within the loop then skip */
+      if (assignmentsToSym (loopReg->regBlocks,IC_RESULT(ic)) > 1 )
+    continue ;
+
+      /* if the address of this was taken inside the loop then continue */
+      if (addressTaken (loopReg->regBlocks,IC_RESULT(ic)))
+    continue ;
+
+      /* find the definition for the result in the block */
+      if (! (dic = findDefInRegion (setFromSet(loopReg->regBlocks),
+            IC_RIGHT(ic),&owner)))
+    continue ;
+
+      /* if not +/- continue */
+      if (dic->op != '+' && dic->op != '-')
+    continue ;
+
+      /* make sure definition is of the form  a +/- c */
+      if (!IS_OP_LITERAL(IC_LEFT(dic)) && !IS_OP_LITERAL(IC_RIGHT(dic)))
+    continue ;
+
+      aSym = (IS_OP_LITERAL(IC_RIGHT(dic)) ?
+        (litValue = operandLitValue(IC_RIGHT(dic)),IC_LEFT(dic)) :
+        (litValue = operandLitValue(IC_LEFT(dic)),IC_RIGHT(dic)));
+
+      if (!isOperandEqual(IC_RESULT(ic),aSym) &&
+    !isOperandEqual(IC_RIGHT(ic),aSym)) {
+    iCode *ddic ;
+    /* find the definition for this and check */
+    if (!(ddic = findDefInRegion (setFromSet(loopReg->regBlocks),
+                aSym,&owner)))
+        continue ;
+
+    if (ddic->op != '=')
+        continue ;
+
+    if (!isOperandEqual(IC_RESULT(ddic),aSym) ||
+        !isOperandEqual(IC_RIGHT(ddic),IC_RESULT(ic)))
+        continue ;
+      }
+
+      /* if the right hand side has more than one usage then
+         don't make it an induction (will have to think some more) */
+      if (bitVectnBitsOn(OP_USES(IC_RIGHT(ic))) > 1)
+        continue;
+
+      /* if the definition is volatile then it cannot be
+         an induction object */
+      if (isOperandVolatile(IC_RIGHT(ic),FALSE) ||
+    isOperandVolatile(IC_RESULT(ic),FALSE))
+    continue;
+
+      /* whew !! that was a lot of work to find the definition */
+      /* create an induction object */
+      indIc = newiCode('=',NULL,IC_RESULT(ic));
+      indIc->lineno = ic->lineno;
+      IC_RESULT(indIc) = operandFromOperand(IC_RIGHT(ic));
+      IC_RESULT(indIc)->isaddr = 0;
+      OP_SYMBOL(IC_RESULT(indIc))->isind = 1;
+      ip = newInduction (IC_RIGHT(ic),dic->op,litValue,indIc,NULL);
+
+      /* replace the inducted variable by the iTemp */
+      replaceSymBySym (loopReg->regBlocks,IC_RESULT(ic),IC_RIGHT(ic));
+
+      /* if it has only one exit then remove it from here
+         and put it in the exit block */
+      nexits = elementsInSet (loopReg->exits);
+      if (nexits == 1) {
+    eBBlock *exit = setFirstItem(loopReg->exits);
+
+    /* if it is the same block then there is no
+       need to move it about */
+    if ( exit != lBlock) {
+        iCode *saveic = ic->prev;
+        /* remove it */
+        remiCodeFromeBBlock(lBlock,ic);
+        /* clear the definition */
+        bitVectUnSetBit(lBlock->defSet,ic->key);
+        /* add it to the exit */
+        addiCodeToeBBlock(exit,ic,NULL);
+        /* set the definition bit */
+        exit->defSet = bitVectSetBit(exit->defSet,ic->key);
+        ic = saveic ;
+    }
+      }
+
+      /* if the number of exits is greater than one then
+         we use another trick ; we will create an intersection
+         of succesors of the exits, then take those that are not
+         part of the loop and have dfNumber greater loop entry
+         and insert a new definition in them */
+      if ( nexits > 1) {
+
+    bitVect *loopSuccs = intersectLoopSucc (loopReg->exits,ebbs);
+
+    /* loopSuccs now contains intersection
+       of all the loops successors */
+    if (loopSuccs) {
+        int i;
+        for (i = 0 ; i < loopSuccs->size; i++) {
+      if (bitVectBitValue(loopSuccs,i)) {
+
+          eBBlock *eblock = ebbs[i];
+
+          /* if the successor does not belong to the loop
+             and will be executed after the loop : then
+             add a definition to the block */
+          if ( !isinSet(loopReg->regBlocks,eblock) &&
+         eblock->dfnum > loopReg->entry->dfnum) {
+        /* create the definition */
+        iCode *newic = newiCode('=',NULL,
+              operandFromOperand(IC_RIGHT(ic)));
+        IC_RESULT(newic) = operandFromOperand(IC_RESULT(ic));
+        OP_DEFS(IC_RESULT(newic)) =
+            bitVectSetBit(OP_DEFS(IC_RESULT(newic)),newic->key);
+        OP_USES(IC_RIGHT(newic)) =
+            bitVectSetBit(OP_USES(IC_RIGHT(newic)),newic->key);
+        /* and add it */
+        if (eblock->sch && eblock->sch->op == LABEL)
+            addiCodeToeBBlock(eblock,newic,eblock->sch->next);
+        else
+            addiCodeToeBBlock(eblock,newic,eblock->sch);
+        /* set the definition bit */
+        eblock->defSet = bitVectSetBit(eblock->defSet,ic->key);
+          }
+      }
+        }
+    }
+      }
+
+      addSet (&indVars,ip);
+  }
 
     } /* end of all blocks for basic induction variables */
-    
+
     return indVars;
 }
-    
+
 /*-----------------------------------------------------------------*/
 /* loopInduction - remove induction variables from a loop          */
 /*-----------------------------------------------------------------*/
  int loopInduction( region *loopReg, eBBlock **ebbs, int count)
-{   
+{
     int change = 0 ;
     eBBlock *lBlock, *lastBlock = NULL;
     set *indVars = NULL ;
     set *basicInd=NULL ;
 
     if (loopReg->entry->preHeader == NULL)
-       return 0;
+  return 0;
 
     /* we first determine the basic Induction variables */
     basicInd = setFromSet(indVars = basicInduction(loopReg, ebbs,count));
@@ -834,141 +834,141 @@ set *basicInduction (region *loopReg , eBBlock **ebbs, int count)
     /* the form x := y (* | / ) <constant> .. we will move  this one to */
     /* beginning of the loop and reduce strength i.e. replace with +/-  */
     /* these expensive expressions: OH! and y must be induction too     */
-    for ( lBlock = setFirstItem(loopReg->regBlocks), lastBlock = lBlock; 
-         lBlock && indVars;
-         lBlock = setNextItem(loopReg->regBlocks)) {
-       
-       iCode *ic, *indIc;
-       induction *ip;
-
-       /* last block is the one with the highest block 
-          number */
-       if (lastBlock->bbnum < lBlock->bbnum )
-           lastBlock = lBlock;
-
-       for ( ic = lBlock->sch ; ic ; ic = ic->next ) {
-           operand *aSym ;       
-           unsigned long litVal ;
-           int lr = 0;
-
-           /* consider only * & / */
-           if (ic->op != '*' && ic->op != '/')
-               continue ;
-
-           /* if the result has more definitions then */
-           if (assignmentsToSym(loopReg->regBlocks,IC_RESULT(ic)) > 1)
-               continue ;
-
-           /* check if the operands are what we want */
-           /* i.e. one of them an symbol the other a literal */
-           if (! ( (IS_SYMOP(IC_LEFT(ic)) && IS_OP_LITERAL(IC_RIGHT(ic))) ||
-                   (IS_OP_LITERAL(IC_LEFT(ic)) && IS_SYMOP(IC_RIGHT(ic))) ))
-               continue ;
-
-           aSym = (IS_SYMOP(IC_LEFT(ic)) ? 
-                   (lr = 1, litVal = operandLitValue(IC_RIGHT(ic)), IC_LEFT(ic) ) : 
-                   (litVal= operandLitValue(IC_LEFT(ic)), IC_RIGHT(ic) ) ) ;     
-
-           ip = NULL ;
-           /* check if this is an induction variable */
-           if (! applyToSetFTrue (basicInd,findInduction,aSym,&ip))
-               continue ;                  
-           
-           /* ask port for size not worth if native instruction
-              exist for multiply & divide */
-           if (getSize(operandType(IC_LEFT(ic))) <= port->muldiv.native_below ||
-               getSize(operandType(IC_RIGHT(ic))) <= port->muldiv.native_below)
-               continue;
-
-           /* if this is a division then the remainder should be zero 
-              for it to be inducted */
-           if (ic->op == '/' && (ip->cval % litVal))
-               continue ;
-
-           /* create the iCode to be placed in the loop header */
-           /* and create the induction object */
-           
-           /* create an instruction */
-           /* this will be put on the loop header */
-           indIc = newiCode(ic->op,
-                            operandFromOperand(aSym),
-                            operandFromLit(litVal));
-           indIc->lineno = ic->lineno;
-           IC_RESULT(indIc) = operandFromOperand(IC_RESULT(ic));
-           OP_SYMBOL(IC_RESULT(indIc))->isind = 1;
-
-           /* keep track of the inductions */
-           litVal = (ic->op == '*' ? (litVal * ip->cval) :
-                     (ip->cval / litVal));         
-
-           addSet (&indVars,
-                   newInduction (IC_RESULT(ic),ip->op,litVal,indIc,NULL)); 
-
-           /* now change this instruction */
-           ic->op = ip->op;
-           if (lr) {
-               IC_LEFT(ic) = operandFromOperand(IC_RESULT(ic));
-               IC_RIGHT(ic) = operandFromLit(litVal);
-           } else {
-               IC_RIGHT(ic) = operandFromOperand(IC_RESULT(ic));
-               IC_LEFT(ic) = operandFromLit(litVal);
-           }
-           
-           /* we need somemore initialisation code */
-           /* we subtract the litVal from itself if increment */
-           if ( ic->op == '+' ) {
-               indIc = newiCode('-',
-                                operandFromOperand(IC_RESULT(ic)),
-                                operandFromLit(litVal));
-               indIc->lineno = ic->lineno;
-               IC_RESULT(indIc) = operandFromOperand(IC_RESULT(ic));
-               
-               addSet (&indVars,
-                       newInduction (IC_RESULT(ic),ip->op,litVal,indIc,NULL)); 
-           }
-       }
-    }    
+    for ( lBlock = setFirstItem(loopReg->regBlocks), lastBlock = lBlock;
+    lBlock && indVars;
+    lBlock = setNextItem(loopReg->regBlocks)) {
+
+  iCode *ic, *indIc;
+  induction *ip;
+
+  /* last block is the one with the highest block
+     number */
+  if (lastBlock->bbnum < lBlock->bbnum )
+      lastBlock = lBlock;
+
+  for ( ic = lBlock->sch ; ic ; ic = ic->next ) {
+      operand *aSym ;
+      unsigned long litVal ;
+      int lr = 0;
+
+      /* consider only * & / */
+      if (ic->op != '*' && ic->op != '/')
+    continue ;
+
+      /* if the result has more definitions then */
+      if (assignmentsToSym(loopReg->regBlocks,IC_RESULT(ic)) > 1)
+    continue ;
+
+      /* check if the operands are what we want */
+      /* i.e. one of them an symbol the other a literal */
+      if (! ( (IS_SYMOP(IC_LEFT(ic)) && IS_OP_LITERAL(IC_RIGHT(ic))) ||
+        (IS_OP_LITERAL(IC_LEFT(ic)) && IS_SYMOP(IC_RIGHT(ic))) ))
+    continue ;
+
+      aSym = (IS_SYMOP(IC_LEFT(ic)) ?
+        (lr = 1, litVal = operandLitValue(IC_RIGHT(ic)), IC_LEFT(ic) ) :
+        (litVal= operandLitValue(IC_LEFT(ic)), IC_RIGHT(ic) ) ) ;
+
+      ip = NULL ;
+      /* check if this is an induction variable */
+      if (! applyToSetFTrue (basicInd,findInduction,aSym,&ip))
+    continue ;
+
+      /* ask port for size not worth if native instruction
+         exist for multiply & divide */
+      if (getSize(operandType(IC_LEFT(ic))) <= port->muldiv.native_below ||
+    getSize(operandType(IC_RIGHT(ic))) <= port->muldiv.native_below)
+    continue;
+
+      /* if this is a division then the remainder should be zero
+         for it to be inducted */
+      if (ic->op == '/' && (ip->cval % litVal))
+    continue ;
+
+      /* create the iCode to be placed in the loop header */
+      /* and create the induction object */
+
+      /* create an instruction */
+      /* this will be put on the loop header */
+      indIc = newiCode(ic->op,
+           operandFromOperand(aSym),
+           operandFromLit(litVal));
+      indIc->lineno = ic->lineno;
+      IC_RESULT(indIc) = operandFromOperand(IC_RESULT(ic));
+      OP_SYMBOL(IC_RESULT(indIc))->isind = 1;
+
+      /* keep track of the inductions */
+      litVal = (ic->op == '*' ? (litVal * ip->cval) :
+          (ip->cval / litVal));
+
+      addSet (&indVars,
+        newInduction (IC_RESULT(ic),ip->op,litVal,indIc,NULL));
+
+      /* now change this instruction */
+      ic->op = ip->op;
+      if (lr) {
+    IC_LEFT(ic) = operandFromOperand(IC_RESULT(ic));
+    IC_RIGHT(ic) = operandFromLit(litVal);
+      } else {
+    IC_RIGHT(ic) = operandFromOperand(IC_RESULT(ic));
+    IC_LEFT(ic) = operandFromLit(litVal);
+      }
+
+      /* we need somemore initialisation code */
+      /* we subtract the litVal from itself if increment */
+      if ( ic->op == '+' ) {
+    indIc = newiCode('-',
+         operandFromOperand(IC_RESULT(ic)),
+         operandFromLit(litVal));
+    indIc->lineno = ic->lineno;
+    IC_RESULT(indIc) = operandFromOperand(IC_RESULT(ic));
+
+    addSet (&indVars,
+      newInduction (IC_RESULT(ic),ip->op,litVal,indIc,NULL));
+      }
+  }
+    }
 
     /* if we have some induction variables then */
     if ( indVars ) {
-       eBBlock *preHdr = loopReg->entry->preHeader ;
-       iCode *icFirst = NULL , *icLast = NULL ;
-       induction *ip;  
-       bitVect *indVect = NULL;
-       
-       /* create an iCode chain from it */
-       for (ip = setFirstItem(indVars); 
-            ip ; 
-            ip = setNextItem(indVars)) {
-
-           indVect = bitVectSetBit(indVect,ip->ic->key);
-           ip->ic->lineno = preHdr->ech->lineno;
-           if (!icFirst)
-               icFirst = ip->ic;
-           if (icLast) {
-               icLast->next = ip->ic;
-               ip->ic->prev = icLast;
-               icLast = ip->ic ;
-           } else 
-               icLast = ip->ic;        
-           change++ ;      
-       }
-       
-       /* add the instruction chain to the end of the */
-       /* preheader for this loop                     */
-       preHdr->ech->next = icFirst ;
-       icFirst->prev = preHdr->ech ;
-       preHdr->ech = icLast;
-       icLast->next = NULL;            
-       
-       /* add the induction variable vector to the last
-          block in the loop */
-       lastBlock->isLastInLoop = 1;
-       lastBlock->linds = indVect;
+  eBBlock *preHdr = loopReg->entry->preHeader ;
+  iCode *icFirst = NULL , *icLast = NULL ;
+  induction *ip;
+  bitVect *indVect = NULL;
+
+  /* create an iCode chain from it */
+  for (ip = setFirstItem(indVars);
+       ip ;
+       ip = setNextItem(indVars)) {
+
+      indVect = bitVectSetBit(indVect,ip->ic->key);
+      ip->ic->lineno = preHdr->ech->lineno;
+      if (!icFirst)
+    icFirst = ip->ic;
+      if (icLast) {
+    icLast->next = ip->ic;
+    ip->ic->prev = icLast;
+    icLast = ip->ic ;
+      } else
+    icLast = ip->ic;
+      change++ ;
+  }
+
+  /* add the instruction chain to the end of the */
+  /* preheader for this loop                     */
+  preHdr->ech->next = icFirst ;
+  icFirst->prev = preHdr->ech ;
+  preHdr->ech = icLast;
+  icLast->next = NULL;
+
+  /* add the induction variable vector to the last
+     block in the loop */
+  lastBlock->isLastInLoop = 1;
+  lastBlock->linds = indVect;
     }
-    
+
     setToNull ((void **)&indVars);
-    return change ;    
+    return change ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -979,23 +979,23 @@ DEFSETFUNC(mergeRegions)
     region *theLoop = item;
     V_ARG(set*,allRegion) ;
     region *lp ;
-    
+
     /* if this has already been merged then do nothing */
     if (theLoop->merged)
-       return 0;
+  return 0;
 
     /* go thru all the region and check if any of them have the */
     /* entryPoint as the Loop                                  */
     for (lp = setFirstItem(allRegion); lp ; lp = setNextItem(allRegion)) {
 
-       if (lp == theLoop)
-           continue ;
+  if (lp == theLoop)
+      continue ;
 
-       if (lp->entry == theLoop->entry) {
-           theLoop->regBlocks = unionSets (theLoop->regBlocks,
-                                            lp->regBlocks,THROW_BOTH);
-           lp->merged = 1;
-       }
+  if (lp->entry == theLoop->entry) {
+      theLoop->regBlocks = unionSets (theLoop->regBlocks,
+               lp->regBlocks,THROW_BOTH);
+      lp->merged = 1;
+  }
     }
 
     return 1;
@@ -1020,22 +1020,22 @@ DEFSETFUNC(mergeInnerLoops)
     V_ARG(set *,allRegion);
     V_ARG(int *,maxDepth);
     region *lp;
-    
+
     /* check if the entry point is present in the body of any */
     /* loop then put the body of this loop into the outer loop*/
     for (lp = setFirstItem(allRegion); lp ; lp = setNextItem(allRegion)) {
 
-       if ( lp == theLoop )
-           continue ;
+  if ( lp == theLoop )
+      continue ;
 
-       if (isinSet(lp->regBlocks, theLoop->entry)) {
-           lp->containsLoops += theLoop->containsLoops + 1 ;
-           if ( lp->containsLoops > (*maxDepth))
-               *maxDepth = lp->containsLoops;
+  if (isinSet(lp->regBlocks, theLoop->entry)) {
+      lp->containsLoops += theLoop->containsLoops + 1 ;
+      if ( lp->containsLoops > (*maxDepth))
+    *maxDepth = lp->containsLoops;
 
-           lp->regBlocks = unionSets (lp->regBlocks,
-                                       theLoop->regBlocks,THROW_DEST);
-       }
+      lp->regBlocks = unionSets (lp->regBlocks,
+          theLoop->regBlocks,THROW_DEST);
+  }
     }
 
     return 1;
@@ -1046,8 +1046,8 @@ DEFSETFUNC(mergeInnerLoops)
 /* createLoopRegions - will detect and create a set of natural loops */
 /*-----------------------------------------------------------------*/
 hTab *createLoopRegions (eBBlock **ebbs , int count  )
-{   
-    set *allRegion  = NULL; /* set of all loops */       
+{
+    set *allRegion  = NULL; /* set of all loops */
     hTab *orderedLoops = NULL ;
     set *bEdges = NULL;
     int maxDepth = 0;
@@ -1055,7 +1055,7 @@ hTab *createLoopRegions (eBBlock **ebbs , int count  )
 
     /* get all the back edges in the graph */
     if (! applyToSet(graphEdges,backEdges,&bEdges))
-       return 0 ; /* found no loops */
+  return 0 ; /* found no loops */
 
     /* for each of these back edges get the blocks that */
     /* constitute the loops                             */
@@ -1065,7 +1065,7 @@ hTab *createLoopRegions (eBBlock **ebbs , int count  )
     /* loops with the same entry points are considered to be the */
     /* same loop & they are merged. If the entry point of a loop */
     /* is found in the body of another loop then , all the blocks*/
-    /* in that loop are added to the loops containing the header */    
+    /* in that loop are added to the loops containing the header */
     applyToSet(allRegion, mergeRegions , allRegion);
 
     /* delete those already merged */
@@ -1075,13 +1075,13 @@ hTab *createLoopRegions (eBBlock **ebbs , int count  )
     maxDepth++;
     /* now create all the exits .. also */
     /* create an ordered set of loops   */
-    /* i.e. we process loops in the inner to outer order */    
+    /* i.e. we process loops in the inner to outer order */
     for (lp = setFirstItem(allRegion) ; lp ; lp = setNextItem(allRegion)) {
-       applyToSet (lp->regBlocks,addToExitsMarkDepth,
-                   lp->regBlocks,&lp->exits,
-                   (maxDepth - lp->containsLoops),lp);
-       
-       hTabAddItem (&orderedLoops,lp->containsLoops,lp);       
+  applyToSet (lp->regBlocks,addToExitsMarkDepth,
+        lp->regBlocks,&lp->exits,
+        (maxDepth - lp->containsLoops),lp);
+
+  hTabAddItem (&orderedLoops,lp->containsLoops,lp);
 
     }
     return orderedLoops ;
@@ -1099,22 +1099,22 @@ int loopOptimizations (hTab *orderedLoops, eBBlock **ebbs, int count)
 
     /* if no loop optimizations requested */
     if (! optimize.loopInvariant &&
-       ! optimize.loopInduction )
-       return 0;
+  ! optimize.loopInduction )
+  return 0;
 
     /* now we process the loops inner to outer order */
     /* this is essential to maintain data flow information */
     /* the other choice is an ugly iteration for the depth */
     /* of the loops would hate that */
-    for ( lp = hTabFirstItem(orderedLoops,&k); lp ; 
-         lp = hTabNextItem(orderedLoops,&k)) {
-       
-       if (optimize.loopInvariant) 
-           change += loopInvariants(lp, ebbs, count);       
-       
-       if (optimize.loopInduction)
-           change += loopInduction(lp, ebbs, count);
+    for ( lp = hTabFirstItem(orderedLoops,&k); lp ;
+    lp = hTabNextItem(orderedLoops,&k)) {
+
+  if (optimize.loopInvariant)
+      change += loopInvariants(lp, ebbs, count);
+
+  if (optimize.loopInduction)
+      change += loopInduction(lp, ebbs, count);
     }
-        
+
     return change;
 }
index 69cfb2ebf09066c2c02cea4182dd54bb33a7e384..6ba9eec875c339788d2528bd22236971dc2cabc0 100644 (file)
@@ -1,5 +1,5 @@
 /*-------------------------------------------------------------------------
-  SDCCmain.c - main file               
+  SDCCmain.c - main file
 
              Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1999)
 
@@ -7,19 +7,19 @@
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 //#define USE_SYSTEM_SYSTEM_CALLS
@@ -55,7 +55,7 @@ FILE  *cdbFile = NULL  ;/* debugger information output file */
 char  *fullSrcFileName ;/* full name for the source file */
 char  *srcFileName     ;/* source file name with the .c stripped */
 char  *moduleName      ;/* module name is srcFilename stripped of any path */
-const char *preArgv[128]          ;/* pre-processor arguments  */
+const char *preArgv[128]     ;/* pre-processor arguments  */
 int   currRegBank = 0 ;
 struct optimize optimize ;
 struct options  options ;
@@ -125,7 +125,7 @@ char DefaultExePath[_MAX_PATH] ;
 #define OPTION_NOPEEP      "-no-peep"
 #define OPTION_ASMPEEP     "-peep-asm"
 #define OPTION_DEBUG       "-debug"
-#define OPTION_NODEBUG    "-nodebug"
+#define OPTION_NODEBUG     "-nodebug"
 #define OPTION_VERSION     "-version"
 #define OPTION_STKAFTRDATA "-stack-after-data"
 #define OPTION_PREPROC_ONLY "-preprocessonly"
@@ -136,9 +136,9 @@ char DefaultExePath[_MAX_PATH] ;
 #define OPTION_NOSTDLIB     "-nostdlib"
 #define OPTION_NOSTDINC     "-nostdinc"
 #define OPTION_VERBOSE      "-verbose"
-#define OPTION_ANSIINT     "-ansiint"
+#define OPTION_ANSIINT      "-ansiint"
 static const char *_preCmd[] = {
-    "sdcpp", "-Wall", "-lang-c++", "-DSDCC=1", 
+    "sdcpp", "-Wall", "-lang-c++", "-DSDCC=1",
     "$l", "-I" SDCC_INCLUDE_DIR, "$1", "$2", NULL
 };
 
@@ -179,17 +179,17 @@ static PORT *_ports[] = {
 extern void             pic14glue();
 
 /** Sets the port to the one given by the command line option.
-    @param             The name minus the option (eg 'mcs51')
-    @return            0 on success.
+    @param    The name minus the option (eg 'mcs51')
+    @return     0 on success.
 */
 static int _setPort(const char *name)
 {
     int i;
     for (i=0; i<NUM_PORTS; i++) {
-       if (!strcmp(_ports[i]->target, name)) {
-           port = _ports[i];
-           return 0;
-       }
+  if (!strcmp(_ports[i]->target, name)) {
+      port = _ports[i];
+      return 0;
+  }
     }
     /* Error - didnt find */
     werror(E_UNKNOWN_TARGET,name);
@@ -200,17 +200,17 @@ static void _validatePorts(void)
 {
     int i;
     for (i=0; i<NUM_PORTS; i++) {
-       if (_ports[i]->magic != PORT_MAGIC) {
-           printf("Error: port %s is incomplete.\n", _ports[i]->target);
-           wassert(0);
-       }
+  if (_ports[i]->magic != PORT_MAGIC) {
+      printf("Error: port %s is incomplete.\n", _ports[i]->target);
+      wassert(0);
+  }
     }
 }
 
 #ifdef USE_SYSTEM_SYSTEM_CALLS
-void buildCmdLine(char *into, const char **cmds, 
-                         const char *p1, const char *p2, 
-                         const char *p3, const char **list)
+void buildCmdLine(char *into, const char **cmds,
+        const char *p1, const char *p2,
+        const char *p3, const char **list)
 {
     const char *p, *from;
 
@@ -218,170 +218,170 @@ void buildCmdLine(char *into, const char **cmds,
 
     while (*cmds) {
 
-       from = *cmds;
-       cmds++;
-
-       /* See if it has a '$' anywhere - if not, just copy */
-       if ((p = strchr(from, '$'))) {
-           strncat(into, from, p - from);
-           /* seperate it */
-           strcat(into, " ");
-           from = p+2;
-           p++;
-           switch (*p) {
-           case '1':
-               if (p1)
-                   strcat(into, p1);
-               break;
-           case '2':
-               if (p2)
-                   strcat(into, p2);
-               break;
-           case '3':
-               if (p3)
-                   strcat(into, p3);
-               break;
-           case 'l': {
-               const char **tmp = list;
-               if (tmp) {
-                   while (*tmp) {
-                       strcat(into, *tmp);
-                       strcat(into, " ");
-                       tmp++;
-                   }
-               }
-               break;
-           }
-           default:
-               assert(0);
-           }
-       }
-       strcat(into, from); // this includes the ".asm" from "$1.asm"
-       strcat(into, " ");
+  from = *cmds;
+  cmds++;
+
+  /* See if it has a '$' anywhere - if not, just copy */
+  if ((p = strchr(from, '$'))) {
+      strncat(into, from, p - from);
+      /* seperate it */
+      strcat(into, " ");
+      from = p+2;
+      p++;
+      switch (*p) {
+      case '1':
+    if (p1)
+        strcat(into, p1);
+    break;
+      case '2':
+    if (p2)
+        strcat(into, p2);
+    break;
+      case '3':
+    if (p3)
+        strcat(into, p3);
+    break;
+      case 'l': {
+    const char **tmp = list;
+    if (tmp) {
+        while (*tmp) {
+      strcat(into, *tmp);
+      strcat(into, " ");
+      tmp++;
+        }
+    }
+    break;
+      }
+      default:
+    assert(0);
+      }
+  }
+  strcat(into, from); // this includes the ".asm" from "$1.asm"
+  strcat(into, " ");
     }
 }
 #else
-void buildCmdLine(char *into, char **args, const char **cmds, 
-                         const char *p1, const char *p2, 
-                         const char *p3, const char **list)
+void buildCmdLine(char *into, char **args, const char **cmds,
+        const char *p1, const char *p2,
+        const char *p3, const char **list)
 {
     const char *p, *from;
 
     while (*cmds) {
-       *args = into;
-       args++;
-
-       from = *cmds;
-       cmds++;
-       *into = '\0';
-
-       /* See if it has a '$' anywhere - if not, just copy */
-       if ((p = strchr(from, '$'))) {
-           strncpy(into, from, p - from);
-           /* NULL terminate it */
-           into[p-from] = '\0';
-           from = p+2;
-           p++;
-           switch (*p) {
-           case '1':
-               if (p1)
-                   strcat(into, p1);
-               break;
-           case '2':
-               if (p2)
-                   strcat(into, p2);
-               break;
-           case '3':
-               if (p3)
-                   strcat(into, p3);
-               break;
-           case 'l': {
-               const char **tmp = list;
-               if (tmp) {
-                   while (*tmp) {
-                       strcpy(into, *tmp);
-                       into += strlen(into)+1;
-                       *args = into;
-                       args++;
-                       tmp++;
-                   }
-               }
-               break;
-           }
-           default:
-               assert(0);
-           }
-       }
-       strcat(into, from);
-       if (strlen(into) == 0)
-           args--;
-       into += strlen(into)+1;
+  *args = into;
+  args++;
+
+  from = *cmds;
+  cmds++;
+  *into = '\0';
+
+  /* See if it has a '$' anywhere - if not, just copy */
+  if ((p = strchr(from, '$'))) {
+      strncpy(into, from, p - from);
+      /* NULL terminate it */
+      into[p-from] = '\0';
+      from = p+2;
+      p++;
+      switch (*p) {
+      case '1':
+    if (p1)
+        strcat(into, p1);
+    break;
+      case '2':
+    if (p2)
+        strcat(into, p2);
+    break;
+      case '3':
+    if (p3)
+        strcat(into, p3);
+    break;
+      case 'l': {
+    const char **tmp = list;
+    if (tmp) {
+        while (*tmp) {
+      strcpy(into, *tmp);
+      into += strlen(into)+1;
+      *args = into;
+      args++;
+      tmp++;
+        }
+    }
+    break;
+      }
+      default:
+    assert(0);
+      }
+  }
+  strcat(into, from);
+  if (strlen(into) == 0)
+      args--;
+  into += strlen(into)+1;
     }
     *args = NULL;
 }
 #endif
 
 /*-----------------------------------------------------------------*/
-/* printVersionInfo - prints the version info                     */
+/* printVersionInfo - prints the version info        */
 /*-----------------------------------------------------------------*/
-void   printVersionInfo ()
+void  printVersionInfo ()
 {
     int i;
-    
+
     fprintf (stderr,
-            "SDCC : ");
+       "SDCC : ");
     for (i=0; i<NUM_PORTS; i++)
-       fprintf(stderr, "%s%s", i==0 ? "" : "/", _ports[i]->target);
+  fprintf(stderr, "%s%s", i==0 ? "" : "/", _ports[i]->target);
     fprintf(stderr, " %s"
 #ifdef SDCC_SUB_VERSION_STR
-           "/" SDCC_SUB_VERSION_STR
+      "/" SDCC_SUB_VERSION_STR
 #endif
-           " ` "
+      " ` "
 #ifdef __CYGWIN32__
-               " (CYGWIN32)\n"
+    " (CYGWIN32)\n"
 #else
 # ifdef __DJGPP__
-               " (DJGPP) \n"
+    " (DJGPP) \n"
 # else
-               " (UNIX) \n"
+    " (UNIX) \n"
 # endif
 #endif
 
-           , VersionString
-           );
+      , VersionString
+      );
 }
 
 /*-----------------------------------------------------------------*/
-/* printUsage - prints command line syntax                        */
+/* printUsage - prints command line syntax         */
 /*-----------------------------------------------------------------*/
-void   printUsage ()
+void  printUsage ()
 {
-       printVersionInfo ();
-       fprintf (stderr,
-                "Usage : [options] filename\n"
-                "Options :-\n"
-                "\t-m<proc>             -     Target processor <proc>.  Default %s\n"
-                "\t                           Try --version for supported values of <proc>\n"
-                "\t--model-large        -     Large Model\n"
-                "\t--model-small        -     Small Model (default)\n"
-                "\t--stack-auto         -     Stack automatic variables\n"
-                "\t--xstack             -     Use external stack\n"
-                "\t--xram-loc <nnnn>    -     External Ram start location\n"
-                "\t--xstack-loc <nnnn>  -     Xternal Stack Location\n"
-                "\t--code-loc <nnnn>    -     Code Segment Location\n"
-                "\t--stack-loc <nnnn>   -     Stack pointer initial value\n"
-                "\t--data-loc <nnnn>    -     Direct data start location\n"
-                "\t--idata-loc <nnnn>   -     Indirect data start location\n"
-                "\t--iram-size <nnnn>   -     Internal Ram size\n"
-                "\t--nojtbound          -     Don't generate boundary check for jump tables\n"
-                "\t--generic            -     All unqualified ptrs converted to '_generic'\n"
-                "PreProcessor Options :-\n"
-                "\t-Dmacro             -       Define Macro\n"          
-                "\t-Ipath              -       Include \"*.h\" path\n"
-                "Note: this is NOT a complete list of options see docs for details\n",
-                _ports[0]->target
-                );             
-       exit (0);
+  printVersionInfo ();
+  fprintf (stderr,
+     "Usage : [options] filename\n"
+     "Options :-\n"
+     "\t-m<proc>             -     Target processor <proc>.  Default %s\n"
+     "\t                           Try --version for supported values of <proc>\n"
+     "\t--model-large        -     Large Model\n"
+     "\t--model-small        -     Small Model (default)\n"
+     "\t--stack-auto         -     Stack automatic variables\n"
+     "\t--xstack             -     Use external stack\n"
+     "\t--xram-loc <nnnn>    -     External Ram start location\n"
+     "\t--xstack-loc <nnnn>  -     Xternal Stack Location\n"
+     "\t--code-loc <nnnn>    -     Code Segment Location\n"
+     "\t--stack-loc <nnnn>   -     Stack pointer initial value\n"
+     "\t--data-loc <nnnn>    -     Direct data start location\n"
+     "\t--idata-loc <nnnn>   -     Indirect data start location\n"
+     "\t--iram-size <nnnn>   -     Internal Ram size\n"
+     "\t--nojtbound          -     Don't generate boundary check for jump tables\n"
+     "\t--generic            -     All unqualified ptrs converted to '_generic'\n"
+     "PreProcessor Options :-\n"
+     "\t-Dmacro   - Define Macro\n"
+     "\t-Ipath    - Include \"*.h\" path\n"
+     "Note: this is NOT a complete list of options see docs for details\n",
+     _ports[0]->target
+     );
+  exit (0);
 }
 
 /*-----------------------------------------------------------------*/
@@ -390,20 +390,20 @@ void      printUsage ()
 void parseWithComma (char **dest,char *src)
 {
     int i = 0;
-    
+
     strtok(src,"\n \t");
     /* skip the initial white spaces */
     while (isspace(*src)) src++;
     dest[i++] = src;
     while (*src) {
-       if (*src == ',') {
-           *src = '\0';
-           src++;
-           if (*src)
-               dest[i++] = src;
-           continue ;
-       }
-       src++;
+  if (*src == ',') {
+      *src = '\0';
+      src++;
+      if (*src)
+    dest[i++] = src;
+      continue ;
+  }
+  src++;
     }
 }
 
@@ -415,9 +415,9 @@ static void setDefaultOptions()
     int i ;
 
     for ( i = 0 ; i < 128 ; i++)
-       preArgv[i] = asmOptions [i] =
-           linkOptions[i] = relFiles[i] = libFiles[i] =
-           libPaths[i] = NULL ;
+  preArgv[i] = asmOptions [i] =
+      linkOptions[i] = relFiles[i] = libFiles[i] =
+      libPaths[i] = NULL ;
 
     /* first the options part */
     options.stack_loc = 0; /* stack pointer initialised to 0 */
@@ -435,11 +435,11 @@ static void setDefaultOptions()
 
     /* now for the optimizations */
     /* turn on the everything */
-    optimize.global_cse = 1;    
+    optimize.global_cse = 1;
     optimize.label1 = 1;
     optimize.label2 = 1;
     optimize.label3 = 1;
-    optimize.label4 = 1;    
+    optimize.label4 = 1;
     optimize.loopInvariant = 1;
     optimize.loopInduction = 1;
 
@@ -452,88 +452,88 @@ static void setDefaultOptions()
 static void processFile (char *s)
 {
     char *fext = NULL;
-    
+
     /* get the file extension */
     fext = s + strlen(s);
     while ((fext != s) && *fext != '.') fext--;
-    
+
     /* now if no '.' then we don't know what the file type is
        so give a warning and return */
     if (fext == s) {
-       werror(W_UNKNOWN_FEXT,s);
-       return ;
+  werror(W_UNKNOWN_FEXT,s);
+  return ;
     }
 
     /* otherwise depending on the file type */
     if (strcmp(fext,".c") == 0 || strcmp(fext,".C") == 0 || options.c1mode) {
-       /* source file name : not if we already have a 
-          source file */
-       if (srcFileName) {
-           werror(W_TOO_MANY_SRC,s);
-           return ;
-       }
-
-       /* the only source file */       
-       if (!(srcFile = fopen((fullSrcFileName = s),"r"))) {
-           werror(E_FILE_OPEN_ERR,s);
-           exit (1);
-       }
-       
-       /* copy the file name into the buffer */
-       strcpy(buffer,s);
-       
-       /* get rid of the "." */
-       strtok(buffer,".");
-       srcFileName = Safe_calloc(strlen(buffer)+1);
-       strcpy(srcFileName,buffer);
-
-       /* get rid of any path information 
-          for the module name; do this by going
-          backwards till we get to either '/' or '\' or ':'
-          or start of buffer */
-       fext = buffer + strlen(buffer);
-       while (fext != buffer && 
-              *(fext -1) != '\\'  &&
-              *(fext-1) != '/'   &&
-              *(fext-1) != ':')
-           fext--;
-       moduleName = Safe_calloc(strlen(fext)+1);
-       strcpy(moduleName,fext);
-       
-       return ;
+  /* source file name : not if we already have a
+     source file */
+  if (srcFileName) {
+      werror(W_TOO_MANY_SRC,s);
+      return ;
+  }
+
+  /* the only source file */
+  if (!(srcFile = fopen((fullSrcFileName = s),"r"))) {
+      werror(E_FILE_OPEN_ERR,s);
+      exit (1);
+  }
+
+  /* copy the file name into the buffer */
+  strcpy(buffer,s);
+
+  /* get rid of the "." */
+  strtok(buffer,".");
+  srcFileName = Safe_calloc(1,strlen(buffer)+1);
+  strcpy(srcFileName,buffer);
+
+  /* get rid of any path information
+     for the module name; do this by going
+     backwards till we get to either '/' or '\' or ':'
+     or start of buffer */
+  fext = buffer + strlen(buffer);
+  while (fext != buffer &&
+         *(fext -1) != '\\'  &&
+         *(fext-1) != '/'   &&
+         *(fext-1) != ':')
+      fext--;
+  moduleName = Safe_calloc(1,strlen(fext)+1);
+  strcpy(moduleName,fext);
+
+  return ;
     }
 
-    /* if the extention is type .rel or .r or .REL or .R 
+    /* if the extention is type .rel or .r or .REL or .R
        addtional object file will be passed to the linker */
     if (strcmp(fext,".r") == 0 || strcmp(fext,".rel") == 0 ||
-       strcmp(fext,".R") == 0 || strcmp(fext,".REL") == 0 ||
-       strcmp(fext, port->linker.rel_ext) == 0)
-       {
-       relFiles[nrelFiles++] = s;
-       return ;
+  strcmp(fext,".R") == 0 || strcmp(fext,".REL") == 0 ||
+  strcmp(fext, port->linker.rel_ext) == 0)
+  {
+  relFiles[nrelFiles++] = s;
+  return ;
     }
 
     /* if .lib or .LIB */
     if (strcmp(fext,".lib") == 0 || strcmp(fext,".LIB") == 0) {
-       libFiles[nlibFiles++] = s;
-       return;
+  libFiles[nlibFiles++] = s;
+  return;
     }
 
     werror(W_UNKNOWN_FEXT,s);
-  
+
 }
 
 static void _processC1Arg(char *s)
 {
     if (srcFileName) {
-       if (options.out_name) {
-           werror(W_TOO_MANY_SRC,s);
-           return;
-       }
-       options.out_name = strdup(s);
+  if (options.out_name) {
+      werror(W_TOO_MANY_SRC,s);
+      return;
+  }
+  options.out_name = strdup(s);
     }
     else {
-       processFile(s);
+  processFile(s);
     }
 }
 
@@ -541,11 +541,11 @@ static void _addToList(const char **list, const char *str)
 {
     /* This is the bad way to do things :) */
     while (*list)
-       list++;
+  list++;
     *list = strdup(str);
     if (!*list) {
-       werror(E_OUT_OF_MEM,__FILE__, 0);
-       exit (1);
+  werror(E_OUT_OF_MEM,__FILE__, 0);
+  exit (1);
     }
     *(++list) = NULL;
 }
@@ -553,9 +553,9 @@ static void _addToList(const char **list, const char *str)
 static void _setModel(int model, const char *sz)
 {
     if (port->general.supported_models & model)
-       options.model = model;
+  options.model = model;
     else
-       werror(W_UNSUPPORTED_MODEL, sz, port->target);
+  werror(W_UNSUPPORTED_MODEL, sz, port->target);
 }
 
 /*-----------------------------------------------------------------*/
@@ -563,581 +563,581 @@ static void _setModel(int model, const char *sz)
 /*-----------------------------------------------------------------*/
 int   parseCmdLine ( int argc, char **argv )
 {
-    int i ;      
+    int i ;
     char cdbfnbuf[50];
 
-    /* go thru all whole command line  */
+    /* go thru all whole command line */
     for ( i = 1; i < argc; i++ ) {
-       if ( i >= argc )
-           break ;
-
-       /* options */
-       if (argv[i][0] == '-' && argv[i][1] == '-') {
-           
-           if (strcmp(&argv[i][1],OPTION_HELP) == 0) {
-               printUsage();
+  if ( i >= argc )
+      break ;
+
+  /* options */
+  if (argv[i][0] == '-' && argv[i][1] == '-') {
+
+      if (strcmp(&argv[i][1],OPTION_HELP) == 0) {
+    printUsage();
                 exit(0);
-           }       
+      }
 
-           if (strcmp(&argv[i][1],OPTION_XREGS) == 0) {
-               options.regExtend = 1;
+      if (strcmp(&argv[i][1],OPTION_XREGS) == 0) {
+    options.regExtend = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_LARGE_MODEL) == 0) {
-               _setModel(MODEL_LARGE, argv[i]);
+      if (strcmp(&argv[i][1],OPTION_LARGE_MODEL) == 0) {
+    _setModel(MODEL_LARGE, argv[i]);
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_MEDIUM_MODEL) == 0) {
-               _setModel(MODEL_MEDIUM, argv[i]);
+      if (strcmp(&argv[i][1],OPTION_MEDIUM_MODEL) == 0) {
+    _setModel(MODEL_MEDIUM, argv[i]);
                 continue;
-           }
-           
-           if (strcmp(&argv[i][1],OPTION_SMALL_MODEL) == 0) {
-               _setModel(MODEL_SMALL, argv[i]);
+      }
+
+      if (strcmp(&argv[i][1],OPTION_SMALL_MODEL) == 0) {
+    _setModel(MODEL_SMALL, argv[i]);
                 continue;
-           }
-           
-           if (strcmp(&argv[i][1],OPTION_FLAT24_MODEL) == 0) {
-               _setModel(MODEL_FLAT24, argv[i]);
+      }
+
+      if (strcmp(&argv[i][1],OPTION_FLAT24_MODEL) == 0) {
+    _setModel(MODEL_FLAT24, argv[i]);
                 continue;
-           }
-           
-           if (strcmp(&argv[i][1],OPTION_STACK_10BIT) == 0) {
-               options.stack10bit = 1;
-               continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_STACK_AUTO) == 0) {
-               options.stackAuto = 1;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_STACK_10BIT) == 0) {
+        options.stack10bit = 1;
+        continue;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_STACK_AUTO) == 0) {
+    options.stackAuto = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_DUMP_RAW) == 0) {
-               options.dump_raw = 1;
+      if (strcmp(&argv[i][1],OPTION_DUMP_RAW) == 0) {
+    options.dump_raw = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_CYCLOMATIC) == 0) {
-               options.cyclomatic = 1;
+      if (strcmp(&argv[i][1],OPTION_CYCLOMATIC) == 0) {
+    options.cyclomatic = 1;
                 continue;
-           }
-           
-           if (strcmp(&argv[i][1],OPTION_DUMP_GCSE) == 0) {
-               options.dump_gcse = 1;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_DUMP_GCSE) == 0) {
+    options.dump_gcse = 1;
                 continue;
-           }
-           
-           if (strcmp(&argv[i][1],OPTION_DUMP_LOOP) == 0) {
-               options.dump_loop = 1;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_DUMP_LOOP) == 0) {
+    options.dump_loop = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_DUMP_KILL) == 0) {
-               options.dump_kill = 1;
+      if (strcmp(&argv[i][1],OPTION_DUMP_KILL) == 0) {
+    options.dump_kill = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_INTLONG_RENT) == 0) {
-               options.intlong_rent = 1;
+      if (strcmp(&argv[i][1],OPTION_INTLONG_RENT) == 0) {
+    options.intlong_rent = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_FLOAT_RENT) == 0) {
-               options.float_rent = 1;
+      if (strcmp(&argv[i][1],OPTION_FLOAT_RENT) == 0) {
+    options.float_rent = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_DUMP_RANGE) == 0) {
-               options.dump_range = 1;
+      if (strcmp(&argv[i][1],OPTION_DUMP_RANGE) == 0) {
+    options.dump_range = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_DUMP_PACK) == 0) {
-               options.dump_pack = 1;
+      if (strcmp(&argv[i][1],OPTION_DUMP_PACK) == 0) {
+    options.dump_pack = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_DUMP_RASSGN) == 0) {
-               options.dump_rassgn = 1;
+      if (strcmp(&argv[i][1],OPTION_DUMP_RASSGN) == 0) {
+    options.dump_rassgn = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_OUT_FMT_IHX) == 0) {
-               options.out_fmt = 0;
+      if (strcmp(&argv[i][1],OPTION_OUT_FMT_IHX) == 0) {
+    options.out_fmt = 0;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_OUT_FMT_S19) == 0) {
-               options.out_fmt = 1;
+      if (strcmp(&argv[i][1],OPTION_OUT_FMT_S19) == 0) {
+    options.out_fmt = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_NOOVERLAY) == 0) {
-               options.noOverlay = 1;
+      if (strcmp(&argv[i][1],OPTION_NOOVERLAY) == 0) {
+    options.noOverlay = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_STKAFTRDATA) == 0) {
-               options.stackOnData = 1;
+      if (strcmp(&argv[i][1],OPTION_STKAFTRDATA) == 0) {
+    options.stackOnData = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_PREPROC_ONLY) == 0) {
-               preProcOnly = 1;
+      if (strcmp(&argv[i][1],OPTION_PREPROC_ONLY) == 0) {
+    preProcOnly = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_C1_MODE) == 0) {
-               options.c1mode = 1;
+      if (strcmp(&argv[i][1],OPTION_C1_MODE) == 0) {
+    options.c1mode = 1;
                 continue;
-           }
+      }
+
 
-           
-           if (strcmp(&argv[i][1],OPTION_DUMP_ALL) == 0) {
-               options.dump_rassgn = 
+      if (strcmp(&argv[i][1],OPTION_DUMP_ALL) == 0) {
+    options.dump_rassgn =
                 options.dump_pack   =
-                options.dump_range  = 
-                options.dump_kill   = 
-                options.dump_loop   = 
-                options.dump_gcse   = 
+                options.dump_range  =
+                options.dump_kill   =
+                options.dump_loop   =
+                options.dump_gcse   =
                 options.dump_raw    = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_COMP_ONLY) == 0) {
-               options.cc_only = 1;
+      if (strcmp(&argv[i][1],OPTION_COMP_ONLY) == 0) {
+    options.cc_only = 1;
                 continue;
-           }
-   
-           if (strcmp(&argv[i][1],OPTION_GENERIC) == 0) {
-               options.genericPtr = 1;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_GENERIC) == 0) {
+    options.genericPtr = 1;
                 continue;
-           }
-           
-           if (strcmp(&argv[i][1],OPTION_NOPEEP) == 0) {
-               options.nopeep = 1;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_NOPEEP) == 0) {
+    options.nopeep = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_ASMPEEP) == 0) {
-               options.asmpeep = 1;
+      if (strcmp(&argv[i][1],OPTION_ASMPEEP) == 0) {
+    options.asmpeep = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_DEBUG) == 0) {
-               options.debug = 1;              
+      if (strcmp(&argv[i][1],OPTION_DEBUG) == 0) {
+    options.debug = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_NODEBUG) == 0) {
-               options.nodebug = 1;            
+      if (strcmp(&argv[i][1],OPTION_NODEBUG) == 0) {
+    options.nodebug = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_NOREGPARMS) == 0) {
-               options.noregparms = 1;         
+      if (strcmp(&argv[i][1],OPTION_NOREGPARMS) == 0) {
+    options.noregparms = 1;
                 continue;
-           }
-           
-           if (strcmp(&argv[i][1],OPTION_PEEP_FILE) == 0) {
-               if (argv[i][1+strlen(OPTION_PEEP_FILE)]) 
-                   options.peep_file = 
-                       &argv[i][1+strlen(OPTION_PEEP_FILE)];
-               else
-                   options.peep_file = argv[++i];
-               continue ;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_LIB_PATH) == 0) {
-               if (argv[i][1+strlen(OPTION_LIB_PATH)]) 
-                   libPaths[nlibPaths++] = 
-                       &argv[i][1+strlen(OPTION_PEEP_FILE)];
-               else
-                   libPaths[nlibPaths++] = argv[++i];
-               continue ;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_XSTACK_LOC) == 0) {
-               
-               if (argv[i][1+strlen(OPTION_XSTACK_LOC)])
-                   options.xstack_loc = 
-                       (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_XSTACK_LOC)]));
-                   else
-                       options.xstack_loc = 
-                           (int) floatFromVal(constVal(argv[++i]));
-               continue ;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_XSTACK) == 0) {
-               options.useXstack = 1;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_PEEP_FILE) == 0) {
+    if (argv[i][1+strlen(OPTION_PEEP_FILE)])
+        options.peep_file =
+      &argv[i][1+strlen(OPTION_PEEP_FILE)];
+    else
+        options.peep_file = argv[++i];
+    continue ;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_LIB_PATH) == 0) {
+    if (argv[i][1+strlen(OPTION_LIB_PATH)])
+        libPaths[nlibPaths++] =
+      &argv[i][1+strlen(OPTION_PEEP_FILE)];
+    else
+        libPaths[nlibPaths++] = argv[++i];
+    continue ;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_XSTACK_LOC) == 0) {
+
+    if (argv[i][1+strlen(OPTION_XSTACK_LOC)])
+        options.xstack_loc =
+      (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_XSTACK_LOC)]));
+        else
+      options.xstack_loc =
+          (int) floatFromVal(constVal(argv[++i]));
+    continue ;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_XSTACK) == 0) {
+    options.useXstack = 1;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_MAINRETURN) == 0) {
-               options.mainreturn = 1;
+      if (strcmp(&argv[i][1],OPTION_MAINRETURN) == 0) {
+    options.mainreturn = 1;
                 continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_CALLEE_SAVES) == 0) {
-               if (argv[i][1+strlen(OPTION_CALLEE_SAVES)])
-                   parseWithComma(options.calleeSaves
-                                  ,&argv[i][1+strlen(OPTION_CALLEE_SAVES)]);
-               else
-                   parseWithComma(options.calleeSaves,argv[++i]);
+      }
+
+      if (strcmp(&argv[i][1],OPTION_CALLEE_SAVES) == 0) {
+    if (argv[i][1+strlen(OPTION_CALLEE_SAVES)])
+        parseWithComma(options.calleeSaves
+           ,&argv[i][1+strlen(OPTION_CALLEE_SAVES)]);
+    else
+        parseWithComma(options.calleeSaves,argv[++i]);
                 continue;
-           }
-           
-           if (strcmp(&argv[i][1],OPTION_STACK_LOC) == 0) {
-               
-               if (argv[i][1+strlen(OPTION_STACK_LOC)])
-                   options.stack_loc = 
-                       (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_STACK_LOC)]));
-                   else
-                       options.stack_loc = 
-                           (int) floatFromVal(constVal(argv[++i]));
-               continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_XRAM_LOC) == 0) {
-               
-               if (argv[i][1+strlen(OPTION_XRAM_LOC)])
-                   options.xdata_loc = 
-                       (unsigned int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_XRAM_LOC)]));
-                   else
-                       options.xdata_loc = 
-                           (unsigned int) floatFromVal(constVal(argv[++i]));
-               continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_IRAM_SIZE) == 0) {
-               
-               if (argv[i][1+strlen(OPTION_IRAM_SIZE)])
-                   options.iram_size = 
-                       (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_IRAM_SIZE)]));
-                   else
-                       options.iram_size = 
-                           (int) floatFromVal(constVal(argv[++i]));
-               continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_VERSION) == 0) {              
-               printVersionInfo();
-               exit(0);
-               continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_DATA_LOC) == 0) {
-               
-               if (argv[i][1+strlen(OPTION_DATA_LOC)])
-                   options.data_loc = 
-                       (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_DATA_LOC)]));
-                   else
-                       options.data_loc = 
-                           (int) floatFromVal(constVal(argv[++i]));
-               continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_IDATA_LOC) == 0) {
-               
-               if (argv[i][1+strlen(OPTION_IDATA_LOC)])
-                   options.idata_loc = 
-                       (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_IDATA_LOC)]));
-                   else
-                       options.idata_loc = 
-                           (int) floatFromVal(constVal(argv[++i]));
-               continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_CODE_LOC) == 0) {
-               
-               if (argv[i][1+strlen(OPTION_CODE_LOC)])
-                   options.code_loc = 
-                       (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_CODE_LOC)]));
-                   else
-                       options.code_loc = 
-                           (int) floatFromVal(constVal(argv[++i]));
-               continue;
-           }
-
-           
-           if (strcmp(&argv[i][1],OPTION_NO_JTBOUND) == 0) {
-               optimize.noJTabBoundary = 1;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_STACK_LOC) == 0) {
+
+    if (argv[i][1+strlen(OPTION_STACK_LOC)])
+        options.stack_loc =
+      (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_STACK_LOC)]));
+        else
+      options.stack_loc =
+          (int) floatFromVal(constVal(argv[++i]));
+    continue;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_XRAM_LOC) == 0) {
+
+    if (argv[i][1+strlen(OPTION_XRAM_LOC)])
+        options.xdata_loc =
+      (unsigned int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_XRAM_LOC)]));
+        else
+      options.xdata_loc =
+          (unsigned int) floatFromVal(constVal(argv[++i]));
+    continue;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_IRAM_SIZE) == 0) {
+
+    if (argv[i][1+strlen(OPTION_IRAM_SIZE)])
+        options.iram_size =
+      (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_IRAM_SIZE)]));
+        else
+      options.iram_size =
+          (int) floatFromVal(constVal(argv[++i]));
+    continue;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_VERSION) == 0) {
+    printVersionInfo();
+    exit(0);
+    continue;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_DATA_LOC) == 0) {
+
+    if (argv[i][1+strlen(OPTION_DATA_LOC)])
+        options.data_loc =
+      (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_DATA_LOC)]));
+        else
+      options.data_loc =
+          (int) floatFromVal(constVal(argv[++i]));
+    continue;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_IDATA_LOC) == 0) {
+
+    if (argv[i][1+strlen(OPTION_IDATA_LOC)])
+        options.idata_loc =
+      (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_IDATA_LOC)]));
+        else
+      options.idata_loc =
+          (int) floatFromVal(constVal(argv[++i]));
+    continue;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_CODE_LOC) == 0) {
+
+    if (argv[i][1+strlen(OPTION_CODE_LOC)])
+        options.code_loc =
+      (int) floatFromVal(constVal(&argv[i][1+strlen(OPTION_CODE_LOC)]));
+        else
+      options.code_loc =
+          (int) floatFromVal(constVal(argv[++i]));
+    continue;
+      }
+
+
+      if (strcmp(&argv[i][1],OPTION_NO_JTBOUND) == 0) {
+    optimize.noJTabBoundary = 1;
                 continue;
-           }
-           if (strcmp(&argv[i][1],OPTION_NO_GCSE) == 0) {
-               optimize.global_cse = 0;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_NO_GCSE) == 0) {
+    optimize.global_cse = 0;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_NO_LOOP_INV) == 0) {
-               optimize.loopInvariant = 0;
+      if (strcmp(&argv[i][1],OPTION_NO_LOOP_INV) == 0) {
+    optimize.loopInvariant = 0;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_NO_LOOP_IND) == 0) {
-               optimize.loopInduction = 0;
+      if (strcmp(&argv[i][1],OPTION_NO_LOOP_IND) == 0) {
+    optimize.loopInduction = 0;
                 continue;
-           }
+      }
 
-           if (strcmp(&argv[i][1],OPTION_NO_LOOPREV) == 0) {
-               optimize.noLoopReverse = 1;
+      if (strcmp(&argv[i][1],OPTION_NO_LOOPREV) == 0) {
+    optimize.noLoopReverse = 1;
                 continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_NOSTDLIB) == 0) {
-               options.nostdlib=1;
-               continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_NOSTDINC) == 0) {
-               options.nostdinc=1;
-               continue;
-           }
-
-           if (strcmp(&argv[i][1],OPTION_VERBOSE) == 0) {
-               options.verbose=1;
-               continue;
-           }
-           
-           if (strcmp(&argv[i][1],OPTION_ANSIINT) == 0) {
-               options.ANSIint=1;
-               continue;
-           }       
-
-           if (!port->parseOption(&argc, argv, &i))
-           {
-               werror(W_UNKNOWN_OPTION,argv[i]);
-           }
-           else
-           {
-               continue;
-           }
-       }      
-
-       /* these are undocumented options */
-       /* if preceded by '/' then turn off certain optmizations, used
-          for debugging only these are also the legacy options from
-          version 1.xx will be removed gradually.
-          It may be an absolute filename.
-       */
-       if ( *argv[i] == '/' && strlen(argv[i]) < 3) {
-           switch (argv[i][1]) {
-               
-           case 'p':
-               optimize.ptrArithmetic=0;
-               break;
-
-           case 'L':
-               switch (argv[i][2]) {
-               case '\0':
-                   optimize.label1 = 
-                       optimize.label2 =
-                       optimize.label3 = 
-                       optimize.label4 = 0 ;
-                   break;
-               case '1':
-                   optimize.label1 = 0;
-                   break;
-               case '2':
-                   optimize.label2 = 0;
-                   break;
-               case '3':
-                   optimize.label3 = 0;
-                   break;
-               case '4':
-                   optimize.label4 = 0;
-                   break;
-               }
-               break;
-               
-           case 'l' :
-               switch (argv[i][2]) {               
-               case 'i' :
-                   optimize.loopInvariant = 0;
-                   break;
-               case 'n' :
-                   optimize.loopInduction = 0;
-                   break;
-
-
-               }
-               break ;
-           case 'g' :
-               optimize.global_cse = 0;
-               break;
-
-           }
-           continue ;
-       }
-
-       /* if preceded by  '-' then option */
-       if ( *argv[i] == '-' ) {
-           switch (argv[i][1]) {
-           case 'h'    :
-               printUsage();
-               exit(0);
-               break;
-               
-           case 'E':
-               preProcOnly = 1;
-               break;
-
-           case 'm':
-               /* Used to select the port */
-               if (_setPort(argv[i] + 2)) {
-                   werror(W_UNSUPP_OPTION,"-m","Unrecognised processor");
-               }
-               break;
-           
-           case 'a'    : 
-               werror(W_UNSUPP_OPTION,"-a","use --stack-auto instead");
-               break ;
-               
-           case 'g'    :
-               werror(W_UNSUPP_OPTION,"-g","use --generic instead");
-               break;
-                               
-           case 'X'    :       /* use external stack           */
-               werror(W_UNSUPP_OPTION,"-X","use --xstack-loc instead");
-               break ;
-               
-           case 'x'    :
-               werror(W_UNSUPP_OPTION,"-x","use --xstack instead");
-               break;
-               
-           case 'p'    :       /* stack pointer intial value */
-           case 'P'    :
-               werror(W_UNSUPP_OPTION,"-p","use --stack-loc instead");
-               break ;
-                               
-           case 'i'    :
-               werror(W_UNSUPP_OPTION,"-i","use --idata-loc instead");
-               break ;
-               
-           case 'r'    :
-               werror(W_UNSUPP_OPTION,"-r","use --xdata-loc instead");
-               break ;
-               
-           case 's'    :
-               werror(W_UNSUPP_OPTION,"-s","use --code-loc instead");
-               break ;         
-                               
-           case 'c':      
-               options.cc_only = 1;
-               break;  
-
-           case 'Y':
-               werror(W_UNSUPP_OPTION,"-Y","use -I instead");
-               break;
-               
-           case 'L' :
-               if (argv[i][2])
-                   libPaths[nlibPaths++] = &argv[i][2];
-               else
-                   libPaths[nlibPaths++] = argv[++i];
-               break;
-               
-           case 'W':
-               /* linker options */
-               if (argv[i][2] == 'l') {
-                   if (argv[i][3])
-                       parseWithComma(linkOptions,&argv[i][3]);
-                   else
-                       parseWithComma(linkOptions,argv[++i]);
-               } else {
-                   /* assembler options */
-                   if (argv[i][2] == 'a') {
-                       if (argv[i][3])
-                           parseWithComma((char **)asmOptions,&argv[i][3]);
-                       else
-                           parseWithComma((char **)asmOptions,argv[++i]);
-                       
-                   } else {
-                       werror(W_UNKNOWN_OPTION,argv[i]);                      
-                   }
-               }
-               break;
-           case 'S':
-               noAssemble = 1;
-               break;
-
-           case 'V':
-             verboseExec = TRUE;
-             break;
-
-           case 'v':
-               printVersionInfo();
-               exit(0);
-               break;
-
-               /* preprocessor options */              
-           case 'M':
-             {
-               preProcOnly=1;
-               _addToList(preArgv, "-M");
-               break;
-             }
-           case 'C':
-             {
-               _addToList(preArgv, "-C");
-               break;
-             }
-           case 'd':
-           case 'D':
-           case 'I':
-           case 'A':
-           case 'U':
-               {
-                   char sOpt = argv[i][1] ;
-                   char *rest ;
-                   
-                   if ( argv[i][2] == ' ' || argv[i][2] == '\0') {
-                       i++ ;
-                       rest = argv[i] ;
-                   }
-                   else
-                       rest = &argv[i][2] ;
-                   
-                   if ( argv[i][1] == 'Y' )
-                       argv[i][1] = 'I';
-
-                   sprintf(buffer, "-%c%s", sOpt, rest);
-                   _addToList(preArgv, buffer);
-               }
-               break ;
-
-           default:
-               if (!port->parseOption(&argc, argv, &i))
-                   werror(W_UNKNOWN_OPTION,argv[i]);
-           }
-           continue ;
-       }
-
-       if (!port->parseOption(&argc, argv, &i)) {
-           /* no option must be a filename */
-           if (options.c1mode)
-               _processC1Arg(argv[i]);
-           else
-               processFile(argv[i]);
-       }
-    }  
+      }
+
+      if (strcmp(&argv[i][1],OPTION_NOSTDLIB) == 0) {
+          options.nostdlib=1;
+    continue;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_NOSTDINC) == 0) {
+          options.nostdinc=1;
+    continue;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_VERBOSE) == 0) {
+          options.verbose=1;
+    continue;
+      }
+
+      if (strcmp(&argv[i][1],OPTION_ANSIINT) == 0) {
+          options.ANSIint=1;
+    continue;
+      }
+
+      if (!port->parseOption(&argc, argv, &i))
+      {
+    werror(W_UNKNOWN_OPTION,argv[i]);
+      }
+      else
+      {
+        continue;
+      }
+  }
+
+  /* these are undocumented options */
+  /* if preceded by '/' then turn off certain optmizations, used
+     for debugging only these are also the legacy options from
+     version 1.xx will be removed gradually.
+     It may be an absolute filename.
+  */
+  if ( *argv[i] == '/' && strlen(argv[i]) < 3) {
+      switch (argv[i][1]) {
+
+      case 'p':
+    optimize.ptrArithmetic=0;
+    break;
+
+      case 'L':
+    switch (argv[i][2]) {
+    case '\0':
+        optimize.label1 =
+      optimize.label2 =
+      optimize.label3 =
+      optimize.label4 = 0 ;
+        break;
+    case '1':
+        optimize.label1 = 0;
+        break;
+    case '2':
+        optimize.label2 = 0;
+        break;
+    case '3':
+        optimize.label3 = 0;
+        break;
+    case '4':
+        optimize.label4 = 0;
+        break;
+    }
+    break;
+
+      case 'l' :
+    switch (argv[i][2]) {
+    case 'i' :
+        optimize.loopInvariant = 0;
+        break;
+    case 'n' :
+        optimize.loopInduction = 0;
+        break;
+
+
+    }
+    break ;
+      case 'g' :
+    optimize.global_cse = 0;
+    break;
+
+      }
+      continue ;
+  }
+
+  /* if preceded by  '-' then option */
+  if ( *argv[i] == '-' ) {
+      switch (argv[i][1]) {
+      case 'h'  :
+    printUsage();
+    exit(0);
+    break;
+
+      case 'E':
+    preProcOnly = 1;
+    break;
+
+      case 'm':
+    /* Used to select the port */
+    if (_setPort(argv[i] + 2)) {
+        werror(W_UNSUPP_OPTION,"-m","Unrecognised processor");
+    }
+    break;
+
+      case 'a'  :
+    werror(W_UNSUPP_OPTION,"-a","use --stack-auto instead");
+    break ;
+
+      case 'g'  :
+    werror(W_UNSUPP_OPTION,"-g","use --generic instead");
+    break;
+
+      case 'X'  : /* use external stack   */
+    werror(W_UNSUPP_OPTION,"-X","use --xstack-loc instead");
+    break ;
+
+      case 'x'  :
+    werror(W_UNSUPP_OPTION,"-x","use --xstack instead");
+    break;
+
+      case 'p'  : /* stack pointer intial value */
+      case 'P'  :
+    werror(W_UNSUPP_OPTION,"-p","use --stack-loc instead");
+    break ;
+
+      case 'i'  :
+    werror(W_UNSUPP_OPTION,"-i","use --idata-loc instead");
+    break ;
+
+      case 'r'  :
+    werror(W_UNSUPP_OPTION,"-r","use --xdata-loc instead");
+    break ;
+
+      case 's'  :
+    werror(W_UNSUPP_OPTION,"-s","use --code-loc instead");
+    break ;
+
+      case 'c':
+    options.cc_only = 1;
+    break;
+
+      case 'Y':
+    werror(W_UNSUPP_OPTION,"-Y","use -I instead");
+    break;
+
+      case 'L' :
+    if (argv[i][2])
+        libPaths[nlibPaths++] = &argv[i][2];
+    else
+        libPaths[nlibPaths++] = argv[++i];
+    break;
+
+      case 'W':
+    /* linker options */
+    if (argv[i][2] == 'l') {
+        if (argv[i][3])
+      parseWithComma(linkOptions,&argv[i][3]);
+        else
+      parseWithComma(linkOptions,argv[++i]);
+    } else {
+        /* assembler options */
+        if (argv[i][2] == 'a') {
+      if (argv[i][3])
+          parseWithComma((char **)asmOptions,&argv[i][3]);
+      else
+          parseWithComma((char **)asmOptions,argv[++i]);
+
+        } else {
+      werror(W_UNKNOWN_OPTION,argv[i]);
+        }
+    }
+    break;
+      case 'S':
+    noAssemble = 1;
+    break;
+
+      case 'V':
+        verboseExec = TRUE;
+        break;
+
+      case 'v':
+    printVersionInfo();
+    exit(0);
+    break;
+
+    /* preprocessor options */
+      case 'M':
+        {
+    preProcOnly=1;
+    _addToList(preArgv, "-M");
+    break;
+        }
+      case 'C':
+        {
+    _addToList(preArgv, "-C");
+    break;
+        }
+      case 'd':
+      case 'D':
+      case 'I':
+      case 'A':
+      case 'U':
+    {
+        char sOpt = argv[i][1] ;
+        char *rest ;
+
+        if ( argv[i][2] == ' ' || argv[i][2] == '\0') {
+      i++ ;
+      rest = argv[i] ;
+        }
+        else
+      rest = &argv[i][2] ;
+
+        if ( argv[i][1] == 'Y' )
+      argv[i][1] = 'I';
+
+        sprintf(buffer, "-%c%s", sOpt, rest);
+        _addToList(preArgv, buffer);
+    }
+    break ;
+
+      default:
+    if (!port->parseOption(&argc, argv, &i))
+        werror(W_UNKNOWN_OPTION,argv[i]);
+      }
+      continue ;
+  }
+
+  if (!port->parseOption(&argc, argv, &i)) {
+      /* no option must be a filename */
+      if (options.c1mode)
+    _processC1Arg(argv[i]);
+      else
+    processFile(argv[i]);
+  }
+    }
 
     /* set up external stack location if not explicitly specified */
     if ( !options.xstack_loc )
-       options.xstack_loc = options.xdata_loc ;
+  options.xstack_loc = options.xdata_loc ;
 
     /* if debug option is set the open the cdbFile */
     if (!options.nodebug && srcFileName) {
-       sprintf(cdbfnbuf,"%s.cdb",srcFileName);
-       if ((cdbFile = fopen(cdbfnbuf,"w")) == NULL)
-           werror(E_FILE_OPEN_ERR,cdbfnbuf);
-       else {
-           /* add a module record */
-           fprintf(cdbFile,"M:%s\n",moduleName);
-       }
+  sprintf(cdbfnbuf,"%s.cdb",srcFileName);
+  if ((cdbFile = fopen(cdbfnbuf,"w")) == NULL)
+      werror(E_FILE_OPEN_ERR,cdbfnbuf);
+  else {
+      /* add a module record */
+      fprintf(cdbFile,"M:%s\n",moduleName);
+  }
     }
     return 0;
 }
@@ -1148,7 +1148,7 @@ int   parseCmdLine ( int argc, char **argv )
 
 #if defined(_MSC_VER)
 
-char *try_dir[]= {DefaultExePath, NULL};                       // TODO : Fill in some default search list
+char *try_dir[]= {DefaultExePath, NULL};      // TODO : Fill in some default search list
 
 #else
 
@@ -1159,12 +1159,12 @@ char *try_dir[]= {NULL};
 
 #ifdef USE_SYSTEM_SYSTEM_CALLS
 int my_system (const char *cmd)
-{    
+{
   int argsStart, e, i=0;
   char *cmdLine=NULL;
 
   argsStart=strstr(cmd, " ")-cmd;
-  
+
   // try to find the command in predefined path's
   while (try_dir[i]) {
     cmdLine = (char*)malloc(strlen(try_dir[i])+strlen(cmd)+10);
@@ -1177,10 +1177,10 @@ int my_system (const char *cmd)
     {
       char *r=cmdLine;
       while (*r) {
-       if (*r == '/') {
-         *r = '\\';
-       }
-       r++;
+  if (*r == '/') {
+    *r = '\\';
+  }
+  r++;
       }
     }
 #endif
@@ -1193,11 +1193,11 @@ int my_system (const char *cmd)
     cmdLine=NULL;
     i++;
   }
-  
+
   if (verboseExec) {
     printf ("+ %s\n", cmdLine ? cmdLine : cmd);
   }
-  
+
   if (cmdLine) {
     // command found in predefined path
     e=system(cmdLine);
@@ -1212,7 +1212,7 @@ int my_system (const char *cmd)
 #else
 
 int my_system (const char *cmd, char **cmd_argv)
-{    
+{
     char *dir, *got= NULL; int i= 0;
 
     while (!got && try_dir[i])
@@ -1226,19 +1226,19 @@ int my_system (const char *cmd, char **cmd_argv)
         strcat(dir, ".exe");
 
         /* Mung slashes into backslashes to keep WIndoze happy. */
-       {
-           char *r;
-           r = dir;
-           
-           while (*r)
-               {
-                   if (*r == '/')
-                       {
-                           *r = '\\';
-                       }
-                   r++;
-               }
-       }
+  {
+      char *r;
+      r = dir;
+
+      while (*r)
+    {
+        if (*r == '/')
+      {
+          *r = '\\';
+      }
+        r++;
+    }
+  }
 #endif
 
         if (access(dir, X_OK) == 0)
@@ -1250,27 +1250,27 @@ int my_system (const char *cmd, char **cmd_argv)
     }
 
     if (verboseExec) {
-       char **pCmd = cmd_argv;
-       printf ("+ ");
-       while (*pCmd) {
-           printf("%s ", *pCmd);
-           pCmd++;
-       }
-       printf("\n");
+  char **pCmd = cmd_argv;
+  printf ("+ ");
+  while (*pCmd) {
+      printf("%s ", *pCmd);
+      pCmd++;
+  }
+  printf("\n");
     }
 
     if (got)
-               {
+    {
       i= spawnv(P_WAIT,got,cmd_argv) == -1;
-               free(got) ;
-               }
+    free(got) ;
+    }
     else
       i= spawnvp(P_WAIT,cmd,cmd_argv) == -1;
     if (i) {
-       perror("Cannot exec process ");
-       return -1;
+  perror("Cannot exec process ");
+  return -1;
     }
-    
+
     return 0;
 }
 #endif
@@ -1288,13 +1288,13 @@ static void linkEdit (char **envp)
 
     int i;
     if (!srcFileName)
-       srcFileName = "temp";
+  srcFileName = "temp";
 
     /* first we need to create the <filename>.lnk file */
     sprintf(buffer,"%s.lnk",srcFileName);
     if (!(lnkfile = fopen(buffer,"w"))) {
-       werror(E_FILE_OPEN_ERR,buffer);
-       exit(1);
+  werror(E_FILE_OPEN_ERR,buffer);
+  exit(1);
     }
 
     /* now write the options */
@@ -1302,8 +1302,8 @@ static void linkEdit (char **envp)
 
     /* if iram size specified */
     if (options.iram_size)
-       fprintf(lnkfile,"-a 0x%04x\n",options.iram_size);
-    
+  fprintf(lnkfile,"-a 0x%04x\n",options.iram_size);
+
     /*if (options.debug) */
     fprintf(lnkfile,"-z\n");
 
@@ -1311,14 +1311,14 @@ static void linkEdit (char **envp)
     segName = strdup(N); \
     c = strtok(segName, " \t"); \
     fprintf (lnkfile,"-b %s = 0x%04x\n", c, L); \
-    if (segName) { free(segName); } 
-    
+    if (segName) { free(segName); }
+
     /* code segment start */
     WRITE_SEG_LOC(CODE_NAME, options.code_loc);
-    
+
      /* data segment start */
      WRITE_SEG_LOC(DATA_NAME, options.data_loc);
-                 
+
     /* xdata start */
     WRITE_SEG_LOC(XDATA_NAME, options. xdata_loc);
 
@@ -1327,42 +1327,42 @@ static void linkEdit (char **envp)
 
     /* bit segment start */
     WRITE_SEG_LOC(BIT_NAME, 0);
-    
+
     /* add the extra linker options */
     for (i=0; linkOptions[i] ; i++)
-       fprintf(lnkfile,"%s\n",linkOptions[i]);
+  fprintf(lnkfile,"%s\n",linkOptions[i]);
 
     /* other library paths if specified */
     for (i = 0 ; i < nlibPaths ; i++ )
-       fprintf (lnkfile,"-k %s\n",libPaths[i]);
+  fprintf (lnkfile,"-k %s\n",libPaths[i]);
 
     /* standard library path */
     if (!options.nostdlib) {
       if (IS_DS390_PORT) {
-       c="ds390";
+  c="ds390";
       } else {
-       switch(options.model)
-         {
-         case MODEL_SMALL:
-           c = "small";
-           break;
-         case MODEL_LARGE:
-           c = "large";
-           break;
-         case MODEL_FLAT24:
-           c = "flat24";
-           break;
-         default:
-           werror(W_UNKNOWN_MODEL, __FILE__, __LINE__);
-           c = "unknown";
-           break;
-         }
+  switch(options.model)
+    {
+    case MODEL_SMALL:
+      c = "small";
+      break;
+    case MODEL_LARGE:
+      c = "large";
+      break;
+    case MODEL_FLAT24:
+      c = "flat24";
+      break;
+    default:
+      werror(W_UNKNOWN_MODEL, __FILE__, __LINE__);
+      c = "unknown";
+      break;
+    }
       }
       fprintf (lnkfile,"-k %s/%s\n",SDCC_LIB_DIR/*STD_LIB_PATH*/,c);
-      
+
       /* standard library files */
       if (strcmp(port->target, "ds390")==0) {
-       fprintf (lnkfile,"-l %s\n",STD_DS390_LIB);
+  fprintf (lnkfile,"-l %s\n",STD_DS390_LIB);
       }
       fprintf (lnkfile,"-l %s\n",STD_LIB);
       fprintf (lnkfile,"-l %s\n",STD_INT_LIB);
@@ -1372,14 +1372,14 @@ static void linkEdit (char **envp)
 
     /* additional libraries if any */
     for (i = 0 ; i < nlibFiles; i++)
-       fprintf (lnkfile,"-l %s\n",libFiles[i]);
+  fprintf (lnkfile,"-l %s\n",libFiles[i]);
 
     /* put in the object files */
     if (strcmp(srcFileName,"temp"))
-       fprintf (lnkfile,"%s ",srcFileName);
+  fprintf (lnkfile,"%s ",srcFileName);
 
     for (i = 0 ; i < nrelFiles ; i++ )
-       fprintf (lnkfile,"%s\n",relFiles[i]);
+  fprintf (lnkfile,"%s\n",relFiles[i]);
 
     fprintf (lnkfile,"\n-e\n");
     fclose(lnkfile);
@@ -1395,18 +1395,18 @@ static void linkEdit (char **envp)
 #else
     buildCmdLine(buffer, argv, port->linker.cmd, srcFileName, NULL, NULL, NULL);
     if (my_system(argv[0], argv)) {
-       perror("Cannot exec linker");
-       exit(1);
+  perror("Cannot exec linker");
+  exit(1);
     }
 
 #endif
 
     if (strcmp(srcFileName,"temp") == 0) {
-       /* rename "temp.cdb" to "firstRelFile.cdb" */
-       char *f = strtok(strdup(relFiles[0]),".");
-       f = strcat(f,".cdb");
-       rename("temp.cdb",f);       
-       srcFileName = NULL;
+  /* rename "temp.cdb" to "firstRelFile.cdb" */
+  char *f = strtok(strdup(relFiles[0]),".");
+  f = strcat(f,".cdb");
+  rename("temp.cdb",f);
+  srcFileName = NULL;
     }
 }
 
@@ -1426,8 +1426,8 @@ static void assemble (char **envp)
     buildCmdLine(buffer, argv, port->assembler.cmd, srcFileName, NULL, NULL, asmOptions);
 
     if (my_system(argv[0], argv)) {
-       perror("Cannot exec assembler");
-       exit(1);
+  perror("Cannot exec assembler");
+  exit(1);
     }
 #endif
 }
@@ -1435,7 +1435,7 @@ static void assemble (char **envp)
 
 
 /*-----------------------------------------------------------------*/
-/* preProcess - spawns the preprocessor with arguments            */
+/* preProcess - spawns the preprocessor with arguments       */
 /*-----------------------------------------------------------------*/
 static int preProcess (char **envp)
 {
@@ -1447,82 +1447,82 @@ static int preProcess (char **envp)
     preOutName = NULL;
 
     if (!options.c1mode) {
-       /* if using external stack define the macro */
-       if ( options.useXstack )
-           _addToList(preArgv, "-DSDCC_USE_XSTACK");
-       
-       /* 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)
-           {
-           case MODEL_LARGE:
-               _addToList(preArgv, "-DSDCC_MODEL_LARGE");
-               break;
-           case MODEL_SMALL:
-               _addToList(preArgv, "-DSDCC_MODEL_SMALL");
-               break;
-           case MODEL_COMPACT:
-               _addToList(preArgv, "-DSDCC_MODEL_COMPACT");
-               break;
-           case MODEL_MEDIUM:
-               _addToList(preArgv, "-DSDCC_MODEL_MEDIUM");
-               break;
-           case MODEL_FLAT24:
-               _addToList(preArgv, "-DSDCC_MODEL_FLAT24");
-               break;
-           default:
-               werror(W_UNKNOWN_MODEL, __FILE__, __LINE__);
-               break;
-           }       
-           
-    
-       /* add port (processor information to processor */
-       sprintf(procDef,"-DSDCC_%s",port->target);
-       _addToList(preArgv,procDef);
-
-       if (!preProcOnly)
-           preOutName = strdup(tmpnam(NULL));
-
-       if (options.verbose)
-         printf ("sdcc: Calling preprocessor...\n");
+  /* if using external stack define the macro */
+  if ( options.useXstack )
+      _addToList(preArgv, "-DSDCC_USE_XSTACK");
+
+  /* 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)
+      {
+      case MODEL_LARGE:
+    _addToList(preArgv, "-DSDCC_MODEL_LARGE");
+    break;
+      case MODEL_SMALL:
+    _addToList(preArgv, "-DSDCC_MODEL_SMALL");
+    break;
+      case MODEL_COMPACT:
+    _addToList(preArgv, "-DSDCC_MODEL_COMPACT");
+    break;
+      case MODEL_MEDIUM:
+    _addToList(preArgv, "-DSDCC_MODEL_MEDIUM");
+    break;
+      case MODEL_FLAT24:
+    _addToList(preArgv, "-DSDCC_MODEL_FLAT24");
+    break;
+      default:
+    werror(W_UNKNOWN_MODEL, __FILE__, __LINE__);
+    break;
+      }
+
+
+  /* add port (processor information to processor */
+  sprintf(procDef,"-DSDCC_%s",port->target);
+  _addToList(preArgv,procDef);
+
+  if (!preProcOnly)
+      preOutName = strdup(tmpnam(NULL));
+
+  if (options.verbose)
+    printf ("sdcc: Calling preprocessor...\n");
 
 #ifdef USE_SYSTEM_SYSTEM_CALLS
-       buildCmdLine(buffer, _preCmd, fullSrcFileName, 
-                     preOutName, srcFileName, preArgv);
-       if (my_system(buffer)) {
-         exit(1);
-       }
+  buildCmdLine(buffer, _preCmd, fullSrcFileName,
+          preOutName, srcFileName, preArgv);
+  if (my_system(buffer)) {
+    exit(1);
+  }
 #else
-       buildCmdLine(buffer, argv, _preCmd, fullSrcFileName, 
-                     preOutName, srcFileName, preArgv);
+  buildCmdLine(buffer, argv, _preCmd, fullSrcFileName,
+          preOutName, srcFileName, preArgv);
 
-       if (my_system(argv[0], argv)) {
-           unlink (preOutName);
-           perror("Cannot exec Preprocessor");
-           exit(1);
-       }
+  if (my_system(argv[0], argv)) {
+      unlink (preOutName);
+      perror("Cannot exec Preprocessor");
+      exit(1);
+  }
 
 #endif
-       if (preProcOnly)
-           exit(0);
+  if (preProcOnly)
+      exit(0);
     }
     else {
-       preOutName = fullSrcFileName;
+  preOutName = fullSrcFileName;
     }
 
     yyin = fopen(preOutName, "r");
     if (yyin == NULL) {
-       perror("Preproc file not found\n");
-       exit(1);
+  perror("Preproc file not found\n");
+  exit(1);
     }
-    
+
     return 0;
 }
 
@@ -1532,18 +1532,18 @@ static void _findPort(int argc, char **argv)
 
     argc--;
     while (argc) {
-       if (!strncmp(*argv, "-m", 2)) {
-           _setPort(*argv + 2);
-           return;
-       }
-       argv++;
-       argc--;
+  if (!strncmp(*argv, "-m", 2)) {
+      _setPort(*argv + 2);
+      return;
+  }
+  argv++;
+  argc--;
     }
     /* Use the first in the list */
     port = _ports[0];
 }
 
-/* 
+/*
  * main routine
  * initialises and calls the parser
  */
@@ -1558,7 +1558,7 @@ int main ( int argc, char **argv , char **envp)
     _findPort(argc, argv);
     /* Initalise the port. */
     if (port->init)
-       port->init();
+  port->init();
 
 #if defined(_MSC_VER)
 
@@ -1570,14 +1570,14 @@ int main ( int argc, char **argv , char **envp)
       strcpy(DefaultExePath,argv[0]) ;
 
       for(i = strlen(DefaultExePath) ; i > 0 ; i--)
-       if (DefaultExePath[i] == '\\')
-         {
-         DefaultExePath[i] = '\0' ;
-         break ;
-         }
+  if (DefaultExePath[i] == '\\')
+    {
+    DefaultExePath[i] = '\0' ;
+    break ;
+    }
 
       if (i == 0)
-       DefaultExePath[0] = '\0' ;
+  DefaultExePath[0] = '\0' ;
       }
 
 #endif
@@ -1591,71 +1591,71 @@ int main ( int argc, char **argv , char **envp)
 
     /* if no input then printUsage & exit */
     if ((!options.c1mode && !srcFileName && !nrelFiles) || (options.c1mode && !srcFileName && !options.out_name)) {
-       printUsage();
-       exit(0);
+  printUsage();
+  exit(0);
     }
-       
+
     if (srcFileName) {
-       preProcess(envp) ;
+  preProcess(envp) ;
 
-       initSymt();
-       initiCode();
-       initCSupport ();
-       initPeepHole();
+  initSymt();
+  initiCode();
+  initCSupport ();
+  initPeepHole();
 
-       if (options.verbose)
-         printf ("sdcc: Generating code...\n");
+  if (options.verbose)
+    printf ("sdcc: Generating code...\n");
 
-       yyparse();
+  yyparse();
 
-       if (!fatalError) 
-       {
+  if (!fatalError)
+  {
 /* TSD PIC port hack - if the PIC port option is enabled
    and SDCC is used to generate PIC code, then we will
    generate .asm files in gpasm's format instead of SDCC's
    assembler's format
 */
 #if !OPT_DISABLE_PIC
-         if(IS_PIC_PORT)
-           pic14glue();
-         else
+    if(IS_PIC_PORT)
+      pic14glue();
+    else
 #endif
-           glue();
-           if (fatalError)
-           {
-               return 1;
-           }
-           if (!options.c1mode)
-           {
-               if (options.verbose)
-                 printf ("sdcc: Calling assembler...\n");
-
-               assemble(envp);
-           }
-       }
-       else 
-       {
-           return 1;
+      glue();
+      if (fatalError)
+      {
+          return 1;
+      }
+      if (!options.c1mode)
+      {
+          if (options.verbose)
+      printf ("sdcc: Calling assembler...\n");
+
+    assemble(envp);
+      }
+  }
+  else
+  {
+      return 1;
         }
-       
+
     }
-    
+
     if (cdbFile)
-       fclose(cdbFile);
-
-    if (!options.cc_only && 
-       !fatalError      &&
-       !noAssemble      &&
-       !options.c1mode  &&
-       (srcFileName || nrelFiles)) {
-       if (port->linker.do_link)
-           port->linker.do_link();
-       else
-         linkEdit (envp);
+  fclose(cdbFile);
+
+    if (!options.cc_only &&
+  !fatalError      &&
+  !noAssemble      &&
+  !options.c1mode  &&
+  (srcFileName || nrelFiles)) {
+  if (port->linker.do_link)
+      port->linker.do_link();
+  else
+    linkEdit (envp);
     }
 
     if (yyin && yyin != stdin)
-       fclose(yyin);
+  fclose(yyin);
 
     if (preOutName && !options.c1mode) {
         unlink(preOutName);
@@ -1663,5 +1663,5 @@ int main ( int argc, char **argv , char **envp)
     }
 
     return 0;
-    
+
   }
index 51c65eb2e2ed003952726f02c17c309bc5dbe2d1..f554ffcaaef67556767954e88c1d7555855f452f 100644 (file)
@@ -45,7 +45,7 @@ static void buildLabelRefCountHash(lineNode *head);
 static bool matchLine (char *, char *, hTab **);
 
 #define FBYNAME(x) int x (hTab *vars, lineNode *currPl, lineNode *head, \
-                         const char *cmdLine)
+        const char *cmdLine)
 
 /*-----------------------------------------------------------------*/
 /* pcDistance - afinds a label back ward or forward                */
@@ -139,14 +139,14 @@ FBYNAME(operandsNotSame)
     return TRUE;
 }
 
-/* labelRefCount: 
+/* labelRefCount:
  *
  * takes two parameters: a variable (bound to a label name)
  * and an expected reference count.
  *
  * Returns TRUE if that label is defined and referenced exactly
  * the given number of times.
- */ 
+ */
 FBYNAME(labelRefCount)
 {
     int  varNumber, expectedRefCount;
@@ -155,57 +155,57 @@ FBYNAME(labelRefCount)
     /* If we don't have the label hash table yet, build it. */
     if (!labelHash)
     {
-       buildLabelRefCountHash(head);
+      buildLabelRefCountHash(head);
     }
 
     if (sscanf(cmdLine, "%*[ \t%]%d %d", &varNumber, &expectedRefCount) == 2)
     {
         char *label = hTabItemWithKey(vars, varNumber);
-        
+
         if (label)
         {
-           labelHashEntry *entry;
-           
-           entry = hTabFirstItemWK(labelHash, hashSymbolName(label));
-           
-           while (entry)
-           {
-               if (!strcmp(label, entry->name))
-               {
-                   break;
-               }
-               entry = hTabNextItemWK(labelHash);
-           }
-           if (entry)
-           {
+      labelHashEntry *entry;
+
+      entry = hTabFirstItemWK(labelHash, hashSymbolName(label));
+
+      while (entry)
+      {
+          if (!strcmp(label, entry->name))
+          {
+              break;
+          }
+          entry = hTabNextItemWK(labelHash);
+      }
+      if (entry)
+      {
 #if 0
-               /* debug spew. */              
-               fprintf(stderr, "labelRefCount: %s has refCount %d, want %d\n",
-                       label, entry->refCount, expectedRefCount);
+    /* debug spew. */
+          fprintf(stderr, "labelRefCount: %s has refCount %d, want %d\n",
+            label, entry->refCount, expectedRefCount);
 #endif
-                       
-               rc = (expectedRefCount == entry->refCount);
-           }
-           else
-           {
-               fprintf(stderr, "*** internal error: no label has entry for"
-                              " %s in labelRefCount peephole.\n",
-                              label);
-           }
+
+          rc = (expectedRefCount == entry->refCount);
+      }
+      else
+      {
+          fprintf(stderr, "*** internal error: no label has entry for"
+                   " %s in labelRefCount peephole.\n",
+                   label);
+      }
         }
         else
         {
             fprintf(stderr, "*** internal error: var %d not bound"
-                           " in peephole labelRefCount rule.\n",
-                           varNumber);
+                    " in peephole labelRefCount rule.\n",
+                    varNumber);
         }
-        
+
     }
     else
     {
-         fprintf(stderr, 
-                 "*** internal error: labelRefCount peephole restriction"
-                 " malformed: %s\n", cmdLine);
+    fprintf(stderr,
+            "*** internal error: labelRefCount peephole restriction"
+            " malformed: %s\n", cmdLine);
     }
     return rc;
 }
@@ -218,16 +218,16 @@ int callFuncByName ( char *fname,
              lineNode *currPl,
              lineNode *head)
 {
-    struct ftab 
+    struct ftab
     {
-       char *fname ;
-       int (*func)(hTab *,lineNode *,lineNode *,const char *) ;
-    }  ftab[] = 
+      char *fname ;
+      int (*func)(hTab *,lineNode *,lineNode *,const char *) ;
+    }  ftab[] =
     {
-       {"labelInRange",   labelInRange },
-       {"operandsNotSame", operandsNotSame },
-       {"24bitMode", flat24bitMode },
-       {"labelRefCount", labelRefCount },
+      {"labelInRange",   labelInRange },
+      {"operandsNotSame", operandsNotSame },
+      {"24bitMode", flat24bitMode },
+      {"labelRefCount", labelRefCount },
     };
     int i;
 
@@ -271,13 +271,13 @@ peepRule *newPeepRule (lineNode *match  ,
 {
     peepRule *pr ;
 
-    pr= Safe_calloc(sizeof(peepRule));
+    pr= Safe_calloc(1,sizeof(peepRule));
     pr->match = match;
     pr->replace= replace;
     pr->restart = restart;
 
     if (cond && *cond) {
-    pr->cond = Safe_calloc(strlen(cond)+1);
+    pr->cond = Safe_calloc(1,strlen(cond)+1);
     strcpy(pr->cond,cond);
     } else
     pr->cond = NULL ;
@@ -300,8 +300,8 @@ lineNode *newLineNode (char *line)
 {
     lineNode *pl;
 
-    pl = Safe_calloc(sizeof(lineNode));
-    pl->line = Safe_calloc(strlen(line)+1);
+    pl = Safe_calloc(1,sizeof(lineNode));
+    pl->line = Safe_calloc(1,strlen(line)+1);
     strcpy(pl->line,line);
     return pl;
 }
@@ -507,7 +507,7 @@ static void bindVar (int key, char **s, hTab **vtab)
     *s = vvx ;
     *vv = '\0';
     /* got value */
-    vvx = Safe_calloc(strlen(vval)+1);
+    vvx = Safe_calloc(1,strlen(vval)+1);
     strcpy(vvx,vval);
     hTabAddItem(vtab,key,vvx);
 
@@ -713,34 +713,34 @@ static void replaceRule (lineNode **shead, lineNode *stail, peepRule *pr)
 bool isLabelDefinition(const char *line, const char **start, int *len)
 {
     const char *cp = line;
-    
+
     /* This line is a label if if consists of:
-     * [optional whitespace] followed by identifier chars 
+     * [optional whitespace] followed by identifier chars
      * (alnum | $ | _ ) followed by a colon.
      */
-    
+
     while (*cp && isspace(*cp))
     {
         cp++;
-    } 
-    
+    }
+
     if (!*cp)
     {
        return FALSE;
     }
-    
+
     *start = cp;
-    
+
     while (isalnum(*cp) || (*cp == '$') || (*cp == '_'))
     {
-       cp++;
+      cp++;
     }
-    
+
     if ((cp == *start) || (*cp != ':'))
     {
         return FALSE;
     }
-    
+
     *len = (cp - (*start));
     return TRUE;
 }
@@ -749,18 +749,18 @@ bool isLabelDefinition(const char *line, const char **start, int *len)
 static int hashSymbolName(const char *name)
 {
     int hash = 0;
-    
+
     while (*name)
     {
        hash = (hash << 6) ^ *name;
        name++;
     }
-    
+
     if (hash < 0)
     {
-       hash = -hash;
+      hash = -hash;
     }
-    
+
     return hash % HTAB_SIZE;
 }
 
@@ -769,32 +769,32 @@ static int hashSymbolName(const char *name)
  */
 static void buildLabelRefCountHash(lineNode *head)
 {
-    lineNode   *line;
-    const char         *label;
-    int        labelLen;
-    int                i;
+    lineNode  *line;
+    const char  *label;
+    int   labelLen;
+    int   i;
 
     assert(labelHash == NULL);
     labelHash = newHashTable(HTAB_SIZE);
-    
+
     /* First pass: locate all the labels. */
     line = head;
-    
+
     while (line)
     {
-       if (isLabelDefinition(line->line, &label, &labelLen)
-        && labelLen <= SDCC_NAME_MAX)
-       {
-           labelHashEntry *entry;
-           
-           entry = Safe_calloc(sizeof(labelHashEntry));
-           
-           memcpy(entry->name, label, labelLen);
-           entry->name[labelLen] = 0;
-           entry->refCount = -1;
-
-           hTabAddItem(&labelHash, hashSymbolName(entry->name), entry);
-       }
+      if (isLabelDefinition(line->line, &label, &labelLen)
+       && labelLen <= SDCC_NAME_MAX)
+      {
+          labelHashEntry *entry;
+
+          entry = Safe_calloc(1,sizeof(labelHashEntry));
+
+          memcpy(entry->name, label, labelLen);
+          entry->name[labelLen] = 0;
+          entry->refCount = -1;
+
+          hTabAddItem(&labelHash, hashSymbolName(entry->name), entry);
+      }
         line = line->next;
     }
 
@@ -804,40 +804,40 @@ static void buildLabelRefCountHash(lineNode *head)
     line = head;
     while (line)
     {
-       for (i = 0; i < HTAB_SIZE; i++)
-       {
+      for (i = 0; i < HTAB_SIZE; i++)
+      {
             labelHashEntry *thisEntry;
-        
+
             thisEntry = hTabFirstItemWK(labelHash, i);
-        
+
             while (thisEntry)
             {
                 if (strstr(line->line, thisEntry->name))
                 {
                     thisEntry->refCount++;
                 }
-               thisEntry = hTabNextItemWK(labelHash);
+              thisEntry = hTabNextItemWK(labelHash);
             }
-        }    
+        }
         line = line->next;
     }
 
 #if 0
-    /* Spew the contents of the table. Debugging fun only. */    
+    /* Spew the contents of the table. Debugging fun only. */
     for (i = 0; i < HTAB_SIZE; i++)
     {
         labelHashEntry *thisEntry;
-        
+
         thisEntry = hTabFirstItemWK(labelHash, i);
-        
+
         while (thisEntry)
         {
-            fprintf(stderr, "label: %s ref %d\n", 
-                    thisEntry->name, thisEntry->refCount);
+            fprintf(stderr, "label: %s ref %d\n",
+                   thisEntry->name, thisEntry->refCount);
             thisEntry = hTabNextItemWK(labelHash);
         }
     }
-#endif    
+#endif
 }
 
 /*-----------------------------------------------------------------*/
@@ -851,7 +851,7 @@ void peepHole (lineNode **pls )
 
     if (labelHash)
     {
-       hTabDeleteAll(labelHash);
+      hTabDeleteAll(labelHash);
     }
     labelHash = NULL;
 
@@ -913,7 +913,7 @@ static char *readFileIntoBuffer (char *fname)
         rs = Safe_realloc(rs,strlen(rs)+strlen(lb)+1);
         strcat(rs,lb);
         } else {
-        rs = Safe_calloc(strlen(lb)+1);
+        rs = Safe_calloc(1,strlen(lb)+1);
         strcpy(rs,lb);
         }
         nch = 0 ;
@@ -928,7 +928,7 @@ static char *readFileIntoBuffer (char *fname)
         rs = Safe_realloc(rs,strlen(rs)+strlen(lb)+1);
         strcat(rs,lb);
     } else {
-        rs = Safe_calloc(strlen(lb)+1);
+        rs = Safe_calloc(1,strlen(lb)+1);
         strcpy(rs,lb);
     }
     }
index 25fbf0c2f34a9213c39c2de2e0f65cd5518f56bb..2632e9c515fad4dab6b038d441f762566c61cb3c 100644 (file)
@@ -1,25 +1,25 @@
 /*-----------------------------------------------------------------
-    SDCCset.c - contains support routines for sets 
-                
+    SDCCset.c - contains support routines for sets
+
     Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
 
     This program is free software; you can redistribute it and/or modify it
     under the terms of the GNU General Public License as published by the
     Free Software Foundation; either version 2, or (at your option) any
     later version.
-    
+
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-    
+
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-    
+
     In other words, you are welcome to use, share and improve this program.
     You are forbidden to forbid anyone else to use, share and improve
-    what you give them.   Help stamp out software-hoarding!  
+    what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include <stdio.h>
@@ -34,10 +34,10 @@ set *newSet  ()
 {
   set *lp ;
 
-  lp = Safe_calloc(sizeof(set));
+  lp = Safe_calloc(1,sizeof(set));
 //  if (lp == 0) {
-//     fprintf(stderr, "out of virtual memory: %s\n", __FILE__);
-//     exit(1);
+//  fprintf(stderr, "out of virtual memory: %s\n", __FILE__);
+//  exit(1);
 //  }
 
   lp->item = lp->curr= lp->next = NULL;
@@ -51,14 +51,14 @@ set *newSet  ()
 set *setFromSet (set *lp)
 {
   set *lfl = NULL ;
-  
+
   while (lp) {
     addSetHead(&lfl,lp->item);
     lp = lp->next ;
   }
 
   return lfl ;
-  
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -70,11 +70,11 @@ int isSetsEqual ( set *dest, set *src )
     set *src1 = src ;
 
     for (; dest && src ; dest=dest->next , src=src->next) {
-       if (!isinSet(src1, dest->item))
-           return 0;
+  if (!isinSet(src1, dest->item))
+      return 0;
     }
     if ( !dest && !src)
-       return 1;
+  return 1;
     return 0;
 }
 
@@ -87,11 +87,11 @@ int isSetsEqualWith ( set *dest, set *src , int (*cFunc)(void *,void *))
     set *src1 = src ;
 
     for (; dest && src ; dest=dest->next , src=src->next) {
-       if (!isinSetWith(src1, dest->item,cFunc))
-           return 0;
+  if (!isinSetWith(src1, dest->item,cFunc))
+      return 0;
     }
     if ( !dest && !src)
-       return 1;
+  return 1;
     return 0;
 }
 
@@ -100,12 +100,12 @@ int isSetsEqualWith ( set *dest, set *src , int (*cFunc)(void *,void *))
 /*-----------------------------------------------------------------*/
 void *addSetIfnotP ( set **list, void *item)
 {
-  
+
     if (isinSet(*list,item))
-       return item ;
-    
+  return item ;
+
     addSetHead(list,item);
-    
+
     return item;
 }
 
@@ -115,14 +115,14 @@ void *addSetIfnotP ( set **list, void *item)
 void *addSetHead (set **list, void *item )
 {
     set *lp = newSet();
-    
+
     lp->item = item ;
     lp->next = *list ;
-    
+
     assert(lp != lp->item);
     *list = lp ;
     return item ;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -131,21 +131,21 @@ void *addSetHead (set **list, void *item )
 void *addSet ( set **list , void *item )
 {
     set *lp ;
-    
+
     /* item added to the tail of the list */
-    
+
     /* if the list is empty */
     if (*list == NULL ) {
-       lp = *list = newSet();
+  lp = *list = newSet();
     } else {
-       /* go to the end of the list */
-       for (lp = *list ; lp->next ; lp = lp->next );
-       lp = lp->next = newSet();
+  /* go to the end of the list */
+  for (lp = *list ; lp->next ; lp = lp->next );
+  lp = lp->next = newSet();
     }
-    
+
     /* lp now all set */
     lp->item = item ;
-    
+
     return item ;
 }
 
@@ -158,15 +158,15 @@ void deleteItemIf ( set **sset, int (*cond) (void *, va_list), ... )
     va_list ap;
 
     va_start(ap,cond);
-    
+
     while (sp) {
-       if ((*cond)(sp->item,ap)) {
-           deleteSetItem(sset,sp->item);
-           sp = *sset ;
-           continue ;
-       }
+  if ((*cond)(sp->item,ap)) {
+      deleteSetItem(sset,sp->item);
+      sp = *sset ;
+      continue ;
+  }
 
-       sp = sp->next ;
+  sp = sp->next ;
     }
 }
 
@@ -176,29 +176,29 @@ void deleteItemIf ( set **sset, int (*cond) (void *, va_list), ... )
 void deleteSetItem ( set **list, void *item )
 {
     set *lp , *lp1;
-    
+
     /* if list is empty */
     if (*list == NULL )
-       return ;
-    
+  return ;
+
     /* if this item is at the head of the list */
     if ((*list)->item == item ) {
-       lp = *list ;
-       *list = (*list)->next ; 
-       return ;
+  lp = *list ;
+  *list = (*list)->next ;
+  return ;
     }
-    
+
     /* find the item in the list */
     for (lp = *list ; lp->next ; lp = lp->next ) {
-       if (lp->next->item == item ) /* the next one is it */ {
-           lp1 = lp->next ; /* this one will need to be freed */
-           lp->next = lp->next->next ; /* take out of list */     
-           return ;
-       }
+  if (lp->next->item == item ) /* the next one is it */ {
+      lp1 = lp->next ; /* this one will need to be freed */
+      lp->next = lp->next->next ; /* take out of list */
+      return ;
+  }
     }
-    
+
     /* could not find it */
-    return ;    
+    return ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -207,11 +207,11 @@ void deleteSetItem ( set **list, void *item )
 int isinSet (set *list, void *item )
 {
     set *lp ;
-    
+
     for (lp = list ; lp ; lp = lp->next )
-       if ( lp->item == item )
-           return 1;
-    
+  if ( lp->item == item )
+      return 1;
+
     return 0;
 }
 
@@ -221,11 +221,11 @@ int isinSet (set *list, void *item )
 int isinSetWith (set *list, void *item , int (*cFunc)(void *,void *) )
 {
     set *lp ;
-    
+
     for (lp = list ; lp ; lp = lp->next )
-       if ( (*cFunc)(lp->item,item) )
-           return 1;
-    
+  if ( (*cFunc)(lp->item,item) )
+      return 1;
+
     return 0;
 }
 
@@ -236,27 +236,27 @@ set *unionSets (set *list1 , set *list2, int throw)
 {
     set *un = NULL ;
     set *lp ;
-    
+
     /* add all elements in the first list */
     for (lp = list1 ; lp ; lp = lp->next )
-       addSet(&un,lp->item);
-    
+  addSet(&un,lp->item);
+
     /* now for all those in list2 which does not */
     /* already exist in the list add             */
     for (lp = list2 ; lp ; lp = lp->next )
-       if (!isinSet(un,lp->item))
-           addSet (&un,lp->item);
-    
+  if (!isinSet(un,lp->item))
+      addSet (&un,lp->item);
+
     switch (throw) {
     case THROW_SRC :
-       setToNull ((void **)&list2);
-       break;
+  setToNull ((void **)&list2);
+  break;
     case THROW_DEST :
-       setToNull ((void **)&list1);
-       break;
+  setToNull ((void **)&list1);
+  break;
     case THROW_BOTH :
-       setToNull ((void **)&list1);
-       setToNull ((void **)&list2);
+  setToNull ((void **)&list1);
+  setToNull ((void **)&list2);
     }
 
     return un;
@@ -269,27 +269,27 @@ set *unionSetsWith (set *list1 , set *list2, int (*cFunc)(),int throw)
 {
     set *un = NULL ;
     set *lp ;
-    
+
     /* add all elements in the first list */
     for (lp = list1 ; lp ; lp = lp->next )
-       addSet (&un,lp->item);
-    
+  addSet (&un,lp->item);
+
     /* now for all those in list2 which does not */
     /* already exist in the list add             */
     for (lp = list2 ; lp ; lp = lp->next )
-       if (!isinSetWith(un,lp->item,cFunc))
-           addSet (&un,lp->item);
-    
+  if (!isinSetWith(un,lp->item,cFunc))
+      addSet (&un,lp->item);
+
     switch (throw) {
     case THROW_SRC :
-       setToNull ((void **)&list2);
-       break;
+  setToNull ((void **)&list2);
+  break;
     case THROW_DEST :
-       setToNull ((void **)&list1);
-       break;
+  setToNull ((void **)&list1);
+  break;
     case THROW_BOTH :
-       setToNull ((void **)&list1);
-       setToNull ((void **)&list2);
+  setToNull ((void **)&list1);
+  setToNull ((void **)&list2);
     }
 
     return un;
@@ -302,54 +302,54 @@ set *intersectSets (set *list1, set *list2, int throw)
 {
     set *in = NULL;
     set *lp ;
-    
+
     /* we can take any one of the lists and iterate over it */
-    for (lp = list1 ; lp ; lp = lp->next ) 
-       if (isinSet (list2,lp->item) ) 
-           addSetHead(&in,lp->item);
+    for (lp = list1 ; lp ; lp = lp->next )
+  if (isinSet (list2,lp->item) )
+      addSetHead(&in,lp->item);
 
     switch (throw) {
     case THROW_SRC :
-       setToNull ((void **)&list2);
-       break;
+  setToNull ((void **)&list2);
+  break;
     case THROW_DEST :
-       setToNull ((void **)&list1);
-       break;
+  setToNull ((void **)&list1);
+  break;
     case THROW_BOTH :
-       setToNull ((void **)&list1);
-       setToNull ((void **)&list2);
+  setToNull ((void **)&list1);
+  setToNull ((void **)&list2);
     }
-    
-    return in; 
+
+    return in;
 }
 
 /*-----------------------------------------------------------------*/
 /* intersectSetsWith - returns list of items in common to two lists*/
 /*-----------------------------------------------------------------*/
-set *intersectSetsWith (set *list1, set *list2, 
-                       int (*cFunc)(void *,void *),int throw)
+set *intersectSetsWith (set *list1, set *list2,
+      int (*cFunc)(void *,void *),int throw)
 {
     set *in = NULL;
     set *lp ;
-    
+
     /* we can take any one of the lists and iterate over it */
-    for (lp = list1 ; lp ; lp = lp->next ) 
-       if (isinSetWith (list2,lp->item,cFunc) ) 
-           addSetHead(&in,lp->item);
+    for (lp = list1 ; lp ; lp = lp->next )
+  if (isinSetWith (list2,lp->item,cFunc) )
+      addSetHead(&in,lp->item);
 
     switch (throw) {
     case THROW_SRC :
-       setToNull ((void **)&list2);
-       break;
+  setToNull ((void **)&list2);
+  break;
     case THROW_DEST :
-       setToNull ((void **)&list1);
-       break;
+  setToNull ((void **)&list1);
+  break;
     case THROW_BOTH :
-       setToNull ((void **)&list1);
-       setToNull ((void **)&list2);
+  setToNull ((void **)&list1);
+  setToNull ((void **)&list2);
     }
-    
-    return in; 
+
+    return in;
 }
 
 /*-----------------------------------------------------------------*/
@@ -361,8 +361,8 @@ int elementsInSet (set *s)
     int count = 0 ;
 
     while (loop) {
-       count++ ;
-       loop = loop->next ;
+  count++ ;
+  loop = loop->next ;
     }
 
     return count ;
@@ -377,22 +377,22 @@ set *subtractFromSet (set *left, set *right, int throw)
     set *loop ;
 
     if (right) {
-       for (loop = right ; loop ; loop = loop->next)
-           if (isinSet(result,loop->item)) 
-               deleteSetItem (&result,loop->item);
+  for (loop = right ; loop ; loop = loop->next)
+      if (isinSet(result,loop->item))
+    deleteSetItem (&result,loop->item);
     }
-    
+
     switch (throw) {
     case THROW_SRC :
-       setToNull ((void **)&right);
-       break;
+  setToNull ((void **)&right);
+  break;
     case THROW_DEST :
-       setToNull ((void **)&left);
-       break;
+  setToNull ((void **)&left);
+  break;
     case THROW_BOTH :
-       setToNull ((void **)&left);
-       setToNull ((void **)&right);
-       break ;
+  setToNull ((void **)&left);
+  setToNull ((void **)&right);
+  break ;
     }
 
     return result ;
@@ -406,11 +406,11 @@ int applyToSet ( set *list , int (*somefunc)(void *, va_list ), ...)
     set *lp ;
     va_list ap;
     int rvalue = 0 ;
-    
+
     for (lp = list ; lp ; lp = lp->next ) {
-         va_start(ap,somefunc);
-         rvalue += (*somefunc)(lp->item,ap) ;
-         va_end(ap);
+    va_start(ap,somefunc);
+    rvalue += (*somefunc)(lp->item,ap) ;
+    va_end(ap);
     }
     return rvalue;
 }
@@ -424,13 +424,13 @@ int applyToSetFTrue ( set *list , int (*somefunc)(void *, va_list ), ...)
     set *lp ;
     va_list ap;
     int rvalue = 0 ;
-    
+
     for (lp = list ; lp ; lp = lp->next ) {
-         va_start(ap,somefunc);
-         rvalue += (*somefunc)(lp->item,ap);
-         va_end(ap);
-         if (rvalue)
-               break;
+    va_start(ap,somefunc);
+    rvalue += (*somefunc)(lp->item,ap);
+    va_end(ap);
+    if (rvalue)
+    break;
     }
     return rvalue;
 }
@@ -441,8 +441,8 @@ int applyToSetFTrue ( set *list , int (*somefunc)(void *, va_list ), ...)
 void *peekSet ( set *sp)
 {
     if (!sp)
-       return NULL ;
-    
+  return NULL ;
+
     return sp->item;
 }
 
@@ -452,8 +452,8 @@ void *peekSet ( set *sp)
 void *setFirstItem (set *sset)
 {
     if (sset) {
-       sset->curr = sset ;
-       return sset->item ;
+  sset->curr = sset ;
+  return sset->item ;
     }
 
     return NULL ;
@@ -464,9 +464,9 @@ void *setFirstItem (set *sset)
 void *setNextItem (set *sset)
 {
     if (sset && sset->curr ) {
-       sset->curr = sset->curr->next ;
-       if ( sset->curr )
-           return sset->curr->item ;       
+  sset->curr = sset->curr->next ;
+  if ( sset->curr )
+      return sset->curr->item ;
     }
     return NULL ;
 }
@@ -478,17 +478,17 @@ void *getSet (set **list)
 {
     set *lp;
     void *item ;
-    
+
     /* if list is empty then we cannot delete */
     if (*list == NULL )
-       return (void *) NULL ;
-    
-    
+  return (void *) NULL ;
+
+
     /* find the item in the list */
     lp = *list ;
     item = lp->item; /* save the item */
-    
-    *list = lp->next ;   
+
+    *list = lp->next ;
     return item ;
 }
 
@@ -497,12 +497,12 @@ void *getSet (set **list)
 /*-----------------------------------------------------------------*/
 void setToNull (void **item )
 {
-    
+
     if ( !item  )
-       return ;
+  return ;
 
     if (! *item )
-       return ;
-    free(*item);  
+  return ;
+    free(*item);
     *item = NULL ;
 }
index 294cb8e5138f3da5dbd043f1a1fdc4c655ce7abe..9898c870b75e36b36be044a314da41a23d0cd059 100644 (file)
@@ -1,24 +1,24 @@
 /*-------------------------------------------------------------------------
-  SDCCsymt.c - Code file for Symbols table related structures and MACRO's.              
-             Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
+  SDCCsymt.c - Code file for Symbols table related structures and MACRO's.
+        Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "common.h"
@@ -39,19 +39,19 @@ void  initSymt ()
 
    for ( i = 0 ; i < 256 ; i++ )
       SymbolTab[i] = StructTab[i] = (void *) NULL ;
-   
-   
+
+
 }
 /*-----------------------------------------------------------------*/
-/* newBucket - allocates & returns a new bucket                   */
+/* newBucket - allocates & returns a new bucket        */
 /*-----------------------------------------------------------------*/
-bucket  *newBucket ()
+bucket   *newBucket ()
 {
-       bucket *bp ;
-             
-       bp = Safe_calloc(sizeof(bucket));
-       
-       return bp ;
+  bucket *bp ;
+
+  bp = Safe_calloc(1,sizeof(bucket));
+
+  return bp ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -62,84 +62,84 @@ int hashKey (const char *s)
     unsigned long key = 0;
 
     while (*s)
-       key += *s++ ;
+  key += *s++ ;
     return key % 256 ;
 }
 
 /*-----------------------------------------------------------------*/
 /* addSym - adds a symbol to the hash Table                        */
 /*-----------------------------------------------------------------*/
-void  addSym ( bucket **stab , 
-              void *sym     , 
-              char *sname   , 
-              int level     , 
-              int block)
+void  addSym ( bucket **stab ,
+         void *sym     ,
+         char *sname   ,
+         int level     ,
+         int block)
 {
-    int i ;      /* index into the hash Table */
-    bucket   *bp ; /* temp bucket    *        */
-    
+    int i ;   /* index into the hash Table */
+    bucket   *bp ; /* temp bucket    *         */
+
     /* the symbols are always added at the head of the list  */
-    i = hashKey(sname) ;      
+    i = hashKey(sname) ;
     /* get a free entry */
-    bp = Safe_calloc(sizeof(bucket));
-    
-    bp->sym = sym ;    /* update the symbol pointer  */
-    bp->level = level;   /* update the nest level      */   
+    bp = Safe_calloc(1,sizeof(bucket));
+
+    bp->sym = sym ; /* update the symbol pointer  */
+    bp->level = level;   /* update the nest level      */
     bp->block = block;
-    strcpy(bp->name,sname);    /* copy the name into place     */
-    
+    strcpy(bp->name,sname); /* copy the name into place */
+
     /* if this is the first entry */
     if (stab[i] == NULL) {
-       bp->prev = bp->next = (void *) NULL ;  /* point to nothing */
-       stab[i] = bp ;
+  bp->prev = bp->next = (void *) NULL ;  /* point to nothing */
+  stab[i] = bp ;
     }
     /* not first entry then add @ head of list */
-    else {       
-       bp->prev      = NULL ;
-       stab[i]->prev = bp ;
-       bp->next      = stab[i] ;
-       stab[i]       = bp ;
+    else {
+  bp->prev      = NULL ;
+  stab[i]->prev = bp ;
+  bp->next      = stab[i] ;
+  stab[i]       = bp ;
     }
 }
 
 /*-----------------------------------------------------------------*/
-/* deleteSym - deletes a symbol from the hash Table  entry        */
+/* deleteSym - deletes a symbol from the hash Table  entry     */
 /*-----------------------------------------------------------------*/
 void  deleteSym ( bucket **stab, void *sym, char *sname)
 {
     int i = 0 ;
     bucket *bp ;
-    
+
     i = hashKey(sname) ;
-    
+
     bp = stab[i] ;
     /* find the symbol */
     while (bp) {
-       if (bp->sym == sym)  /* found it then break out */
-           break ;        /* of the loop             */
-       bp = bp->next ;
+  if (bp->sym == sym)  /* found it then break out */
+      break ;    /* of the loop       */
+  bp = bp->next ;
     }
-    
+
     if (!bp)   /* did not find it */
-       return ;
+  return ;
     /* if this is the first one in the chain */
     if ( ! bp->prev ) {
-       stab[i] = bp->next ;
-       if ( stab[i] ) /* if chain ! empty */
-           stab[i]->prev = (void *) NULL ;
+  stab[i] = bp->next ;
+  if ( stab[i] ) /* if chain ! empty */
+      stab[i]->prev = (void *) NULL ;
     }
     /* middle || end of chain */
     else {
-       if ( bp->next ) /* if not end of chain */
-           bp->next->prev = bp->prev ;
-       
-       bp->prev->next = bp->next ;
+  if ( bp->next ) /* if not end of chain */
+      bp->next->prev = bp->prev ;
+
+  bp->prev->next = bp->next ;
     }
 
 }
 
 /*-----------------------------------------------------------------*/
-/* findSym - finds a symbol in a table                            */
+/* findSym - finds a symbol in a table           */
 /*-----------------------------------------------------------------*/
 void  *findSym ( bucket **stab, void *sym, const char *sname)
 {
@@ -149,7 +149,7 @@ void  *findSym ( bucket **stab, void *sym, const char *sname)
    while (bp)
    {
       if ( bp->sym == sym || strcmp (bp->name,sname) == 0 )
-             break ;
+        break ;
       bp = bp->next ;
    }
 
@@ -166,10 +166,10 @@ void *findSymWithLevel ( bucket **stab, symbol *sym)
   bp = stab[hashKey(sym->name)];
 
   /**
-   **  do the search from the head of the list since the 
+   **  do the search from the head of the list since the
    **  elements are added at the head it is ensured that
    ** we will find the deeper definitions before we find
-   ** the global ones. we need to check for symbols with 
+   ** the global ones. we need to check for symbols with
    ** level <= to the level given, if levels match then block
    ** numbers need to match as well
    **/
@@ -178,19 +178,19 @@ void *findSymWithLevel ( bucket **stab, symbol *sym)
     if ( strcmp(bp->name,sym->name) == 0 && bp->level <= sym->level) {
       /* if this is parameter then nothing else need to be checked */
       if (((symbol *)(bp->sym))->_isparm)
-       return (bp->sym) ;
+  return (bp->sym) ;
       /* if levels match then block numbers hsould also match */
       if (bp->level && bp->level == sym->level && bp->block == sym->block )
-             return ( bp->sym );
+        return ( bp->sym );
       /* if levels don't match then we are okay */
       if (bp->level && bp->level != sym->level)
-             return ( bp->sym );
+        return ( bp->sym );
       /* if this is a global variable then we are ok too */
       if (bp->level == 0 )
-             return (bp->sym);
+        return (bp->sym);
     }
-    
-    bp = bp->next; 
+
+    bp = bp->next;
   }
 
   return (void *) NULL ;
@@ -207,8 +207,8 @@ void  *findSymWithBlock ( bucket **stab, symbol *sym, int block)
    while (bp)
    {
       if ( strcmp (bp->name,sym->name) == 0 &&
-          bp->block <= block )
-             break ;
+     bp->block <= block )
+        break ;
       bp = bp->next ;
    }
 
@@ -221,13 +221,13 @@ void  *findSymWithBlock ( bucket **stab, symbol *sym, int block)
 symbol *newSymbol (char *name, int scope )
 {
    symbol *sym ;
-   
-   sym = Safe_calloc(sizeof(symbol));   
+
+   sym = Safe_calloc(1,sizeof(symbol));
 
    strcpy(sym->name,name);             /* copy the name    */
    sym->level = scope ;                /* set the level    */
    sym->block = currBlockno ;
-   sym->lineDef = yylineno ;    /* set the line number */   
+   sym->lineDef = yylineno ;    /* set the line number */
    return sym ;
 }
 
@@ -238,7 +238,7 @@ sym_link  *newLink ()
 {
    sym_link *p ;
 
-   p = Safe_calloc(sizeof(sym_link));
+   p = Safe_calloc(1,sizeof(sym_link));
 
    return p;
 }
@@ -250,8 +250,8 @@ structdef   *newStruct  ( char   *tag   )
 {
    structdef  *s;
 
-   s = Safe_calloc(sizeof(structdef));
-   
+   s = Safe_calloc(1,sizeof(structdef));
+
    strcpy(s->tag,tag) ;                     /* copy the tag            */
    return s ;
 }
@@ -260,68 +260,68 @@ structdef   *newStruct  ( char   *tag   )
 /* pointerTypes - do the computation for the pointer types          */
 /*------------------------------------------------------------------*/
 void pointerTypes (sym_link *ptr, sym_link *type)
-{    
+{
     if (IS_SPEC(ptr))
-       return ;
-    
+  return ;
+
     /* find the first pointer type */
-    while (ptr && !IS_PTR(ptr)) 
-       ptr = ptr->next;
+    while (ptr && !IS_PTR(ptr))
+  ptr = ptr->next;
 
     /* could not find it */
     if (!ptr || IS_SPEC(ptr) ||
-       DCL_TYPE(ptr) != UPOINTER)
-       return ;
-       
-    /* change the pointer type depending on the 
+  DCL_TYPE(ptr) != UPOINTER)
+  return ;
+
+    /* change the pointer type depending on the
        storage class of the type */
     if (IS_SPEC(type)) {
-       DCL_PTR_CONST(ptr) = SPEC_CONST(type);
-       DCL_PTR_VOLATILE(ptr) = SPEC_VOLATILE(type);
-       switch (SPEC_SCLS(type)) {
-       case S_XDATA:
-           DCL_TYPE(ptr) = FPOINTER;
-           break;
-       case S_IDATA:
-           DCL_TYPE(ptr) = IPOINTER ;
-           break;
-       case S_PDATA:
-           DCL_TYPE(ptr) = PPOINTER ;
-           break;
-       case S_DATA:
-           DCL_TYPE(ptr) = POINTER ;
-           break;
-       case S_CODE:
-           DCL_PTR_CONST(ptr) = port->mem.code_ro;
-           DCL_TYPE(ptr) = CPOINTER ;
-           break;
-       case S_EEPROM:
-           DCL_TYPE(ptr) = EEPPOINTER;
-           break;
-       default:
-           DCL_TYPE(ptr) = GPOINTER;
-           break;
-       }
-       /* the storage class of type ends here */
-       SPEC_SCLS(type) =
-           SPEC_CONST(type) =
-           SPEC_VOLATILE(type) = 0;
-    }    
-    
+  DCL_PTR_CONST(ptr) = SPEC_CONST(type);
+  DCL_PTR_VOLATILE(ptr) = SPEC_VOLATILE(type);
+  switch (SPEC_SCLS(type)) {
+  case S_XDATA:
+      DCL_TYPE(ptr) = FPOINTER;
+      break;
+  case S_IDATA:
+      DCL_TYPE(ptr) = IPOINTER ;
+      break;
+  case S_PDATA:
+      DCL_TYPE(ptr) = PPOINTER ;
+      break;
+  case S_DATA:
+      DCL_TYPE(ptr) = POINTER ;
+      break;
+  case S_CODE:
+      DCL_PTR_CONST(ptr) = port->mem.code_ro;
+      DCL_TYPE(ptr) = CPOINTER ;
+      break;
+  case S_EEPROM:
+      DCL_TYPE(ptr) = EEPPOINTER;
+      break;
+  default:
+      DCL_TYPE(ptr) = GPOINTER;
+      break;
+  }
+  /* the storage class of type ends here */
+  SPEC_SCLS(type) =
+      SPEC_CONST(type) =
+      SPEC_VOLATILE(type) = 0;
+    }
+
     /* now change all the remaining unknown pointers
        to generic pointers */
     while (ptr) {
-       if (!IS_SPEC(ptr) && DCL_TYPE(ptr) == UPOINTER)
-           DCL_TYPE(ptr) = GPOINTER;
-       ptr = ptr->next;
+  if (!IS_SPEC(ptr) && DCL_TYPE(ptr) == UPOINTER)
+      DCL_TYPE(ptr) = GPOINTER;
+  ptr = ptr->next;
     }
 
     /* same for the type although it is highly unlikely that
        type will have a pointer */
     while (type) {
-       if (!IS_SPEC(type) && DCL_TYPE(type) == UPOINTER)
-           DCL_TYPE(type) = GPOINTER;
-       type = type->next;
+  if (!IS_SPEC(type) && DCL_TYPE(type) == UPOINTER)
+      DCL_TYPE(type) = GPOINTER;
+  type = type->next;
     }
 
 }
@@ -334,56 +334,56 @@ void  addDecl ( symbol *sym, int type , sym_link *p )
     sym_link    *head;
     sym_link    *tail;
     sym_link        *t ;
-    
+
     /* if we are passed a link then set head & tail */
     if ( p )  {
-       tail = head = p ;
-       while ( tail->next )
-           tail = tail->next ;
+  tail = head = p ;
+  while ( tail->next )
+      tail = tail->next ;
     }
     else {
-       head = tail = newLink() ;
-       DCL_TYPE(head) = type   ;
+  head = tail = newLink() ;
+  DCL_TYPE(head) = type   ;
     }
-    
+
     /* if this is the first entry   */
     if ( !sym->type )  {
-       sym->type = head ;
-       sym->etype = tail ;
+  sym->type = head ;
+  sym->etype = tail ;
     }
     else   {
-       if ( IS_SPEC(sym->etype) && IS_SPEC(head) && head == tail ) {
-           sym->etype = mergeSpec(sym->etype,head);
-       }
-       else {
-           if ( IS_SPEC(sym->etype) && !IS_SPEC(head) && head == tail ) {
-               t = sym->type ;
-               while (t->next != sym->etype) t = t->next ;
-               t->next = head ;
-               tail->next = sym->etype;
-           } else {
-               sym->etype->next = head;
-               sym->etype   = tail;
-           }
-       }
+  if ( IS_SPEC(sym->etype) && IS_SPEC(head) && head == tail ) {
+      sym->etype = mergeSpec(sym->etype,head);
+  }
+  else {
+      if ( IS_SPEC(sym->etype) && !IS_SPEC(head) && head == tail ) {
+    t = sym->type ;
+    while (t->next != sym->etype) t = t->next ;
+    t->next = head ;
+    tail->next = sym->etype;
+      } else {
+    sym->etype->next = head;
+    sym->etype   = tail;
+      }
+  }
     }
-    
+
     /* if the type is a unknown pointer and has
        a tspec then take the storage class const & volatile
        attribute from the tspec & make it those of this
        symbol */
     if (p &&
-       !IS_SPEC(p) && 
-       DCL_TYPE(p) == UPOINTER &&
-       DCL_TSPEC(p)) {
-       if (!IS_SPEC(sym->etype)) {
-           sym->etype = sym->etype->next = newLink();
-           sym->etype->class = SPECIFIER;
-       }
-       SPEC_SCLS(sym->etype) = SPEC_SCLS(DCL_TSPEC(p));
-       SPEC_CONST(sym->etype) = SPEC_CONST(DCL_TSPEC(p));
-       SPEC_VOLATILE(sym->etype) = SPEC_VOLATILE(DCL_TSPEC(p));
-       DCL_TSPEC(p) = NULL;
+  !IS_SPEC(p) &&
+  DCL_TYPE(p) == UPOINTER &&
+  DCL_TSPEC(p)) {
+  if (!IS_SPEC(sym->etype)) {
+      sym->etype = sym->etype->next = newLink();
+      sym->etype->class = SPECIFIER;
+  }
+  SPEC_SCLS(sym->etype) = SPEC_SCLS(DCL_TSPEC(p));
+  SPEC_CONST(sym->etype) = SPEC_CONST(DCL_TSPEC(p));
+  SPEC_VOLATILE(sym->etype) = SPEC_VOLATILE(DCL_TSPEC(p));
+  DCL_TSPEC(p) = NULL;
     }
     return  ;
 }
@@ -395,11 +395,11 @@ sym_link  *mergeSpec ( sym_link *dest, sym_link *src )
 {
     /* if noun different then src overrides */
     if ( SPEC_NOUN(dest) != SPEC_NOUN(src) && !SPEC_NOUN(dest))
-       SPEC_NOUN(dest) = SPEC_NOUN(src) ;
-    
+  SPEC_NOUN(dest) = SPEC_NOUN(src) ;
+
     if (! SPEC_SCLS(dest))  /* if destination has no storage class */
-       SPEC_SCLS(dest) = SPEC_SCLS(src) ;
-    
+  SPEC_SCLS(dest) = SPEC_SCLS(src) ;
+
     /* copy all the specifications  */
     SPEC_LONG(dest) |= SPEC_LONG(src);
     SPEC_SHORT(dest) |= SPEC_SHORT(src);
@@ -420,8 +420,8 @@ sym_link  *mergeSpec ( sym_link *dest, sym_link *src )
     SPEC_NONBANKED(dest) |= SPEC_NONBANKED(src);
 
     if ( IS_STRUCT(dest) && SPEC_STRUCT(dest) == NULL )
-       SPEC_STRUCT(dest) = SPEC_STRUCT(src);   
-    
+  SPEC_STRUCT(dest) = SPEC_STRUCT(src);
+
     return dest ;
 }
 
@@ -431,11 +431,11 @@ sym_link  *mergeSpec ( sym_link *dest, sym_link *src )
 sym_link  *cloneSpec ( sym_link *src )
 {
     sym_link  *spec ;
-    
+
     /* go thru chain till we find the specifier */
     while ( src && src->class != SPECIFIER )
-       src = src->next ;
-    
+  src = src->next ;
+
     spec = newLink() ;
     memcpy (spec,src,sizeof(sym_link));
     return spec ;
@@ -448,7 +448,7 @@ char  *genSymName ( int level )
 {
     static   int gCount = 0 ;
     static   char gname[SDCC_NAME_MAX+1] ;
-    
+
     sprintf (gname,"__%04d%04d",level,gCount++);
     return gname ;
 }
@@ -459,11 +459,11 @@ char  *genSymName ( int level )
 sym_link  *getSpec ( sym_link *p )
 {
     sym_link *loop ;
-    
+
     loop = p ;
     while ( p && ! (IS_SPEC(p)))
-       p = p->next ;
-    
+  p = p->next ;
+
     return p ;
 }
 
@@ -473,11 +473,11 @@ sym_link  *getSpec ( sym_link *p )
 sym_link  *newCharLink()
 {
     sym_link *p;
-    
+
     p = newLink();
     p->class = SPECIFIER ;
     SPEC_NOUN(p) = V_CHAR ;
-    
+
     return p;
 }
 
@@ -487,11 +487,11 @@ sym_link  *newCharLink()
 sym_link *newFloatLink()
 {
     sym_link *p;
-    
+
     p = newLink();
     p->class = SPECIFIER ;
     SPEC_NOUN(p) = V_FLOAT ;
-    
+
     return p;
 }
 
@@ -506,7 +506,7 @@ sym_link *newLongLink()
     p->class = SPECIFIER ;
     SPEC_NOUN(p) = V_INT ;
     SPEC_LONG(p) = 1;
-    
+
     return p;
 }
 
@@ -516,11 +516,11 @@ sym_link *newLongLink()
 sym_link  *newIntLink()
 {
     sym_link *p;
-    
+
     p = newLink();
     p->class = SPECIFIER ;
     SPEC_NOUN(p) = V_INT ;
-    
+
     return p;
 }
 
@@ -531,49 +531,49 @@ unsigned int   getSize ( sym_link *p )
 {
     /* if nothing return 0 */
     if ( ! p )
-       return 0 ;
+  return 0 ;
     if ( IS_SPEC(p) ) { /* if this is the specifier then */
-       switch (SPEC_NOUN(p)) { /* depending on the specifier type */
-       case V_INT:
-           return (IS_LONG(p) ? LONGSIZE : ( IS_SHORT(p) ? SHORTSIZE: INTSIZE)) ;
-       case V_FLOAT:
-           return FLOATSIZE ;
-       case V_CHAR:
-           return CHARSIZE ;
-       case V_VOID:
-           return   0 ;
-       case V_STRUCT:
-           return SPEC_STRUCT(p)->size ;
-       case V_LABEL:
-           return 0 ;
-       case V_SBIT:
-           return BITSIZE ;
-       case V_BIT:
-           return ((SPEC_BLEN(p) / 8) + (SPEC_BLEN(p) % 8 ? 1 : 0)) ;
-       default  :
-           return 0 ;
-       }
+  switch (SPEC_NOUN(p)) { /* depending on the specifier type */
+  case V_INT:
+      return (IS_LONG(p) ? LONGSIZE : ( IS_SHORT(p) ? SHORTSIZE: INTSIZE)) ;
+  case V_FLOAT:
+      return FLOATSIZE ;
+  case V_CHAR:
+      return CHARSIZE ;
+  case V_VOID:
+      return   0 ;
+  case V_STRUCT:
+      return SPEC_STRUCT(p)->size ;
+  case V_LABEL:
+      return 0 ;
+  case V_SBIT:
+      return BITSIZE ;
+  case V_BIT:
+      return ((SPEC_BLEN(p) / 8) + (SPEC_BLEN(p) % 8 ? 1 : 0)) ;
+  default  :
+      return 0 ;
+  }
     }
-    
+
     /* this is a specifier  */
     switch (DCL_TYPE(p))  {
     case FUNCTION:
-       return 2;
+  return 2;
     case ARRAY:
-       return DCL_ELEM(p) * getSize (p->next) ;
+  return DCL_ELEM(p) * getSize (p->next) ;
     case IPOINTER:
     case PPOINTER:
     case POINTER:
-       return ( PTRSIZE ) ;
+  return ( PTRSIZE ) ;
     case EEPPOINTER:
     case FPOINTER:
     case CPOINTER:
-       return ( FPTRSIZE );
-    case GPOINTER:     
-       return ( GPTRSIZE );
-       
+  return ( FPTRSIZE );
+    case GPOINTER:
+  return ( GPTRSIZE );
+
     default     :
-       return  0 ;
+  return  0 ;
     }
 }
 
@@ -584,51 +584,51 @@ unsigned int   bitsForType ( sym_link *p )
 {
     /* if nothing return 0 */
     if ( ! p )
-       return 0 ;
-    
+  return 0 ;
+
     if ( IS_SPEC(p) ) { /* if this is the specifier then */
-       
-       switch (SPEC_NOUN(p)) { /* depending on the specifier type */
-       case V_INT:
-           return (IS_LONG(p) ? LONGSIZE*8 : ( IS_SHORT(p) ? SHORTSIZE*8: INTSIZE*8)) ;
-       case V_FLOAT:
-           return FLOATSIZE*8 ;
-       case V_CHAR:
-           return   CHARSIZE*8 ;
-       case V_VOID:
-           return   0 ;
-       case V_STRUCT:
-           return   SPEC_STRUCT(p)->size*8 ;
-       case V_LABEL:
-           return 0 ;
-       case V_SBIT:
-           return 1 ;
-       case V_BIT:
-           return SPEC_BLEN(p);
-       default  :
-           return 0 ;
-       }
+
+  switch (SPEC_NOUN(p)) { /* depending on the specifier type */
+  case V_INT:
+      return (IS_LONG(p) ? LONGSIZE*8 : ( IS_SHORT(p) ? SHORTSIZE*8: INTSIZE*8)) ;
+  case V_FLOAT:
+      return FLOATSIZE*8 ;
+  case V_CHAR:
+      return   CHARSIZE*8 ;
+  case V_VOID:
+      return   0 ;
+  case V_STRUCT:
+      return   SPEC_STRUCT(p)->size*8 ;
+  case V_LABEL:
+      return 0 ;
+  case V_SBIT:
+      return 1 ;
+  case V_BIT:
+      return SPEC_BLEN(p);
+  default  :
+      return 0 ;
+  }
     }
-    
+
     /* this is a specifier  */
     switch (DCL_TYPE(p))  {
     case FUNCTION:
-       return 2;
+  return 2;
     case ARRAY:
-       return DCL_ELEM(p) * getSize (p->next) *8 ;
+  return DCL_ELEM(p) * getSize (p->next) *8 ;
     case IPOINTER:
     case PPOINTER:
     case POINTER:
-       return ( PTRSIZE * 8) ;
+  return ( PTRSIZE * 8) ;
     case EEPPOINTER:
     case FPOINTER:
     case CPOINTER:
-       return ( FPTRSIZE * 8);
+  return ( FPTRSIZE * 8);
     case GPOINTER:
-       return ( GPTRSIZE * 8);
-       
+  return ( GPTRSIZE * 8);
+
     default     :
-       return  0 ;
+  return  0 ;
     }
 }
 
@@ -637,14 +637,14 @@ unsigned int   bitsForType ( sym_link *p )
 /*------------------------------------------------------------------*/
 symbol *copySymbolChain (symbol *src)
 {
-       symbol *dest ;
+  symbol *dest ;
 
-       if (!src)
-               return NULL ;
+  if (!src)
+    return NULL ;
 
-       dest = copySymbol(src);
-       dest->next = copySymbolChain(src->next);
-       return dest ;
+  dest = copySymbol(src);
+  dest->next = copySymbolChain(src->next);
+  return dest ;
 }
 
 /*------------------------------------------------------------------*/
@@ -652,24 +652,24 @@ symbol *copySymbolChain (symbol *src)
 /*------------------------------------------------------------------*/
 symbol  *copySymbol     (symbol *src)
 {
-       symbol *dest;
-
-       if (!src )
-               return NULL ;
-
-       dest = newSymbol( src->name, src->level );
-       memcpy(dest,src,sizeof(symbol));
-       dest->level = src->level ;
-       dest->block = src->block ;
-       dest->ival = copyIlist(src->ival);
-       dest->type = copyLinkChain(src->type);
-       dest->etype= getSpec(dest->type);
-       dest->next = NULL ;
-       dest->args = copyValueChain (src->args);
-       dest->key = src->key;
-       dest->calleeSave = src->calleeSave;
-       dest->allocreq = src->allocreq;
-       return dest;
+  symbol *dest;
+
+  if (!src )
+    return NULL ;
+
+  dest = newSymbol( src->name, src->level );
+  memcpy(dest,src,sizeof(symbol));
+  dest->level = src->level ;
+  dest->block = src->block ;
+  dest->ival = copyIlist(src->ival);
+  dest->type = copyLinkChain(src->type);
+  dest->etype= getSpec(dest->type);
+  dest->next = NULL ;
+  dest->args = copyValueChain (src->args);
+  dest->key = src->key;
+  dest->calleeSave = src->calleeSave;
+  dest->allocreq = src->allocreq;
+  return dest;
 }
 
 /*------------------------------------------------------------------*/
@@ -730,39 +730,39 @@ void addSymChain ( symbol *symHead )
 
   for (;sym != NULL ; sym = sym->next ) {
 
-    /* if already exists in the symbol table then check if 
-       the previous was an extern definition if yes then   
-       then check if the type match, if the types match then 
-       delete the current entry and add the new entry      */   
+    /* if already exists in the symbol table then check if
+       the previous was an extern definition if yes then
+       then check if the type match, if the types match then
+       delete the current entry and add the new entry      */
       if ((csym = findSymWithLevel (SymbolTab,sym)) &&
-       csym->level == sym->level) {
-      
+  csym->level == sym->level) {
+
       /* previous definition extern ? */
       if ( IS_EXTERN(csym->etype) ) {
-       /* do types match ? */
-       if (checkType ( csym->type,sym->type) != 1)
-         /* no then error */
-         werror (E_DUPLICATE,csym->name);
-
-       /* delete current entry */
-       deleteSym (SymbolTab, csym, csym->name );
-       /* add new entry */
-       addSym (SymbolTab, sym, sym->name, sym->level,sym->block);
+  /* do types match ? */
+  if (checkType ( csym->type,sym->type) != 1)
+    /* no then error */
+    werror (E_DUPLICATE,csym->name);
+
+  /* delete current entry */
+  deleteSym (SymbolTab, csym, csym->name );
+  /* add new entry */
+  addSym (SymbolTab, sym, sym->name, sym->level,sym->block);
       } else /* not extern */
-         werror(E_DUPLICATE,sym->name) ;
+    werror(E_DUPLICATE,sym->name) ;
       continue ;
     }
-    
+
     /* check if previously defined */
     if (csym  && csym->level == sym->level  ) {
       /* if the previous one was declared as extern */
       /* then check the type with the current one         */
       if ( IS_EXTERN(csym->etype) ) {
-       if ( checkType (csym->type, sym->type ) <= 0 )
-         werror (W_EXTERN_MISMATCH,csym->name);
+  if ( checkType (csym->type, sym->type ) <= 0 )
+    werror (W_EXTERN_MISMATCH,csym->name);
       }
     }
-    
+
     addSym (SymbolTab,sym,sym->name,sym->level,sym->block) ;
   }
 }
@@ -774,9 +774,9 @@ void addSymChain ( symbol *symHead )
 int funcInChain (sym_link *lnk)
 {
     while (lnk) {
-       if (IS_FUNC(lnk))
-           return 1;
-       lnk = lnk->next;
+  if (IS_FUNC(lnk))
+      return 1;
+  lnk = lnk->next;
     }
     return 0;
 }
@@ -791,24 +791,24 @@ sym_link *structElemType (sym_link *stype, value *id ,value **argsp)
     sym_link *petype = getSpec(stype);
 
     if ( ! fields || ! id)
-       return NULL ;
-       
+  return NULL ;
+
     /* look for the id */
     while (fields) {
-       if (strcmp(fields->rname,id->name) == 0) {
-           if (argsp) {
-               *argsp = fields->args;
-           }
-           type = copyLinkChain (fields->type) ;
-           etype=getSpec(type);
-           SPEC_SCLS(etype) = (SPEC_SCLS(petype) == S_REGISTER ? 
-                               SPEC_SCLS(etype) : SPEC_SCLS(petype));
-           return type;
-       }
-       fields = fields->next ;
+  if (strcmp(fields->rname,id->name) == 0) {
+      if (argsp) {
+    *argsp = fields->args;
+      }
+      type = copyLinkChain (fields->type) ;
+      etype=getSpec(type);
+      SPEC_SCLS(etype) = (SPEC_SCLS(petype) == S_REGISTER ?
+        SPEC_SCLS(etype) : SPEC_SCLS(petype));
+      return type;
+  }
+  fields = fields->next ;
     }
     werror(E_NOT_MEMBER,id->name);
-    
+
     return NULL ;
 }
 
@@ -818,13 +818,13 @@ sym_link *structElemType (sym_link *stype, value *id ,value **argsp)
 symbol *getStructElement ( structdef *sdef, symbol *sym)
 {
     symbol *field ;
-    
+
     for ( field = sdef->fields ; field ; field = field->next )
-       if ( strcmp(field->name,sym->name) == 0)
-           return field ;
-    
+  if ( strcmp(field->name,sym->name) == 0)
+      return field ;
+
     werror(E_NOT_MEMBER,sym->name);
-    
+
     return sdef->fields ;
 }
 
@@ -836,68 +836,68 @@ int   compStructSize (int su, structdef  *sdef )
     int sum = 0 , usum =0;
     int bitOffset = 0 ;
     symbol   *loop ;
-    
+
     /* for the identifiers  */
     loop = sdef->fields ;
     while ( loop ) {
 
-       /* create the internal name for this variable */
-       sprintf (loop->rname,"_%s",loop->name);
-       loop->offset = ( su == UNION ? sum = 0 : sum ) ;
-       SPEC_VOLATILE(loop->etype) |= (su == UNION ? 1 : 0);
-
-       /* if this is a bit field  */
-       if (loop->bitVar)       {
-           
-           /* change it to a unsigned bit */
-           SPEC_NOUN(loop->etype) = V_BIT ;
-           SPEC_USIGN(loop->etype) = 1     ;
-           /* check if this fit into the remaining   */
-           /* bits of this byte else align it to the */
-           /* next byte boundary                     */
-           if ((SPEC_BLEN(loop->etype)=loop->bitVar) <= (8 - bitOffset))  {
-               SPEC_BSTR(loop->etype) = bitOffset   ;
-               if ((bitOffset += (loop->bitVar % 8)) == 8) sum++;
-           } 
-           else  /* does not fit */
-               {
-                   bitOffset = 0 ;
-                   SPEC_BSTR(loop->etype) = bitOffset   ;
-                   sum += (loop->bitVar / 8)  ;
-                   bitOffset += (loop->bitVar % 8);
-               }
-           /* if this is the last field then pad */
-           if (!loop->next && bitOffset && bitOffset != 8) {
-               bitOffset = 0 ;
-               sum++ ;
-           }
-       }
-       else {
-           checkDecl (loop);
-           sum += getSize (loop->type) ;
-       }
-
-       /* if function then do the arguments for it */
-       if (funcInChain(loop->type)) {
-           processFuncArgs (loop, 1);
-       }
-
-       loop = loop->next ;
-
-       /* if this is not a bitfield but the */
-       /* previous one was and did not take */
-       /* the whole byte then pad the rest  */
-       if ((loop && !loop->bitVar) && bitOffset) {
-           bitOffset = 0 ;
-           sum++ ;
-       }
-       
-       /* if union then size = sizeof larget field */
-       if (su == UNION)
-           usum = max(usum,sum);
-    
+  /* create the internal name for this variable */
+  sprintf (loop->rname,"_%s",loop->name);
+  loop->offset = ( su == UNION ? sum = 0 : sum ) ;
+  SPEC_VOLATILE(loop->etype) |= (su == UNION ? 1 : 0);
+
+  /* if this is a bit field  */
+  if (loop->bitVar)       {
+
+      /* change it to a unsigned bit */
+      SPEC_NOUN(loop->etype) = V_BIT ;
+      SPEC_USIGN(loop->etype) = 1     ;
+      /* check if this fit into the remaining   */
+      /* bits of this byte else align it to the */
+      /* next byte boundary                     */
+      if ((SPEC_BLEN(loop->etype)=loop->bitVar) <= (8 - bitOffset))  {
+    SPEC_BSTR(loop->etype) = bitOffset   ;
+    if ((bitOffset += (loop->bitVar % 8)) == 8) sum++;
+      }
+      else  /* does not fit */
+    {
+        bitOffset = 0 ;
+        SPEC_BSTR(loop->etype) = bitOffset   ;
+        sum += (loop->bitVar / 8)  ;
+        bitOffset += (loop->bitVar % 8);
     }
-    
+      /* if this is the last field then pad */
+      if (!loop->next && bitOffset && bitOffset != 8) {
+    bitOffset = 0 ;
+    sum++ ;
+      }
+  }
+  else {
+      checkDecl (loop);
+      sum += getSize (loop->type) ;
+  }
+
+  /* if function then do the arguments for it */
+  if (funcInChain(loop->type)) {
+      processFuncArgs (loop, 1);
+  }
+
+  loop = loop->next ;
+
+  /* if this is not a bitfield but the */
+  /* previous one was and did not take */
+  /* the whole byte then pad the rest  */
+  if ((loop && !loop->bitVar) && bitOffset) {
+      bitOffset = 0 ;
+      sum++ ;
+  }
+
+  /* if union then size = sizeof larget field */
+    if (su == UNION)
+      usum = max(usum,sum);
+
+    }
+
     return (su == UNION ? usum : sum);
 }
 
@@ -905,132 +905,132 @@ int   compStructSize (int su, structdef  *sdef )
 /* checkSClass - check the storage class specification              */
 /*------------------------------------------------------------------*/
 static void  checkSClass ( symbol *sym )
-{         
+{
     /* type is literal can happen foe enums change
        to auto */
     if (SPEC_SCLS(sym->etype) == S_LITERAL && !SPEC_ENUM(sym->etype))
-       SPEC_SCLS(sym->etype) = S_AUTO;
+  SPEC_SCLS(sym->etype) = S_AUTO;
 
     /* if sfr or sbit then must also be */
     /* volatile the initial value will be xlated */
     /* to an absolute address */
     if (SPEC_SCLS(sym->etype) == S_SBIT ||
-       SPEC_SCLS(sym->etype) == S_SFR ) {
-       SPEC_VOLATILE(sym->etype) = 1;
-       /* if initial value given */
-       if (sym->ival) {
-           SPEC_ABSA(sym->etype) = 1;
-           SPEC_ADDR(sym->etype) =
-               (int) list2int(sym->ival);
-           sym->ival = NULL;
-       }
+  SPEC_SCLS(sym->etype) == S_SFR ) {
+  SPEC_VOLATILE(sym->etype) = 1;
+  /* if initial value given */
+  if (sym->ival) {
+      SPEC_ABSA(sym->etype) = 1;
+      SPEC_ADDR(sym->etype) =
+    (int) list2int(sym->ival);
+      sym->ival = NULL;
+  }
     }
 
     /* if absolute address given then it mark it as
        volatile */
     if (IS_ABSOLUTE(sym->etype))
-       SPEC_VOLATILE(sym->etype) = 1;
+  SPEC_VOLATILE(sym->etype) = 1;
 
     /* global variables declared const put into code */
-    if (sym->level == 0 && 
-       SPEC_SCLS(sym->etype) == S_CONSTANT) {
-       SPEC_SCLS(sym->etype) = S_CODE ;
-       SPEC_CONST(sym->etype) = 1;
+    if (sym->level == 0 &&
+  SPEC_SCLS(sym->etype) == S_CONSTANT) {
+  SPEC_SCLS(sym->etype) = S_CODE ;
+  SPEC_CONST(sym->etype) = 1;
     }
 
     /* global variable in code space is a constant */
-    if (sym->level == 0 && 
-       SPEC_SCLS(sym->etype) == S_CODE &&
-       port->mem.code_ro )
-       SPEC_CONST(sym->etype) = 1;
-    
+    if (sym->level == 0 &&
+  SPEC_SCLS(sym->etype) == S_CODE &&
+  port->mem.code_ro )
+  SPEC_CONST(sym->etype) = 1;
+
 
     /* if bit variable then no storage class can be */
     /* specified since bit is already a storage */
-    if ( IS_BITVAR(sym->etype)              && 
-        ( SPEC_SCLS(sym->etype) != S_FIXED &&   
-          SPEC_SCLS(sym->etype) != S_SBIT  &&
-          SPEC_SCLS(sym->etype) != S_BIT )
-        ) {
-       werror (E_BITVAR_STORAGE,sym->name);
-       SPEC_SCLS(sym->etype) = S_FIXED ;
+    if ( IS_BITVAR(sym->etype)              &&
+   ( SPEC_SCLS(sym->etype) != S_FIXED &&
+     SPEC_SCLS(sym->etype) != S_SBIT  &&
+     SPEC_SCLS(sym->etype) != S_BIT )
+   ) {
+  werror (E_BITVAR_STORAGE,sym->name);
+  SPEC_SCLS(sym->etype) = S_FIXED ;
     }
-    
+
     /* extern variables cannot be initialized */
     if (IS_EXTERN(sym->etype) && sym->ival)     {
-       werror(E_EXTERN_INIT,sym->name);
-       sym->ival = NULL;
-    }    
-    
+  werror(E_EXTERN_INIT,sym->name);
+  sym->ival = NULL;
+    }
+
     /* if this is an automatic symbol then */
     /* storage class will be ignored and   */
     /* symbol will be allocated on stack/  */
     /* data depending on flag             */
     if ( sym->level                             &&
-        (options.stackAuto || reentrant )      &&
-        ( SPEC_SCLS(sym->etype) != S_AUTO      &&
-          SPEC_SCLS(sym->etype) != S_FIXED     &&
-          SPEC_SCLS(sym->etype) != S_REGISTER  &&
-          SPEC_SCLS(sym->etype) != S_STACK     &&
-          SPEC_SCLS(sym->etype) != S_XSTACK    &&
-          SPEC_SCLS(sym->etype) != S_CONSTANT  )) {
-
-       werror(E_AUTO_ASSUMED,sym->name) ;
-       SPEC_SCLS(sym->etype) = S_AUTO   ;
+   (options.stackAuto || reentrant )      &&
+   ( SPEC_SCLS(sym->etype) != S_AUTO      &&
+     SPEC_SCLS(sym->etype) != S_FIXED     &&
+     SPEC_SCLS(sym->etype) != S_REGISTER  &&
+     SPEC_SCLS(sym->etype) != S_STACK     &&
+     SPEC_SCLS(sym->etype) != S_XSTACK    &&
+     SPEC_SCLS(sym->etype) != S_CONSTANT  )) {
+
+  werror(E_AUTO_ASSUMED,sym->name) ;
+  SPEC_SCLS(sym->etype) = S_AUTO   ;
     }
-       
+
     /* automatic symbols cannot be given   */
     /* an absolute address ignore it      */
-    if ( sym->level  && 
-        SPEC_ABSA(sym->etype) &&
-        (options.stackAuto || reentrant) )  {
-       werror(E_AUTO_ABSA,sym->name);
-       SPEC_ABSA(sym->etype) = 0 ;
+    if ( sym->level  &&
+   SPEC_ABSA(sym->etype) &&
+   (options.stackAuto || reentrant) )  {
+  werror(E_AUTO_ABSA,sym->name);
+  SPEC_ABSA(sym->etype) = 0 ;
     }
-        
+
     /* arrays & pointers cannot be defined for bits   */
     /* SBITS or SFRs or BIT                           */
     if ((IS_ARRAY(sym->type) || IS_PTR(sym->type))  &&
-       ( SPEC_NOUN(sym->etype) == V_BIT          || 
-        SPEC_NOUN(sym->etype) == V_SBIT             ||
-        SPEC_SCLS(sym->etype) == S_SFR              ))
-       werror(E_BIT_ARRAY,sym->name);
-    
+  ( SPEC_NOUN(sym->etype) == V_BIT          ||
+   SPEC_NOUN(sym->etype) == V_SBIT             ||
+   SPEC_SCLS(sym->etype) == S_SFR              ))
+  werror(E_BIT_ARRAY,sym->name);
+
     /* if this is a bit|sbit then set length & start  */
     if (SPEC_NOUN(sym->etype) == V_BIT              ||
-       SPEC_NOUN(sym->etype) == V_SBIT             )  {
-       SPEC_BLEN(sym->etype) = 1 ;
-       SPEC_BSTR(sym->etype) = 0 ;
-    }    
-    
+  SPEC_NOUN(sym->etype) == V_SBIT             )  {
+  SPEC_BLEN(sym->etype) = 1 ;
+  SPEC_BSTR(sym->etype) = 0 ;
+    }
+
     /* variables declared in CODE space must have */
     /* initializers if not an extern */
-    if (SPEC_SCLS(sym->etype) == S_CODE && 
-       sym->ival == NULL               &&
-       !sym->level                     &&
-       port->mem.code_ro               &&
-       !IS_EXTERN(sym->etype)          &&
-       !funcInChain(sym->type)) 
-       werror(E_CODE_NO_INIT,sym->name);
-    
+    if (SPEC_SCLS(sym->etype) == S_CODE &&
+  sym->ival == NULL               &&
+  !sym->level                     &&
+  port->mem.code_ro               &&
+  !IS_EXTERN(sym->etype)    &&
+  !funcInChain(sym->type))
+  werror(E_CODE_NO_INIT,sym->name);
+
     /* if parameter or local variable then change */
     /* the storage class to reflect where the var will go */
     if ( sym->level && SPEC_SCLS(sym->etype) == S_FIXED) {
-       if ( options.stackAuto || (currFunc && IS_RENT(currFunc->etype)))
-       {
-           SPEC_SCLS(sym->etype) = (options.useXstack  ?
-                                    S_XSTACK : S_STACK ) ;
-       }
-       else
-       {
-           /* hack-o-matic! I see no reason why the useXstack option should ever
-            * control this allcoation, but the code was originally that way, and
-            * changing it for non-390 ports breaks the compiler badly.
-            */
-           bool useXdata = IS_DS390_PORT ? options.model : options.useXstack;
-           SPEC_SCLS(sym->etype) = (useXdata  ?
-                                    S_XDATA : S_FIXED ) ;
-       }
+  if ( options.stackAuto || (currFunc && IS_RENT(currFunc->etype)))
+  {
+      SPEC_SCLS(sym->etype) = (options.useXstack  ?
+             S_XSTACK : S_STACK ) ;
+  }
+  else
+  {
+      /* hack-o-matic! I see no reason why the useXstack option should ever
+       * control this allcoation, but the code was originally that way, and
+       * changing it for non-390 ports breaks the compiler badly.
+       */
+      bool useXdata = IS_DS390_PORT ? options.model : options.useXstack;
+      SPEC_SCLS(sym->etype) = (useXdata  ?
+             S_XDATA : S_FIXED ) ;
+  }
     }
 }
 
@@ -1040,16 +1040,16 @@ static void  checkSClass ( symbol *sym )
 void  changePointer  (symbol  *sym)
 {
     sym_link *p ;
-    
+
     /* go thru the chain of declarations   */
     /* if we find a pointer to a function  */
     /* unconditionally change it to a ptr  */
     /* to code area                        */
     for ( p = sym->type ; p ; p = p->next) {
-       if ( !IS_SPEC(p) && DCL_TYPE(p) == UPOINTER)
-           DCL_TYPE(p) = GPOINTER ;
-       if ( IS_PTR(p) && IS_FUNC(p->next))
-           DCL_TYPE(p) = CPOINTER ;
+  if ( !IS_SPEC(p) && DCL_TYPE(p) == UPOINTER)
+      DCL_TYPE(p) = GPOINTER ;
+  if ( IS_PTR(p) && IS_FUNC(p->next))
+      DCL_TYPE(p) = CPOINTER ;
     }
 }
 
@@ -1058,14 +1058,14 @@ void  changePointer  (symbol  *sym)
 /*------------------------------------------------------------------*/
 int checkDecl ( symbol *sym )
 {
-    
+
     checkSClass  (sym); /* check the storage class      */
     changePointer(sym);  /* change pointers if required */
 
     /* if this is an array without any dimension
        then update the dimension from the initial value */
     if (IS_ARRAY(sym->type) && !DCL_ELEM(sym->type))
-       DCL_ELEM(sym->type) = getNelements (sym->type,sym->ival);    
+  DCL_ELEM(sym->type) = getNelements (sym->type,sym->ival);
 
     return 0 ;
 }
@@ -1076,16 +1076,16 @@ int checkDecl ( symbol *sym )
 sym_link  *copyLinkChain ( sym_link *p)
 {
     sym_link  *head, *curr , *loop;
-    
+
     curr = p ;
     head = loop = ( curr ? newLink() : (void *) NULL) ;
     while (curr)   {
-       memcpy(loop,curr,sizeof(sym_link)) ; /* copy it */
-       loop->next = (curr->next ? newLink() : (void *) NULL) ;
-       loop = loop->next ;
-       curr = curr->next ;
+  memcpy(loop,curr,sizeof(sym_link)) ; /* copy it */
+  loop->next = (curr->next ? newLink() : (void *) NULL) ;
+  loop = loop->next ;
+  curr = curr->next ;
     }
-    
+
     return head ;
 }
 
@@ -1095,17 +1095,17 @@ sym_link  *copyLinkChain ( sym_link *p)
 /*                symbols in the given block                        */
 /*------------------------------------------------------------------*/
 void cleanUpBlock ( bucket **table, int block)
-{    
+{
     int i ;
     bucket  *chain;
-    
+
     /* go thru the entire  table  */
     for ( i = 0 ; i < 256; i++ ) {
-       for ( chain = table[i]; chain ; chain = chain->next ) {
-           if (chain->block >= block) {
-               deleteSym (table,chain->sym,chain->name);                                 
-           }   
-       }
+  for ( chain = table[i]; chain ; chain = chain->next ) {
+      if (chain->block >= block) {
+    deleteSym (table,chain->sym,chain->name);
+      }
+  }
     }
 }
 
@@ -1117,14 +1117,14 @@ void  cleanUpLevel   (bucket  **table, int level )
 {
     int i ;
     bucket  *chain;
-    
+
     /* go thru the entire  table  */
     for ( i = 0 ; i < 256; i++ ) {
-       for ( chain = table[i]; chain ; chain = chain->next ) {
-           if (chain->level >= level) {
-               deleteSym (table,chain->sym,chain->name);                                 
-           }   
-       }
+  for ( chain = table[i]; chain ; chain = chain->next ) {
+      if (chain->level >= level) {
+    deleteSym (table,chain->sym,chain->name);
+      }
+  }
     }
 }
 
@@ -1137,45 +1137,45 @@ sym_link *computeType ( sym_link *type1, sym_link *type2)
     sym_link *reType;
     sym_link *etype1 = getSpec(type1);
     sym_link *etype2 = getSpec(type2);
-    
+
     /* if one of them is a float then result is a float */
     /* here we assume that the types passed are okay */
     /* and can be cast to one another                */
     /* which ever is greater in size */
     if (IS_FLOAT(etype1) || IS_FLOAT(etype2))
-       rType = newFloatLink();
+  rType = newFloatLink();
     else
-       /* if only one of them is a bit variable
-          then the other one prevails */
-       if (IS_BITVAR(etype1) && !IS_BITVAR(etype2))
-           rType = copyLinkChain(type2);
-       else
-           if (IS_BITVAR(etype2) && !IS_BITVAR(etype1))
-               rType = copyLinkChain(type1);
-           else
-               /* if one of them is a pointer then that
-                  prevails */
-               if (IS_PTR(type1))
-                   rType = copyLinkChain(type1);
-               else
-                   if (IS_PTR(type2))
-                       rType = copyLinkChain(type2);
-                   else
-                       if (getSize (type1) > getSize(type2) )
-                           rType = copyLinkChain(type1);
-                       else
-                           rType = copyLinkChain(type2);
-    
+  /* if only one of them is a bit variable
+     then the other one prevails */
+  if (IS_BITVAR(etype1) && !IS_BITVAR(etype2))
+      rType = copyLinkChain(type2);
+  else
+      if (IS_BITVAR(etype2) && !IS_BITVAR(etype1))
+    rType = copyLinkChain(type1);
+      else
+    /* if one of them is a pointer then that
+       prevails */
+    if (IS_PTR(type1))
+        rType = copyLinkChain(type1);
+    else
+        if (IS_PTR(type2))
+      rType = copyLinkChain(type2);
+        else
+      if (getSize (type1) > getSize(type2) )
+          rType = copyLinkChain(type1);
+      else
+          rType = copyLinkChain(type2);
+
     reType = getSpec(rType);
-    
+
     /* if either of them unsigned then make this unsigned */
     if ((SPEC_USIGN(etype1) || SPEC_USIGN(etype2)) && !IS_FLOAT(reType))
-       SPEC_USIGN(reType) = 1;
-    
+  SPEC_USIGN(reType) = 1;
+
     /* if result is a literal then make not so */
     if (IS_LITERAL(reType))
-       SPEC_SCLS(reType) = S_REGISTER ;
-    
+  SPEC_SCLS(reType) = S_REGISTER ;
+
     return rType;
 }
 
@@ -1185,98 +1185,98 @@ sym_link *computeType ( sym_link *type1, sym_link *type2)
 int checkType ( sym_link *dest, sym_link *src )
 {
     if ( !dest && !src)
-       return 1;
-    
+  return 1;
+
     if (dest && !src)
-       return 0;
-    
+  return 0;
+
     if (src && !dest)
-       return 0;
-    
+  return 0;
+
     /* if dest is a declarator then */
     if (IS_DECL(dest)) {
-       if (IS_DECL(src)) {
-           if (DCL_TYPE(src) == DCL_TYPE(dest))
-               return checkType(dest->next,src->next);
-           else
-               if (IS_PTR(src) && IS_PTR(dest))
-                   return -1;
-               else
-                   if (IS_PTR(dest) && IS_ARRAY(src))
-                       return -1;
-                   else 
-                       if (IS_PTR(dest) && IS_FUNC(dest->next) && IS_FUNC(src))
-                           return -1 * checkType (dest->next,src) ;
-                       else
-                           return 0;
-       }
-       else
-           if (IS_PTR(dest) && IS_INTEGRAL(src))
-               return -1;
-           else
-               return 0;
+  if (IS_DECL(src)) {
+      if (DCL_TYPE(src) == DCL_TYPE(dest))
+    return checkType(dest->next,src->next);
+      else
+    if (IS_PTR(src) && IS_PTR(dest))
+        return -1;
+    else
+        if (IS_PTR(dest) && IS_ARRAY(src))
+      return -1;
+        else
+      if (IS_PTR(dest) && IS_FUNC(dest->next) && IS_FUNC(src))
+          return -1 * checkType (dest->next,src) ;
+      else
+          return 0;
+  }
+  else
+      if (IS_PTR(dest) && IS_INTEGRAL(src))
+    return -1;
+      else
+    return 0;
     }
 
     /* if one is a specifier and the other is not */
     if ((IS_SPEC(src) && !IS_SPEC(dest)) ||
-       (IS_SPEC(dest) && !IS_SPEC(src))) return 0;
+  (IS_SPEC(dest) && !IS_SPEC(src))) return 0;
 
     /* if one of them is a void then ok */
     if (SPEC_NOUN(dest) == V_VOID    &&
-       SPEC_NOUN(src)  != V_VOID    )
-       return -1 ;
-    
+  SPEC_NOUN(src)  != V_VOID    )
+  return -1 ;
+
     if (SPEC_NOUN(dest) != V_VOID &&
-       SPEC_NOUN(src) == V_VOID )
-       return -1;
-    
+  SPEC_NOUN(src) == V_VOID )
+  return -1;
+
     /* char === to short */
     if (SPEC_NOUN(dest) == V_CHAR &&
-       SPEC_NOUN(src)  == V_INT  &&
-       SPEC_SHORT(src)           )
-       return (SPEC_USIGN(src) == SPEC_USIGN(dest) ? 1 : -2);
+  SPEC_NOUN(src)  == V_INT  &&
+  SPEC_SHORT(src)           )
+  return (SPEC_USIGN(src) == SPEC_USIGN(dest) ? 1 : -2);
 
     if (SPEC_NOUN(src) == V_CHAR &&
-       SPEC_NOUN(dest)  == V_INT  &&
-       SPEC_SHORT(dest)           )
-       return (SPEC_USIGN(src) == SPEC_USIGN(dest) ? 1 : -2);    
+  SPEC_NOUN(dest)  == V_INT  &&
+  SPEC_SHORT(dest)           )
+  return (SPEC_USIGN(src) == SPEC_USIGN(dest) ? 1 : -2);
 
     /* if they are both bitfields then if the lengths
        and starts don't match */
     if (IS_BITFIELD(dest) && IS_BITFIELD(src) &&
-       (SPEC_BLEN(dest) != SPEC_BLEN(src) ||
-        SPEC_BSTR(dest) != SPEC_BSTR(src)))
-           return -1;
-    
+  (SPEC_BLEN(dest) != SPEC_BLEN(src) ||
+   SPEC_BSTR(dest) != SPEC_BSTR(src)))
+      return -1;
+
     /* it is a specifier */
     if (SPEC_NOUN(dest) != SPEC_NOUN(src))      {
-       if (SPEC_USIGN(dest) == SPEC_USIGN(src) &&
-           IS_INTEGRAL(dest) && IS_INTEGRAL(src) &&
-           getSize(dest) == getSize(src))
-           return 1;
-       else
-           if (IS_ARITHMETIC(dest) && IS_ARITHMETIC(src))
-               return -1;
-       else
-           return 0;
+  if (SPEC_USIGN(dest) == SPEC_USIGN(src) &&
+      IS_INTEGRAL(dest) && IS_INTEGRAL(src) &&
+      getSize(dest) == getSize(src))
+      return 1;
+  else
+      if (IS_ARITHMETIC(dest) && IS_ARITHMETIC(src))
+    return -1;
+  else
+      return 0;
     }
     else
-       if (IS_STRUCT(dest)) {
-           if (SPEC_STRUCT(dest) != SPEC_STRUCT(src))
-               return 0 ;
-           else 
-               return 1 ;
-       }
+  if (IS_STRUCT(dest)) {
+      if (SPEC_STRUCT(dest) != SPEC_STRUCT(src))
+    return 0 ;
+      else
+    return 1 ;
+  }
     if (SPEC_LONG(dest) != SPEC_LONG(src))
-       return -1;
-    
+  return -1;
+
     if (SPEC_SHORT(dest) != SPEC_SHORT(src))
-       return -1;
-    
+  return -1;
+
     if (SPEC_USIGN(dest) != SPEC_USIGN(src))
-       return -2;
-    
-    return 1;   
+  return -2;
+
+    return 1;
 }
 
 /*------------------------------------------------------------------*/
@@ -1285,77 +1285,77 @@ int checkType ( sym_link *dest, sym_link *src )
 bool inCalleeSaveList ( char *s)
 {
     int i;
-    
+
     for (i = 0 ; options.calleeSaves[i] ; i++ )
-       if (strcmp(options.calleeSaves[i],s) == 0)
-           return 1;
+  if (strcmp(options.calleeSaves[i],s) == 0)
+      return 1;
 
     return 0;
 }
 
 /*-----------------------------------------------------------------*/
 /* aggregateArgToPointer:  change an agggregate type function      */
-/*                        argument to a pointer to that type.     */
+/*         argument to a pointer to that type.     */
 /*-----------------------------------------------------------------*/
 void aggregateArgToPointer(value *val)
 {
-       if ( IS_AGGREGATE(val->type)) {
-           /* if this is a structure */
-           /* then we need to add a new link */
-           if (IS_STRUCT(val->type)) {
-                               /* first lets add DECLARATOR type */
-               sym_link *p = val->type ;
-               
-               werror(W_STRUCT_AS_ARG,val->name);
-               val->type = newLink();
-               val->type->next = p ;                           
-           }
-           
-           /* change to a pointer depending on the */
-           /* storage class specified                          */
-           switch (SPEC_SCLS(val->etype)) {
-           case S_IDATA:
-               DCL_TYPE(val->type) = IPOINTER;
-               break;
-           case S_PDATA:
-               DCL_TYPE(val->type) = PPOINTER;
-               break;
-           case S_FIXED:
-               if (IS_DS390_PORT)
-               {
-                   /* The AUTO and REGISTER classes should probably
-                    * also become generic pointers, but I haven't yet
-                    * devised a test case for that.
-                    */
-                   DCL_TYPE(val->type) = GPOINTER;
-                   break;
-               }
-               /* fall through! */
-           case S_AUTO:
-           case S_DATA:
-           case S_REGISTER:
-               DCL_TYPE(val->type) = POINTER ;
-               break;
-           case S_CODE:
-               DCL_TYPE(val->type) = CPOINTER;
-               break;
-           case S_XDATA:
-               DCL_TYPE(val->type) = FPOINTER;
-               break;
-           case S_EEPROM:
-               DCL_TYPE(val->type) = EEPPOINTER;
-               break;
-           default :
-               DCL_TYPE(val->type) = GPOINTER;
-           }
-           
-           /* is there is a symbol associated then */
-           /* change the type of the symbol as well*/
-           if ( val->sym ) {          
-               val->sym->type = copyLinkChain(val->type);
-               val->sym->etype = getSpec(val->sym->type);
-           }
-       }
+  if ( IS_AGGREGATE(val->type)) {
+      /* if this is a structure */
+      /* then we need to add a new link */
+      if (IS_STRUCT(val->type)) {
+        /* first lets add DECLARATOR type */
+    sym_link *p = val->type ;
+
+    werror(W_STRUCT_AS_ARG,val->name);
+    val->type = newLink();
+    val->type->next = p ;
+      }
+
+      /* change to a pointer depending on the */
+      /* storage class specified        */
+      switch (SPEC_SCLS(val->etype)) {
+      case S_IDATA:
+    DCL_TYPE(val->type) = IPOINTER;
+    break;
+      case S_PDATA:
+    DCL_TYPE(val->type) = PPOINTER;
+    break;
+      case S_FIXED:
+        if (IS_DS390_PORT)
+        {
+            /* The AUTO and REGISTER classes should probably
+             * also become generic pointers, but I haven't yet
+             * devised a test case for that.
+             */
+            DCL_TYPE(val->type) = GPOINTER;
+            break;
+        }
+        /* fall through! */
+      case S_AUTO:
+      case S_DATA:
+      case S_REGISTER:
+    DCL_TYPE(val->type) = POINTER ;
+    break;
+      case S_CODE:
+    DCL_TYPE(val->type) = CPOINTER;
+    break;
+      case S_XDATA:
+    DCL_TYPE(val->type) = FPOINTER;
+    break;
+      case S_EEPROM:
+    DCL_TYPE(val->type) = EEPPOINTER;
+    break;
+      default :
+    DCL_TYPE(val->type) = GPOINTER;
+      }
+
+      /* is there is a symbol associated then */
+      /* change the type of the symbol as well*/
+      if ( val->sym ) {
+    val->sym->type = copyLinkChain(val->type);
+    val->sym->etype = getSpec(val->sym->type);
+      }
+  }
 }
 /*------------------------------------------------------------------*/
 /* checkFunction - does all kinds of check on a function            */
@@ -1365,112 +1365,112 @@ int   checkFunction (symbol   *sym)
     symbol *csym ;
     value  *exargs, *acargs ;
     int argCnt = 0 ;
-    
+
     /* if not type then some kind of error */
     if ( !sym->type )
-       return 0;
-    
+  return 0;
+
     /* if the function has no type then make it return int */
     if ( !sym->type->next )
-       sym->type->next = sym->etype = newIntLink();
-   
+  sym->type->next = sym->etype = newIntLink();
+
     /* function cannot return aggregate */
     if (IS_AGGREGATE(sym->type->next))   {
-       werror(E_FUNC_AGGR,sym->name);
-       return 0;      
+  werror(E_FUNC_AGGR,sym->name);
+  return 0;
     }
-          
+
     /* function cannot return bit */
     if (IS_BITVAR(sym->type->next)) {
-       werror(E_FUNC_BIT,sym->name);
-       return 0;
+  werror(E_FUNC_BIT,sym->name);
+  return 0;
     }
-    
+
     /* check if this function is defined as calleeSaves
        then mark it as such */
-    sym->calleeSave = inCalleeSaveList(sym->name); 
+    sym->calleeSave = inCalleeSaveList(sym->name);
 
     /* if interrupt service routine  */
     /* then it cannot have arguments */
     if ( sym->args  && IS_ISR(sym->etype) && !IS_VOID(sym->args->type))   {
-       werror(E_INT_ARGS,sym->name);     
-       sym->args = NULL ;
+  werror(E_INT_ARGS,sym->name);
+  sym->args = NULL ;
     }
-    
+
     if (!(csym = findSym (SymbolTab, sym, sym->name )))
-       return 1 ;  /* not defined nothing more to check  */
-    
+  return 1 ;  /* not defined nothing more to check  */
+
     /* check if body already present */
     if ( csym && csym->fbody )   {
-       werror(E_FUNC_BODY,sym->name);
-       return 0;
+  werror(E_FUNC_BODY,sym->name);
+  return 0;
     }
-    
+
     /* check the return value type   */
     if (checkType (csym->type,sym->type) <= 0) {
-       werror(E_PREV_DEF_CONFLICT,csym->name,"type") ;
-       werror (E_CONTINUE,"previous defintion type ");
-       printTypeChain(csym->type,stderr);fprintf(stderr,"\n");
-       werror (E_CONTINUE,"current definition type ");
-       printTypeChain(sym->type,stderr);fprintf(stderr,"\n");
-       return 0;
+  werror(E_PREV_DEF_CONFLICT,csym->name,"type") ;
+  werror (E_CONTINUE,"previous defintion type ");
+  printTypeChain(csym->type,stderr);fprintf(stderr,"\n");
+  werror (E_CONTINUE,"current definition type ");
+  printTypeChain(sym->type,stderr);fprintf(stderr,"\n");
+  return 0;
     }
 
     if ( SPEC_INTRTN(csym->etype) != SPEC_INTRTN(sym->etype)) {
-       werror (E_PREV_DEF_CONFLICT,csym->name,"interrupt");
-       return 0;
+  werror (E_PREV_DEF_CONFLICT,csym->name,"interrupt");
+  return 0;
     }
 
     if (SPEC_BANK(csym->etype) != SPEC_BANK(sym->etype)) {
-       werror (E_PREV_DEF_CONFLICT,csym->name,"using");
-       return 0;
+  werror (E_PREV_DEF_CONFLICT,csym->name,"using");
+  return 0;
     }
 
     /* compare expected agrs with actual args */
     exargs = csym->args ;
     acargs = sym->args  ;
-    
+
     /* for all the expected args do */
-    for (argCnt =  1    ; 
-        exargs && acargs ; 
-         exargs = exargs->next, acargs = acargs->next, argCnt++ ) 
+    for (argCnt =  1    ;
+   exargs && acargs ;
+         exargs = exargs->next, acargs = acargs->next, argCnt++ )
     {
         value *checkValue;
         /* If the actual argument is an array, any prototype
          * will have modified it to a pointer. Duplicate that
          * change here.
          */
-        if ( IS_AGGREGATE(acargs->type)) 
+        if ( IS_AGGREGATE(acargs->type))
         {
             checkValue = copyValue(acargs);
-           aggregateArgToPointer(checkValue);
-       } 
-       else
-       {
-           checkValue = acargs;
-       }
-       
-       if ( checkType(exargs->type,checkValue->type) <= 0) 
-       {
-           werror(E_ARG_TYPE,argCnt);
-           return 0;
-       }
+      aggregateArgToPointer(checkValue);
+  }
+  else
+  {
+      checkValue = acargs;
+  }
+
+  if ( checkType(exargs->type,checkValue->type) <= 0)
+  {
+      werror(E_ARG_TYPE,argCnt);
+      return 0;
+  }
     }
-    
+
     /* if one them ended we have a problem */
-    if ((exargs && !acargs && !IS_VOID(exargs->type)) || 
-       (!exargs && acargs && !IS_VOID(acargs->type)))
-       werror(E_ARG_COUNT);
-    
+    if ((exargs && !acargs && !IS_VOID(exargs->type)) ||
+  (!exargs && acargs && !IS_VOID(acargs->type)))
+  werror(E_ARG_COUNT);
+
     /* replace with this defition */
     sym->cdef = csym->cdef;
     deleteSym (SymbolTab,csym,csym->name);
     addSym    (SymbolTab,sym,sym->name,sym->level,sym->block);
     if (IS_EXTERN(csym->etype) && !
-       IS_EXTERN(sym->etype)) {
-       addSet(&publics,sym);
+  IS_EXTERN(sym->etype)) {
+  addSet(&publics,sym);
     }
-    return 1 ;      
+    return 1 ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -1479,24 +1479,24 @@ int   checkFunction (symbol   *sym)
 void  processFuncArgs   (symbol *func, int ignoreName)
 {
     value *val ;
-    int pNum = 1;   
-    
+    int pNum = 1;
+
 
     /* if this function has variable argument list */
-    /* then make the function a reentrant one     */
+    /* then make the function a reentrant one    */
     if (func->hasVargs)
-       SPEC_RENT(func->etype) = 1;
+  SPEC_RENT(func->etype) = 1;
 
     /* check if this function is defined as calleeSaves
        then mark it as such */
-    func->calleeSave = inCalleeSaveList(func->name); 
+    func->calleeSave = inCalleeSaveList(func->name);
 
     val = func->args; /* loop thru all the arguments   */
-        
+
     /* if it is void then remove parameters */
-    if (val && IS_VOID(val->type)) {     
-       func->args = NULL ;
-       return ;
+    if (val && IS_VOID(val->type)) {
+  func->args = NULL ;
+  return ;
     }
 
     /* reset regparm for the port */
@@ -1504,60 +1504,60 @@ void  processFuncArgs   (symbol *func, int ignoreName)
     /* if any of the arguments is an aggregate */
     /* change it to pointer to the same type */
     while (val) {
-       /* mark it as a register parameter if
-          the function does not have VA_ARG
-          and as port dictates
-          not inhibited by command line option or #pragma */
-       if (!func->hasVargs       &&        
-           !options.noregparms   &&
-           !IS_RENT(func->etype) &&
-           (*port->reg_parm)(val->type)) {
-           SPEC_REGPARM(val->etype) = 1;
-       }
-       
-       if ( IS_AGGREGATE(val->type)) {
-           aggregateArgToPointer(val);
-       }
-       val = val->next ;
-       pNum++;
+  /* mark it as a register parameter if
+     the function does not have VA_ARG
+     and as port dictates
+     not inhibited by command line option or #pragma */
+  if (!func->hasVargs       &&
+      !options.noregparms   &&
+      !IS_RENT(func->etype) &&
+      (*port->reg_parm)(val->type)) {
+      SPEC_REGPARM(val->etype) = 1;
+  }
+
+  if ( IS_AGGREGATE(val->type)) {
+      aggregateArgToPointer(val);
+  }
+  val = val->next ;
+  pNum++;
     }
-    
+
     /* if this function is reentrant or */
     /* automatics r 2b stacked then nothing */
     if (IS_RENT(func->etype) || options.stackAuto )
-       return ;
-    
+  return ;
+
     val = func->args;
     pNum = 1;
     while (val) {
-       
-       /* if a symbolname is not given  */
-       /* synthesize a variable name */
-       if (!val->sym) {
-
-           sprintf(val->name,"_%s_PARM_%d",func->name,pNum++);
-           val->sym = newSymbol(val->name,1);
-           SPEC_OCLS(val->etype) = port->mem.default_local_map;
-           val->sym->type = copyLinkChain (val->type);
-           val->sym->etype = getSpec (val->sym->type);
-           val->sym->_isparm = 1;
-           strcpy (val->sym->rname,val->name);  
-           SPEC_STAT(val->etype) = SPEC_STAT(val->sym->etype) =
-               SPEC_STAT(func->etype);
-           addSymChain(val->sym);
-   
-       }
-       else  /* symbol name given create synth name */      {
-           
-           sprintf(val->name,"_%s_PARM_%d",func->name,pNum++);
-           strcpy (val->sym->rname,val->name);
-           val->sym->_isparm = 1;
-           SPEC_OCLS(val->etype) = SPEC_OCLS(val->sym->etype) = 
-               (options.model != MODEL_SMALL ? xdata : data);
-           SPEC_STAT(val->etype) = SPEC_STAT(val->sym->etype) = 
-               SPEC_STAT(func->etype);
-       }
-       val = val->next ;
+
+  /* if a symbolname is not given  */
+  /* synthesize a variable name */
+  if (!val->sym) {
+
+      sprintf(val->name,"_%s_PARM_%d",func->name,pNum++);
+      val->sym = newSymbol(val->name,1);
+      SPEC_OCLS(val->etype) = port->mem.default_local_map;
+      val->sym->type = copyLinkChain (val->type);
+      val->sym->etype = getSpec (val->sym->type);
+      val->sym->_isparm = 1;
+      strcpy (val->sym->rname,val->name);
+      SPEC_STAT(val->etype) = SPEC_STAT(val->sym->etype) =
+    SPEC_STAT(func->etype);
+      addSymChain(val->sym);
+
+  }
+  else  /* symbol name given create synth name */      {
+
+      sprintf(val->name,"_%s_PARM_%d",func->name,pNum++);
+      strcpy (val->sym->rname,val->name);
+      val->sym->_isparm = 1;
+      SPEC_OCLS(val->etype) = SPEC_OCLS(val->sym->etype) =
+    (options.model != MODEL_SMALL ? xdata : data);
+      SPEC_STAT(val->etype) = SPEC_STAT(val->sym->etype) =
+    SPEC_STAT(func->etype);
+  }
+  val = val->next ;
     }
 }
 
@@ -1568,285 +1568,285 @@ int isSymbolEqual (symbol *dest, symbol *src)
 {
     /* if pointers match then equal */
     if (dest == src)
-       return 1;
+  return 1;
 
     /* if one of them is null then don't match */
     if (!dest || !src)
-       return 0;
-    
+  return 0;
+
     /* if both of them have rname match on rname */
-    if (dest->rname[0] && src->rname[0]) 
-       return (!strcmp(dest->rname,src->rname));
-    
+    if (dest->rname[0] && src->rname[0])
+  return (!strcmp(dest->rname,src->rname));
+
     /* otherwise match on name */
     return (!strcmp(dest->name,src->name));
 }
 
-/*-----------------------------------------------------------------*/ 
+/*-----------------------------------------------------------------*/
 /* printTypeChain - prints the type chain in human readable form   */
-/*-----------------------------------------------------------------*/ 
+/*-----------------------------------------------------------------*/
 void printTypeChain (sym_link *type, FILE *of)
 {
     int nlr = 0;
 
     if (!of) {
-       of = stdout;
-       nlr = 1;
+  of = stdout;
+  nlr = 1;
     }
 
     while (type) {
-       if (IS_DECL(type)) {
-           switch (DCL_TYPE(type)) {
-           case FUNCTION:
-               fprintf (of,"function ");
-               break;
-           case GPOINTER:
-               fprintf (of,"_generic * ");
-               if (DCL_PTR_CONST(type))
-                   fprintf(of,"const ");
-               break;          
-           case CPOINTER:
-               fprintf (of,"_code * ");
-               if (DCL_PTR_CONST(type))
-                   fprintf(of,"const ");
-               break;
-           case FPOINTER:
-               fprintf (of,"_far * ");
-               if (DCL_PTR_CONST(type))
-                   fprintf(of,"const ");
-               break;
-           case EEPPOINTER:
-               fprintf (of,"_eeprom * ");
-               if (DCL_PTR_CONST(type))
-                   fprintf(of,"const ");
-               break;
-               
-           case POINTER:
-               fprintf (of,"_near * ");
-               if (DCL_PTR_CONST(type))
-                   fprintf(of,"const ");       
-               break;
-           case IPOINTER:
-               fprintf (of,"_idata *");
-               if (DCL_PTR_CONST(type))
-                   fprintf(of,"const ");       
-               break; 
-           case PPOINTER:
-               fprintf (of,"_pdata *");
-               if (DCL_PTR_CONST(type))
-                   fprintf(of,"const ");       
-               break;
-           case UPOINTER:
-               fprintf (of," _unkown *");
-               if (DCL_PTR_CONST(type))
-                   fprintf(of,"const ");       
-               break;
-               
-           case ARRAY :
-               fprintf (of,"array of ");
-               break;
-           }
-       } else { 
-           if (SPEC_VOLATILE(type))
-               fprintf (of,"volatile "); 
-           if (SPEC_USIGN(type))
-               fprintf (of,"unsigned ");
-           
-           switch (SPEC_NOUN(type)) {
-           case V_INT:
-               if (IS_LONG(type))
-                   fprintf (of,"long ");
-               else
-                   if (IS_SHORT(type))
-                       fprintf (of,"short ");
-                   else
-                       fprintf (of,"int ");
-               break;
-
-           case V_CHAR:
-               fprintf(of,"char ");
-               break;
-
-           case V_VOID:
-               fprintf(of,"void ");
-               break;
+  if (IS_DECL(type)) {
+      switch (DCL_TYPE(type)) {
+      case FUNCTION:
+    fprintf (of,"function ");
+    break;
+      case GPOINTER:
+    fprintf (of,"_generic * ");
+    if (DCL_PTR_CONST(type))
+        fprintf(of,"const ");
+    break;
+      case CPOINTER:
+    fprintf (of,"_code * ");
+    if (DCL_PTR_CONST(type))
+        fprintf(of,"const ");
+    break;
+      case FPOINTER:
+    fprintf (of,"_far * ");
+    if (DCL_PTR_CONST(type))
+        fprintf(of,"const ");
+    break;
+      case EEPPOINTER:
+    fprintf (of,"_eeprom * ");
+    if (DCL_PTR_CONST(type))
+        fprintf(of,"const ");
+    break;
+
+      case POINTER:
+    fprintf (of,"_near * ");
+    if (DCL_PTR_CONST(type))
+        fprintf(of,"const ");
+    break;
+      case IPOINTER:
+    fprintf (of,"_idata *");
+    if (DCL_PTR_CONST(type))
+        fprintf(of,"const ");
+    break;
+      case PPOINTER:
+    fprintf (of,"_pdata *");
+    if (DCL_PTR_CONST(type))
+        fprintf(of,"const ");
+    break;
+      case UPOINTER:
+    fprintf (of," _unkown *");
+    if (DCL_PTR_CONST(type))
+        fprintf(of,"const ");
+    break;
+
+      case ARRAY :
+    fprintf (of,"array of ");
+    break;
+      }
+  } else {
+      if (SPEC_VOLATILE(type))
+    fprintf (of,"volatile ");
+      if (SPEC_USIGN(type))
+    fprintf (of,"unsigned ");
+
+      switch (SPEC_NOUN(type)) {
+      case V_INT:
+    if (IS_LONG(type))
+        fprintf (of,"long ");
+    else
+        if (IS_SHORT(type))
+      fprintf (of,"short ");
+        else
+      fprintf (of,"int ");
+    break;
+
+      case V_CHAR:
+    fprintf(of,"char ");
+    break;
+
+      case V_VOID:
+    fprintf(of,"void ");
+    break;
 
             case V_FLOAT:
-               fprintf(of,"float ");
-               break;
-
-           case V_STRUCT:
-               fprintf(of,"struct %s",SPEC_STRUCT(type)->tag);
-               break;
-                                 
-           case V_SBIT:
-               fprintf(of,"sbit ");
-               break;
-
-           case V_BIT:
-               fprintf(of,"bit {%d,%d}",SPEC_BSTR(type),SPEC_BLEN(type));
-               break;
-               
-           default:
-               break;
-           }
-       }
-       type = type->next;
+          fprintf(of,"float ");
+    break;
+
+      case V_STRUCT:
+    fprintf(of,"struct %s",SPEC_STRUCT(type)->tag);
+    break;
+
+      case V_SBIT:
+    fprintf(of,"sbit ");
+    break;
+
+      case V_BIT:
+    fprintf(of,"bit {%d,%d}",SPEC_BSTR(type),SPEC_BLEN(type));
+    break;
+
+      default:
+    break;
+      }
+  }
+  type = type->next;
     }
     if (nlr)
-       fprintf(of,"\n");
+  fprintf(of,"\n");
 }
 
-/*-----------------------------------------------------------------*/ 
+/*-----------------------------------------------------------------*/
 /* cdbTypeInfo - print the type information for debugger           */
 /*-----------------------------------------------------------------*/
 void cdbTypeInfo (sym_link *type,FILE *of)
 {
     fprintf(of,"{%d}",getSize(type));
     while (type) {
-       if (IS_DECL(type)) {
-           switch (DCL_TYPE(type)) {
-           case FUNCTION:
-               fprintf (of,"DF,");
-               break;
-           case GPOINTER:
-               fprintf (of,"DG,");             
-               break;          
-           case CPOINTER:
-               fprintf (of,"DC,");             
-               break;
-           case FPOINTER:
-               fprintf (of,"DX,");             
-               break;
-           case POINTER:
-               fprintf (of,"DD,");             
-               break;
-           case IPOINTER:
-               fprintf (of,"DI,");
-               break;
-           case PPOINTER:
-               fprintf (of,"DP,");
-               break;
-           case EEPPOINTER:
-               fprintf (of,"DA,");
-               break;
-           case ARRAY :
-               fprintf (of,"DA%d,",DCL_ELEM(type));
-               break;
-           default:
-               break;
-           }
-       } else { 
-           switch (SPEC_NOUN(type)) {
-           case V_INT:
-               if (IS_LONG(type))
-                   fprintf (of,"SL");
-               else
-                   if (IS_SHORT(type))
-                       fprintf (of,"SS");
-                   else
-                       fprintf (of,"SI");
-               break;
-
-           case V_CHAR:
-               fprintf(of,"SC");
-               break;
-
-           case V_VOID:
-               fprintf(of,"SV");
-               break;
+  if (IS_DECL(type)) {
+      switch (DCL_TYPE(type)) {
+      case FUNCTION:
+    fprintf (of,"DF,");
+    break;
+      case GPOINTER:
+    fprintf (of,"DG,");
+    break;
+      case CPOINTER:
+    fprintf (of,"DC,");
+    break;
+      case FPOINTER:
+    fprintf (of,"DX,");
+    break;
+      case POINTER:
+    fprintf (of,"DD,");
+    break;
+      case IPOINTER:
+    fprintf (of,"DI,");
+    break;
+      case PPOINTER:
+    fprintf (of,"DP,");
+    break;
+      case EEPPOINTER:
+    fprintf (of,"DA,");
+    break;
+      case ARRAY :
+    fprintf (of,"DA%d,",DCL_ELEM(type));
+    break;
+      default:
+    break;
+      }
+  } else {
+      switch (SPEC_NOUN(type)) {
+      case V_INT:
+    if (IS_LONG(type))
+        fprintf (of,"SL");
+    else
+        if (IS_SHORT(type))
+      fprintf (of,"SS");
+        else
+      fprintf (of,"SI");
+    break;
+
+      case V_CHAR:
+    fprintf(of,"SC");
+    break;
+
+      case V_VOID:
+    fprintf(of,"SV");
+    break;
 
             case V_FLOAT:
-               fprintf(of,"SF");
-               break;
-
-           case V_STRUCT:
-               fprintf(of,"ST%s",SPEC_STRUCT(type)->tag);
-               break;
-                                 
-           case V_SBIT:
-               fprintf(of,"SX");
-               break;
-
-           case V_BIT:
-               fprintf(of,"SB%d$%d",SPEC_BSTR(type),SPEC_BLEN(type));
-               break;
-
-           default:
-               break;
-           }
-           fputs(":",of);
-           if (SPEC_USIGN(type))
-               fputs("U",of);
-           else
-               fputs("S",of);
-       }
-       type = type->next;
+          fprintf(of,"SF");
+    break;
+
+      case V_STRUCT:
+    fprintf(of,"ST%s",SPEC_STRUCT(type)->tag);
+    break;
+
+      case V_SBIT:
+    fprintf(of,"SX");
+    break;
+
+      case V_BIT:
+    fprintf(of,"SB%d$%d",SPEC_BSTR(type),SPEC_BLEN(type));
+    break;
+
+      default:
+    break;
+      }
+      fputs(":",of);
+      if (SPEC_USIGN(type))
+    fputs("U",of);
+      else
+    fputs("S",of);
+  }
+  type = type->next;
     }
 }
-/*-----------------------------------------------------------------*/ 
+/*-----------------------------------------------------------------*/
 /* cdbSymbol - prints a symbol & its type information for debugger */
-/*-----------------------------------------------------------------*/ 
+/*-----------------------------------------------------------------*/
 void cdbSymbol ( symbol *sym, FILE *of, int isStructSym, int isFunc)
 {
     memmap *map;
 
     if (!sym)
-       return ;
+  return ;
     if (!of)
-       of = stdout;
-    
+  of = stdout;
+
     if (isFunc)
-       fprintf(of,"F:");
+  fprintf(of,"F:");
     else
-       fprintf(of,"S:"); /* symbol record */
+  fprintf(of,"S:"); /* symbol record */
     /* if this is not a structure symbol then
        we need to figure out the scope information */
     if (!isStructSym) {
-       if (!sym->level) {
-           /* global */
-           if (IS_STATIC(sym->etype))
-               fprintf(of,"F%s$",moduleName); /* scope is file */
-           else
-               fprintf(of,"G$"); /* scope is global */
-       }
-       else 
-           /* symbol is local */
-           fprintf(of,"L%s$",(sym->localof ? sym->localof->name : "-null-"));
+  if (!sym->level) {
+      /* global */
+      if (IS_STATIC(sym->etype))
+    fprintf(of,"F%s$",moduleName); /* scope is file */
+      else
+    fprintf(of,"G$"); /* scope is global */
+  }
+  else
+      /* symbol is local */
+      fprintf(of,"L%s$",(sym->localof ? sym->localof->name : "-null-"));
     } else
-       fprintf(of,"S$"); /* scope is structure */
-    
+  fprintf(of,"S$"); /* scope is structure */
+
     /* print the name, & mangled name */
     fprintf(of,"%s$%d$%d(",sym->name,
-           sym->level,sym->block);
+      sym->level,sym->block);
 
     cdbTypeInfo(sym->type,of);
     fprintf(of,"),");
-    
+
     /* print the address space */
     map = SPEC_OCLS(sym->etype);
     fprintf(of,"%c,%d,%d",
-           (map ? map->dbName : 'Z') ,sym->onStack,SPEC_STAK(sym->etype));
-    
-    /* if assigned to registers then output register names */   
+      (map ? map->dbName : 'Z') ,sym->onStack,SPEC_STAK(sym->etype));
+
+    /* if assigned to registers then output register names */
     /* if this is a function then print
        if is it an interrupt routine & interrupt number
        and the register bank it is using */
     if (isFunc)
-       fprintf(of,",%d,%d,%d",SPEC_INTRTN(sym->etype),
-               SPEC_INTN(sym->etype),SPEC_BANK(sym->etype));
+  fprintf(of,",%d,%d,%d",SPEC_INTRTN(sym->etype),
+    SPEC_INTN(sym->etype),SPEC_BANK(sym->etype));
     /* alternate location to find this symbol @ : eg registers
        or spillication */
-   
+
     if (!isStructSym)
-       fprintf(of,"\n");
-}                  
+  fprintf(of,"\n");
+}
 
-/*-----------------------------------------------------------------*/ 
+/*-----------------------------------------------------------------*/
 /* cdbStruct - print a structure for debugger                      */
 /*-----------------------------------------------------------------*/
 void cdbStruct ( structdef *sdef,int block,FILE *of,
-                int inStruct, char *tag)
+     int inStruct, char *tag)
 {
     symbol *sym;
 
@@ -1855,20 +1855,20 @@ void cdbStruct ( structdef *sdef,int block,FILE *of,
     fprintf(of,"F%s$",moduleName);
     fprintf(of,"%s[",(tag ? tag : sdef->tag));
     for (sym=sdef->fields ; sym ; sym = sym->next) {
-       fprintf(of,"({%d}",sym->offset);
-           cdbSymbol(sym,of,TRUE,FALSE);
-       fprintf(of,")");
+  fprintf(of,"({%d}",sym->offset);
+      cdbSymbol(sym,of,TRUE,FALSE);
+  fprintf(of,")");
     }
     fprintf(of,"]");
     if (!inStruct)
-       fprintf(of,"\n");
+  fprintf(of,"\n");
 }
 
 /*------------------------------------------------------------------*/
 /* cdbStructBlock - calls struct printing for a blcks               */
 /*------------------------------------------------------------------*/
 void cdbStructBlock (int block , FILE *of)
-{    
+{
     int i ;
     bucket **table = StructTab;
     bucket  *chain;
@@ -1876,28 +1876,28 @@ void cdbStructBlock (int block , FILE *of)
 
     /* go thru the entire  table  */
     for ( i = 0 ; i < 256; i++ ) {
-       for ( chain = table[i]; chain ; chain = chain->next ) {
-           if (chain->block >= block) {
-               cdbStruct((structdef *)chain->sym, chain->block ,of,0,NULL);
-           }   
-       }
+  for ( chain = table[i]; chain ; chain = chain->next ) {
+      if (chain->block >= block) {
+    cdbStruct((structdef *)chain->sym, chain->block ,of,0,NULL);
+      }
+  }
     }
 }
-               
-/*-----------------------------------------------------------------*/ 
+
+/*-----------------------------------------------------------------*/
 /* powof2 - returns power of two for the number if number is pow 2 */
-/*-----------------------------------------------------------------*/ 
+/*-----------------------------------------------------------------*/
 int powof2 (unsigned long num)
 {
     int nshifts = 0;
     int n1s = 0 ;
-    
+
     while (num) {
-       if (num & 1) n1s++ ;
-       num >>= 1 ;
-       nshifts++ ;
+  if (num & 1) n1s++ ;
+  num >>= 1 ;
+  nshifts++ ;
     }
-    
+
     if (n1s > 1 || nshifts == 0) return 0;
     return nshifts - 1 ;
 }
@@ -1931,49 +1931,49 @@ static void _makeRegParam(symbol *sym)
     /* reset regparm for the port */
     (*port->reset_regparms)();
     while (val) {
-       SPEC_REGPARM(val->etype) = 1;
-       sym->argStack -= getSize(val->type);
-       val = val->next ;
+  SPEC_REGPARM(val->etype) = 1;
+  sym->argStack -= getSize(val->type);
+  val = val->next ;
     }
 }
 
-/*-----------------------------------------------------------------*/ 
+/*-----------------------------------------------------------------*/
 /* initCSupport - create functions for C support routines          */
-/*-----------------------------------------------------------------*/ 
+/*-----------------------------------------------------------------*/
 void initCSupport ()
 {
     const char *smuldivmod[] = {
-       "mul", "div", "mod"
+  "mul", "div", "mod"
     };
     const char *sbwd[] = {
-       "char", "int", "long"
+  "char", "int", "long"
     };
     const char *ssu[] = {
-       "s", "u"
+  "s", "u"
     };
-       
+
     int bwd, su, muldivmod, tofrom;
 
     floatType= newFloatLink();
 
     for (bwd = 0; bwd < 3; bwd++) {
-       sym_link *l;
-       switch (bwd) {
-       case 0:
-           l = newCharLink();
-           break;
-       case 1:
-           l = newIntLink();
-           break;
-       case 2:
-           l = newLongLink();
-           break;
-       default:
-           assert(0);
-       }
-       __multypes[bwd][0] = l;
-       __multypes[bwd][1] = copyLinkChain(l);
-       SPEC_USIGN(__multypes[bwd][1]) = 1;
+  sym_link *l;
+  switch (bwd) {
+  case 0:
+      l = newCharLink();
+      break;
+  case 1:
+      l = newIntLink();
+      break;
+  case 2:
+      l = newLongLink();
+      break;
+  default:
+      assert(0);
+  }
+  __multypes[bwd][0] = l;
+  __multypes[bwd][1] = copyLinkChain(l);
+  SPEC_USIGN(__multypes[bwd][1]) = 1;
     }
 
     __fsadd = funcOfType ("__fsadd", floatType, floatType, 2, options.float_rent);
@@ -1988,32 +1988,32 @@ void initCSupport ()
     __fsgteq= funcOfType ("__fsgteq", CHARTYPE, floatType, 2, options.float_rent);
 
     for (tofrom = 0; tofrom < 2; tofrom++) {
-       for (bwd = 0; bwd < 3; bwd++) {
-           for (su = 0; su < 2; su++) {
-               if (tofrom) {
-                   sprintf(buffer, "__fs2%s%s", ssu[su], sbwd[bwd]);
-                   __conv[tofrom][bwd][su] = funcOfType(buffer, __multypes[bwd][su], floatType, 1, options.float_rent);
-               }
-               else {
-                   sprintf(buffer, "__%s%s2fs", ssu[su], sbwd[bwd]);
-                   __conv[tofrom][bwd][su] = funcOfType(buffer, floatType, __multypes[bwd][su], 1, options.float_rent);
-               }
-           }
-       }
+  for (bwd = 0; bwd < 3; bwd++) {
+      for (su = 0; su < 2; su++) {
+    if (tofrom) {
+        sprintf(buffer, "__fs2%s%s", ssu[su], sbwd[bwd]);
+        __conv[tofrom][bwd][su] = funcOfType(buffer, __multypes[bwd][su], floatType, 1, options.float_rent);
+    }
+    else {
+        sprintf(buffer, "__%s%s2fs", ssu[su], sbwd[bwd]);
+        __conv[tofrom][bwd][su] = funcOfType(buffer, floatType, __multypes[bwd][su], 1, options.float_rent);
+    }
+      }
+  }
     }
 
     for (muldivmod = 0; muldivmod < 3; muldivmod++) {
-       for (bwd = 0; bwd < 3; bwd++) {
-           for (su = 0; su < 2; su++) {
-               sprintf(buffer, "_%s%s%s", 
-                       smuldivmod[muldivmod],
-                       ssu[su],
-                       sbwd[bwd]);
-               __muldiv[muldivmod][bwd][su] = funcOfType(buffer, __multypes[bwd][su], __multypes[bwd][su], 2, options.intlong_rent);
-               SPEC_NONBANKED(__muldiv[muldivmod][bwd][su]->etype) = 1;
-               if (bwd < port->muldiv.force_reg_param_below) 
-                   _makeRegParam(__muldiv[muldivmod][bwd][su]);
-           }
-       }
+  for (bwd = 0; bwd < 3; bwd++) {
+      for (su = 0; su < 2; su++) {
+    sprintf(buffer, "_%s%s%s",
+      smuldivmod[muldivmod],
+      ssu[su],
+      sbwd[bwd]);
+    __muldiv[muldivmod][bwd][su] = funcOfType(buffer, __multypes[bwd][su], __multypes[bwd][su], 2, options.intlong_rent);
+    SPEC_NONBANKED(__muldiv[muldivmod][bwd][su]->etype) = 1;
+    if (bwd < port->muldiv.force_reg_param_below)
+        _makeRegParam(__muldiv[muldivmod][bwd][su]);
+      }
+  }
     }
 }
index 83885665f266151e9e66c5b5e037f0ff599ea79e..46eab66911444dd7ce4d5cd8fe85ac9c17670557 100644 (file)
@@ -1,26 +1,26 @@
 /*----------------------------------------------------------------------
-    SDCCval.c :- has routine to do all kinds of fun stuff with the 
+    SDCCval.c :- has routine to do all kinds of fun stuff with the
                 value wrapper & with initialiser lists.
-    
+
     Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
 
     This program is free software; you can redistribute it and/or modify it
     under the terms of the GNU General Public License as published by the
     Free Software Foundation; either version 2, or (at your option) any
     later version.
-    
+
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
-    
+
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-    
+
     In other words, you are welcome to use, share and improve this program.
     You are forbidden to forbid anyone else to use, share and improve
-    what you give them.   Help stamp out software-hoarding!  
+    what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "common.h"
 #include <limits.h>
 #include "newalloc.h"
 
-int            cNestLevel ;
+int   cNestLevel ;
 
 /*-----------------------------------------------------------------*/
-/* newValue - allocates and returns a new value                   */
+/* newValue - allocates and returns a new value        */
 /*-----------------------------------------------------------------*/
 value *newValue ()
 {
     value *val ;
-    
-    val = Safe_calloc(sizeof(value));
-    
+
+    val = Safe_calloc(1,sizeof(value));
+
     return val ;
 }
 
@@ -49,71 +49,71 @@ value *newValue ()
 initList *newiList ( int type, void *ilist)
 {
     initList *nilist;
-    
-    
-    nilist = Safe_calloc(sizeof(initList));    
-    
-    nilist->type = type        ;
+
+
+    nilist = Safe_calloc(1,sizeof(initList));
+
+    nilist->type = type ;
     nilist->lineno = yylineno ;
-    
+
     switch (type)   {
     case INIT_NODE :
-       nilist->init.node = (struct ast *) ilist ;
-       break ;
-       
+  nilist->init.node = (struct ast *) ilist ;
+  break ;
+
     case INIT_DEEP :
-       nilist->init.deep = (struct initList *) ilist ;
-       break ;
+  nilist->init.deep = (struct initList *) ilist ;
+  break ;
     }
-    
+
     return nilist ;
 }
 
 /*------------------------------------------------------------------*/
-/* revinit   - reverses the initial values for a value  chain       */
+/* revinit   - reverses the initial values for a value  chain        */
 /*------------------------------------------------------------------*/
 initList *revinit   ( initList   *val)
 {
     initList  *prev  , *curr, *next ;
-    
+
     if (!val)
-       return NULL ;
-    
+  return NULL ;
+
     prev = val ;
     curr = val->next ;
-    
+
     while (curr)   {
-       next = curr->next ;
-       curr->next = prev   ;
-       prev = curr ;
-       curr = next ;
+  next = curr->next ;
+  curr->next = prev   ;
+  prev = curr ;
+  curr = next ;
     }
     val->next = (void *) NULL ;
     return prev ;
 }
 
 /*------------------------------------------------------------------*/
-/* copyIlist - copy initializer list                               */
+/* copyIlist - copy initializer list            */
 /*------------------------------------------------------------------*/
 initList *copyIlist (initList *src)
 {
     initList *dest = NULL;
-    
+
     if (!src)
-       return NULL ;
-    
+  return NULL ;
+
     switch (src->type) {
     case INIT_DEEP :
-       dest = newiList (INIT_DEEP,copyIlist (src->init.deep));
-       break;
+  dest = newiList (INIT_DEEP,copyIlist (src->init.deep));
+  break;
     case INIT_NODE :
-       dest = newiList (INIT_NODE,copyAst (src->init.node)) ;
-       break;
+  dest = newiList (INIT_NODE,copyAst (src->init.node)) ;
+  break;
     }
-    
+
     if ( src->next )
-       dest->next = copyIlist(src->next);
-    
+  dest->next = copyIlist(src->next);
+
     return dest ;
 }
 
@@ -123,10 +123,10 @@ initList *copyIlist (initList *src)
 double list2int (initList   *val)
 {
     initList *i = val;
-    
+
     if ( i->type == INIT_DEEP )
-       return list2int (val->init.deep) ;
-    
+  return list2int (val->init.deep) ;
+
     return floatFromVal(constExprValue(val->init.node,TRUE));
 }
 
@@ -136,21 +136,21 @@ double list2int (initList   *val)
 value *list2val (initList   *val)
 {
     if (!val)
-       return NULL;
+  return NULL;
 
     if ( val->type == INIT_DEEP )
-       return list2val (val->init.deep) ;
-    
+  return list2val (val->init.deep) ;
+
     return constExprValue(val->init.node,TRUE);
 }
 
 /*------------------------------------------------------------------*/
 /* list2expr - returns the first expression in the initializer list */
 /*------------------------------------------------------------------*/
-ast    *list2expr ( initList   *ilist)
+ast *list2expr ( initList *ilist)
 {
     if ( ilist->type == INIT_DEEP )
-       return list2expr (ilist->init.deep) ;
+  return list2expr (ilist->init.deep) ;
     return ilist->init.node ;
 }
 
@@ -160,41 +160,41 @@ ast       *list2expr ( initList   *ilist)
 void resolveIvalSym ( initList *ilist)
 {
     if ( ! ilist )
-       return ;
-    
+  return ;
+
     if ( ilist->type == INIT_NODE )
-       ilist->init.node = decorateType(resolveSymbols (ilist->init.node));
-    
+  ilist->init.node = decorateType(resolveSymbols (ilist->init.node));
+
     if ( ilist->type == INIT_DEEP )
-       resolveIvalSym (ilist->init.deep);
-    
+  resolveIvalSym (ilist->init.deep);
+
     resolveIvalSym (ilist->next);
 }
 
 /*-----------------------------------------------------------------*/
-/* symbolVal - creates a value for a symbol                       */
+/* symbolVal - creates a value for a symbol              */
 /*-----------------------------------------------------------------*/
 value *symbolVal ( symbol  *sym )
 {
     value *val ;
-    
+
     if (!sym)
-       return NULL ;
-    
+  return NULL ;
+
     val = newValue();
     val->sym = sym ;
-    
+
     if ( sym->type ) {
-       val->type = sym->type;
-       val->etype= getSpec(val->type);
+  val->type = sym->type;
+  val->etype= getSpec(val->type);
     }
-    
+
     if ( *sym->rname )
-       sprintf (val->name,"%s",sym->rname);
+  sprintf (val->name,"%s",sym->rname);
     else
-       sprintf(val->name,"_%s",sym->name);
-    
-    
+  sprintf(val->name,"_%s",sym->name);
+
+
     return val ;
 }
 
@@ -204,12 +204,12 @@ value *symbolVal ( symbol  *sym )
 value *valueFromLit (float lit)
 {
     char buffer[50];
-    
-    if ( ( ((long) lit ) - lit ) == 0 ) {      
-       sprintf(buffer,"%ld",(long) lit);
-       return constVal (buffer);
+
+    if ( ( ((long) lit ) - lit ) == 0 ) {
+  sprintf(buffer,"%ld",(long) lit);
+  return constVal (buffer);
     }
-    
+
     sprintf(buffer,"%f",lit);
     return constFloatVal (buffer);
 }
@@ -221,189 +221,189 @@ value *constFloatVal ( char *s )
 {
     value *val = newValue();
     float sval;
-    
+
     if(sscanf (s,"%f",&sval) != 1) {
-       werror(E_INVALID_FLOAT_CONST,s);
-       return constVal("0");
+  werror(E_INVALID_FLOAT_CONST,s);
+  return constVal("0");
     }
-    
+
     val->type = val->etype = newLink();
     val->type->class = SPECIFIER ;
     SPEC_NOUN(val->type) = V_FLOAT ;
     SPEC_SCLS(val->type) = S_LITERAL;
     SPEC_CVAL(val->type).v_float = sval;
-    
+
     return val;
 }
 
 /*-----------------------------------------------------------------*/
-/* constVal - converts a INTEGER constant into a value            */
+/* constVal - converts a INTEGER constant into a value       */
 /*-----------------------------------------------------------------*/
 value *constVal   (char *s)
 {
     value *val ;
     short hex = 0 , octal = 0 ;
     char  scanFmt[10] ;
-    int         scI = 0 ;
+    int  scI = 0 ;
     unsigned long sval ;
-    
-    val = newValue() ;       /* alloc space for value   */
-    
+
+    val = newValue() ;        /* alloc space for value   */
+
     val->type = val->etype = newLink() ; /* create the spcifier */
-    val->type->class   = SPECIFIER ;
+    val->type->class  = SPECIFIER ;
     SPEC_NOUN(val->type) =  V_INT ;
     SPEC_SCLS(val->type) =  S_LITERAL ;
-    
+
     /* set the _unsigned flag if 'uU' found */
     if (strchr(s,'u') || strchr(s,'U'))
-       SPEC_USIGN(val->type) = 1;
-    
+  SPEC_USIGN(val->type) = 1;
+
     /* set the _long flag if 'lL' is found */
     if (strchr(s,'l') || strchr(s,'L'))
-       SPEC_LONG(val->type) = 1;
-    
+  SPEC_LONG(val->type) = 1;
+
     hex = ((strchr(s,'x') || strchr(s,'X')) ? 1 : 0) ;
-    
+
     /* set the octal flag   */
     if (!hex && *s == '0' && *(s+1) )
-       octal = 1 ;
-    
+  octal = 1 ;
+
     /* create the scan string */
     scanFmt[scI++] = '%' ;
-    
+
     if (octal)
-       scanFmt[scI++] = 'o' ;
+  scanFmt[scI++] = 'o' ;
     else
-       if (hex)
-           scanFmt[scI++] = 'x' ;
-       else
-           if (SPEC_USIGN(val->type))
-               scanFmt[scI++] = 'u' ;
-           else
-               scanFmt[scI++] = 'd' ;
-    
+  if (hex)
+      scanFmt[scI++] = 'x' ;
+  else
+      if (SPEC_USIGN(val->type))
+    scanFmt[scI++] = 'u' ;
+      else
+    scanFmt[scI++] = 'd' ;
+
     scanFmt[scI++] = '\0' ;
-    
+
     /* if hex or octal then set the unsigned flag   */
     if ( hex || octal ) {
-       SPEC_USIGN(val->type) = 1 ;
-       sscanf(s,scanFmt,&sval);
+  SPEC_USIGN(val->type) = 1 ;
+  sscanf(s,scanFmt,&sval);
     } else
-       sval = atol(s);
-    
-    
+  sval = atol(s);
+
+
     if (SPEC_LONG(val->type) || sval > 32768) {
-       if (SPEC_USIGN(val->type))
-           SPEC_CVAL(val->type).v_ulong = sval ;
-       else
-           SPEC_CVAL(val->type).v_long = sval ;
-       SPEC_LONG(val->type) = 1;
+  if (SPEC_USIGN(val->type))
+      SPEC_CVAL(val->type).v_ulong = sval ;
+  else
+      SPEC_CVAL(val->type).v_long = sval ;
+  SPEC_LONG(val->type) = 1;
     }
     else {
-       if (SPEC_USIGN(val->type))
-           SPEC_CVAL(val->type).v_uint = sval ;
-       else
-           SPEC_CVAL(val->type).v_int = sval ;
+  if (SPEC_USIGN(val->type))
+      SPEC_CVAL(val->type).v_uint = sval ;
+  else
+      SPEC_CVAL(val->type).v_int = sval ;
     }
 
     // check the size and make it a short if required
     if (sval < 256 )
-       SPEC_SHORT(val->etype) = 1;                     
-    
+  SPEC_SHORT(val->etype) = 1;
+
     return val ;
-    
+
 }
 
 /*------------------------------------------------------------------*/
 /* copyStr - copies src to dest ignoring leading & trailing \"s     */
 /*------------------------------------------------------------------*/
-void   copyStr (char *dest, char *src )
+void  copyStr (char *dest, char *src )
 {
     unsigned int x;
     while (*src) {
-       if (*src == '\"' ) 
-           src++ ;
-       else
-           if ( *src == '\\' ) {
-               src++ ;
-               switch (*src) {
-               case 'n'        :
-                   *dest++ = '\n';
-                   break ;
-               case 't'        :
-                   *dest++ = '\t';
-                   break;
-               case 'v'        :
-                   *dest++ = '\v';
-                   break;
-               case 'b'        :
-                   *dest++ = '\b';
-                   break;
-               case 'r'        :
-                   *dest++ = '\r';
-                   break;
-               case 'f'        :
-                   *dest++ = '\f';
-                   break;
-               case 'a' :
-                   *dest++ = '\a';
-                   break;
-               case '0':
-                   /* embedded octal or hex constant */
-                   if (*(src+1) == 'x' ||
-                       *(src+1) == 'X') {
-                       x = strtol(src,&src,16);
-                       *dest++ = x;
-                   } else {
-                       /* must be octal */
-                       x = strtol(src,&src,8);
-                       *dest++ = x;
-                   }
-                   break;
-                       
-               case '\\':
-                   *dest++ = '\\';
-                   break;
-               case '\?':
-                   *dest++ = '\?';
-                   break;
-               case '\'':
-                   *dest++ = '\'';
-                   break;
-               case '\"':
-                   *dest++ = '\"';
-                   break;                  
-               default :
-                   *dest++ = *src ;
-               }
-               src++ ;
-           }
-           else
-               *dest++ = *src++ ;
+  if (*src == '\"' )
+      src++ ;
+  else
+      if ( *src == '\\' ) {
+    src++ ;
+    switch (*src) {
+    case 'n'  :
+        *dest++ = '\n';
+        break ;
+    case 't'  :
+        *dest++ = '\t';
+        break;
+    case 'v'  :
+        *dest++ = '\v';
+        break;
+    case 'b'  :
+        *dest++ = '\b';
+        break;
+    case 'r'  :
+        *dest++ = '\r';
+        break;
+    case 'f'  :
+        *dest++ = '\f';
+        break;
+    case 'a' :
+        *dest++ = '\a';
+        break;
+    case '0':
+        /* embedded octal or hex constant */
+        if (*(src+1) == 'x' ||
+      *(src+1) == 'X') {
+      x = strtol(src,&src,16);
+      *dest++ = x;
+        } else {
+      /* must be octal */
+      x = strtol(src,&src,8);
+      *dest++ = x;
+        }
+        break;
+
+    case '\\':
+        *dest++ = '\\';
+        break;
+    case '\?':
+        *dest++ = '\?';
+        break;
+    case '\'':
+        *dest++ = '\'';
+        break;
+    case '\"':
+        *dest++ = '\"';
+        break;
+    default :
+        *dest++ = *src ;
     }
-    
+    src++ ;
+      }
+      else
+    *dest++ = *src++ ;
+    }
+
     *dest = '\0' ;
 }
 
 /*------------------------------------------------------------------*/
-/* strVal - converts a string constant to a value                  */
+/* strVal - converts a string constant to a value       */
 /*------------------------------------------------------------------*/
-value *strVal  ( char  *s )
+value *strVal  ( char *s )
 {
     value *val ;
-    
-    val = newValue() ;       /* get a new one */
-    
-    /* get a declarator        */
+
+    val = newValue() ;        /* get a new one */
+
+    /* get a declarator */
     val->type   =  newLink();
     DCL_TYPE(val->type) = ARRAY ;
     DCL_ELEM(val->type) = strlen(s) - 1;
     val->type->next = val->etype = newLink() ;
-    val->etype->class      =  SPECIFIER;
+    val->etype->class     =  SPECIFIER;
     SPEC_NOUN(val->etype)   =  V_CHAR   ;
     SPEC_SCLS(val->etype)   =  S_LITERAL;
-    
-    SPEC_CVAL(val->etype).v_char = Safe_calloc(strlen(s)+1);
+
+    SPEC_CVAL(val->etype).v_char = Safe_calloc(1,strlen(s)+1);
     copyStr (SPEC_CVAL(val->etype).v_char,s);
     return val;
 }
@@ -412,47 +412,47 @@ value *strVal  ( char     *s )
 /*------------------------------------------------------------------*/
 /* reverseValWithType - reverses value chain with type & etype      */
 /*------------------------------------------------------------------*/
-value  *reverseValWithType ( value *val )
+value *reverseValWithType ( value *val )
 {
     sym_link *type ;
     sym_link *etype;
-    
-    if (!val) 
-       return NULL ;
-    
+
+    if (!val)
+  return NULL ;
+
     /* save the type * etype chains */
     type = val->type ;
     etype = val->etype ;
-    
+
     /* set the current one 2b null */
     val->type = val->etype = NULL;
     val = reverseVal (val);
-    
+
     /* restore type & etype */
     val->type = type ;
     val->etype = etype ;
-    
+
     return val;
 }
 
 /*------------------------------------------------------------------*/
-/* reverseVal - reverses the values for a value  chain                     */
+/* reverseVal - reverses the values for a value  chain        */
 /*------------------------------------------------------------------*/
-value   *reverseVal   ( value  *val)
+value  *reverseVal   ( value  *val)
 {
     value  *prev  , *curr, *next ;
-    
+
     if (!val)
-       return NULL ;
-    
+  return NULL ;
+
     prev = val ;
     curr = val->next ;
-    
+
     while (curr) {
-       next = curr->next ;
-       curr->next = prev   ;
-       prev = curr ;
-       curr = next ;
+  next = curr->next ;
+  curr->next = prev   ;
+  prev = curr ;
+  curr = next ;
     }
     val->next = (void *) NULL ;
     return prev ;
@@ -464,13 +464,13 @@ value      *reverseVal   ( value  *val)
 value *copyValueChain ( value *src )
 {
     value *dest ;
-    
+
     if ( ! src )
-       return NULL ;
-    
+  return NULL ;
+
     dest = copyValue (src);
     dest->next = copyValueChain (src->next);
-    
+
     return dest ;
 }
 
@@ -480,83 +480,83 @@ value *copyValueChain ( value *src )
 value *copyValue  (value   *src)
 {
     value *dest ;
-    
+
     dest = newValue();
     dest->sym    = copySymbol(src->sym);
     strcpy(dest->name,src->name);
     dest->type   = (src->type ? copyLinkChain(src->type) : NULL) ;
     dest->etype  = (src->type ? getSpec(dest->type) : NULL);
-    
+
     return dest ;
 }
 
 /*------------------------------------------------------------------*/
-/* charVal - converts a character constant to a value              */
+/* charVal - converts a character constant to a value       */
 /*------------------------------------------------------------------*/
 value *charVal ( char *s )
 {
     value *val ;
-    
+
     val = newValue ();
-    
+
     val->type = val->etype = newLink();
     val->type->class = SPECIFIER  ;
     SPEC_NOUN(val->type) = V_CHAR ;
     SPEC_SCLS(val->type) = S_LITERAL ;
-    
-    s++ ;      /* get rid of quotation */
-    /* if \ then special processing    */
-    if ( *s == '\\' )  {
-       s++ ;   /* go beyond the backslash      */
-       switch (*s)             {
-       case 'n'        :
-           SPEC_CVAL(val->type).v_int = '\n';
-           break ;
-       case 't'        :
-           SPEC_CVAL(val->type).v_int = '\t';
-           break;
-       case 'v'        :
-           SPEC_CVAL(val->type).v_int = '\v';
-           break;
-       case 'b'        :
-           SPEC_CVAL(val->type).v_int = '\b';
-           break;
-       case 'r'        :
-           SPEC_CVAL(val->type).v_int = '\r';
-           break;
-       case 'f'        :
-           SPEC_CVAL(val->type).v_int = '\f';
-           break;
-       case 'a' :
-           SPEC_CVAL(val->type).v_int = '\a';
-           break;
-       case '\\':
-           SPEC_CVAL(val->type).v_int = '\\';
-           break;
-       case '\?':
-           SPEC_CVAL(val->type).v_int = '\?';
-           break;
-       case '\'':
-           SPEC_CVAL(val->type).v_int = '\'';
-           break;
-       case '\"':
-           SPEC_CVAL(val->type).v_int = '\"';
-           break;
-       case '0'        :
-           sscanf(s,"%o",&SPEC_CVAL(val->type).v_int);
-           break;
-       case 'x' :
-           s++ ; /* go behond the 'x' */
-           sscanf(s,"%x",&SPEC_CVAL(val->type).v_int);
-           break;
-       default :
-           SPEC_CVAL(val->type).v_int = *s;
-           break;
-       }
+
+    s++ ; /* get rid of quotation */
+    /* if \ then special processing */
+    if ( *s == '\\' ) {
+  s++ ; /* go beyond the backslash  */
+  switch (*s)   {
+  case 'n'  :
+      SPEC_CVAL(val->type).v_int = '\n';
+      break ;
+  case 't'  :
+      SPEC_CVAL(val->type).v_int = '\t';
+      break;
+  case 'v'  :
+      SPEC_CVAL(val->type).v_int = '\v';
+      break;
+  case 'b'  :
+      SPEC_CVAL(val->type).v_int = '\b';
+      break;
+  case 'r'  :
+      SPEC_CVAL(val->type).v_int = '\r';
+      break;
+  case 'f'  :
+      SPEC_CVAL(val->type).v_int = '\f';
+      break;
+  case 'a' :
+      SPEC_CVAL(val->type).v_int = '\a';
+      break;
+  case '\\':
+      SPEC_CVAL(val->type).v_int = '\\';
+      break;
+  case '\?':
+      SPEC_CVAL(val->type).v_int = '\?';
+      break;
+  case '\'':
+      SPEC_CVAL(val->type).v_int = '\'';
+      break;
+  case '\"':
+      SPEC_CVAL(val->type).v_int = '\"';
+      break;
+  case '0'  :
+      sscanf(s,"%o",&SPEC_CVAL(val->type).v_int);
+      break;
+  case 'x' :
+      s++ ; /* go behond the 'x' */
+      sscanf(s,"%x",&SPEC_CVAL(val->type).v_int);
+      break;
+  default :
+      SPEC_CVAL(val->type).v_int = *s;
+      break;
+  }
     }
-    else       /* not a backslash */
-       SPEC_CVAL(val->type).v_int = *s;
-    
+    else  /* not a backslash */
+  SPEC_CVAL(val->type).v_int = *s;
+
     return val ;
 }
 
@@ -572,38 +572,38 @@ value *valFromType ( sym_link *type)
 }
 
 /*------------------------------------------------------------------*/
-/* floatFromVal - value to unsinged integer conversion             */
+/* floatFromVal - value to unsinged integer conversion        */
 /*------------------------------------------------------------------*/
 double   floatFromVal ( value *val )
 {
     if (!val)
-       return 0;
+  return 0;
 
     if (val->etype && SPEC_SCLS(val->etype) != S_LITERAL) {
-       werror(E_CONST_EXPECTED,val->name);
-       return 0;
+  werror(E_CONST_EXPECTED,val->name);
+  return 0;
     }
-    
+
     /* if it is not a specifier then we can assume that */
     /* it will be an unsigned long                      */
     if (!IS_SPEC(val->type))
-       return (double) SPEC_CVAL(val->etype).v_ulong;
+  return (double) SPEC_CVAL(val->etype).v_ulong;
 
     if (SPEC_NOUN(val->etype) == V_FLOAT )
-       return (double) SPEC_CVAL(val->etype).v_float ;
+  return (double) SPEC_CVAL(val->etype).v_float ;
     else {
-       if (SPEC_LONG(val->etype)) {
-           if (SPEC_USIGN(val->etype))
-               return (double) SPEC_CVAL(val->etype).v_ulong ;
-           else
-               return (double) SPEC_CVAL(val->etype).v_long  ;
-       }
-       else {
-           if (SPEC_USIGN(val->etype))
-               return (double) SPEC_CVAL(val->etype).v_uint ;
-           else
-               return (double) SPEC_CVAL(val->etype).v_int  ;
-       }
+  if (SPEC_LONG(val->etype)) {
+      if (SPEC_USIGN(val->etype))
+    return (double) SPEC_CVAL(val->etype).v_ulong ;
+      else
+    return (double) SPEC_CVAL(val->etype).v_long  ;
+  }
+  else {
+      if (SPEC_USIGN(val->etype))
+    return (double) SPEC_CVAL(val->etype).v_uint ;
+      else
+    return (double) SPEC_CVAL(val->etype).v_int  ;
+  }
     }
 }
 
@@ -615,23 +615,23 @@ value *valUnaryPM (value   *val)
 {
     /* depending on type */
     if (SPEC_NOUN(val->etype) == V_FLOAT )
-       SPEC_CVAL(val->etype).v_float = -1.0 * SPEC_CVAL(val->etype).v_float;
+  SPEC_CVAL(val->etype).v_float = -1.0 * SPEC_CVAL(val->etype).v_float;
     else {
-       if ( SPEC_LONG(val->etype)) {
-           if (SPEC_USIGN(val->etype))
-               SPEC_CVAL(val->etype).v_ulong = - SPEC_CVAL(val->etype).v_ulong ;
-           else
-               SPEC_CVAL(val->etype).v_long  = - SPEC_CVAL(val->etype).v_long;
-       }
-       else {
-           if (SPEC_USIGN(val->etype))
-               SPEC_CVAL(val->etype).v_uint  = -  SPEC_CVAL(val->etype).v_uint ;
-           else
-               SPEC_CVAL(val->etype).v_int   = - SPEC_CVAL(val->etype).v_int ; 
-       }
+  if ( SPEC_LONG(val->etype)) {
+      if (SPEC_USIGN(val->etype))
+    SPEC_CVAL(val->etype).v_ulong = - SPEC_CVAL(val->etype).v_ulong ;
+      else
+    SPEC_CVAL(val->etype).v_long  = - SPEC_CVAL(val->etype).v_long;
+  }
+  else {
+      if (SPEC_USIGN(val->etype))
+    SPEC_CVAL(val->etype).v_uint  = -  SPEC_CVAL(val->etype).v_uint ;
+      else
+    SPEC_CVAL(val->etype).v_int   = - SPEC_CVAL(val->etype).v_int ;
+  }
     }
     return val ;
-    
+
 }
 
 /*------------------------------------------------------------------*/
@@ -641,16 +641,16 @@ value *valComplement ( value  *val)
 {
     /* depending on type */
     if ( SPEC_LONG(val->etype)) {
-       if (SPEC_USIGN(val->etype))
-           SPEC_CVAL(val->etype).v_ulong = ~SPEC_CVAL(val->etype).v_ulong ;
-       else
-           SPEC_CVAL(val->etype).v_long  = ~SPEC_CVAL(val->etype).v_long;
+  if (SPEC_USIGN(val->etype))
+      SPEC_CVAL(val->etype).v_ulong = ~SPEC_CVAL(val->etype).v_ulong ;
+  else
+      SPEC_CVAL(val->etype).v_long  = ~SPEC_CVAL(val->etype).v_long;
     }
     else {
-       if (SPEC_USIGN(val->etype))
-           SPEC_CVAL(val->etype).v_uint  = ~SPEC_CVAL(val->etype).v_uint ;
-       else
-           SPEC_CVAL(val->etype).v_int   = ~SPEC_CVAL(val->etype).v_int ; 
+  if (SPEC_USIGN(val->etype))
+      SPEC_CVAL(val->etype).v_uint  = ~SPEC_CVAL(val->etype).v_uint ;
+  else
+      SPEC_CVAL(val->etype).v_int   = ~SPEC_CVAL(val->etype).v_int ;
     }
     return val ;
 }
@@ -662,16 +662,16 @@ value *valNot ( value  *val)
 {
     /* depending on type */
     if ( SPEC_LONG(val->etype)) {
-       if (SPEC_USIGN(val->etype))
-           SPEC_CVAL(val->etype).v_ulong = !SPEC_CVAL(val->etype).v_ulong ;
-       else
-           SPEC_CVAL(val->etype).v_long  = !SPEC_CVAL(val->etype).v_long;
+  if (SPEC_USIGN(val->etype))
+      SPEC_CVAL(val->etype).v_ulong = !SPEC_CVAL(val->etype).v_ulong ;
+  else
+      SPEC_CVAL(val->etype).v_long  = !SPEC_CVAL(val->etype).v_long;
     }
     else {
-       if (SPEC_USIGN(val->etype))
-           SPEC_CVAL(val->etype).v_uint  = !SPEC_CVAL(val->etype).v_uint ;
-       else
-           SPEC_CVAL(val->etype).v_int   = !SPEC_CVAL(val->etype).v_int ; 
+  if (SPEC_USIGN(val->etype))
+      SPEC_CVAL(val->etype).v_uint  = !SPEC_CVAL(val->etype).v_uint ;
+  else
+      SPEC_CVAL(val->etype).v_int   = !SPEC_CVAL(val->etype).v_int ;
     }
     return val ;
 }
@@ -682,38 +682,38 @@ value *valNot ( value  *val)
 value *valMult (value  *lval, value *rval)
 {
     value *val ;
-    
+
     /* create a new value */
     val = newValue();
     val->type = val->etype = newLink();
     val->type->class = SPECIFIER  ;
-    SPEC_NOUN(val->type) = (IS_FLOAT(lval->etype) || 
-                           IS_FLOAT(rval->etype) ? V_FLOAT : V_INT ); 
+    SPEC_NOUN(val->type) = (IS_FLOAT(lval->etype) ||
+          IS_FLOAT(rval->etype) ? V_FLOAT : V_INT );
     SPEC_SCLS(val->type) = S_LITERAL;/* will remain literal */
     SPEC_USIGN(val->type) = (SPEC_USIGN(lval->etype) | SPEC_USIGN(rval->etype));
     SPEC_LONG(val->type) = (SPEC_LONG(lval->etype) | SPEC_LONG(rval->etype));
-    
+
     if (IS_FLOAT(val->type))
-       SPEC_CVAL(val->type).v_float = floatFromVal(lval) * floatFromVal(rval);
+  SPEC_CVAL(val->type).v_float = floatFromVal(lval) * floatFromVal(rval);
     else {
-       if (SPEC_LONG(val->type)) {
-           if (SPEC_USIGN(val->type))
-               SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) * 
-                   (unsigned long) floatFromVal(rval);
-           else
-               SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) * 
-                   (long) floatFromVal(rval);
-       }
-       else {
-           if (SPEC_USIGN(val->type))
-               SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) * 
-                   (unsigned) floatFromVal(rval);
-           else
-               SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) * 
-                   (int) floatFromVal(rval);
-       }
+  if (SPEC_LONG(val->type)) {
+      if (SPEC_USIGN(val->type))
+    SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) *
+        (unsigned long) floatFromVal(rval);
+      else
+    SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) *
+        (long) floatFromVal(rval);
+  }
+  else {
+      if (SPEC_USIGN(val->type))
+    SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) *
+        (unsigned) floatFromVal(rval);
+      else
+    SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) *
+        (int) floatFromVal(rval);
+  }
     }
-    return val ;   
+    return val ;
 }
 
 /*------------------------------------------------------------------*/
@@ -724,41 +724,41 @@ value *valDiv  (value  *lval, value *rval)
     value *val ;
 
     if (floatFromVal(rval) == 0) {
-       werror(E_DIVIDE_BY_ZERO);
-       return rval;
+  werror(E_DIVIDE_BY_ZERO);
+  return rval;
     }
-       
+
     /* create a new value */
     val = newValue();
     val->type = val->etype = ((floatFromVal(lval) / floatFromVal(rval)) < 256 ?
-                             newCharLink() : newIntLink());
+            newCharLink() : newIntLink());
     if (IS_FLOAT(lval->etype) || IS_FLOAT(rval->etype))
-       SPEC_NOUN(val->etype) = V_FLOAT ;
+  SPEC_NOUN(val->etype) = V_FLOAT ;
     SPEC_SCLS(val->etype) = S_LITERAL ;
     SPEC_USIGN(val->type) = (SPEC_USIGN(lval->etype) | SPEC_USIGN(rval->etype));
     SPEC_LONG(val->type) = (SPEC_LONG(lval->etype) | SPEC_LONG(rval->etype));
-    
+
     if (IS_FLOAT(val->type))
-       SPEC_CVAL(val->type).v_float = floatFromVal(lval) / floatFromVal(rval);
+  SPEC_CVAL(val->type).v_float = floatFromVal(lval) / floatFromVal(rval);
     else {
-       if (SPEC_LONG(val->type)) {
-           if (SPEC_USIGN(val->type))
-               SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) /
-                   (unsigned long) floatFromVal(rval);
-           else
-               SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) /
-                   (long) floatFromVal(rval);
-       }
-       else {
-           if (SPEC_USIGN(val->type))
-               SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) /
-                   (unsigned) floatFromVal(rval);
-           else
-               SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) / 
-                   (int) floatFromVal(rval);
-       }
+  if (SPEC_LONG(val->type)) {
+      if (SPEC_USIGN(val->type))
+    SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) /
+        (unsigned long) floatFromVal(rval);
+      else
+    SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) /
+        (long) floatFromVal(rval);
+  }
+  else {
+      if (SPEC_USIGN(val->type))
+    SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) /
+        (unsigned) floatFromVal(rval);
+      else
+    SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) /
+        (int) floatFromVal(rval);
+  }
     }
-    return val ;   
+    return val ;
 }
 
 /*------------------------------------------------------------------*/
@@ -767,7 +767,7 @@ value *valDiv  (value  *lval, value *rval)
 value *valMod  (value  *lval, value *rval)
 {
     value *val ;
-    
+
     /* create a new value */
     val = newValue();
     val->type = val->etype = newLink();
@@ -776,25 +776,25 @@ value *valMod  (value  *lval, value *rval)
     SPEC_SCLS(val->type) = S_LITERAL;/* will remain literal */
     SPEC_USIGN(val->type) = (SPEC_USIGN(lval->etype) | SPEC_USIGN(rval->etype));
     SPEC_LONG(val->type) = (SPEC_LONG(lval->etype) | SPEC_LONG(rval->etype));
-    
+
     if (SPEC_LONG(val->type)) {
-       if (SPEC_USIGN(val->type))
-           SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) % 
-               (unsigned long) floatFromVal(rval);
-       else
-           SPEC_CVAL(val->type).v_long = (unsigned long) floatFromVal(lval) % 
-               (unsigned long) floatFromVal(rval);
+  if (SPEC_USIGN(val->type))
+      SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) %
+    (unsigned long) floatFromVal(rval);
+  else
+      SPEC_CVAL(val->type).v_long = (unsigned long) floatFromVal(lval) %
+    (unsigned long) floatFromVal(rval);
     }
     else {
-       if (SPEC_USIGN(val->type))
-           SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) % 
-               (unsigned) floatFromVal(rval);
-       else
-           SPEC_CVAL(val->type).v_int = (unsigned) floatFromVal(lval) % 
-               (unsigned) floatFromVal(rval);
+  if (SPEC_USIGN(val->type))
+      SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) %
+    (unsigned) floatFromVal(rval);
+  else
+      SPEC_CVAL(val->type).v_int = (unsigned) floatFromVal(lval) %
+    (unsigned) floatFromVal(rval);
     }
-    
-    return val ;   
+
+    return val ;
 }
 
 /*------------------------------------------------------------------*/
@@ -803,38 +803,38 @@ value *valMod  (value  *lval, value *rval)
 value *valPlus (value  *lval, value *rval)
 {
     value *val ;
-    
+
     /* create a new value */
     val = newValue();
     val->type = val->etype = newLink();
     val->type->class = SPECIFIER  ;
-    SPEC_NOUN(val->type) = (IS_FLOAT(lval->etype) || 
-                           IS_FLOAT(rval->etype) ? V_FLOAT : V_INT ); 
+    SPEC_NOUN(val->type) = (IS_FLOAT(lval->etype) ||
+          IS_FLOAT(rval->etype) ? V_FLOAT : V_INT );
     SPEC_SCLS(val->type) = S_LITERAL;/* will remain literal */
     SPEC_USIGN(val->type) = (SPEC_USIGN(lval->etype) | SPEC_USIGN(rval->etype));
     SPEC_LONG(val->type) = (SPEC_LONG(lval->etype) | SPEC_LONG(rval->etype));
-    
+
     if (IS_FLOAT(val->type))
-       SPEC_CVAL(val->type).v_float = floatFromVal(lval) + floatFromVal(rval);
+  SPEC_CVAL(val->type).v_float = floatFromVal(lval) + floatFromVal(rval);
     else {
-       if (SPEC_LONG(val->type)) {
-           if (SPEC_USIGN(val->type))
-               SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) +
-                   (unsigned long) floatFromVal(rval);
-           else
-               SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) +
-                   (long) floatFromVal(rval);
-       }
-       else {
-           if (SPEC_USIGN(val->type))
-               SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) +
-                   (unsigned) floatFromVal(rval);
-           else
-               SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) + 
-                   (int) floatFromVal(rval);
-       }
+  if (SPEC_LONG(val->type)) {
+      if (SPEC_USIGN(val->type))
+    SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) +
+        (unsigned long) floatFromVal(rval);
+      else
+    SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) +
+        (long) floatFromVal(rval);
+  }
+  else {
+      if (SPEC_USIGN(val->type))
+    SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) +
+        (unsigned) floatFromVal(rval);
+      else
+    SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) +
+        (int) floatFromVal(rval);
+  }
     }
-    return val ;     
+    return val ;
 }
 
 /*------------------------------------------------------------------*/
@@ -843,37 +843,37 @@ value *valPlus (value  *lval, value *rval)
 value *valMinus (value  *lval, value *rval)
 {
     value *val ;
-    
+
     /* create a new value */
     val = newValue();
     val->type = val->etype = newLink();
     val->type->class = SPECIFIER  ;
-    SPEC_NOUN(val->type) = (IS_FLOAT(lval->etype) || 
-                           IS_FLOAT(rval->etype) ? V_FLOAT : V_INT ); 
+    SPEC_NOUN(val->type) = (IS_FLOAT(lval->etype) ||
+          IS_FLOAT(rval->etype) ? V_FLOAT : V_INT );
     SPEC_SCLS(val->type) = S_LITERAL;/* will remain literal */
     SPEC_USIGN(val->type) = (SPEC_USIGN(lval->etype) | SPEC_USIGN(rval->etype));
     SPEC_LONG(val->type) = (SPEC_LONG(lval->etype) | SPEC_LONG(rval->etype));
-    
+
     if (IS_FLOAT(val->type))
-       SPEC_CVAL(val->type).v_float = floatFromVal(lval) - floatFromVal(rval);
+  SPEC_CVAL(val->type).v_float = floatFromVal(lval) - floatFromVal(rval);
     else {
-       if (SPEC_LONG(val->type)) {
-           if (SPEC_USIGN(val->type))
-               SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) -
-                   (unsigned long) floatFromVal(rval);
-           else
-               SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) -
-                   (long) floatFromVal(rval);
-       }
-       else {
-           if (SPEC_USIGN(val->type))
-               SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) -
-                   (unsigned) floatFromVal(rval);
-           else
-               SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) - (int) floatFromVal(rval);
-       }
+  if (SPEC_LONG(val->type)) {
+      if (SPEC_USIGN(val->type))
+    SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) -
+        (unsigned long) floatFromVal(rval);
+      else
+    SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) -
+        (long) floatFromVal(rval);
+  }
+  else {
+      if (SPEC_USIGN(val->type))
+    SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) -
+        (unsigned) floatFromVal(rval);
+      else
+    SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) - (int) floatFromVal(rval);
+  }
     }
-    return val ; 
+    return val ;
 }
 
 /*------------------------------------------------------------------*/
@@ -891,45 +891,45 @@ value *valShift (value  *lval, value *rval, int lr)
    SPEC_SCLS(val->type) = S_LITERAL;/* will remain literal */
    SPEC_USIGN(val->type) = (SPEC_USIGN(lval->etype) | SPEC_USIGN(rval->etype));
    SPEC_LONG(val->type) = (SPEC_LONG(lval->etype) | SPEC_LONG(rval->etype));
-   
+
    if (lr) {
        if (SPEC_LONG(val->type)) {
-          if (SPEC_USIGN(val->type))
-              SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) << 
-                  (unsigned long) floatFromVal(rval);
-          else
-              SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) << 
-                  (long) floatFromVal(rval);
+     if (SPEC_USIGN(val->type))
+         SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) <<
+       (unsigned long) floatFromVal(rval);
+     else
+         SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) <<
+       (long) floatFromVal(rval);
        }
        else {
-          if (SPEC_USIGN(val->type))
-              SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) << 
-                  (unsigned) floatFromVal(rval);
-          else
-              SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) << 
-                  (int) floatFromVal(rval);
+     if (SPEC_USIGN(val->type))
+         SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) <<
+       (unsigned) floatFromVal(rval);
+     else
+         SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) <<
+       (int) floatFromVal(rval);
        }
    }
    else {
        if (SPEC_LONG(val->type)) {
-          if (SPEC_USIGN(val->type))
-              SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) >>
-                  (unsigned long) floatFromVal(rval);
-          else
-              SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) >>
-                  (long) floatFromVal(rval);
+     if (SPEC_USIGN(val->type))
+         SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) >>
+       (unsigned long) floatFromVal(rval);
+     else
+         SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) >>
+       (long) floatFromVal(rval);
        }
        else {
-          if (SPEC_USIGN(val->type))
-              SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) >>
-                  (unsigned) floatFromVal(rval);
-          else
-              SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) >>
-                  (int) floatFromVal(rval);
+     if (SPEC_USIGN(val->type))
+         SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) >>
+       (unsigned) floatFromVal(rval);
+     else
+         SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) >>
+       (int) floatFromVal(rval);
        }
    }
 
-   return val ;   
+   return val ;
 }
 
 /*------------------------------------------------------------------*/
@@ -944,15 +944,15 @@ value *valCompare (value  *lval, value *rval, int ctype)
    val->type = val->etype = newCharLink();
    val->type->class = SPECIFIER  ;
    SPEC_NOUN(val->type) = V_INT ;   /* type is int */
-   SPEC_SCLS(val->type) = S_LITERAL;/* will remain literal */   
+   SPEC_SCLS(val->type) = S_LITERAL;/* will remain literal */
 
    switch (ctype)
    {
-   case '<' :                 
+   case '<' :
        SPEC_CVAL(val->type).v_int = floatFromVal(lval) < floatFromVal(rval);
        break ;
 
-   case '>' :    
+   case '>' :
        SPEC_CVAL(val->type).v_int = floatFromVal(lval) > floatFromVal(rval);
       break ;
 
@@ -971,10 +971,10 @@ value *valCompare (value  *lval, value *rval, int ctype)
    case NE_OP  :
        SPEC_CVAL(val->type).v_int = floatFromVal(lval) != floatFromVal(rval);
        break ;
-       
-   }                            
 
-   return val ;   
+   }
+
+   return val ;
 }
 
 /*------------------------------------------------------------------*/
@@ -993,63 +993,63 @@ value *valBitwise (value  *lval, value *rval, int op)
    {
    case '&' :
        if (SPEC_LONG(val->type)) {
-          if (SPEC_USIGN(val->type))
-              SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) &
-                  (unsigned long) floatFromVal(rval);
-          else
-              SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) &
-                  (long) floatFromVal(rval);
+     if (SPEC_USIGN(val->type))
+         SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) &
+       (unsigned long) floatFromVal(rval);
+     else
+         SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) &
+       (long) floatFromVal(rval);
        }
        else {
-          if (SPEC_USIGN(val->type))
-              SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) &
-                  (unsigned) floatFromVal(rval);
-          else
-              SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) & (int) floatFromVal(rval);
+     if (SPEC_USIGN(val->type))
+         SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) &
+       (unsigned) floatFromVal(rval);
+     else
+         SPEC_CVAL(val->type).v_int = (int) floatFromVal(lval) & (int) floatFromVal(rval);
        }
        break ;
 
    case '|' :
        if (SPEC_LONG(val->type)) {
-          if (SPEC_USIGN(val->type))
-              SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) |
-                  (unsigned long) floatFromVal(rval);
-          else
-              SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) |
-                  (long) floatFromVal(rval);
+     if (SPEC_USIGN(val->type))
+         SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) |
+       (unsigned long) floatFromVal(rval);
+     else
+         SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) |
+       (long) floatFromVal(rval);
        }
        else {
-          if (SPEC_USIGN(val->type))
-              SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) |
-                  (unsigned) floatFromVal(rval);
-          else
-              SPEC_CVAL(val->type).v_int = 
-                  (int) floatFromVal(lval) | (int) floatFromVal(rval);
+     if (SPEC_USIGN(val->type))
+         SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) |
+       (unsigned) floatFromVal(rval);
+     else
+         SPEC_CVAL(val->type).v_int =
+       (int) floatFromVal(lval) | (int) floatFromVal(rval);
        }
+
       break ;
 
    case '^' :
        if (SPEC_LONG(val->type)) {
-          if (SPEC_USIGN(val->type))
-              SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) ^
-                  (unsigned long) floatFromVal(rval);
-          else
-              SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) ^
-                  (long) floatFromVal(rval);
+     if (SPEC_USIGN(val->type))
+         SPEC_CVAL(val->type).v_ulong = (unsigned long) floatFromVal(lval) ^
+       (unsigned long) floatFromVal(rval);
+     else
+         SPEC_CVAL(val->type).v_long = (long) floatFromVal(lval) ^
+       (long) floatFromVal(rval);
        }
        else {
-          if (SPEC_USIGN(val->type))
-              SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) ^
-                  (unsigned) floatFromVal(rval);
-          else
-              SPEC_CVAL(val->type).v_int = 
-                  (int) floatFromVal(lval) ^ (int) floatFromVal(rval);
+     if (SPEC_USIGN(val->type))
+         SPEC_CVAL(val->type).v_uint = (unsigned) floatFromVal(lval) ^
+       (unsigned) floatFromVal(rval);
+     else
+         SPEC_CVAL(val->type).v_int =
+       (int) floatFromVal(lval) ^ (int) floatFromVal(rval);
        }
-      break ;               
+      break ;
    }
 
-   return val ;   
+   return val ;
 }
 
 /*------------------------------------------------------------------*/
@@ -1063,7 +1063,7 @@ value *valLogicAndOr (value  *lval, value *rval, int op)
    val = newValue();
    val->type = val->etype = newCharLink();
    val->type->class = SPECIFIER  ;
-   SPEC_SCLS(val->type) = S_LITERAL;/* will remain literal */  
+   SPEC_SCLS(val->type) = S_LITERAL;/* will remain literal */
 
    switch (op)
    {
@@ -1075,9 +1075,9 @@ value *valLogicAndOr (value  *lval, value *rval, int op)
        SPEC_CVAL(val->type).v_int = floatFromVal(lval)  || floatFromVal(rval);
        break ;
    }
-  
-   
-   return val ;   
+
+
+   return val ;
 }
 
 /*------------------------------------------------------------------*/
@@ -1088,7 +1088,7 @@ value *valCastLiteral (sym_link *dtype, double fval)
     value *val ;
 
     if (!dtype)
-       return NULL ;
+  return NULL ;
 
     val = newValue();
     val->etype = getSpec (val->type = copyLinkChain(dtype));
@@ -1096,25 +1096,25 @@ value *valCastLiteral (sym_link *dtype, double fval)
     /* if it is not a specifier then we can assume that */
     /* it will be an unsigned long                      */
     if (!IS_SPEC(val->type)) {
-       SPEC_CVAL(val->etype).v_ulong = (unsigned long) fval;
-       return val;
+  SPEC_CVAL(val->etype).v_ulong = (unsigned long) fval;
+  return val;
     }
 
     if (SPEC_NOUN(val->etype) == V_FLOAT )
-       SPEC_CVAL(val->etype).v_float = fval;
+  SPEC_CVAL(val->etype).v_float = fval;
     else {
-       if (SPEC_LONG(val->etype)) {
-           if (SPEC_USIGN(val->etype))
-               SPEC_CVAL(val->etype).v_ulong = (unsigned long) fval;
-           else
-               SPEC_CVAL(val->etype).v_long  = (long) fval;
-       }
-       else {
-           if (SPEC_USIGN(val->etype))
-               SPEC_CVAL(val->etype).v_uint = (unsigned int) fval;
-           else
-               SPEC_CVAL(val->etype).v_int  = (int) fval;   
-       }
+  if (SPEC_LONG(val->etype)) {
+      if (SPEC_USIGN(val->etype))
+    SPEC_CVAL(val->etype).v_ulong = (unsigned long) fval;
+      else
+    SPEC_CVAL(val->etype).v_long  = (long) fval;
+  }
+  else {
+      if (SPEC_USIGN(val->etype))
+    SPEC_CVAL(val->etype).v_uint = (unsigned int) fval;
+      else
+    SPEC_CVAL(val->etype).v_int  = (int) fval;
+  }
     }
     return val;
 }
@@ -1128,31 +1128,31 @@ int getNelements (sym_link *type,initList *ilist)
     int i;
 
     if (! ilist)
-       return 0;
+  return 0;
 
     if (ilist->type == INIT_DEEP)
-       ilist = ilist->init.deep;
+  ilist = ilist->init.deep;
 
     /* if type is a character array and there is only one
        initialiser then get the length of the string */
     if (IS_ARRAY(type) && IS_CHAR(etype) && !ilist->next) {
-       ast *iast = ilist->init.node;
-       value *v = (iast->type == EX_VALUE ? iast->opval.val : NULL);
-       if (!v) {
-           werror(E_INIT_WRONG);
-           return 0;
-       }
-       if (!IS_ARRAY(v->type) || !IS_CHAR(v->etype)) {
-            werror(E_INIT_WRONG);
-            return 0;
-       }
-       return DCL_ELEM(v->type);
+  ast *iast = ilist->init.node;
+  value *v = (iast->type == EX_VALUE ? iast->opval.val : NULL);
+  if (!v) {
+      werror(E_INIT_WRONG);
+      return 0;
+  }
+  if (!IS_ARRAY(v->type) || !IS_CHAR(v->etype)) {
+       werror(E_INIT_WRONG);
+       return 0;
+  }
+  return DCL_ELEM(v->type);
     }
 
     i = 0 ;
     while (ilist) {
-       i++;
-       ilist = ilist->next;
+  i++;
+  ilist = ilist->next;
     }
 
     return i;
@@ -1169,55 +1169,55 @@ value *valForArray (ast *arrExpr)
     /* if the right or left is an array
        resolve it first */
     if (IS_AST_OP(arrExpr->left)) {
-       if (arrExpr->left->opval.op == '[')
-           lval = valForArray(arrExpr->left);
-       else
-           if (arrExpr->left->opval.op == '.')
-               lval = valForStructElem(arrExpr->left->left,
-                                       arrExpr->left->right);
-           else
-               if (arrExpr->left->opval.op == PTR_OP &&
-                   IS_ADDRESS_OF_OP(arrExpr->left->left))
-                   lval = valForStructElem(arrExpr->left->left->left,
-                                           arrExpr->left->right);
-               else
-                   return NULL;
-                   
+  if (arrExpr->left->opval.op == '[')
+      lval = valForArray(arrExpr->left);
+  else
+      if (arrExpr->left->opval.op == '.')
+    lval = valForStructElem(arrExpr->left->left,
+          arrExpr->left->right);
+      else
+    if (arrExpr->left->opval.op == PTR_OP &&
+        IS_ADDRESS_OF_OP(arrExpr->left->left))
+        lval = valForStructElem(arrExpr->left->left->left,
+              arrExpr->left->right);
+    else
+        return NULL;
+
     } else
-       if (!IS_AST_SYM_VALUE(arrExpr->left))
-           return NULL ;
-    
+  if (!IS_AST_SYM_VALUE(arrExpr->left))
+      return NULL ;
+
     if (!IS_AST_LIT_VALUE(arrExpr->right))
-       return NULL;
-    
+  return NULL;
+
     val = newValue();
     if (!lval)
-       sprintf(buffer,"%s",AST_SYMBOL(arrExpr->left)->rname);
+  sprintf(buffer,"%s",AST_SYMBOL(arrExpr->left)->rname);
     else
-       sprintf(buffer,"%s",lval->name);
-      
+  sprintf(buffer,"%s",lval->name);
+
     sprintf(val->name,"(%s + %d)",buffer,
-           (int)AST_LIT_VALUE(arrExpr->right)*size);    
-    
-    val->type = newLink();    
+      (int)AST_LIT_VALUE(arrExpr->right)*size);
+
+    val->type = newLink();
     if (SPEC_SCLS(arrExpr->left->etype) == S_CODE) {
-       DCL_TYPE(val->type) = CPOINTER ;
-       DCL_PTR_CONST(val->type) = port->mem.code_ro;
+  DCL_TYPE(val->type) = CPOINTER ;
+  DCL_PTR_CONST(val->type) = port->mem.code_ro;
     }
     else
-       if (SPEC_SCLS(arrExpr->left->etype) == S_XDATA)
-           DCL_TYPE(val->type) = FPOINTER;
-       else
-           if (SPEC_SCLS(arrExpr->left->etype) == S_XSTACK )
-               DCL_TYPE(val->type) = PPOINTER ;
-           else
-               if (SPEC_SCLS(arrExpr->left->etype) == S_IDATA)
-                   DCL_TYPE(val->type) = IPOINTER ;
-               else
-                   if (SPEC_SCLS(arrExpr->left->etype) == S_EEPROM)
-                       DCL_TYPE(val->type) = EEPPOINTER ;
-                   else
-                       DCL_TYPE(val->type) = POINTER ;
+  if (SPEC_SCLS(arrExpr->left->etype) == S_XDATA)
+      DCL_TYPE(val->type) = FPOINTER;
+  else
+      if (SPEC_SCLS(arrExpr->left->etype) == S_XSTACK )
+    DCL_TYPE(val->type) = PPOINTER ;
+      else
+    if (SPEC_SCLS(arrExpr->left->etype) == S_IDATA)
+        DCL_TYPE(val->type) = IPOINTER ;
+    else
+        if (SPEC_SCLS(arrExpr->left->etype) == S_EEPROM)
+      DCL_TYPE(val->type) = EEPPOINTER ;
+        else
+      DCL_TYPE(val->type) = POINTER ;
     val->type->next = arrExpr->left->ftype;
     val->etype = getSpec(val->type);
     return val;
@@ -1234,62 +1234,62 @@ value *valForStructElem(ast *structT, ast *elemT)
 
     /* left could be furthur derefed */
     if (IS_AST_OP(structT)) {
-       if (structT->opval.op == '[')
-           lval = valForArray(structT);
-       else
-           if (structT->opval.op == '.')
-               lval = valForStructElem(structT->left,structT->right);
-           else
-               if (structT->opval.op == PTR_OP &&
-                   IS_ADDRESS_OF_OP(structT->left))
-                   lval = valForStructElem(structT->left->left,
-                                           structT->right);
-               else
-                   return NULL;
+  if (structT->opval.op == '[')
+      lval = valForArray(structT);
+  else
+      if (structT->opval.op == '.')
+    lval = valForStructElem(structT->left,structT->right);
+      else
+    if (structT->opval.op == PTR_OP &&
+        IS_ADDRESS_OF_OP(structT->left))
+        lval = valForStructElem(structT->left->left,
+              structT->right);
+    else
+        return NULL;
     }
 
     if (!IS_AST_SYM_VALUE(elemT))
-       return NULL;
+  return NULL;
 
     if (!IS_STRUCT(structT->etype))
-       return NULL;
+  return NULL;
 
     if ((sym = getStructElement(SPEC_STRUCT(structT->etype),
-                               AST_SYMBOL(elemT))) == NULL) {
-       return NULL;
+        AST_SYMBOL(elemT))) == NULL) {
+  return NULL;
     }
 
     val = newValue();
     if (!lval)
-       sprintf(buffer,"%s",AST_SYMBOL(structT)->rname);
+  sprintf(buffer,"%s",AST_SYMBOL(structT)->rname);
     else
-       sprintf(buffer,"%s",lval->name);
-      
+  sprintf(buffer,"%s",lval->name);
+
     sprintf(val->name,"(%s + %d)",buffer,
-           (int)sym->offset);   
-    
+      (int)sym->offset);
+
     val->type = newLink();
     if (SPEC_SCLS(structT->etype) == S_CODE) {
-       DCL_TYPE(val->type) = CPOINTER ;
-       DCL_PTR_CONST(val->type) = port->mem.code_ro;
+  DCL_TYPE(val->type) = CPOINTER ;
+  DCL_PTR_CONST(val->type) = port->mem.code_ro;
     }
     else
-       if (SPEC_SCLS(structT->etype) == S_XDATA)
-           DCL_TYPE(val->type) = FPOINTER;
-       else
-           if (SPEC_SCLS(structT->etype) == S_XSTACK )
-               DCL_TYPE(val->type) = PPOINTER ;
-           else
-               if (SPEC_SCLS(structT->etype) == S_IDATA)
-                   DCL_TYPE(val->type) = IPOINTER ;
-               else
-                   if (SPEC_SCLS(structT->etype) == S_EEPROM)
-                       DCL_TYPE(val->type) = EEPPOINTER ;
-                   else
-                       DCL_TYPE(val->type) = POINTER ;
+  if (SPEC_SCLS(structT->etype) == S_XDATA)
+      DCL_TYPE(val->type) = FPOINTER;
+  else
+      if (SPEC_SCLS(structT->etype) == S_XSTACK )
+    DCL_TYPE(val->type) = PPOINTER ;
+      else
+    if (SPEC_SCLS(structT->etype) == S_IDATA)
+        DCL_TYPE(val->type) = IPOINTER ;
+    else
+        if (SPEC_SCLS(structT->etype) == S_EEPROM)
+      DCL_TYPE(val->type) = EEPPOINTER ;
+        else
+      DCL_TYPE(val->type) = POINTER ;
     val->type->next = sym->type;
     val->etype = getSpec(val->type);
-    return val; 
+    return val;
 }
 
 /*-----------------------------------------------------------------*/
@@ -1306,8 +1306,8 @@ value *valForCastAggr (ast *aexpr, sym_link *type, ast *cnst, int op)
     val = newValue();
 
     sprintf(val->name,"(%s %c %d)",
-          AST_SYMBOL(aexpr)->rname, op,
-          getSize(type->next)*(int)AST_LIT_VALUE(cnst));
+     AST_SYMBOL(aexpr)->rname, op,
+     getSize(type->next)*(int)AST_LIT_VALUE(cnst));
 
     val->type = type;
     val->etype = getSpec(val->type);
index 1a8ffb63bb134dfce79c2ee52d5503ac65796299..89bb52a8ff53fccb15506090138b0956798e8904 100644 (file)
@@ -1,26 +1,26 @@
 /*-------------------------------------------------------------------------
   avrgen.c - source file for code generation for ATMEL AVR
-  
+
   Written By -  Sandeep Dutta . sandeep.dutta@usa.net (2000)
-  
+
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
-  
+
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  
+
   In other words, you are welcome to use, share and improve this program.
   You are forbidden to forbid anyone else to use, share and improve
   what you give them.   Help stamp out software-hoarding!
-  
+
 
 -------------------------------------------------------------------------*/
 
@@ -52,7 +52,7 @@
 char *aopLiteral (value *val, int offset);
 extern int allocInfo;
 
-/* this is the down and dirty file with all kinds of 
+/* this is the down and dirty file with all kinds of
    kludgy & hacky stuff. This is what it is all about
    CODE GENERATION for a specific MCU . some of the
    routines may be reusable, will have to see */
@@ -68,13 +68,13 @@ static short rbank = -1;
 static char *larray[4] = {"lo8","hi8","hlo8","hhi8"};
 static char *tscr[4] = {"r0","r1","r24","r25"};
 static struct {
-       short xPushed;
-       short zPushed;
-       short accInUse;
-       short inLine;
-       short debugLine;
-       short nRegsSaved;
-       set *sendSet;
+  short xPushed;
+  short zPushed;
+  short accInUse;
+  short inLine;
+  short debugLine;
+  short nRegsSaved;
+  set *sendSet;
 } _G;
 
 extern int avr_ptrRegReq ;
@@ -95,9 +95,9 @@ static lineNode *lineHead = NULL;
 static lineNode *lineCurr = NULL;
 
 static unsigned char   SLMask[] = {0xFF ,0xFE, 0xFC, 0xF8, 0xF0,
-                                  0xE0, 0xC0, 0x80, 0x00};
+           0xE0, 0xC0, 0x80, 0x00};
 static unsigned char   SRMask[] = {0xFF, 0x7F, 0x3F, 0x1F, 0x0F,
-                                  0x07, 0x03, 0x01, 0x00};
+           0x07, 0x03, 0x01, 0x00};
 
 #define LSB     0
 #define MSB16   1
@@ -109,30 +109,30 @@ static unsigned char   SRMask[] = {0xFF, 0x7F, 0x3F, 0x1F, 0x0F,
 /*-----------------------------------------------------------------*/
 static void emitcode (char *inst,char *fmt, ...)
 {
-       va_list ap;
-       char lb[MAX_INLINEASM];  
-       char *lbp = lb;
-
-       va_start(ap,fmt);   
-
-       if (inst && *inst) {
-               if (fmt && *fmt)
-                       sprintf(lb,"%s\t",inst);
-               else
-                       sprintf(lb,"%s",inst);
-               vsprintf(lb+(strlen(lb)),fmt,ap);
-       }  else
-               vsprintf(lb,fmt,ap);
-
-       while (isspace(*lbp)) lbp++;
-
-       if (lbp && *lbp) 
-               lineCurr = (lineCurr ?
-                           connectLine(lineCurr,newLineNode(lb)) :
-                           (lineHead = newLineNode(lb)));
-       lineCurr->isInline = _G.inLine;
-       lineCurr->isDebug  = _G.debugLine;
-       va_end(ap);
+  va_list ap;
+  char lb[MAX_INLINEASM];
+  char *lbp = lb;
+
+  va_start(ap,fmt);
+
+  if (inst && *inst) {
+    if (fmt && *fmt)
+      sprintf(lb,"%s\t",inst);
+    else
+      sprintf(lb,"%s",inst);
+    vsprintf(lb+(strlen(lb)),fmt,ap);
+  }  else
+    vsprintf(lb,fmt,ap);
+
+  while (isspace(*lbp)) lbp++;
+
+  if (lbp && *lbp)
+    lineCurr = (lineCurr ?
+          connectLine(lineCurr,newLineNode(lb)) :
+          (lineHead = newLineNode(lb)));
+  lineCurr->isInline = _G.inLine;
+  lineCurr->isDebug  = _G.debugLine;
+  va_end(ap);
 }
 
 /*-----------------------------------------------------------------*/
@@ -140,92 +140,92 @@ static void emitcode (char *inst,char *fmt, ...)
 /*-----------------------------------------------------------------*/
 static regs *getFreePtr (iCode *ic, asmop **aopp, bool result, bool zonly)
 {
-       bool xiu = FALSE , ziu = FALSE;
-       bool xou = FALSE , zou = FALSE;
-
-       /* the logic: if x & z used in the instruction
-          then we are in trouble otherwise */
-
-       /* first check if x & z are used by this
-          instruction, in which case we are in trouble */
-       if ((xiu = bitVectBitValue(ic->rUsed,X_IDX)) &&
-           (ziu = bitVectBitValue(ic->rUsed,Z_IDX))) 
-               {
-                       goto endOfWorld;      
-               }
-
-       xou = bitVectBitValue(ic->rMask,X_IDX);
-       zou = bitVectBitValue(ic->rMask,Z_IDX);
-
-       /* if no usage of Z then return it */
-       if (!ziu && !zou) {
-               ic->rUsed = bitVectSetBit(ic->rUsed,Z_IDX);
-               (*aopp)->type = AOP_Z;
-
-               (*aopp)->aop_ptr2 = avr_regWithIdx(R31_IDX);
-               return (*aopp)->aopu.aop_ptr = avr_regWithIdx(R30_IDX);
-       }    
-
-       /* if no usage of X then return it */
-       if (!xiu && !xou && !zonly) {
-               ic->rUsed = bitVectSetBit(ic->rUsed,X_IDX);
-               (*aopp)->type = AOP_X;
-        
-               (*aopp)->aop_ptr2 = avr_regWithIdx(R27_IDX);
-               return (*aopp)->aopu.aop_ptr = avr_regWithIdx(R26_IDX);
-       }
-
-       /* if z not used then */
-
-       if (!ziu) {
-               /* push it if not already pushed */
-               if (!_G.zPushed) {
-                       emitcode ("push","%s",
-                                 avr_regWithIdx(R30_IDX)->dname);
-                       emitcode ("push","%s",
-                                 avr_regWithIdx(R31_IDX)->dname);
-                       _G.zPushed++ ;
-               }
-        
-               ic->rUsed = bitVectSetBit(ic->rUsed,Z_IDX);
-               (*aopp)->type = AOP_Z;
-               (*aopp)->aop_ptr2 = avr_regWithIdx(R31_IDX);
-               return (*aopp)->aopu.aop_ptr = avr_regWithIdx(R30_IDX);
-       }
-
-       /* now we know they both have usage */
-       /* if x not used in this instruction */
-       if (!xiu && !zonly) {
-               /* push it if not already pushed */
-               if (!_G.xPushed) {
-                       emitcode ("push","%s",
-                                 avr_regWithIdx(R26_IDX)->dname);
-                       emitcode ("push","%s",
-                                 avr_regWithIdx(R27_IDX)->dname);
-                       _G.xPushed++ ;
-               }
-        
-               ic->rUsed = bitVectSetBit(ic->rUsed,X_IDX);
-               (*aopp)->type = AOP_X;
-
-               (*aopp)->aop_ptr2 = avr_regWithIdx(R27_IDX);
-               return (*aopp)->aopu.aop_ptr = avr_regWithIdx(R26_IDX);
-       }
-
-
-       endOfWorld :
-               /* I said end of world but not quite end of world yet */
-               /* if this is a result then we can push it on the stack*/
-               if (result) {
-                       (*aopp)->type = AOP_STK;    
-                       return NULL;
-               }
-
-       piCode(ic,stdout);
-       /* other wise this is true end of the world */
-       werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-              "getFreePtr should never reach here");
-       exit(0);
+  bool xiu = FALSE , ziu = FALSE;
+  bool xou = FALSE , zou = FALSE;
+
+  /* the logic: if x & z used in the instruction
+     then we are in trouble otherwise */
+
+  /* first check if x & z are used by this
+     instruction, in which case we are in trouble */
+  if ((xiu = bitVectBitValue(ic->rUsed,X_IDX)) &&
+      (ziu = bitVectBitValue(ic->rUsed,Z_IDX)))
+    {
+      goto endOfWorld;
+    }
+
+  xou = bitVectBitValue(ic->rMask,X_IDX);
+  zou = bitVectBitValue(ic->rMask,Z_IDX);
+
+  /* if no usage of Z then return it */
+  if (!ziu && !zou) {
+    ic->rUsed = bitVectSetBit(ic->rUsed,Z_IDX);
+    (*aopp)->type = AOP_Z;
+
+    (*aopp)->aop_ptr2 = avr_regWithIdx(R31_IDX);
+    return (*aopp)->aopu.aop_ptr = avr_regWithIdx(R30_IDX);
+  }
+
+  /* if no usage of X then return it */
+  if (!xiu && !xou && !zonly) {
+    ic->rUsed = bitVectSetBit(ic->rUsed,X_IDX);
+    (*aopp)->type = AOP_X;
+
+    (*aopp)->aop_ptr2 = avr_regWithIdx(R27_IDX);
+    return (*aopp)->aopu.aop_ptr = avr_regWithIdx(R26_IDX);
+  }
+
+  /* if z not used then */
+
+  if (!ziu) {
+    /* push it if not already pushed */
+    if (!_G.zPushed) {
+      emitcode ("push","%s",
+          avr_regWithIdx(R30_IDX)->dname);
+      emitcode ("push","%s",
+          avr_regWithIdx(R31_IDX)->dname);
+      _G.zPushed++ ;
+    }
+
+    ic->rUsed = bitVectSetBit(ic->rUsed,Z_IDX);
+    (*aopp)->type = AOP_Z;
+    (*aopp)->aop_ptr2 = avr_regWithIdx(R31_IDX);
+    return (*aopp)->aopu.aop_ptr = avr_regWithIdx(R30_IDX);
+  }
+
+  /* now we know they both have usage */
+  /* if x not used in this instruction */
+  if (!xiu && !zonly) {
+    /* push it if not already pushed */
+    if (!_G.xPushed) {
+      emitcode ("push","%s",
+          avr_regWithIdx(R26_IDX)->dname);
+      emitcode ("push","%s",
+          avr_regWithIdx(R27_IDX)->dname);
+      _G.xPushed++ ;
+    }
+
+    ic->rUsed = bitVectSetBit(ic->rUsed,X_IDX);
+    (*aopp)->type = AOP_X;
+
+    (*aopp)->aop_ptr2 = avr_regWithIdx(R27_IDX);
+    return (*aopp)->aopu.aop_ptr = avr_regWithIdx(R26_IDX);
+  }
+
+
+  endOfWorld :
+    /* I said end of world but not quite end of world yet */
+    /* if this is a result then we can push it on the stack*/
+    if (result) {
+      (*aopp)->type = AOP_STK;
+      return NULL;
+    }
+
+  piCode(ic,stdout);
+  /* other wise this is true end of the world */
+  werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+         "getFreePtr should never reach here");
+  exit(0);
 }
 
 /*-----------------------------------------------------------------*/
@@ -233,11 +233,11 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result, bool zonly)
 /*-----------------------------------------------------------------*/
 static asmop *newAsmop (short type)
 {
-       asmop *aop;
+  asmop *aop;
 
-       aop = Safe_calloc(sizeof(asmop));
-       aop->type = type;
-       return aop;
+  aop = Safe_calloc(1,sizeof(asmop));
+  aop->type = type;
+  return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -246,7 +246,7 @@ static asmop *newAsmop (short type)
 static int pointerCode (sym_link *etype)
 {
 
-       return PTR_TYPE(SPEC_OCLS(etype));
+  return PTR_TYPE(SPEC_OCLS(etype));
 
 }
 
@@ -255,94 +255,94 @@ static int pointerCode (sym_link *etype)
 /*-----------------------------------------------------------------*/
 static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
 {
-       asmop *aop;
-       memmap *space= SPEC_OCLS(sym->etype);
-
-       /* if already has one */
-       if (sym->aop)
-               return sym->aop;
-
-       /* assign depending on the storage class */
-       /* if it is on the stack */
-       if (sym->onStack) {
-               sym->aop = aop = newAsmop(0);
-               aop->size = getSize(sym->type);
-
-               /* we can use std / ldd instruction */
-               if (sym->stack > 0 && (sym->stack + getSize(sym->type) - 1) <= 63) {
-                       aop->type = AOP_STK_D;
-                       aop->aopu.aop_stk = sym->stack;
-                       return aop;
-               }
-
-               /* otherwise get a free pointer register X/Z */
-               aop->aopu.aop_ptr = getFreePtr(ic,&aop,result,FALSE);
-
-               /* now assign the address of the variable to 
-                  the pointer register */
-               if (aop->type != AOP_STK) {
-                       emitcode("movw","%s,r28",aop->aopu.aop_ptr->name);
-                       if (sym->stack < 0) {
-                               if ((sym->stack - _G.nRegsSaved) > -63) {
-                                       emitcode("sbiw","%s,0x%02x",
-                                                aop->aopu.aop_ptr->name,
-                                                (sym->stack - _G.nRegsSaved));
-                               } else {
-                                       emitcode("subi","%s,lo8(%d)", aop->aopu.aop_ptr->name,
-                                                sym->stack - _G.nRegsSaved);
-                                       emitcode("sbci","%s,hi8(%d)",aop->aop_ptr2->name,
-                                                sym->stack - _G.nRegsSaved);
-                               }
-                       } else {
-                               if (sym->stack <= 63) {
-                                       emitcode("adiw","%s,0x%02x",aop->aopu.aop_ptr->name,sym->stack);
-                               } else {
-                                       emitcode("subi","%s,lo8(-%d)",aop->aopu.aop_ptr->name,sym->stack);
-                                       emitcode("sbci","%s,hi8(-%d)",aop->aop_ptr2->name,sym->stack); 
-                               }
-                       }
-               }
-               return aop;
-       }
-    
-       /* if in bit space */
-       if (IN_BITSPACE(space)) {
-               sym->aop = aop = newAsmop (AOP_CRY);
-               aop->aopu.aop_dir = sym->rname ;
-               aop->size = getSize(sym->type);
-               return aop;
-       }
-       /* if it is in direct space */
-       if (IN_DIRSPACE(space)) {
-               sym->aop = aop = newAsmop (AOP_DIR);
-               aop->aopu.aop_dir = sym->rname ;
-               aop->size = getSize(sym->type);
-               return aop;
-       }
-
-       /* special case for a function */
-       if (IS_FUNC(sym->type)) {   
-               sym->aop = aop = newAsmop(AOP_IMMD);    
-               aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
-               strcpy(aop->aopu.aop_immd,sym->rname);
-               aop->size = FPTRSIZE; 
-               return aop;
-       }
-
-       /* only remaining is code / eeprom which will need pointer reg */
-       /* if it is in code space */
-
-       sym->aop = aop = newAsmop(0);
-
-       if (IN_CODESPACE(space))
-               aop->code = 1;
-
-       aop->aopu.aop_ptr = getFreePtr(ic,&aop,result,aop->code);
-       aop->size = getSize(sym->type);
-       emitcode ("ldi","%s,lo8(%s)",aop->aopu.aop_ptr->name,sym->rname);
-       emitcode ("ldi","%s,hi8(%s)",aop->aop_ptr2);
-
-       return aop;     
+  asmop *aop;
+  memmap *space= SPEC_OCLS(sym->etype);
+
+  /* if already has one */
+  if (sym->aop)
+    return sym->aop;
+
+  /* assign depending on the storage class */
+  /* if it is on the stack */
+  if (sym->onStack) {
+    sym->aop = aop = newAsmop(0);
+    aop->size = getSize(sym->type);
+
+    /* we can use std / ldd instruction */
+    if (sym->stack > 0 && (sym->stack + getSize(sym->type) - 1) <= 63) {
+      aop->type = AOP_STK_D;
+      aop->aopu.aop_stk = sym->stack;
+      return aop;
+    }
+
+    /* otherwise get a free pointer register X/Z */
+    aop->aopu.aop_ptr = getFreePtr(ic,&aop,result,FALSE);
+
+    /* now assign the address of the variable to
+       the pointer register */
+    if (aop->type != AOP_STK) {
+      emitcode("movw","%s,r28",aop->aopu.aop_ptr->name);
+      if (sym->stack < 0) {
+        if ((sym->stack - _G.nRegsSaved) > -63) {
+          emitcode("sbiw","%s,0x%02x",
+             aop->aopu.aop_ptr->name,
+             (sym->stack - _G.nRegsSaved));
+        } else {
+          emitcode("subi","%s,lo8(%d)", aop->aopu.aop_ptr->name,
+             sym->stack - _G.nRegsSaved);
+          emitcode("sbci","%s,hi8(%d)",aop->aop_ptr2->name,
+             sym->stack - _G.nRegsSaved);
+        }
+      } else {
+        if (sym->stack <= 63) {
+          emitcode("adiw","%s,0x%02x",aop->aopu.aop_ptr->name,sym->stack);
+        } else {
+          emitcode("subi","%s,lo8(-%d)",aop->aopu.aop_ptr->name,sym->stack);
+          emitcode("sbci","%s,hi8(-%d)",aop->aop_ptr2->name,sym->stack);
+        }
+      }
+    }
+    return aop;
+  }
+
+  /* if in bit space */
+  if (IN_BITSPACE(space)) {
+    sym->aop = aop = newAsmop (AOP_CRY);
+    aop->aopu.aop_dir = sym->rname ;
+    aop->size = getSize(sym->type);
+    return aop;
+  }
+  /* if it is in direct space */
+  if (IN_DIRSPACE(space)) {
+    sym->aop = aop = newAsmop (AOP_DIR);
+    aop->aopu.aop_dir = sym->rname ;
+    aop->size = getSize(sym->type);
+    return aop;
+  }
+
+  /* special case for a function */
+  if (IS_FUNC(sym->type)) {
+    sym->aop = aop = newAsmop(AOP_IMMD);
+    aop->aopu.aop_immd = Safe_calloc(1,strlen(sym->rname)+1);
+    strcpy(aop->aopu.aop_immd,sym->rname);
+    aop->size = FPTRSIZE;
+    return aop;
+  }
+
+  /* only remaining is code / eeprom which will need pointer reg */
+  /* if it is in code space */
+
+  sym->aop = aop = newAsmop(0);
+
+  if (IN_CODESPACE(space))
+    aop->code = 1;
+
+  aop->aopu.aop_ptr = getFreePtr(ic,&aop,result,aop->code);
+  aop->size = getSize(sym->type);
+  emitcode ("ldi","%s,lo8(%s)",aop->aopu.aop_ptr->name,sym->rname);
+  emitcode ("ldi","%s,hi8(%s)",aop->aop_ptr2);
+
+  return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -350,32 +350,32 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
 /*-----------------------------------------------------------------*/
 static asmop *aopForRemat (symbol *sym)
 {
-       iCode *ic = sym->rematiCode;
-       asmop *aop = newAsmop(AOP_IMMD);
-       int val = 0;
-
-       for (;;) {
-               if (ic->op == '+')
-                       val += operandLitValue(IC_RIGHT(ic));
-               else if (ic->op == '-')
-                       val -= operandLitValue(IC_RIGHT(ic));
-               else
-                       break;
-       
-               ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode;
-       }
-
-       if (val)
-               sprintf(buffer,"(%s %c 0x%04x)",
-                       OP_SYMBOL(IC_LEFT(ic))->rname, 
-                       val >= 0 ? '+' : '-',
-                       abs(val) & 0xffff);
-       else
-               strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
-
-       aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
-       strcpy(aop->aopu.aop_immd,buffer);    
-       return aop;        
+  iCode *ic = sym->rematiCode;
+  asmop *aop = newAsmop(AOP_IMMD);
+  int val = 0;
+
+  for (;;) {
+    if (ic->op == '+')
+      val += (int) operandLitValue(IC_RIGHT(ic));
+    else if (ic->op == '-')
+      val -= (int) operandLitValue(IC_RIGHT(ic));
+    else
+      break;
+
+    ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode;
+  }
+
+  if (val)
+    sprintf(buffer,"(%s %c 0x%04x)",
+      OP_SYMBOL(IC_LEFT(ic))->rname,
+      val >= 0 ? '+' : '-',
+      abs(val) & 0xffff);
+  else
+    strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
+
+  aop->aopu.aop_immd = Safe_calloc(1,strlen(buffer)+1);
+  strcpy(aop->aopu.aop_immd,buffer);
+  return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -383,34 +383,34 @@ static asmop *aopForRemat (symbol *sym)
 /*-----------------------------------------------------------------*/
 static bool regsInCommon (operand *op1, operand *op2)
 {
-       symbol *sym1, *sym2;
-       int i;
+  symbol *sym1, *sym2;
+  int i;
 
-       /* if they have registers in common */
-       if (!IS_SYMOP(op1) || !IS_SYMOP(op2))
-               return FALSE ;
+  /* if they have registers in common */
+  if (!IS_SYMOP(op1) || !IS_SYMOP(op2))
+    return FALSE ;
 
-       sym1 = OP_SYMBOL(op1);
-       sym2 = OP_SYMBOL(op2);
+  sym1 = OP_SYMBOL(op1);
+  sym2 = OP_SYMBOL(op2);
 
-       if (sym1->nRegs == 0 || sym2->nRegs == 0)
-               return FALSE ;
+  if (sym1->nRegs == 0 || sym2->nRegs == 0)
+    return FALSE ;
 
-       for (i = 0 ; i < sym1->nRegs ; i++) {
-               int j;
-               if (!sym1->regs[i])
-                       continue ;
+  for (i = 0 ; i < sym1->nRegs ; i++) {
+    int j;
+    if (!sym1->regs[i])
+      continue ;
 
-               for (j = 0 ; j < sym2->nRegs ;j++ ) {
-                       if (!sym2->regs[j])
-                               continue ;
+    for (j = 0 ; j < sym2->nRegs ;j++ ) {
+      if (!sym2->regs[j])
+        continue ;
 
-                       if (sym2->regs[j] == sym1->regs[i])
-                               return TRUE ;
-               }
-       }
+      if (sym2->regs[j] == sym1->regs[i])
+        return TRUE ;
+    }
+  }
 
-       return FALSE ;
+  return FALSE ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -418,44 +418,44 @@ static bool regsInCommon (operand *op1, operand *op2)
 /*-----------------------------------------------------------------*/
 static bool operandsEqu ( operand *op1, operand *op2)
 {
-       symbol *sym1, *sym2;
+  symbol *sym1, *sym2;
 
-       /* if they not symbols */
-       if (!IS_SYMOP(op1) || !IS_SYMOP(op2))
-               return FALSE;
+  /* if they not symbols */
+  if (!IS_SYMOP(op1) || !IS_SYMOP(op2))
+    return FALSE;
 
-       sym1 = OP_SYMBOL(op1);
-       sym2 = OP_SYMBOL(op2);
+  sym1 = OP_SYMBOL(op1);
+  sym2 = OP_SYMBOL(op2);
 
-       /* if both are itemps & one is spilt
-          and the other is not then false */
-       if (IS_ITEMP(op1) && IS_ITEMP(op2) &&
-           sym1->isspilt != sym2->isspilt )
-               return FALSE ;
+  /* if both are itemps & one is spilt
+     and the other is not then false */
+  if (IS_ITEMP(op1) && IS_ITEMP(op2) &&
+      sym1->isspilt != sym2->isspilt )
+    return FALSE ;
 
-       /* if they are the same */
-       if (sym1 == sym2)
-               return TRUE ;
+  /* if they are the same */
+  if (sym1 == sym2)
+    return TRUE ;
 
-       if (strcmp(sym1->rname,sym2->rname) == 0)
-               return TRUE;
+  if (strcmp(sym1->rname,sym2->rname) == 0)
+    return TRUE;
 
 
-       /* if left is a tmp & right is not */
-       if (IS_ITEMP(op1)  && 
-           !IS_ITEMP(op2) &&
-           sym1->isspilt  &&
-           (sym1->usl.spillLoc == sym2))
-               return TRUE;
+  /* if left is a tmp & right is not */
+  if (IS_ITEMP(op1)  &&
+      !IS_ITEMP(op2) &&
+      sym1->isspilt  &&
+      (sym1->usl.spillLoc == sym2))
+    return TRUE;
 
-       if (IS_ITEMP(op2)  && 
-           !IS_ITEMP(op1) &&
-           sym2->isspilt  &&
-           sym1->level > 0 &&
-           (sym2->usl.spillLoc == sym1))
-               return TRUE ;
+  if (IS_ITEMP(op2)  &&
+      !IS_ITEMP(op1) &&
+      sym2->isspilt  &&
+      sym1->level > 0 &&
+      (sym2->usl.spillLoc == sym1))
+    return TRUE ;
 
-       return FALSE ;
+  return FALSE ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -463,24 +463,24 @@ static bool operandsEqu ( operand *op1, operand *op2)
 /*-----------------------------------------------------------------*/
 static bool sameRegs (asmop *aop1, asmop *aop2 )
 {
-       int i;
+  int i;
 
-       if (aop1 == aop2)
-               return TRUE ;
+  if (aop1 == aop2)
+    return TRUE ;
 
-       if (aop1->type != AOP_REG ||
-           aop2->type != AOP_REG )
-               return FALSE ;
+  if (aop1->type != AOP_REG ||
+      aop2->type != AOP_REG )
+    return FALSE ;
 
-       if (aop1->size != aop2->size )
-               return FALSE ;
+  if (aop1->size != aop2->size )
+    return FALSE ;
 
-       for (i = 0 ; i < aop1->size ; i++ )
-               if (aop1->aopu.aop_reg[i] !=
-                   aop2->aopu.aop_reg[i] )
-                       return FALSE ;
+  for (i = 0 ; i < aop1->size ; i++ )
+    if (aop1->aopu.aop_reg[i] !=
+        aop2->aopu.aop_reg[i] )
+      return FALSE ;
 
-       return TRUE ;
+  return TRUE ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -488,12 +488,12 @@ static bool sameRegs (asmop *aop1, asmop *aop2 )
 /*-----------------------------------------------------------------*/
 static int isRegPair (asmop *aop)
 {
-       if (!aop || aop->size != 2) return 0;
-       if (aop->type == AOP_X || aop->type == AOP_Z) return 1;
-       if (aop->type != AOP_REG) return 0;
-       if ((aop->aopu.aop_reg[1]->rIdx - 
-            aop->aopu.aop_reg[0]->rIdx) == 1) return 1;
-       return 0;
+  if (!aop || aop->size != 2) return 0;
+  if (aop->type == AOP_X || aop->type == AOP_Z) return 1;
+  if (aop->type != AOP_REG) return 0;
+  if ((aop->aopu.aop_reg[1]->rIdx -
+       aop->aopu.aop_reg[0]->rIdx) == 1) return 1;
+  return 0;
 }
 
 /*-----------------------------------------------------------------*/
@@ -501,191 +501,191 @@ static int isRegPair (asmop *aop)
 /*-----------------------------------------------------------------*/
 static void aopOp (operand *op, iCode *ic, bool result)
 {
-       asmop *aop;
-       symbol *sym;
-       int i;
-
-       if (!op)
-               return ;
-
-       /* if this a literal */
-       if (IS_OP_LITERAL(op)) {
-               op->aop = aop = newAsmop(AOP_LIT);
-               aop->aopu.aop_lit = op->operand.valOperand;
-               aop->size = getSize(operandType(op));
-               return;
-       }
-
-       /* if already has a asmop then continue */
-       if (op->aop)
-               return ;
-
-       /* if the underlying symbol has a aop */
-       if (IS_SYMOP(op) && OP_SYMBOL(op)->aop) {
-               op->aop = OP_SYMBOL(op)->aop;
-               return;
-       }
-
-       /* if this is a true symbol */
-       if (IS_TRUE_SYMOP(op)) {    
-               op->aop = aopForSym(ic,OP_SYMBOL(op),result);
-               return ;
-       }
-
-       /* this is a temporary : this has
-          only four choices :
-          a) register
-          b) spillocation
-          c) rematerialize 
-          d) conditional   
-          e) can be a return use only */
-
-       sym = OP_SYMBOL(op);
-
-
-       /* if the type is a conditional */
-       if (sym->regType == REG_CND) {
-               aop = op->aop = sym->aop = newAsmop(AOP_CRY);
-               aop->size = 0;
-               return;
-       }
-
-       /* if it is spilt then two situations
-          a) is rematerialize 
-          b) has a spill location */
-       if (sym->isspilt || sym->nRegs == 0) {
-
-               /* rematerialize it NOW */
-               if (sym->remat) {
-                       sym->aop = op->aop = aop =
-                               aopForRemat (sym);
-                       aop->size = getSize(sym->type);
-                       return;
-               }
-
-               if (sym->accuse) {
-                       assert("ACC_USE cannot happen in AVR\n");
-               }
-
-               if (sym->ruonly ) {
-                       int i;
-                       aop = op->aop = sym->aop = newAsmop(AOP_STR);
-                       aop->size = getSize(sym->type);
-                       for ( i = 0 ; i < fAVRReturnSize ; i++ )
-                               aop->aopu.aop_str[i] = fAVRReturn[i];
-                       return;
-               }
-
-               /* else spill location  */
-               sym->aop = op->aop = aop = 
-                       aopForSym(ic,sym->usl.spillLoc,result);
-               aop->size = getSize(sym->type);
-               return;
-       }
-
-       /* must be in a register */
-       sym->aop = op->aop = aop = newAsmop(AOP_REG);
-       aop->size = sym->nRegs;
-       for ( i = 0 ; i < sym->nRegs ;i++)
-               aop->aopu.aop_reg[i] = sym->regs[i];
+  asmop *aop;
+  symbol *sym;
+  int i;
+
+  if (!op)
+    return ;
+
+  /* if this a literal */
+  if (IS_OP_LITERAL(op)) {
+    op->aop = aop = newAsmop(AOP_LIT);
+    aop->aopu.aop_lit = op->operand.valOperand;
+    aop->size = getSize(operandType(op));
+    return;
+  }
+
+  /* if already has a asmop then continue */
+  if (op->aop)
+    return ;
+
+  /* if the underlying symbol has a aop */
+  if (IS_SYMOP(op) && OP_SYMBOL(op)->aop) {
+    op->aop = OP_SYMBOL(op)->aop;
+    return;
+  }
+
+  /* if this is a true symbol */
+  if (IS_TRUE_SYMOP(op)) {
+    op->aop = aopForSym(ic,OP_SYMBOL(op),result);
+    return ;
+  }
+
+  /* this is a temporary : this has
+     only four choices :
+     a) register
+     b) spillocation
+     c) rematerialize
+     d) conditional
+     e) can be a return use only */
+
+  sym = OP_SYMBOL(op);
+
+
+  /* if the type is a conditional */
+  if (sym->regType == REG_CND) {
+    aop = op->aop = sym->aop = newAsmop(AOP_CRY);
+    aop->size = 0;
+    return;
+  }
+
+  /* if it is spilt then two situations
+     a) is rematerialize
+     b) has a spill location */
+  if (sym->isspilt || sym->nRegs == 0) {
+
+    /* rematerialize it NOW */
+    if (sym->remat) {
+      sym->aop = op->aop = aop =
+        aopForRemat (sym);
+      aop->size = getSize(sym->type);
+      return;
+    }
+
+    if (sym->accuse) {
+      assert("ACC_USE cannot happen in AVR\n");
+    }
+
+    if (sym->ruonly ) {
+      int i;
+      aop = op->aop = sym->aop = newAsmop(AOP_STR);
+      aop->size = getSize(sym->type);
+      for ( i = 0 ; i < (int) fAVRReturnSize ; i++ )
+        aop->aopu.aop_str[i] = fAVRReturn[i];
+      return;
+    }
+
+    /* else spill location  */
+    sym->aop = op->aop = aop =
+      aopForSym(ic,sym->usl.spillLoc,result);
+    aop->size = getSize(sym->type);
+    return;
+  }
+
+  /* must be in a register */
+  sym->aop = op->aop = aop = newAsmop(AOP_REG);
+  aop->size = sym->nRegs;
+  for ( i = 0 ; i < sym->nRegs ;i++)
+    aop->aopu.aop_reg[i] = sym->regs[i];
 }
 
 /*-----------------------------------------------------------------*/
 /* freeAsmop - free up the asmop given to an operand               */
 /*----------------------------------------------------------------*/
 static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
-{   
-       asmop *aop ;
+{
+  asmop *aop ;
 
-       if (!op)
-               aop = aaop;
-       else 
-               aop = op->aop;
+  if (!op)
+    aop = aaop;
+  else
+    aop = op->aop;
 
-       if (!aop)
-               return ;
+  if (!aop)
+    return ;
 
-       if (aop->freed)
-               goto dealloc; 
+  if (aop->freed)
+    goto dealloc;
 
-       aop->freed = 1;
+  aop->freed = 1;
 
-       /* depending on the asmop type only three cases need work AOP_RO
-          , AOP_R1 && AOP_STK */
-       switch (aop->type) {
+  /* depending on the asmop type only three cases need work AOP_RO
+     , AOP_R1 && AOP_STK */
+  switch (aop->type) {
         case AOP_X :
-               if (_G.xPushed ) {
-                       if (pop) {
-                               emitcode ("pop","r26");
-                               emitcode ("pop","r27");
-                               _G.xPushed--;
-                       }
-               }
-               bitVectUnSetBit(ic->rUsed,X_IDX);
-               break;
+    if (_G.xPushed ) {
+      if (pop) {
+        emitcode ("pop","r26");
+        emitcode ("pop","r27");
+        _G.xPushed--;
+      }
+    }
+    bitVectUnSetBit(ic->rUsed,X_IDX);
+    break;
 
         case AOP_Z :
-               if (_G.zPushed ) {
-                       if (pop) {
-                               emitcode ("pop","r30");
-                               emitcode ("pop","r31");
-                               _G.zPushed--;
-                       }
-               }
-               bitVectUnSetBit(ic->rUsed,Z_IDX);          
-               break;
+    if (_G.zPushed ) {
+      if (pop) {
+        emitcode ("pop","r30");
+        emitcode ("pop","r31");
+        _G.zPushed--;
+      }
+    }
+    bitVectUnSetBit(ic->rUsed,Z_IDX);
+    break;
 
         case AOP_STK :
-               {
-                       int sz = aop->size;    
-                       int stk = aop->aopu.aop_stk + aop->size;
-                       bitVectUnSetBit(ic->rUsed,X_IDX);
-                       bitVectUnSetBit(ic->rUsed,Z_IDX);          
-
-                       getFreePtr(ic,&aop,FALSE,0);
-            
-                       emitcode ("movw","%s,r28");
-                       if (stk) {
-                               if (stk <= 63 && stk > 0) {
-                                       emitcode ("adiw","%s,0x%02x",aop->aopu.aop_ptr->name,stk+1);
-                               } else {
-                                       emitcode ("subi","%s,lo8(%d)",aop->aopu.aop_ptr->name,-(stk+1));
-                                       emitcode ("sbci","%s,hi8(%d)",aop->aop_ptr2->name,-(stk+1));
-                               }
-                       }
-
-                       while (sz--) {
-                               emitcode("pop","r24");
-                               emitcode("st","-%s,r24",aop->type == AOP_X ? "X" : "Z");
-                               if (!sz) break;
-                       }
-                       op->aop = aop;
-                       freeAsmop(op,NULL,ic,TRUE);
-                       if (_G.xPushed) {
-                               emitcode("pop","r26");
-                               emitcode("pop","r27");
-                               _G.xPushed--;
-                       }
-
-                       if (_G.zPushed) {
-                               emitcode("pop","r30");
-                               emitcode("pop","r31");
-                               _G.zPushed--;
-                       }       
-               }
-       }
+    {
+      int sz = aop->size;
+      int stk = aop->aopu.aop_stk + aop->size;
+      bitVectUnSetBit(ic->rUsed,X_IDX);
+      bitVectUnSetBit(ic->rUsed,Z_IDX);
+
+      getFreePtr(ic,&aop,FALSE,0);
+
+      emitcode ("movw","%s,r28");
+      if (stk) {
+        if (stk <= 63 && stk > 0) {
+          emitcode ("adiw","%s,0x%02x",aop->aopu.aop_ptr->name,stk+1);
+        } else {
+          emitcode ("subi","%s,lo8(%d)",aop->aopu.aop_ptr->name,-(stk+1));
+          emitcode ("sbci","%s,hi8(%d)",aop->aop_ptr2->name,-(stk+1));
+        }
+      }
+
+      while (sz--) {
+        emitcode("pop","r24");
+        emitcode("st","-%s,r24",aop->type == AOP_X ? "X" : "Z");
+        if (!sz) break;
+      }
+      op->aop = aop;
+      freeAsmop(op,NULL,ic,TRUE);
+      if (_G.xPushed) {
+        emitcode("pop","r26");
+        emitcode("pop","r27");
+        _G.xPushed--;
+      }
+
+      if (_G.zPushed) {
+        emitcode("pop","r30");
+        emitcode("pop","r31");
+        _G.zPushed--;
+      }
+    }
+  }
 
  dealloc:
-       /* all other cases just dealloc */
-       if (op ) {
-               op->aop = NULL;
-               if (IS_SYMOP(op)) {
-                       OP_SYMBOL(op)->aop = NULL;    
-                       /* if the symbol has a spill */
-                       if (SPIL_LOC(op))
-                               SPIL_LOC(op)->aop = NULL;
-               }
-       }
+  /* all other cases just dealloc */
+  if (op ) {
+    op->aop = NULL;
+    if (IS_SYMOP(op)) {
+      OP_SYMBOL(op)->aop = NULL;
+      /* if the symbol has a spill */
+      if (SPIL_LOC(op))
+        SPIL_LOC(op)->aop = NULL;
+    }
+  }
 }
 
 /*-----------------------------------------------------------------*/
@@ -693,199 +693,199 @@ static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
 /*-----------------------------------------------------------------*/
 static char *aopGet (asmop *aop, int offset)
 {
-       char *s = buffer ;
-       char *rs;
-
-       /* offset is greater than
-          size then zero */
-       if (offset > (aop->size - 1) &&
-           aop->type != AOP_LIT)
-               return zero;
-
-       /* depending on type */
-       switch (aop->type) {
-       
-       case AOP_X:
-               if (offset > aop->coff) {
-                       emitcode ("adiw","%s,%d",aop->aopu.aop_ptr->name,offset - aop->coff);  
-               }
-       
-               if (offset < aop->coff) {
-                       emitcode("sbiw","%s,%d",aop->aopu.aop_ptr->name,aop->coff - offset);
-               }
-       
-               aop->coff = offset ;
-               emitcode("ld","%s,x",
-                        (rs = ((offset & 1) ? "r25" : "r24")));
-               return rs;
-
-       case AOP_Z:
-               if (aop->code) {
-                       if (offset > aop->coff) {
-                               emitcode("adiw","r30,%d",offset - aop->coff);
-                       } else {
-                               emitcode("sbiw","r30,%d",aop->coff - offset);
-                       }
-                       emitcode("lpm","%s,z",(rs = ((offset & 1) ? "r25" : "r24")));
-               } else {
-                       /* we can use lds */
-                       if (offset  > aop->coff) {
-                               emitcode ("ldd","%s,z+%d",(rs = ((offset & 1) ? "r25" : "r24")),
-                                         offset - aop->coff);
-                       } else {
-                               emitcode("sbiw","%s,%d",aop->aopu.aop_ptr->name,aop->coff - offset);
-                               aop->coff = offset;
-                               emitcode ("ld","%s,z",(rs = ((offset & 1) ? "r25" : "r24")));
-                       }
-               }
-               return rs;
-
-       case AOP_IMMD:
-       
-               emitcode ("lds","%s,(%s)+%d",
-                         (rs = ((offset & 1) ? "r25" : "r24")),
-                         aop->aopu.aop_immd, offset);
-               return rs;
-       
-       case AOP_DIR:
-               emitcode ("lds","%s,(%s)+%d",
-                         (rs = ((offset & 1) ? "r25" : "r24")),
-                         aop->aopu.aop_dir, offset);
-               return rs;
-       
-       case AOP_REG:
-               return aop->aopu.aop_reg[offset]->name;
-       
-       case AOP_CRY:
-               assert("cannot be in bit space AOP_CRY\n");
-               break;
-
-       case AOP_LIT:
-               s = aopLiteral(aop->aopu.aop_lit,offset);
-               emitcode("ldi","%s,lo8(%s)",(rs = ((offset & 1)?"r24" : "r25")),s);
-               return rs;
-
-       case AOP_STR:
-               aop->coff = offset ;
-               return aop->aopu.aop_str[offset];
-       
-       case AOP_STK_D:
-               emitcode ("ldd","%s,Y+%d",
-                         (rs = ((offset & 1) ? "r25" : "r24")),                  
-                         aop->aopu.aop_stk+offset);
-               return rs;
-       }
-
-       werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-              "aopget got unsupported aop->type");
-       exit(0);
+  char *s = buffer ;
+  char *rs;
+
+  /* offset is greater than
+     size then zero */
+  if (offset > (aop->size - 1) &&
+      aop->type != AOP_LIT)
+    return zero;
+
+  /* depending on type */
+  switch (aop->type) {
+
+  case AOP_X:
+    if (offset > aop->coff) {
+      emitcode ("adiw","%s,%d",aop->aopu.aop_ptr->name,offset - aop->coff);
+    }
+
+    if (offset < aop->coff) {
+      emitcode("sbiw","%s,%d",aop->aopu.aop_ptr->name,aop->coff - offset);
+    }
+
+    aop->coff = offset ;
+    emitcode("ld","%s,x",
+       (rs = ((offset & 1) ? "r25" : "r24")));
+    return rs;
+
+  case AOP_Z:
+    if (aop->code) {
+      if (offset > aop->coff) {
+        emitcode("adiw","r30,%d",offset - aop->coff);
+      } else {
+        emitcode("sbiw","r30,%d",aop->coff - offset);
+      }
+      emitcode("lpm","%s,z",(rs = ((offset & 1) ? "r25" : "r24")));
+    } else {
+      /* we can use lds */
+      if (offset  > aop->coff) {
+        emitcode ("ldd","%s,z+%d",(rs = ((offset & 1) ? "r25" : "r24")),
+            offset - aop->coff);
+      } else {
+        emitcode("sbiw","%s,%d",aop->aopu.aop_ptr->name,aop->coff - offset);
+        aop->coff = offset;
+        emitcode ("ld","%s,z",(rs = ((offset & 1) ? "r25" : "r24")));
+      }
+    }
+    return rs;
+
+  case AOP_IMMD:
+
+    emitcode ("lds","%s,(%s)+%d",
+        (rs = ((offset & 1) ? "r25" : "r24")),
+        aop->aopu.aop_immd, offset);
+    return rs;
+
+  case AOP_DIR:
+    emitcode ("lds","%s,(%s)+%d",
+        (rs = ((offset & 1) ? "r25" : "r24")),
+        aop->aopu.aop_dir, offset);
+    return rs;
+
+  case AOP_REG:
+    return aop->aopu.aop_reg[offset]->name;
+
+  case AOP_CRY:
+    assert("cannot be in bit space AOP_CRY\n");
+    break;
+
+  case AOP_LIT:
+    s = aopLiteral(aop->aopu.aop_lit,offset);
+    emitcode("ldi","%s,lo8(%s)",(rs = ((offset & 1)?"r24" : "r25")),s);
+    return rs;
+
+  case AOP_STR:
+    aop->coff = offset ;
+    return aop->aopu.aop_str[offset];
+
+  case AOP_STK_D:
+    emitcode ("ldd","%s,Y+%d",
+        (rs = ((offset & 1) ? "r25" : "r24")),
+        aop->aopu.aop_stk+offset);
+    return rs;
+  }
+
+  werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+         "aopget got unsupported aop->type");
+  exit(0);
 }
 /*-----------------------------------------------------------------*/
 /* aopPut - puts a string for a aop                                */
 /*-----------------------------------------------------------------*/
 static void aopPut (asmop *aop, char *s, int offset)
 {
-       char *d = buffer ;
-
-       if (aop->size && offset > ( aop->size - 1)) {
-               werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                      "aopPut got offset > aop->size");
-               exit(0);
-       }
-
-       /* will assign value to value */
-       /* depending on where it is ofcourse */
-       switch (aop->type) {
-       case AOP_DIR:
-               if (offset) {
-                       sprintf(d,"(%s)+%d", aop->aopu.aop_dir,offset);
-               }
-               else {
-                       sprintf(d,"%s",aop->aopu.aop_dir);
-               }
-       
-               emitcode("sts","%s,%s",d,s);
-               break;
-       
-       case AOP_REG:
-               if (toupper(*s) != 'R') {
-                       if (s == zero) {
-                               emitcode("clr","%s",aop->aopu.aop_reg[offset]->name);
-                       } else {
-                               emitcode("ldi","r25,%s",s);
-                               emitcode("mov","%s,r35",aop->aopu.aop_reg[offset]->name);
-                       }
-               } else {
-                       if (strcmp( aop->aopu.aop_reg[offset]->name,s)) {
-                               emitcode("mov","%s,%s", aop->aopu.aop_reg[offset]->name,s);
-                       }
-               }
-               break;
-       
-       case AOP_X:
-               if (offset > aop->coff) {
-                       emitcode ("adiw","%s,%d",aop->aopu.aop_ptr->name,offset - aop->coff);  
-               }
-       
-               if (offset < aop->coff) {
-                       emitcode("sbiw","%s,%d",aop->aopu.aop_ptr->name,aop->coff - offset);
-               }
-       
-               aop->coff = offset ;
-               emitcode("st","x,%s", s);
-               break;
-       
-       case AOP_Z:
-               if (aop->code) {
-                       if (offset > aop->coff) {
-                               emitcode("adiw","r30,%d",offset - aop->coff);
-                       } else {
-                               emitcode("sbiw","r30,%d",aop->coff - offset);
-                       }
-                       emitcode("lpm","%s,z",s);
-               } else {
-                       /* we can use lds */
-                       if (offset  > aop->coff) {
-                               emitcode ("sdd","z+%d,%s",offset - aop->coff,s);
-                       } else {
-                               emitcode("sbiw","%s,%d",aop->aopu.aop_ptr->name,aop->coff - offset);
-                               aop->coff = offset;
-                               emitcode ("ld","%s,z",s);
-                       }
-               }
-               break;
-       
-       case AOP_STK:
-               emitcode("push","%s",s);        
-               break;
-       
-       case AOP_CRY:
-               /* if used only for a condition code check */
-               assert(toupper(*s) == 'R');
-               if (offset == 0) {
-                       emitcode("xrl","r0,r0");
-                       emitcode("cpi","%s,0",s);
-               }
-               else {
-                       emitcode("cpc","r0,%s",s);
-               }
-               break;
-       
-       case AOP_STR:
-               aop->coff = offset;
-               if (strcmp(aop->aopu.aop_str[offset],s))
-                       emitcode ("mov","%s,%s",aop->aopu.aop_str[offset],s);
-               break;
-
-       case AOP_STK_D:
-               emitcode ("std","y+%d,%s",offset,s);
-               break;
-
-       default :
-               werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                      "aopPut got unsupported aop->type");
-               exit(0);    
-       }    
+  char *d = buffer ;
+
+  if (aop->size && offset > ( aop->size - 1)) {
+    werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+           "aopPut got offset > aop->size");
+    exit(0);
+  }
+
+  /* will assign value to value */
+  /* depending on where it is ofcourse */
+  switch (aop->type) {
+  case AOP_DIR:
+    if (offset) {
+      sprintf(d,"(%s)+%d", aop->aopu.aop_dir,offset);
+    }
+    else {
+      sprintf(d,"%s",aop->aopu.aop_dir);
+    }
+
+    emitcode("sts","%s,%s",d,s);
+    break;
+
+  case AOP_REG:
+    if (toupper(*s) != 'R') {
+      if (s == zero) {
+        emitcode("clr","%s",aop->aopu.aop_reg[offset]->name);
+      } else {
+        emitcode("ldi","r25,%s",s);
+        emitcode("mov","%s,r35",aop->aopu.aop_reg[offset]->name);
+      }
+    } else {
+      if (strcmp( aop->aopu.aop_reg[offset]->name,s)) {
+        emitcode("mov","%s,%s", aop->aopu.aop_reg[offset]->name,s);
+      }
+    }
+    break;
+
+  case AOP_X:
+    if (offset > aop->coff) {
+      emitcode ("adiw","%s,%d",aop->aopu.aop_ptr->name,offset - aop->coff);
+    }
+
+    if (offset < aop->coff) {
+      emitcode("sbiw","%s,%d",aop->aopu.aop_ptr->name,aop->coff - offset);
+    }
+
+    aop->coff = offset ;
+    emitcode("st","x,%s", s);
+    break;
+
+  case AOP_Z:
+    if (aop->code) {
+      if (offset > aop->coff) {
+        emitcode("adiw","r30,%d",offset - aop->coff);
+      } else {
+        emitcode("sbiw","r30,%d",aop->coff - offset);
+      }
+      emitcode("lpm","%s,z",s);
+    } else {
+      /* we can use lds */
+      if (offset  > aop->coff) {
+        emitcode ("sdd","z+%d,%s",offset - aop->coff,s);
+      } else {
+        emitcode("sbiw","%s,%d",aop->aopu.aop_ptr->name,aop->coff - offset);
+        aop->coff = offset;
+        emitcode ("ld","%s,z",s);
+      }
+    }
+    break;
+
+  case AOP_STK:
+    emitcode("push","%s",s);
+    break;
+
+  case AOP_CRY:
+    /* if used only for a condition code check */
+    assert(toupper(*s) == 'R');
+    if (offset == 0) {
+      emitcode("xrl","r0,r0");
+      emitcode("cpi","%s,0",s);
+    }
+    else {
+      emitcode("cpc","r0,%s",s);
+    }
+    break;
+
+  case AOP_STR:
+    aop->coff = offset;
+    if (strcmp(aop->aopu.aop_str[offset],s))
+      emitcode ("mov","%s,%s",aop->aopu.aop_str[offset],s);
+    break;
+
+  case AOP_STK_D:
+    emitcode ("std","y+%d,%s",offset,s);
+    break;
+
+  default :
+    werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+           "aopPut got unsupported aop->type");
+    exit(0);
+  }
 
 }
 
@@ -894,18 +894,18 @@ static void aopPut (asmop *aop, char *s, int offset)
 /*-----------------------------------------------------------------*/
 static void reAdjustPreg (asmop *aop)
 {
-       int size ;
+  int size ;
 
-       aop->coff = 0;
-       if ((size = aop->size) <= 1)
-               return ;
-       size-- ;
-       switch (aop->type) {
+  aop->coff = 0;
+  if ((size = aop->size) <= 1)
+    return ;
+  size-- ;
+  switch (aop->type) {
         case AOP_X :
         case AOP_Z :
-               emitcode("sbiw","%s,%d",aop->aopu.aop_ptr->name,size);
-               break;          
-       }
+    emitcode("sbiw","%s,%d",aop->aopu.aop_ptr->name,size);
+    break;
+  }
 
 }
 
@@ -923,51 +923,51 @@ static void reAdjustPreg (asmop *aop)
 /*-----------------------------------------------------------------*/
 static void genNotFloat (operand *op, operand *res)
 {
-       int size, offset;
-       char *l;
-       symbol *tlbl ;
-
-       /* we will put 127 in the first byte of 
-          the result */
-       aopPut(AOP(res),"127",0);
-       size = AOP_SIZE(op) - 1;
-       offset = 1;
-
-       l = aopGet(op->aop,offset++);
-       MOVR0(l);    
-
-       while(size--) {
-               emitcode("or","R0,%s", aopGet(op->aop, offset++));
-       }
-       tlbl = newiTempLabel(NULL);
-
-       tlbl = newiTempLabel(NULL);
-       aopPut(res->aop,zero,1);
-       emitcode("cpi","r0,0");
-       emitcode("breq","L%05d",tlbl->key);
-       aopPut(res->aop,one,1);
-       emitcode("","L%05d:",tlbl->key);
-
-       size = res->aop->size - 2;
-       offset = 2;    
-       /* put zeros in the rest */
-       while (size--) 
-               aopPut(res->aop,zero,offset++);
+  int size, offset;
+  char *l;
+  symbol *tlbl ;
+
+  /* we will put 127 in the first byte of
+     the result */
+  aopPut(AOP(res),"127",0);
+  size = AOP_SIZE(op) - 1;
+  offset = 1;
+
+  l = aopGet(op->aop,offset++);
+  MOVR0(l);
+
+  while(size--) {
+    emitcode("or","R0,%s", aopGet(op->aop, offset++));
+  }
+  tlbl = newiTempLabel(NULL);
+
+  tlbl = newiTempLabel(NULL);
+  aopPut(res->aop,zero,1);
+  emitcode("cpi","r0,0");
+  emitcode("breq","L%05d",tlbl->key);
+  aopPut(res->aop,one,1);
+  emitcode("","L%05d:",tlbl->key);
+
+  size = res->aop->size - 2;
+  offset = 2;
+  /* put zeros in the rest */
+  while (size--)
+    aopPut(res->aop,zero,offset++);
 }
 
 /*-----------------------------------------------------------------*/
-/* opIsGptr: returns non-zero if the passed operand is            */   
-/* a generic pointer type.                                        */
-/*-----------------------------------------------------------------*/ 
+/* opIsGptr: returns non-zero if the passed operand is       */
+/* a generic pointer type.             */
+/*-----------------------------------------------------------------*/
 static int opIsGptr(operand *op)
 {
-       sym_link *type = operandType(op);
-    
-       if ((AOP_SIZE(op) == GPTRSIZE) && IS_GENPTR(type))
-               {
-                       return 1;
-               }
-       return 0;        
+  sym_link *type = operandType(op);
+
+  if ((AOP_SIZE(op) == GPTRSIZE) && IS_GENPTR(type))
+    {
+      return 1;
+    }
+  return 0;
 }
 
 /*-----------------------------------------------------------------*/
@@ -975,20 +975,20 @@ static int opIsGptr(operand *op)
 /*-----------------------------------------------------------------*/
 static int getDataSize(operand *op)
 {
-       int size;
-       size = AOP_SIZE(op);
-       if (size == GPTRSIZE)
-               {
-                       sym_link *type = operandType(op);
-                       if (IS_GENPTR(type))
-                               {
-                                       /* generic pointer; arithmetic operations
-                                        * should ignore the high byte (pointer type).
-                                        */
-                                       size--;
-                               }
-               }
-       return size;
+  int size;
+  size = AOP_SIZE(op);
+  if (size == GPTRSIZE)
+    {
+      sym_link *type = operandType(op);
+      if (IS_GENPTR(type))
+        {
+          /* generic pointer; arithmetic operations
+           * should ignore the high byte (pointer type).
+           */
+          size--;
+        }
+    }
+  return size;
 }
 
 /*-----------------------------------------------------------------*/
@@ -996,17 +996,17 @@ static int getDataSize(operand *op)
 /*-----------------------------------------------------------------*/
 static void outAcc(operand *result)
 {
-       int size, offset;
-       size = getDataSize(result);
-       if(size){
-               aopPut(AOP(result),"r0",0);
-               size--;
-               offset = 1;
-               /* unsigned or positive */
-               while(size--){
-                       aopPut(AOP(result),zero,offset++);
-               }
-       }
+  int size, offset;
+  size = getDataSize(result);
+  if(size){
+    aopPut(AOP(result),"r0",0);
+    size--;
+    offset = 1;
+    /* unsigned or positive */
+    while(size--){
+      aopPut(AOP(result),zero,offset++);
+    }
+  }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1014,9 +1014,9 @@ static void outAcc(operand *result)
 /*-----------------------------------------------------------------*/
 static void outBitC(operand *result)
 {
-       emitcode("clr","r0");
-       emitcode("rol","r0");
-       outAcc(result);
+  emitcode("clr","r0");
+  emitcode("rol","r0");
+  outAcc(result);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1024,11 +1024,11 @@ static void outBitC(operand *result)
 /*-----------------------------------------------------------------*/
 static void toBoolean(operand *oper, char *r, bool clr)
 {
-       int size = AOP_SIZE(oper) ;
-       int offset = 0;
-       if (clr) emitcode ("clr","%s",r);
-       while (size--) 
-               emitcode("or","%s,%s",r,aopGet(AOP(oper),offset++));
+  int size = AOP_SIZE(oper) ;
+  int offset = 0;
+  if (clr) emitcode ("clr","%s",r);
+  while (size--)
+    emitcode("or","%s,%s",r,aopGet(AOP(oper),offset++));
 }
 
 
@@ -1037,46 +1037,46 @@ static void toBoolean(operand *oper, char *r, bool clr)
 /*-----------------------------------------------------------------*/
 static void genNot (iCode *ic)
 {
-       symbol *tlbl;
-       sym_link *optype = operandType(IC_LEFT(ic));
-       int size, offset = 1;
-
-       /* assign asmOps to operand & result */
-       aopOp (IC_LEFT(ic),ic,FALSE);
-       aopOp (IC_RESULT(ic),ic,TRUE);
-
-       /* if type float then do float */
-       if (IS_FLOAT(optype)) {
-               genNotFloat(IC_LEFT(ic),IC_RESULT(ic));
-               goto release;
-       }
-       emitcode("clr","r0");
-       tlbl = newiTempLabel(NULL);
-       size = AOP_SIZE(IC_LEFT(ic));
-       offset = 0;
-       if (size == 1) {
-               emitcode("cpse","%s,r0",aopGet(AOP(IC_LEFT(ic)),0));
-       }
-       else {
-               while (size--) {
-                       if (offset) emitcode("cpc","%s,r0",aopGet(AOP(IC_LEFT(ic)),offset));
-                       else emitcode("cpi","%s,0",aopGet(AOP(IC_LEFT(ic)),offset));
-                       offset++;
-               }
-               emitcode("bne","L%05d",tlbl->key);
-       }
-       emitcode("ldi","r0,1");
-       emitcode("","L%05d:",tlbl->key);
-       aopPut(AOP(IC_RESULT(ic)),"r0",0);
-       size = AOP_SIZE(IC_RESULT(ic)) -1;
-       offset = 1;
-       while (size--) aopPut(AOP(IC_RESULT(ic)),zero,offset++);
-    
-
- release:    
-       /* release the aops */
-       freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
-       freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
+  symbol *tlbl;
+  sym_link *optype = operandType(IC_LEFT(ic));
+  int size, offset = 1;
+
+  /* assign asmOps to operand & result */
+  aopOp (IC_LEFT(ic),ic,FALSE);
+  aopOp (IC_RESULT(ic),ic,TRUE);
+
+  /* if type float then do float */
+  if (IS_FLOAT(optype)) {
+    genNotFloat(IC_LEFT(ic),IC_RESULT(ic));
+    goto release;
+  }
+  emitcode("clr","r0");
+  tlbl = newiTempLabel(NULL);
+  size = AOP_SIZE(IC_LEFT(ic));
+  offset = 0;
+  if (size == 1) {
+    emitcode("cpse","%s,r0",aopGet(AOP(IC_LEFT(ic)),0));
+  }
+  else {
+    while (size--) {
+      if (offset) emitcode("cpc","%s,r0",aopGet(AOP(IC_LEFT(ic)),offset));
+      else emitcode("cpi","%s,0",aopGet(AOP(IC_LEFT(ic)),offset));
+      offset++;
+    }
+    emitcode("bne","L%05d",tlbl->key);
+  }
+  emitcode("ldi","r0,1");
+  emitcode("","L%05d:",tlbl->key);
+  aopPut(AOP(IC_RESULT(ic)),"r0",0);
+  size = AOP_SIZE(IC_RESULT(ic)) -1;
+  offset = 1;
+  while (size--) aopPut(AOP(IC_RESULT(ic)),zero,offset++);
+
+
+ release:
+  /* release the aops */
+  freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
+  freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
 }
 
 
@@ -1085,29 +1085,29 @@ static void genNot (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genCpl (iCode *ic)
 {
-       int offset = 0;
-       int size ;
-       int samer;
-
-       /* assign asmOps to operand & result */
-       aopOp (IC_LEFT(ic),ic,FALSE);
-       aopOp (IC_RESULT(ic),ic,TRUE);
-       samer = sameRegs(AOP(IC_LEFT(ic)),AOP(IC_RESULT(ic)));
-       size = AOP_SIZE(IC_RESULT(ic));
-       while (size--) {
-               char *l = aopGet(AOP(IC_LEFT(ic)),offset);
-               if (samer) {
-                       emitcode ("com","%s",l);
-               } else {
-                       aopPut(AOP(IC_RESULT(ic)),l,offset);
-                       emitcode ("com","%s",aopGet(AOP(IC_RESULT(ic)),offset));
-               }
-               offset++;
-       }
-
-       /* release the aops */
-       freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
-       freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
+  int offset = 0;
+  int size ;
+  int samer;
+
+  /* assign asmOps to operand & result */
+  aopOp (IC_LEFT(ic),ic,FALSE);
+  aopOp (IC_RESULT(ic),ic,TRUE);
+  samer = sameRegs(AOP(IC_LEFT(ic)),AOP(IC_RESULT(ic)));
+  size = AOP_SIZE(IC_RESULT(ic));
+  while (size--) {
+    char *l = aopGet(AOP(IC_LEFT(ic)),offset);
+    if (samer) {
+      emitcode ("com","%s",l);
+    } else {
+      aopPut(AOP(IC_RESULT(ic)),l,offset);
+      emitcode ("com","%s",aopGet(AOP(IC_RESULT(ic)),offset));
+    }
+    offset++;
+  }
+
+  /* release the aops */
+  freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
+  freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1115,24 +1115,24 @@ static void genCpl (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genUminusFloat(operand *op,operand *result)
 {
-       int size ,offset =0 ;
-       char *l;
-       /* for this we just need to flip the 
-          first it then copy the rest in place */
-       size = AOP_SIZE(op) - 1;
-       l = aopGet(AOP(op),3);
-    
-       emitcode("ldi","r24,0x80");
-       if (sameRegs(AOP(op),AOP(result))) {
-               emitcode("eor","%s,r24",l);
-       } else {
-               aopPut(AOP(result),l,3);
-               emitcode("eor","%s,r24",aopGet(AOP(result),3));
-       }
-       while(size--) {
-               aopPut(AOP(result), aopGet(AOP(op),offset), offset);
-               offset++;
-       }          
+  int size ,offset =0 ;
+  char *l;
+  /* for this we just need to flip the
+     first it then copy the rest in place */
+  size = AOP_SIZE(op) - 1;
+  l = aopGet(AOP(op),3);
+
+  emitcode("ldi","r24,0x80");
+  if (sameRegs(AOP(op),AOP(result))) {
+    emitcode("eor","%s,r24",l);
+  } else {
+    aopPut(AOP(result),l,3);
+    emitcode("eor","%s,r24",aopGet(AOP(result),3));
+  }
+  while(size--) {
+    aopPut(AOP(result), aopGet(AOP(op),offset), offset);
+    offset++;
+  }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1140,82 +1140,82 @@ static void genUminusFloat(operand *op,operand *result)
 /*-----------------------------------------------------------------*/
 static void genUminus (iCode *ic)
 {
-       int offset ,size ;
-       sym_link *optype, *rtype;
-       int samer ;
-
-       /* assign asmops */
-       aopOp(IC_LEFT(ic),ic,FALSE);
-       aopOp(IC_RESULT(ic),ic,TRUE);
-
-       optype = operandType(IC_LEFT(ic));
-       rtype = operandType(IC_RESULT(ic));
-
-       /* if float then do float stuff */
-       if (IS_FLOAT(optype)) {
-               genUminusFloat(IC_LEFT(ic),IC_RESULT(ic));
-               goto release;
-       }
-
-       /* otherwise subtract from zero */
-       size = AOP_SIZE(IC_LEFT(ic));
-       offset = 0 ;
-       samer = sameRegs(AOP(IC_LEFT(ic)),AOP(IC_RESULT(ic)));
-       if (size == 1) {
-               if (samer) {
-                       emitcode("neg","%s",aopGet(AOP(IC_LEFT(ic)),0));
-               } else {
-                       aopPut(AOP(IC_RESULT(ic)),aopGet(AOP(IC_LEFT(ic)),0),0);
-                       emitcode("neg","%s",aopGet(AOP(IC_RESULT(ic)),0));
-               }
-       } else {
-               offset = size - 1;
-               while(size--) {
-                       char *l = aopGet(AOP(IC_LEFT(ic)),offset);
-                       if (!samer) {
-                               aopPut(AOP(IC_RESULT(ic)),l,offset);
-                               l = aopGet(AOP(IC_RESULT(ic)),offset);
-                       }
-                       if (offset) emitcode("com","%s",l);
-                       else emitcode("neg","%s",l);
-                       offset--;
-               }
-               size = AOP_SIZE(IC_LEFT(ic)) -1;
-               offset = 1 ;
-               while (size--) {
-                       emitcode("sbci","%s,lo8(-1)",aopGet(AOP(IC_RESULT(ic)),offset++));
-               }
-       }
-
-       /* if any remaining bytes in the result */
-       /* we just need to propagate the sign   */
-       if ((size = (AOP_SIZE(IC_RESULT(ic)) - AOP_SIZE(IC_LEFT(ic))))) {
-               symbol *tlbl = newiTempLabel(NULL);
-               emitcode("clr","r0");
-               emitcode("brcc","L%05d",tlbl->key);
-               emitcode("com","r0");
-               emitcode("","L%05d:",tlbl->key);
-               while (size--) 
-                       aopPut(AOP(IC_RESULT(ic)),"r0",offset++);
-       }       
+  int offset ,size ;
+  sym_link *optype, *rtype;
+  int samer ;
+
+  /* assign asmops */
+  aopOp(IC_LEFT(ic),ic,FALSE);
+  aopOp(IC_RESULT(ic),ic,TRUE);
+
+  optype = operandType(IC_LEFT(ic));
+  rtype = operandType(IC_RESULT(ic));
+
+  /* if float then do float stuff */
+  if (IS_FLOAT(optype)) {
+    genUminusFloat(IC_LEFT(ic),IC_RESULT(ic));
+    goto release;
+  }
+
+  /* otherwise subtract from zero */
+  size = AOP_SIZE(IC_LEFT(ic));
+  offset = 0 ;
+  samer = sameRegs(AOP(IC_LEFT(ic)),AOP(IC_RESULT(ic)));
+  if (size == 1) {
+    if (samer) {
+      emitcode("neg","%s",aopGet(AOP(IC_LEFT(ic)),0));
+    } else {
+      aopPut(AOP(IC_RESULT(ic)),aopGet(AOP(IC_LEFT(ic)),0),0);
+      emitcode("neg","%s",aopGet(AOP(IC_RESULT(ic)),0));
+    }
+  } else {
+    offset = size - 1;
+    while(size--) {
+      char *l = aopGet(AOP(IC_LEFT(ic)),offset);
+      if (!samer) {
+        aopPut(AOP(IC_RESULT(ic)),l,offset);
+        l = aopGet(AOP(IC_RESULT(ic)),offset);
+      }
+      if (offset) emitcode("com","%s",l);
+      else emitcode("neg","%s",l);
+      offset--;
+    }
+    size = AOP_SIZE(IC_LEFT(ic)) -1;
+    offset = 1 ;
+    while (size--) {
+      emitcode("sbci","%s,lo8(-1)",aopGet(AOP(IC_RESULT(ic)),offset++));
+    }
+  }
+
+  /* if any remaining bytes in the result */
+  /* we just need to propagate the sign   */
+  if ((size = (AOP_SIZE(IC_RESULT(ic)) - AOP_SIZE(IC_LEFT(ic))))) {
+    symbol *tlbl = newiTempLabel(NULL);
+    emitcode("clr","r0");
+    emitcode("brcc","L%05d",tlbl->key);
+    emitcode("com","r0");
+    emitcode("","L%05d:",tlbl->key);
+    while (size--)
+      aopPut(AOP(IC_RESULT(ic)),"r0",offset++);
+  }
 
  release:
-       /* release the aops */
-       freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
-       freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);    
+  /* release the aops */
+  freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
+  freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
-/* assignResultValue -                                            */
+/* assignResultValue -               */
 /*-----------------------------------------------------------------*/
 static void assignResultValue(operand * oper)
 {
-       int offset = 0;
-       int size = AOP_SIZE(oper);
-       while (size--) {
-               aopPut(AOP(oper),fAVRReturn[offset],offset);
-               offset++;
-       }
+  int offset = 0;
+  int size = AOP_SIZE(oper);
+  while (size--) {
+    aopPut(AOP(oper),fAVRReturn[offset],offset);
+    offset++;
+  }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1223,14 +1223,14 @@ static void assignResultValue(operand * oper)
 /*-----------------------------------------------------------------*/
 static void saveZreg (iCode *ic)
 {
-       /* only if live accross this call */
-       if (ic->regsSaved == 0 && 
-           (bitVectBitValue(ic->rMask,R30_IDX) ||
-            bitVectBitValue(ic->rMask,R31_IDX))) {
-               ic->regsSaved = 1;
-               emitcode("push","r30");
-               emitcode("push","r31");
-       }
+  /* only if live accross this call */
+  if (ic->regsSaved == 0 &&
+      (bitVectBitValue(ic->rMask,R30_IDX) ||
+       bitVectBitValue(ic->rMask,R31_IDX))) {
+    ic->regsSaved = 1;
+    emitcode("push","r30");
+    emitcode("push","r31");
+  }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1238,10 +1238,10 @@ static void saveZreg (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void popZreg (iCode *ic)
 {
-       if (ic->regsSaved) {
-               emitcode ("pop","r31");
-               emitcode ("pop","r30");
-       }
+  if (ic->regsSaved) {
+    emitcode ("pop","r31");
+    emitcode ("pop","r30");
+  }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1249,30 +1249,30 @@ static void popZreg (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genIpush (iCode *ic)
 {
-       int size, offset = 0 ;
-       char *l;
-
-
-       if (!ic->parmPush) {
-               /* and the item is spilt then do nothing */
-               if (OP_SYMBOL(IC_LEFT(ic))->isspilt)
-                       return ;
-       } else {
-               iCode *lic ; 
-               for (lic = ic->next ; lic ; lic = lic->next) 
-                       if (lic->op == PCALL) break;
-               if (lic) saveZreg(lic);
-       }
-
-       /* this is a paramter push */
-       aopOp(IC_LEFT(ic),ic,FALSE);
-       size = AOP_SIZE(IC_LEFT(ic));
-       while (size--) {
-               l = aopGet(AOP(IC_LEFT(ic)),offset++);
-               emitcode("push","%s",l);
-       }       
-
-       freeAsmop(IC_LEFT(ic),NULL,ic,TRUE);
+  int size, offset = 0 ;
+  char *l;
+
+
+  if (!ic->parmPush) {
+    /* and the item is spilt then do nothing */
+    if (OP_SYMBOL(IC_LEFT(ic))->isspilt)
+      return ;
+  } else {
+    iCode *lic ;
+    for (lic = ic->next ; lic ; lic = lic->next)
+      if (lic->op == PCALL) break;
+    if (lic) saveZreg(lic);
+  }
+
+  /* this is a paramter push */
+  aopOp(IC_LEFT(ic),ic,FALSE);
+  size = AOP_SIZE(IC_LEFT(ic));
+  while (size--) {
+    l = aopGet(AOP(IC_LEFT(ic)),offset++);
+    emitcode("push","%s",l);
+  }
+
+  freeAsmop(IC_LEFT(ic),NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1280,20 +1280,20 @@ static void genIpush (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genIpop (iCode *ic)
 {
-       int size,offset ;
+  int size,offset ;
 
 
-       /* if the temp was not pushed then */
-       if (OP_SYMBOL(IC_LEFT(ic))->isspilt)
-               return ;
+  /* if the temp was not pushed then */
+  if (OP_SYMBOL(IC_LEFT(ic))->isspilt)
+    return ;
 
-       aopOp(IC_LEFT(ic),ic,FALSE);
-       size = AOP_SIZE(IC_LEFT(ic));
-       offset = (size-1);
-       while (size--) 
-               emitcode("pop","%s",aopGet(AOP(IC_LEFT(ic)),offset--));
+  aopOp(IC_LEFT(ic),ic,FALSE);
+  size = AOP_SIZE(IC_LEFT(ic));
+  offset = (size-1);
+  while (size--)
+    emitcode("pop","%s",aopGet(AOP(IC_LEFT(ic)),offset--));
 
-       freeAsmop(IC_LEFT(ic),NULL,ic,TRUE);
+  freeAsmop(IC_LEFT(ic),NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1302,52 +1302,52 @@ static void genIpop (iCode *ic)
 static void genCall (iCode *ic)
 {
 
-       /* if send set is not empty the assign */
-       if (_G.sendSet) {
-               iCode *sic ;
-               int rnum = 16;
-               for (sic = setFirstItem(_G.sendSet) ; sic ; 
-                    sic = setNextItem(_G.sendSet)) {
-                       int size, offset = 0;
-                       aopOp(IC_LEFT(sic),sic,FALSE);
-                       size = AOP_SIZE(IC_LEFT(sic));
-                       while (size--) {
-                               char *l = aopGet(AOP(IC_LEFT(sic)),offset);
-                               char *b = buffer;
-                               sprintf(buffer,"r%d",rnum++);
-                               if (strcmp(l,b))
-                                       emitcode("mov","%s,%s",b,l);
-                               offset++;
-                       }
-                       freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
-               }
-               _G.sendSet = NULL;
-       }
-       /* make the call */
-       emitcode("call","%s",(OP_SYMBOL(IC_LEFT(ic))->rname[0] ?
-                             OP_SYMBOL(IC_LEFT(ic))->rname :
-                             OP_SYMBOL(IC_LEFT(ic))->name));
-
-       /* if we need assign a result value */
-       if ((IS_ITEMP(IC_RESULT(ic)) && 
-            (OP_SYMBOL(IC_RESULT(ic))->nRegs ||
-             OP_SYMBOL(IC_RESULT(ic))->spildir )) ||
-           IS_TRUE_SYMOP(IC_RESULT(ic)) ) {
-
-               aopOp(IC_RESULT(ic),ic,FALSE);
-               assignResultValue(IC_RESULT(ic));
-               freeAsmop(IC_RESULT(ic),NULL, ic,TRUE);
-       }
-
-       /* adjust the stack for parameters if required */
-       if (IC_LEFT(ic)->parmBytes) {
-               if (IC_LEFT(ic)->parmBytes > 63) {
-                       emitcode("sbiw","r28,%d",IC_LEFT(ic)->parmBytes);
-               } else {
-                       emitcode("subi","r28,lo8(%d)",IC_LEFT(ic)->parmBytes);
-                       emitcode("sbci","r29,hi8(%d)",IC_LEFT(ic)->parmBytes);
-               }
-       }
+  /* if send set is not empty the assign */
+  if (_G.sendSet) {
+    iCode *sic ;
+    int rnum = 16;
+    for (sic = setFirstItem(_G.sendSet) ; sic ;
+         sic = setNextItem(_G.sendSet)) {
+      int size, offset = 0;
+      aopOp(IC_LEFT(sic),sic,FALSE);
+      size = AOP_SIZE(IC_LEFT(sic));
+      while (size--) {
+        char *l = aopGet(AOP(IC_LEFT(sic)),offset);
+        char *b = buffer;
+        sprintf(buffer,"r%d",rnum++);
+        if (strcmp(l,b))
+          emitcode("mov","%s,%s",b,l);
+        offset++;
+      }
+      freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
+    }
+    _G.sendSet = NULL;
+  }
+  /* make the call */
+  emitcode("call","%s",(OP_SYMBOL(IC_LEFT(ic))->rname[0] ?
+            OP_SYMBOL(IC_LEFT(ic))->rname :
+            OP_SYMBOL(IC_LEFT(ic))->name));
+
+  /* if we need assign a result value */
+  if ((IS_ITEMP(IC_RESULT(ic)) &&
+       (OP_SYMBOL(IC_RESULT(ic))->nRegs ||
+        OP_SYMBOL(IC_RESULT(ic))->spildir )) ||
+      IS_TRUE_SYMOP(IC_RESULT(ic)) ) {
+
+    aopOp(IC_RESULT(ic),ic,FALSE);
+    assignResultValue(IC_RESULT(ic));
+    freeAsmop(IC_RESULT(ic),NULL, ic,TRUE);
+  }
+
+  /* adjust the stack for parameters if required */
+  if (IC_LEFT(ic)->parmBytes) {
+    if (IC_LEFT(ic)->parmBytes > 63) {
+      emitcode("sbiw","r28,%d",IC_LEFT(ic)->parmBytes);
+    } else {
+      emitcode("subi","r28,lo8(%d)",IC_LEFT(ic)->parmBytes);
+      emitcode("sbci","r29,hi8(%d)",IC_LEFT(ic)->parmBytes);
+    }
+  }
 
 }
 
@@ -1357,73 +1357,73 @@ static void genCall (iCode *ic)
 static void genPcall (iCode *ic)
 {
 
-       if (!ic->regsSaved) saveZreg(ic);
-
-       aopOp(IC_LEFT(ic),ic,FALSE);
-       emitcode("mov","r30",aopGet(AOP(IC_LEFT(ic)),0));
-       emitcode("mov","r31",aopGet(AOP(IC_RIGHT(ic)),0));
-       freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); 
-
-       /* if send set is not empty the assign */
-       if (_G.sendSet) {
-               iCode *sic ;
-               int rnum = 16;
-               for (sic = setFirstItem(_G.sendSet) ; sic ; 
-                    sic = setNextItem(_G.sendSet)) {
-                       int size, offset = 0;
-                       aopOp(IC_LEFT(sic),sic,FALSE);
-                       size = AOP_SIZE(IC_LEFT(sic));
-                       while (size--) {
-                               char *l = aopGet(AOP(IC_LEFT(sic)),offset);
-                               char *b = buffer;
-                               sprintf(b,"r%d",rnum++);
-                               if (strcmp(l,b))
-                                       emitcode("mov","%s,%s",b,l);
-                               offset++;
-                       }
-                       freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
-               }
-               _G.sendSet = NULL;
-       }
-
-       emitcode("icall","");
-
-       /* if we need assign a result value */
-       if ((IS_ITEMP(IC_RESULT(ic)) &&
-            (OP_SYMBOL(IC_RESULT(ic))->nRegs ||
-             OP_SYMBOL(IC_RESULT(ic))->spildir)) ||
-           IS_TRUE_SYMOP(IC_RESULT(ic)) ) {
-
-               aopOp(IC_RESULT(ic),ic,FALSE);
-
-               assignResultValue(IC_RESULT(ic));
-               freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
-       }
-
-       /* adjust the stack for parameters if 
-          required */
-       if (IC_LEFT(ic)->parmBytes) {
-               int i;
-               if (IC_LEFT(ic)->parmBytes > 3) {
-                       emitcode("mov","a,%s",spname);
-                       emitcode("add","a,#0x%02x", (- IC_LEFT(ic)->parmBytes) & 0xff);
-                       emitcode("mov","%s,a",spname);
-               } else 
-                       for ( i = 0 ; i <  IC_LEFT(ic)->parmBytes ;i++)
-                               emitcode("dec","%s",spname);
-
-       }
-
-       /* adjust the stack for parameters if required */
-       if (IC_LEFT(ic)->parmBytes) {
-               if (IC_LEFT(ic)->parmBytes > 63) {
-                       emitcode("sbiw","r28,%d",IC_LEFT(ic)->parmBytes);
-               } else {
-                       emitcode("subi","r28,lo8(%d)",IC_LEFT(ic)->parmBytes);
-                       emitcode("sbci","r29,hi8(%d)",IC_LEFT(ic)->parmBytes);
-               }
-       }
-       if (ic->regsSaved) popZreg(ic);
+  if (!ic->regsSaved) saveZreg(ic);
+
+  aopOp(IC_LEFT(ic),ic,FALSE);
+  emitcode("mov","r30",aopGet(AOP(IC_LEFT(ic)),0));
+  emitcode("mov","r31",aopGet(AOP(IC_RIGHT(ic)),0));
+  freeAsmop(IC_LEFT(ic),NULL,ic,TRUE);
+
+  /* if send set is not empty the assign */
+  if (_G.sendSet) {
+    iCode *sic ;
+    int rnum = 16;
+    for (sic = setFirstItem(_G.sendSet) ; sic ;
+         sic = setNextItem(_G.sendSet)) {
+      int size, offset = 0;
+      aopOp(IC_LEFT(sic),sic,FALSE);
+      size = AOP_SIZE(IC_LEFT(sic));
+      while (size--) {
+        char *l = aopGet(AOP(IC_LEFT(sic)),offset);
+        char *b = buffer;
+        sprintf(b,"r%d",rnum++);
+        if (strcmp(l,b))
+          emitcode("mov","%s,%s",b,l);
+        offset++;
+      }
+      freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
+    }
+    _G.sendSet = NULL;
+  }
+
+  emitcode("icall","");
+
+  /* if we need assign a result value */
+  if ((IS_ITEMP(IC_RESULT(ic)) &&
+       (OP_SYMBOL(IC_RESULT(ic))->nRegs ||
+        OP_SYMBOL(IC_RESULT(ic))->spildir)) ||
+      IS_TRUE_SYMOP(IC_RESULT(ic)) ) {
+
+    aopOp(IC_RESULT(ic),ic,FALSE);
+
+    assignResultValue(IC_RESULT(ic));
+    freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
+  }
+
+  /* adjust the stack for parameters if
+     required */
+  if (IC_LEFT(ic)->parmBytes) {
+    int i;
+    if (IC_LEFT(ic)->parmBytes > 3) {
+      emitcode("mov","a,%s",spname);
+      emitcode("add","a,#0x%02x", (- IC_LEFT(ic)->parmBytes) & 0xff);
+      emitcode("mov","%s,a",spname);
+    } else
+      for ( i = 0 ; i <  IC_LEFT(ic)->parmBytes ;i++)
+        emitcode("dec","%s",spname);
+
+  }
+
+  /* adjust the stack for parameters if required */
+  if (IC_LEFT(ic)->parmBytes) {
+    if (IC_LEFT(ic)->parmBytes > 63) {
+      emitcode("sbiw","r28,%d",IC_LEFT(ic)->parmBytes);
+    } else {
+      emitcode("subi","r28,lo8(%d)",IC_LEFT(ic)->parmBytes);
+      emitcode("sbci","r29,hi8(%d)",IC_LEFT(ic)->parmBytes);
+    }
+  }
+  if (ic->regsSaved) popZreg(ic);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1431,16 +1431,16 @@ static void genPcall (iCode *ic)
 /*-----------------------------------------------------------------*/
 static int resultRemat (iCode *ic)
 {
-       if (SKIP_IC(ic) || ic->op == IFX)
-               return 0;
+  if (SKIP_IC(ic) || ic->op == IFX)
+    return 0;
 
-       if (IC_RESULT(ic) && IS_ITEMP(IC_RESULT(ic))) {
-               symbol *sym = OP_SYMBOL(IC_RESULT(ic));
-               if (sym->remat && !POINTER_SET(ic)) 
-                       return 1;
-       }
+  if (IC_RESULT(ic) && IS_ITEMP(IC_RESULT(ic))) {
+    symbol *sym = OP_SYMBOL(IC_RESULT(ic));
+    if (sym->remat && !POINTER_SET(ic))
+      return 1;
+  }
 
-       return 0;
+  return 0;
 }
 
 #if defined(__BORLANDC__) || defined(_MSC_VER)
@@ -1454,18 +1454,18 @@ static int resultRemat (iCode *ic)
 /*-----------------------------------------------------------------*/
 static bool inExcludeList(char *s)
 {
-       int i =0;
-    
-       if (options.excludeRegs[i] &&
-           STRCASECMP(options.excludeRegs[i],"none") == 0)
-               return FALSE ;
-
-       for ( i = 0 ; options.excludeRegs[i]; i++) {
-               if (options.excludeRegs[i] &&
-                   STRCASECMP(s,options.excludeRegs[i]) == 0)
-                       return TRUE;
-       }
-       return FALSE ;
+  int i =0;
+
+  if (options.excludeRegs[i] &&
+      STRCASECMP(options.excludeRegs[i],"none") == 0)
+    return FALSE ;
+
+  for ( i = 0 ; options.excludeRegs[i]; i++) {
+    if (options.excludeRegs[i] &&
+        STRCASECMP(s,options.excludeRegs[i]) == 0)
+      return TRUE;
+  }
+  return FALSE ;
 }
 
 /*-----------------------------------------------------------------*/
@@ -1473,65 +1473,65 @@ static bool inExcludeList(char *s)
 /*-----------------------------------------------------------------*/
 static void genFunction (iCode *ic)
 {
-       symbol *sym;
-       sym_link *fetype;
-       int i = 0;
-
-       _G.nRegsSaved = 0;
-       /* create the function header */
-       emitcode(";","-----------------------------------------");
-       emitcode(";"," function %s",(sym = OP_SYMBOL(IC_LEFT(ic)))->name);
-       emitcode(";","-----------------------------------------");
-
-       emitcode("","%s:",sym->rname);
-       fetype = getSpec(operandType(IC_LEFT(ic)));
-
-       /* if critical function then turn interrupts off */
-       if (SPEC_CRTCL(fetype))
-               emitcode("cli","");
-
-       if (IS_ISR(sym->etype)) {
-       }
-
-       /* save the preserved registers that are used in this function */
-       for (i = R2_IDX ; i <= R15_IDX ; i++ ) {
-               if (bitVectBitValue(sym->regsUsed,i)) {
-                       _G.nRegsSaved++;
-                       emitcode("push","%s",avr_regWithIdx(i)->name);
-               }
-       }
-       /* now for the pointer registers */
-       if (bitVectBitValue(sym->regsUsed,R26_IDX)) {
-               _G.nRegsSaved++;
-               emitcode("push","r26");
-       }
-       if (bitVectBitValue(sym->regsUsed,R27_IDX)) {
-               _G.nRegsSaved++;
-               emitcode("push","r27");
-       }
-       if (bitVectBitValue(sym->regsUsed,R30_IDX)) {
-               _G.nRegsSaved++;
-               emitcode("push","r30");
-       }
-       if (bitVectBitValue(sym->regsUsed,R31_IDX)) {
-               _G.nRegsSaved++;
-               emitcode("push","r31");
-       }
-       /* adjust the stack for the function */
-       if (sym->stack) {
-               emitcode ("push","r28");
-               emitcode ("push","r29");
-               emitcode ("in","r28,__SP_L__");
-               emitcode ("in","r29,__SP_H__");
-               if (sym->stack <= 63) {
-                       emitcode("sbiw","r28,%d",sym->stack);
-               } else {
-                       emitcode ("subi","r28,lo8(%d)",sym->stack);
-                       emitcode ("sbci","r29,hi8(%d)",sym->stack);
-               }
-               emitcode("out","__SP_L__,r28");
-               emitcode("out","__SP_H__,r29");
-       }
+  symbol *sym;
+  sym_link *fetype;
+  int i = 0;
+
+  _G.nRegsSaved = 0;
+  /* create the function header */
+  emitcode(";","-----------------------------------------");
+  emitcode(";"," function %s",(sym = OP_SYMBOL(IC_LEFT(ic)))->name);
+  emitcode(";","-----------------------------------------");
+
+  emitcode("","%s:",sym->rname);
+  fetype = getSpec(operandType(IC_LEFT(ic)));
+
+  /* if critical function then turn interrupts off */
+  if (SPEC_CRTCL(fetype))
+    emitcode("cli","");
+
+  if (IS_ISR(sym->etype)) {
+  }
+
+  /* save the preserved registers that are used in this function */
+  for (i = R2_IDX ; i <= R15_IDX ; i++ ) {
+    if (bitVectBitValue(sym->regsUsed,i)) {
+      _G.nRegsSaved++;
+      emitcode("push","%s",avr_regWithIdx(i)->name);
+    }
+  }
+  /* now for the pointer registers */
+  if (bitVectBitValue(sym->regsUsed,R26_IDX)) {
+    _G.nRegsSaved++;
+    emitcode("push","r26");
+  }
+  if (bitVectBitValue(sym->regsUsed,R27_IDX)) {
+    _G.nRegsSaved++;
+    emitcode("push","r27");
+  }
+  if (bitVectBitValue(sym->regsUsed,R30_IDX)) {
+    _G.nRegsSaved++;
+    emitcode("push","r30");
+  }
+  if (bitVectBitValue(sym->regsUsed,R31_IDX)) {
+    _G.nRegsSaved++;
+    emitcode("push","r31");
+  }
+  /* adjust the stack for the function */
+  if (sym->stack) {
+    emitcode ("push","r28");
+    emitcode ("push","r29");
+    emitcode ("in","r28,__SP_L__");
+    emitcode ("in","r29,__SP_H__");
+    if (sym->stack <= 63) {
+      emitcode("sbiw","r28,%d",sym->stack);
+    } else {
+      emitcode ("subi","r28,lo8(%d)",sym->stack);
+      emitcode ("sbci","r29,hi8(%d)",sym->stack);
+    }
+    emitcode("out","__SP_L__,r28");
+    emitcode("out","__SP_H__,r29");
+  }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1539,56 +1539,56 @@ static void genFunction (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genEndFunction (iCode *ic)
 {
-       symbol *sym = OP_SYMBOL(IC_LEFT(ic));
-       int i;
-
-       /* restore stack pointer */
-       if (sym->stack) {
-               if (sym->stack <= 63) {
-                       emitcode("adiw","r28,%d",sym->stack);
-               } else {
-                       emitcode ("subi","r28,lo8(-%d)",sym->stack);
-                       emitcode ("sbci","r29,hi8(-%d)",sym->stack);
-               }
-               emitcode("out","__SP_L__,r28");
-               emitcode("out","__SP_H__,r29");
-
-               /* pop frame pointer */
-               emitcode ("pop","r29");
-               emitcode ("pop","r28");
-       }
-       /* restore preserved registers */
-       if (bitVectBitValue(sym->regsUsed,R31_IDX)) {
-               _G.nRegsSaved--;
-               emitcode("pop","r31");
-       }
-       if (bitVectBitValue(sym->regsUsed,R30_IDX)) {
-               _G.nRegsSaved--;
-               emitcode("pop","r30");
-       }
-       if (bitVectBitValue(sym->regsUsed,R27_IDX)) {
-               _G.nRegsSaved--;
-               emitcode("push","r27");
-       }
-       if (bitVectBitValue(sym->regsUsed,R26_IDX)) {
-               _G.nRegsSaved--;
-               emitcode("push","r26");
-       }
-       for (i = R15_IDX ; i >= R2_IDX ; i-- ) {
-               if (bitVectBitValue(sym->regsUsed,i)) {
-                       _G.nRegsSaved--;
-                       emitcode("pop","%s",avr_regWithIdx(i)->name);
-               }
-       }
-
-       if (SPEC_CRTCL(sym->etype))
-               emitcode("sti","");
-
-       if (IS_ISR(sym->etype)) {
-               emitcode("rti","");
-       } else {
-               emitcode("ret","");
-       }
+  symbol *sym = OP_SYMBOL(IC_LEFT(ic));
+  int i;
+
+  /* restore stack pointer */
+  if (sym->stack) {
+    if (sym->stack <= 63) {
+      emitcode("adiw","r28,%d",sym->stack);
+    } else {
+      emitcode ("subi","r28,lo8(-%d)",sym->stack);
+      emitcode ("sbci","r29,hi8(-%d)",sym->stack);
+    }
+    emitcode("out","__SP_L__,r28");
+    emitcode("out","__SP_H__,r29");
+
+    /* pop frame pointer */
+    emitcode ("pop","r29");
+    emitcode ("pop","r28");
+  }
+  /* restore preserved registers */
+  if (bitVectBitValue(sym->regsUsed,R31_IDX)) {
+    _G.nRegsSaved--;
+    emitcode("pop","r31");
+  }
+  if (bitVectBitValue(sym->regsUsed,R30_IDX)) {
+    _G.nRegsSaved--;
+    emitcode("pop","r30");
+  }
+  if (bitVectBitValue(sym->regsUsed,R27_IDX)) {
+    _G.nRegsSaved--;
+    emitcode("push","r27");
+  }
+  if (bitVectBitValue(sym->regsUsed,R26_IDX)) {
+    _G.nRegsSaved--;
+    emitcode("push","r26");
+  }
+  for (i = R15_IDX ; i >= R2_IDX ; i-- ) {
+    if (bitVectBitValue(sym->regsUsed,i)) {
+      _G.nRegsSaved--;
+      emitcode("pop","%s",avr_regWithIdx(i)->name);
+    }
+  }
+
+  if (SPEC_CRTCL(sym->etype))
+    emitcode("sti","");
+
+  if (IS_ISR(sym->etype)) {
+    emitcode("rti","");
+  } else {
+    emitcode("ret","");
+  }
 
 }
 
@@ -1597,41 +1597,41 @@ static void genEndFunction (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genRet (iCode *ic)
 {
-       int size,offset = 0 ;
-    
-       /* if we have no return value then
-          just generate the "ret" */
-       if (!IC_LEFT(ic)) 
-               goto jumpret;       
-    
-       /* we have something to return then
-          move the return value into place */
-       aopOp(IC_LEFT(ic),ic,FALSE);
-       size = AOP_SIZE(IC_LEFT(ic));
-    
-       while (size--) {
-               if (AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) {
-                       emitcode("ldi","%s,%s(%d)",fAVRReturn[offset],larray[offset],
-                                (int)floatFromVal (AOP(IC_LEFT(ic))->aopu.aop_lit),offset);
-               } else {                
-                       char *l ;
-                       l = aopGet(AOP(IC_LEFT(ic)),offset);
-                       if (strcmp(fAVRReturn[offset],l))
-                               emitcode("mov","%s,%s",fAVRReturn[offset],l);
-               }
-               offset++;
-       }    
-
-       freeAsmop (IC_LEFT(ic),NULL,ic,TRUE);
-    
+  int size,offset = 0 ;
+
+  /* if we have no return value then
+     just generate the "ret" */
+  if (!IC_LEFT(ic))
+    goto jumpret;
+
+  /* we have something to return then
+     move the return value into place */
+  aopOp(IC_LEFT(ic),ic,FALSE);
+  size = AOP_SIZE(IC_LEFT(ic));
+
+  while (size--) {
+    if (AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) {
+      emitcode("ldi","%s,%s(%d)",fAVRReturn[offset],larray[offset],
+         (int)floatFromVal (AOP(IC_LEFT(ic))->aopu.aop_lit),offset);
+    } else {
+      char *l ;
+      l = aopGet(AOP(IC_LEFT(ic)),offset);
+      if (strcmp(fAVRReturn[offset],l))
+        emitcode("mov","%s,%s",fAVRReturn[offset],l);
+    }
+    offset++;
+  }
+
+  freeAsmop (IC_LEFT(ic),NULL,ic,TRUE);
+
  jumpret:
-       /* generate a jump to the return label
-          if the next is not the return statement */
-       if (!(ic->next && ic->next->op == LABEL &&
-             IC_LABEL(ic->next) == returnLabel))
-       
-               emitcode("rjmp","L%05d",returnLabel->key);
-    
+  /* generate a jump to the return label
+     if the next is not the return statement */
+  if (!(ic->next && ic->next->op == LABEL &&
+        IC_LABEL(ic->next) == returnLabel))
+
+    emitcode("rjmp","L%05d",returnLabel->key);
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -1639,11 +1639,11 @@ static void genRet (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genLabel (iCode *ic)
 {
-       /* special case never generate */
-       if (IC_LABEL(ic) == entryLabel)
-               return ;
+  /* special case never generate */
+  if (IC_LABEL(ic) == entryLabel)
+    return ;
 
-       emitcode("","L%05d:",IC_LABEL(ic)->key);
+  emitcode("","L%05d:",IC_LABEL(ic)->key);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1651,32 +1651,32 @@ static void genLabel (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genGoto (iCode *ic)
 {
-       emitcode ("rjmp","L%05d:",(IC_LABEL(ic)->key+100));
+  emitcode ("rjmp","L%05d:",(IC_LABEL(ic)->key+100));
 }
 
 /*-----------------------------------------------------------------*/
 /* findLabelBackwards: walks back through the iCode chain looking  */
-/* for the given label. Returns number of iCode instructions      */
-/* between that label and given ic.                               */
-/* Returns zero if label not found.                               */
+/* for the given label. Returns number of iCode instructions     */
+/* between that label and given ic.          */
+/* Returns zero if label not found.          */
 /*-----------------------------------------------------------------*/
 static int findLabelBackwards(iCode *ic, int key)
 {
-       int count = 0;
-    
-       while (ic->prev)
-               {
-                       ic = ic->prev;
-                       count++;
-        
-                       if (ic->op == LABEL && IC_LABEL(ic)->key == key)
-                               {
-                                       /* printf("findLabelBackwards = %d\n", count); */
-                                       return count;
-                               }
-               }
-    
-       return 0;
+  int count = 0;
+
+  while (ic->prev)
+    {
+      ic = ic->prev;
+      count++;
+
+      if (ic->op == LABEL && IC_LABEL(ic)->key == key)
+        {
+          /* printf("findLabelBackwards = %d\n", count); */
+          return count;
+        }
+    }
+
+  return 0;
 }
 
 /*-----------------------------------------------------------------*/
@@ -1684,90 +1684,90 @@ static int findLabelBackwards(iCode *ic, int key)
 /*-----------------------------------------------------------------*/
 static bool genPlusIncr (iCode *ic)
 {
-       unsigned int icount ;
-    
-       /* will try to generate an increment */
-       /* if the right side is not a literal 
-          we cannot */
-       if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
-               return FALSE ;
-    
-       icount = floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit);
-    
-       /* if the sizes are greater than 2 or they are not the same regs
-          then we cannot */
-       if (!sameRegs(AOP(IC_LEFT(ic)),AOP(IC_RESULT(ic))))
-               return FALSE ;
-    
-       /* so we know LEFT & RESULT in the same registers and add
-          amount <= 63 */
-       /* for short & char types */
-       if (AOP_SIZE(IC_RESULT(ic)) < 2) {
-               if (icount == 1) {
-                       emitcode("inc","%s",aopGet(AOP(IC_LEFT(ic)),0));
-                       return TRUE;
-               } 
-               emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_LEFT(ic)),0),-icount);
-               return TRUE;
-       }
-
-       if (AOP_SIZE(IC_RESULT(ic)) <= 3) {
-               /* if register pair and starts with 26/30 then adiw */
-               if (isRegPair(AOP(IC_RESULT(ic))) && icount > 0 && icount < 64 &&
-                   ( IS_REGIDX(AOP(IC_RESULT(ic)),R26_IDX) ||
-                     IS_REGIDX(AOP(IC_RESULT(ic)),R30_IDX) )) {
-                       emitcode("adiw","%s,%d",aopGet(AOP(IC_RESULT(ic)),0),icount);
-                       return TRUE;
-               }
-    
-               /* use subi */
-               emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_RESULT(ic)),0),-icount);
-               emitcode("sbci","%s,hi8(%d)",aopGet(AOP(IC_RESULT(ic)),1),-icount);
-               return TRUE;
-       }
-
-       /* for 32 bit longs */
-       emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_RESULT(ic)),0),-icount);
-       emitcode("sbci","%s,hi8(%d)",aopGet(AOP(IC_RESULT(ic)),1),-icount);
-       emitcode("sbci","%s,hlo8(%d)",aopGet(AOP(IC_RESULT(ic)),2),-icount);
-       emitcode("sbci","%s,hhi8(%d)",aopGet(AOP(IC_RESULT(ic)),3),-icount);
-       return TRUE;
-   
+  unsigned int icount ;
+
+  /* will try to generate an increment */
+  /* if the right side is not a literal
+     we cannot */
+  if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
+    return FALSE ;
+
+  icount = (unsigned int) floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit);
+
+  /* if the sizes are greater than 2 or they are not the same regs
+     then we cannot */
+  if (!sameRegs(AOP(IC_LEFT(ic)),AOP(IC_RESULT(ic))))
+    return FALSE ;
+
+  /* so we know LEFT & RESULT in the same registers and add
+     amount <= 63 */
+  /* for short & char types */
+  if (AOP_SIZE(IC_RESULT(ic)) < 2) {
+    if (icount == 1) {
+      emitcode("inc","%s",aopGet(AOP(IC_LEFT(ic)),0));
+      return TRUE;
+    }
+    emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_LEFT(ic)),0),-icount);
+    return TRUE;
+  }
+
+  if (AOP_SIZE(IC_RESULT(ic)) <= 3) {
+    /* if register pair and starts with 26/30 then adiw */
+    if (isRegPair(AOP(IC_RESULT(ic))) && icount > 0 && icount < 64 &&
+        ( IS_REGIDX(AOP(IC_RESULT(ic)),R26_IDX) ||
+          IS_REGIDX(AOP(IC_RESULT(ic)),R30_IDX) )) {
+      emitcode("adiw","%s,%d",aopGet(AOP(IC_RESULT(ic)),0),icount);
+      return TRUE;
+    }
+
+    /* use subi */
+    emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_RESULT(ic)),0),-icount);
+    emitcode("sbci","%s,hi8(%d)",aopGet(AOP(IC_RESULT(ic)),1),-icount);
+    return TRUE;
+  }
+
+  /* for 32 bit longs */
+  emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_RESULT(ic)),0),-icount);
+  emitcode("sbci","%s,hi8(%d)",aopGet(AOP(IC_RESULT(ic)),1),-icount);
+  emitcode("sbci","%s,hlo8(%d)",aopGet(AOP(IC_RESULT(ic)),2),-icount);
+  emitcode("sbci","%s,hhi8(%d)",aopGet(AOP(IC_RESULT(ic)),3),-icount);
+  return TRUE;
+
 }
 
 /* This is the pure and virtuous version of this code.
- * I'm pretty certain it's right, but not enough to toss the old 
+ * I'm pretty certain it's right, but not enough to toss the old
  * code just yet...
  */
 static void adjustArithmeticResult  (iCode *ic)
 {
-       if (opIsGptr(IC_RESULT(ic)) &&
-           opIsGptr(IC_LEFT(ic))   &&
-           !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
-               {
-                       aopPut(AOP(IC_RESULT(ic)),
-                              aopGet(AOP(IC_LEFT(ic)), GPTRSIZE - 1),
-                              GPTRSIZE - 1);
-               }
-
-       if (opIsGptr(IC_RESULT(ic)) &&
-           opIsGptr(IC_RIGHT(ic))   &&
-           !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
-               {
-                       aopPut(AOP(IC_RESULT(ic)),
-                              aopGet(AOP(IC_RIGHT(ic)),GPTRSIZE - 1),
-                              GPTRSIZE - 1);
-               }
-
-       if (opIsGptr(IC_RESULT(ic))        &&
-           AOP_SIZE(IC_LEFT(ic)) < GPTRSIZE   &&
-           AOP_SIZE(IC_RIGHT(ic)) < GPTRSIZE  &&
-           !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
-           !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
-               char buffer[5];
-               sprintf(buffer,"%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
-               aopPut(AOP(IC_RESULT(ic)),buffer,GPTRSIZE - 1);
-       }
+  if (opIsGptr(IC_RESULT(ic)) &&
+      opIsGptr(IC_LEFT(ic))   &&
+      !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
+    {
+      aopPut(AOP(IC_RESULT(ic)),
+             aopGet(AOP(IC_LEFT(ic)), GPTRSIZE - 1),
+             GPTRSIZE - 1);
+    }
+
+  if (opIsGptr(IC_RESULT(ic)) &&
+      opIsGptr(IC_RIGHT(ic))   &&
+      !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
+    {
+      aopPut(AOP(IC_RESULT(ic)),
+             aopGet(AOP(IC_RIGHT(ic)),GPTRSIZE - 1),
+             GPTRSIZE - 1);
+    }
+
+  if (opIsGptr(IC_RESULT(ic))      &&
+      AOP_SIZE(IC_LEFT(ic)) < GPTRSIZE   &&
+      AOP_SIZE(IC_RIGHT(ic)) < GPTRSIZE  &&
+      !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
+      !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
+    char buffer[5];
+    sprintf(buffer,"%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
+    aopPut(AOP(IC_RESULT(ic)),buffer,GPTRSIZE - 1);
+  }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1775,52 +1775,52 @@ static void adjustArithmeticResult  (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genPlus (iCode *ic)
 {
-       int size, offset = 0;
-       int samer;
-       char *l;
+  int size, offset = 0;
+  int samer;
+  char *l;
 
-       /* special cases :- */
+  /* special cases :- */
 
-       aopOp (IC_LEFT(ic),ic,FALSE);
-       aopOp (IC_RIGHT(ic),ic,FALSE);
-       aopOp (IC_RESULT(ic),ic,TRUE);
+  aopOp (IC_LEFT(ic),ic,FALSE);
+  aopOp (IC_RIGHT(ic),ic,FALSE);
+  aopOp (IC_RESULT(ic),ic,TRUE);
 
-       /* if I can do an increment instead
-          of add then GOOD for ME */
-       if (genPlusIncr (ic) == TRUE)
-               goto release;   
+  /* if I can do an increment instead
+     of add then GOOD for ME */
+  if (genPlusIncr (ic) == TRUE)
+    goto release;
 
-       size = getDataSize(IC_RESULT(ic));
-       samer = sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic)));
+  size = getDataSize(IC_RESULT(ic));
+  samer = sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic)));
 
-       while(size--) {
-               if (!samer) 
-                       aopPut(AOP(IC_RESULT(ic)),aopGet(AOP(IC_LEFT(ic)),offset),offset);
+  while(size--) {
+    if (!samer)
+      aopPut(AOP(IC_RESULT(ic)),aopGet(AOP(IC_LEFT(ic)),offset),offset);
 
-               if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT) {
+    if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT) {
 
-                       if(offset == 0) l = "add";
-                       else l = "adc";
+      if(offset == 0) l = "add";
+      else l = "adc";
 
-                       emitcode(l,"%s,%s",aopGet(AOP(IC_RESULT(ic)),offset),
-                                aopGet(AOP(IC_RIGHT(ic)),offset));
-               } else {
-                       if (offset == 0) l = "subi";
-                       else l = "sbci";
+      emitcode(l,"%s,%s",aopGet(AOP(IC_RESULT(ic)),offset),
+         aopGet(AOP(IC_RIGHT(ic)),offset));
+    } else {
+      if (offset == 0) l = "subi";
+      else l = "sbci";
 
-                       emitcode(l,"%s,%s(-%d)",aopGet(AOP(IC_RESULT(ic)),offset),
-                                larray[offset],
-                                (int)floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit));
-               }
-               offset++;
-       }
+      emitcode(l,"%s,%s(-%d)",aopGet(AOP(IC_RESULT(ic)),offset),
+         larray[offset],
+         (int)floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit));
+    }
+    offset++;
+  }
 
-       adjustArithmeticResult(ic);
+  adjustArithmeticResult(ic);
 
  release:
-       freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(IC_RIGHT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
+  freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(IC_RIGHT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1828,53 +1828,53 @@ static void genPlus (iCode *ic)
 /*-----------------------------------------------------------------*/
 static bool genMinusDec (iCode *ic)
 {
-       unsigned int icount ;
-    
-       /* will try to generate an increment */
-       /* if the right side is not a literal 
-          we cannot */
-       if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
-               return FALSE ;
-    
-       icount = floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit);
-    
-       /* if the sizes are greater than 2 or they are not the same regs
-          then we cannot */
-       if (!sameRegs(AOP(IC_LEFT(ic)),AOP(IC_RIGHT(ic))))
-               return FALSE ;
-    
-       /* so we know LEFT & RESULT in the same registers and add
-          amount <= 63 */
-       /* for short & char types */
-       if (AOP_SIZE(IC_RESULT(ic)) < 2) {
-               if (icount == 1) {
-                       emitcode("dec","%s",aopGet(AOP(IC_LEFT(ic)),0));
-                       return TRUE;
-               } 
-               emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_LEFT(ic)),0),icount);
-               return TRUE;
-       }
-
-       if (AOP_SIZE(IC_RESULT(ic)) <= 3) {
-               /* if register pair and starts with 26/30 then adiw */
-               if (isRegPair(AOP(IC_RESULT(ic))) && icount > 0 && icount < 64 &&
-                   ( IS_REGIDX(AOP(IC_RESULT(ic)),R26_IDX) ||
-                     IS_REGIDX(AOP(IC_RESULT(ic)),R30_IDX) )) {
-                       emitcode("sbiw","%s,%d",aopGet(AOP(IC_RESULT(ic)),0),icount);
-                       return TRUE;
-               }
-    
-               /* use subi */
-               emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_RESULT(ic)),0),icount);
-               emitcode("sbci","%s,hi8(%d)",aopGet(AOP(IC_RESULT(ic)),1),icount);
-               return TRUE;
-       }
-       /* for 32 bit longs */
-       emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_RESULT(ic)),0),icount);
-       emitcode("sbci","%s,hi8(%d)",aopGet(AOP(IC_RESULT(ic)),1),icount);
-       emitcode("sbci","%s,hlo8(%d)",aopGet(AOP(IC_RESULT(ic)),2),icount);
-       emitcode("sbci","%s,hhi8(%d)",aopGet(AOP(IC_RESULT(ic)),3),icount);
-       return TRUE;
+  unsigned int icount ;
+
+  /* will try to generate an increment */
+  /* if the right side is not a literal
+     we cannot */
+  if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
+    return FALSE ;
+
+  icount = (unsigned int) floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit);
+
+  /* if the sizes are greater than 2 or they are not the same regs
+     then we cannot */
+  if (!sameRegs(AOP(IC_LEFT(ic)),AOP(IC_RIGHT(ic))))
+    return FALSE ;
+
+  /* so we know LEFT & RESULT in the same registers and add
+     amount <= 63 */
+  /* for short & char types */
+  if (AOP_SIZE(IC_RESULT(ic)) < 2) {
+    if (icount == 1) {
+      emitcode("dec","%s",aopGet(AOP(IC_LEFT(ic)),0));
+      return TRUE;
+    }
+    emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_LEFT(ic)),0),icount);
+    return TRUE;
+  }
+
+  if (AOP_SIZE(IC_RESULT(ic)) <= 3) {
+    /* if register pair and starts with 26/30 then adiw */
+    if (isRegPair(AOP(IC_RESULT(ic))) && icount > 0 && icount < 64 &&
+        ( IS_REGIDX(AOP(IC_RESULT(ic)),R26_IDX) ||
+          IS_REGIDX(AOP(IC_RESULT(ic)),R30_IDX) )) {
+      emitcode("sbiw","%s,%d",aopGet(AOP(IC_RESULT(ic)),0),icount);
+      return TRUE;
+    }
+
+    /* use subi */
+    emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_RESULT(ic)),0),icount);
+    emitcode("sbci","%s,hi8(%d)",aopGet(AOP(IC_RESULT(ic)),1),icount);
+    return TRUE;
+  }
+  /* for 32 bit longs */
+  emitcode("subi","%s,lo8(%d)",aopGet(AOP(IC_RESULT(ic)),0),icount);
+  emitcode("sbci","%s,hi8(%d)",aopGet(AOP(IC_RESULT(ic)),1),icount);
+  emitcode("sbci","%s,hlo8(%d)",aopGet(AOP(IC_RESULT(ic)),2),icount);
+  emitcode("sbci","%s,hhi8(%d)",aopGet(AOP(IC_RESULT(ic)),3),icount);
+  return TRUE;
 
 }
 
@@ -1883,17 +1883,17 @@ static bool genMinusDec (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void addSign(operand *result, int offset, int sign)
 {
-       int size = (getDataSize(result) - offset);
-       if(size > 0){
-               if(sign){
-                       emitcode("rlc","a");
-                       emitcode("subb","a,acc");
-                       while(size--)
-                               aopPut(AOP(result),"a",offset++); 
-               } else
-                       while(size--)
-                               aopPut(AOP(result),zero,offset++);
-       }
+  int size = (getDataSize(result) - offset);
+  if(size > 0){
+    if(sign){
+      emitcode("rlc","a");
+      emitcode("subb","a,acc");
+      while(size--)
+        aopPut(AOP(result),"a",offset++);
+    } else
+      while(size--)
+        aopPut(AOP(result),zero,offset++);
+  }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1901,48 +1901,48 @@ static void addSign(operand *result, int offset, int sign)
 /*-----------------------------------------------------------------*/
 static void genMinus (iCode *ic)
 {
-       int size, offset = 0, samer;
-       char *l;
-
-       aopOp (IC_LEFT(ic),ic,FALSE);
-       aopOp (IC_RIGHT(ic),ic,FALSE);
-       aopOp (IC_RESULT(ic),ic,TRUE);
-    
-       /* if I can do an decrement instead
-          of subtract then GOOD for ME */
-       if (genMinusDec (ic) == TRUE)
-               goto release;   
-    
-       size = getDataSize(IC_RESULT(ic));   
-       samer = sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic)));
-       while (size--) {
-               if (!samer) 
-                       aopPut(AOP(IC_RESULT(ic)),aopGet(AOP(IC_LEFT(ic)),offset),offset);
-
-               if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT) {
-
-                       if(offset == 0) l = "sub";
-                       else l = "sbc";
-
-                       emitcode(l,"%s,%s",aopGet(AOP(IC_RESULT(ic)),offset),
-                                aopGet(AOP(IC_RIGHT(ic)),offset));
-               } else {
-                       if (offset == 0) l = "subi";
-                       else l = "sbci";
-
-                       emitcode(l,"%s,%s(%d)",aopGet(AOP(IC_RESULT(ic)),offset),
-                                larray[offset],
-                                (int)floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit));
-               }
-               offset++;
-       }
-
-       adjustArithmeticResult(ic);
-    
+  int size, offset = 0, samer;
+  char *l;
+
+  aopOp (IC_LEFT(ic),ic,FALSE);
+  aopOp (IC_RIGHT(ic),ic,FALSE);
+  aopOp (IC_RESULT(ic),ic,TRUE);
+
+  /* if I can do an decrement instead
+     of subtract then GOOD for ME */
+  if (genMinusDec (ic) == TRUE)
+    goto release;
+
+  size = getDataSize(IC_RESULT(ic));
+  samer = sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic)));
+  while (size--) {
+    if (!samer)
+      aopPut(AOP(IC_RESULT(ic)),aopGet(AOP(IC_LEFT(ic)),offset),offset);
+
+    if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT) {
+
+      if(offset == 0) l = "sub";
+      else l = "sbc";
+
+      emitcode(l,"%s,%s",aopGet(AOP(IC_RESULT(ic)),offset),
+         aopGet(AOP(IC_RIGHT(ic)),offset));
+    } else {
+      if (offset == 0) l = "subi";
+      else l = "sbci";
+
+      emitcode(l,"%s,%s(%d)",aopGet(AOP(IC_RESULT(ic)),offset),
+         larray[offset],
+         (int)floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit));
+    }
+    offset++;
+  }
+
+  adjustArithmeticResult(ic);
+
  release:
-       freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(IC_RIGHT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
+  freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(IC_RIGHT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1952,47 +1952,47 @@ static void genMultOneByte (operand *left,
                             operand *right,
                             operand *result)
 {
-       sym_link *opetype = operandType(result);
-       symbol *lbl ;
-       int size,offset;
-    
-       /* (if two literals, the value is computed before) */
-       /* if one literal, literal on the right */
-       if (AOP_TYPE(left) == AOP_LIT){
-               operand *t = right;
-               right = left;
-               left = t;
-       }
-    
-       size = AOP_SIZE(result);
-
-       if (SPEC_USIGN(opetype)) {
-               emitcode("mul","%s,%s", aopGet(AOP(left),0),aopGet(AOP(right),0));
-       } else {
-               emitcode("muls","%s,%s", aopGet(AOP(left),0),
-                        aopGet(AOP(right),0));
-       }
-       aopPut(AOP(result),"r0",0);
-       if (size > 1){
-               aopPut(AOP(result),"r1",1);
-               offset = 2;
-               size -= 2;
-               if (SPEC_USIGN(opetype)) {
-                       while(size--) {
-                               aopPut(AOP(result),zero,offset++);
-                       }
-               } else {
-                       if (size) {
-                               lbl = newiTempLabel(NULL);
-                               emitcode("ldi","r24,0");
-                               emitcode("brcc","L%05d",lbl->key);
-                               emitcode("ldi","r24,lo8(-1)");
-                               emitcode("","L%05d:",lbl->key);
-                               while (size--) aopPut(AOP(result),"r24",offset++);
-                       }
-               }
-       }
-       return;
+  sym_link *opetype = operandType(result);
+  symbol *lbl ;
+  int size,offset;
+
+  /* (if two literals, the value is computed before) */
+  /* if one literal, literal on the right */
+  if (AOP_TYPE(left) == AOP_LIT){
+    operand *t = right;
+    right = left;
+    left = t;
+  }
+
+  size = AOP_SIZE(result);
+
+  if (SPEC_USIGN(opetype)) {
+    emitcode("mul","%s,%s", aopGet(AOP(left),0),aopGet(AOP(right),0));
+  } else {
+    emitcode("muls","%s,%s", aopGet(AOP(left),0),
+       aopGet(AOP(right),0));
+  }
+  aopPut(AOP(result),"r0",0);
+  if (size > 1){
+    aopPut(AOP(result),"r1",1);
+    offset = 2;
+    size -= 2;
+    if (SPEC_USIGN(opetype)) {
+      while(size--) {
+        aopPut(AOP(result),zero,offset++);
+      }
+    } else {
+      if (size) {
+        lbl = newiTempLabel(NULL);
+        emitcode("ldi","r24,0");
+        emitcode("brcc","L%05d",lbl->key);
+        emitcode("ldi","r24,lo8(-1)");
+        emitcode("","L%05d:",lbl->key);
+        while (size--) aopPut(AOP(result),"r24",offset++);
+      }
+    }
+  }
+  return;
 }
 
 /*-----------------------------------------------------------------*/
@@ -2000,29 +2000,29 @@ static void genMultOneByte (operand *left,
 /*-----------------------------------------------------------------*/
 static void genMult (iCode *ic)
 {
-       operand *left = IC_LEFT(ic);
-       operand *right = IC_RIGHT(ic);
-       operand *result= IC_RESULT(ic);   
-
-       /* assign the amsops */
-       aopOp (left,ic,FALSE);
-       aopOp (right,ic,FALSE);
-       aopOp (result,ic,TRUE);
-
-       /* if both are of size == 1 */
-       if (AOP_SIZE(left) == 1 &&
-           AOP_SIZE(right) == 1 ) {
-               genMultOneByte(left,right,result);
-               goto release ;
-       }
-
-       /* should have been converted to function call */       
-       assert(1) ;
-
-       release :
-               freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(result,NULL,ic,TRUE); 
+  operand *left = IC_LEFT(ic);
+  operand *right = IC_RIGHT(ic);
+  operand *result= IC_RESULT(ic);
+
+  /* assign the amsops */
+  aopOp (left,ic,FALSE);
+  aopOp (right,ic,FALSE);
+  aopOp (result,ic,TRUE);
+
+  /* if both are of size == 1 */
+  if (AOP_SIZE(left) == 1 &&
+      AOP_SIZE(right) == 1 ) {
+    genMultOneByte(left,right,result);
+    goto release ;
+  }
+
+  /* should have been converted to function call */
+  assert(1) ;
+
+  release :
+    freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2030,8 +2030,8 @@ static void genMult (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genDiv (iCode *ic)
 {
-       /* should have been converted to function call */
-       assert(1);
+  /* should have been converted to function call */
+  assert(1);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2039,16 +2039,16 @@ static void genDiv (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genMod (iCode *ic)
 {
-       /* should have been converted to function call */
-       assert(1);
+  /* should have been converted to function call */
+  assert(1);
 
 }
 
 enum {
-       AVR_EQ = 0,
-       AVR_NE,
-       AVR_LT,
-       AVR_GE
+  AVR_EQ = 0,
+  AVR_NE,
+  AVR_LT,
+  AVR_GE
 };
 
 /*-----------------------------------------------------------------*/
@@ -2056,17 +2056,17 @@ enum {
 /*-----------------------------------------------------------------*/
 static int revavrcnd(int type)
 {
-       static struct {
-               int type, rtype;
-       } rar[] = { { AVR_EQ, AVR_NE}, {AVR_LT, AVR_GE}};
-       int i;
-
-       for (i = 0 ; i < (sizeof(rar)/sizeof(rar[0]));i++) {
-               if (rar[i].type == type) return rar[i].rtype;
-               if (rar[i].rtype== type) return rar[i].type;
-       }
-       assert(1); /* cannot happen */
-       return 0;  /* makes the compiler happy */
+  static struct {
+    int type, rtype;
+  } rar[] = { { AVR_EQ, AVR_NE}, {AVR_LT, AVR_GE}};
+  int i;
+
+  for (i = 0 ; i < (sizeof(rar)/sizeof(rar[0]));i++) {
+    if (rar[i].type == type) return rar[i].rtype;
+    if (rar[i].rtype== type) return rar[i].type;
+  }
+  assert(1); /* cannot happen */
+  return 0;  /* makes the compiler happy */
 }
 
 static char *br_name[4] = {"breq","brne","brlt","brge"};
@@ -2077,17 +2077,17 @@ static char *br_uname[4]= {"breq","brne","brlo","brcc"};
 /*-----------------------------------------------------------------*/
 static void genBranch (iCode *ifx, int br_type, int sign)
 {
-       int tj = (IC_TRUE(ifx) ? 1 : 0) ;
-
-       if (tj) { /* if true jump */
-               char *nm = (sign ? br_name[br_type] : br_uname[br_type]);
-               emitcode(nm,"L%05d",IC_TRUE(ifx)->key);
-       } else { /* if false jump */
-               int rtype = revavrcnd(br_type);
-               char *nm = (sign ? br_name[rtype] : br_uname[rtype]);
-               emitcode(nm,"L%05d",IC_FALSE(ifx)->key);
-       }
-       ifx->generated = 1;
+  int tj = (IC_TRUE(ifx) ? 1 : 0) ;
+
+  if (tj) { /* if true jump */
+    char *nm = (sign ? br_name[br_type] : br_uname[br_type]);
+    emitcode(nm,"L%05d",IC_TRUE(ifx)->key);
+  } else { /* if false jump */
+    int rtype = revavrcnd(br_type);
+    char *nm = (sign ? br_name[rtype] : br_uname[rtype]);
+    emitcode(nm,"L%05d",IC_FALSE(ifx)->key);
+  }
+  ifx->generated = 1;
 }
 
 /*-----------------------------------------------------------------*/
@@ -2095,69 +2095,69 @@ static void genBranch (iCode *ifx, int br_type, int sign)
 /*-----------------------------------------------------------------*/
 static void genCmp (iCode *ic, iCode *ifx, int br_type)
 {
-       operand *left, *right, *result;
-       sym_link *letype , *retype;
-       symbol *lbl;
-       int sign, size, offset =0;
-
-       left = IC_LEFT(ic);
-       right= IC_RIGHT(ic);
-       result = IC_RESULT(ic);
-
-       letype = getSpec(operandType(left));
-       retype =getSpec(operandType(right));
-       sign =  !(SPEC_USIGN(letype) | SPEC_USIGN(retype));
-
-       /* assign the amsops */
-       aopOp (left,ic,FALSE);
-       aopOp (right,ic,FALSE);
-       aopOp (result,ic,TRUE);
-       size = AOP_SIZE(left);
-
-       if (ifx) {
-               if (size == 1) {
-                       if (AOP_TYPE(right) == AOP_LIT) {
-                               emitcode("cpi","%s,lo8(%d)",aopGet(AOP(left),0),
-                                        (int) floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit));
-                               genBranch(ifx,br_type,sign);
-                       } else { /* right != literal */
-                               emitcode("cp","%s,%s",aopGet(AOP(left),0),aopGet(AOP(right),0));
-                               genBranch(ifx,br_type,sign);
-                       }
-               } else { /* size != 1 */
-                       while (size--) {
-                               if (offset == 0) 
-                                       emitcode("cp","%s,%s",aopGet(AOP(left),0),aopGet(AOP(right),0));
-                               else
-                                       emitcode("cpc","%s,%s",aopGet(AOP(left),offset),aopGet(AOP(right),offset));
-                               offset++;
-                       }
-                       genBranch(ifx,br_type,sign);
-               }
-       } else { /* no ifx */
-               emitcode("clr","r0");
-               while (size--) {
-                       if (offset == 0) 
-                               emitcode("cp","%s,%s",aopGet(AOP(left),0),aopGet(AOP(right),0));
-                       else
-                               emitcode("cpc","%s,%s",aopGet(AOP(left),offset),aopGet(AOP(right),offset));
-                       offset++;
-               }
-               lbl = newiTempLabel(NULL);
-               br_type = revavrcnd(br_type);
-               if (sign) emitcode(br_uname[br_type],"L%05d",lbl->key);
-               else emitcode(br_name[br_type],"L%05d",lbl->key);
-               emitcode("inc","r0");
-               emitcode("","L%05d:",lbl->key);
-               aopPut(AOP(result),"r0",0);
-               size = AOP_SIZE(result) - 1;
-               offset = 1;
-               while (size--) aopPut(AOP(result),zero,offset++);
-       }
-
-       freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(result,NULL,ic,TRUE); 
+  operand *left, *right, *result;
+  sym_link *letype , *retype;
+  symbol *lbl;
+  int sign, size, offset =0;
+
+  left = IC_LEFT(ic);
+  right= IC_RIGHT(ic);
+  result = IC_RESULT(ic);
+
+  letype = getSpec(operandType(left));
+  retype =getSpec(operandType(right));
+  sign =  !(SPEC_USIGN(letype) | SPEC_USIGN(retype));
+
+  /* assign the amsops */
+  aopOp (left,ic,FALSE);
+  aopOp (right,ic,FALSE);
+  aopOp (result,ic,TRUE);
+  size = AOP_SIZE(left);
+
+  if (ifx) {
+    if (size == 1) {
+      if (AOP_TYPE(right) == AOP_LIT) {
+        emitcode("cpi","%s,lo8(%d)",aopGet(AOP(left),0),
+           (int) floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit));
+        genBranch(ifx,br_type,sign);
+      } else { /* right != literal */
+        emitcode("cp","%s,%s",aopGet(AOP(left),0),aopGet(AOP(right),0));
+        genBranch(ifx,br_type,sign);
+      }
+    } else { /* size != 1 */
+      while (size--) {
+        if (offset == 0)
+          emitcode("cp","%s,%s",aopGet(AOP(left),0),aopGet(AOP(right),0));
+        else
+          emitcode("cpc","%s,%s",aopGet(AOP(left),offset),aopGet(AOP(right),offset));
+        offset++;
+      }
+      genBranch(ifx,br_type,sign);
+    }
+  } else { /* no ifx */
+    emitcode("clr","r0");
+    while (size--) {
+      if (offset == 0)
+        emitcode("cp","%s,%s",aopGet(AOP(left),0),aopGet(AOP(right),0));
+      else
+        emitcode("cpc","%s,%s",aopGet(AOP(left),offset),aopGet(AOP(right),offset));
+      offset++;
+    }
+    lbl = newiTempLabel(NULL);
+    br_type = revavrcnd(br_type);
+    if (sign) emitcode(br_uname[br_type],"L%05d",lbl->key);
+    else emitcode(br_name[br_type],"L%05d",lbl->key);
+    emitcode("inc","r0");
+    emitcode("","L%05d:",lbl->key);
+    aopPut(AOP(result),"r0",0);
+    size = AOP_SIZE(result) - 1;
+    offset = 1;
+    while (size--) aopPut(AOP(result),zero,offset++);
+  }
+
+  freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2165,8 +2165,8 @@ static void genCmp (iCode *ic, iCode *ifx, int br_type)
 /*-----------------------------------------------------------------*/
 static void genCmpGt (iCode *ic, iCode *ifx)
 {
-       /* should have transformed by the parser */
-       assert(1);
+  /* should have transformed by the parser */
+  assert(1);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2174,7 +2174,7 @@ static void genCmpGt (iCode *ic, iCode *ifx)
 /*-----------------------------------------------------------------*/
 static void genCmpLt (iCode *ic, iCode *ifx)
 {
-       genCmp(ic,ifx,AVR_LT);
+  genCmp(ic,ifx,AVR_LT);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2182,7 +2182,7 @@ static void genCmpLt (iCode *ic, iCode *ifx)
 /*-----------------------------------------------------------------*/
 static void genCmpEq (iCode *ic, iCode *ifx)
 {
-       genCmp(ic,ifx,AVR_EQ);
+  genCmp(ic,ifx,AVR_EQ);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2190,7 +2190,7 @@ static void genCmpEq (iCode *ic, iCode *ifx)
 /*-----------------------------------------------------------------*/
 static void genCmpNe (iCode *ic, iCode *ifx)
 {
-       genCmp(ic,ifx,AVR_NE);
+  genCmp(ic,ifx,AVR_NE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2198,7 +2198,7 @@ static void genCmpNe (iCode *ic, iCode *ifx)
 /*-----------------------------------------------------------------*/
 static void genCmpGe (iCode *ic, iCode *ifx)
 {
-       genCmp(ic,ifx,AVR_GE);
+  genCmp(ic,ifx,AVR_GE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2206,12 +2206,12 @@ static void genCmpGe (iCode *ic, iCode *ifx)
 /*-----------------------------------------------------------------*/
 static void genCmpLe (iCode *ic, iCode *ifx)
 {
-       operand *left = IC_LEFT(ic);
-       operand *right= IC_RIGHT(ic);
-    
-       IC_RIGHT(ic) = left;
-       IC_LEFT(ic)  = right;
-       genCmp(ic,ifx,AVR_GE);
+  operand *left = IC_LEFT(ic);
+  operand *right= IC_RIGHT(ic);
+
+  IC_RIGHT(ic) = left;
+  IC_LEFT(ic)  = right;
+  genCmp(ic,ifx,AVR_GE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2219,53 +2219,53 @@ static void genCmpLe (iCode *ic, iCode *ifx)
 /*-----------------------------------------------------------------*/
 static iCode *ifxForOp ( operand *op, iCode *ic )
 {
-       /* if true symbol then needs to be assigned */
-       if (IS_TRUE_SYMOP(op))
-               return NULL ;
+  /* if true symbol then needs to be assigned */
+  if (IS_TRUE_SYMOP(op))
+    return NULL ;
 
     /* if this has register type condition and
     the next instruction is ifx with the same operand
     and live to of the operand is upto the ifx only then */
-       if (ic->next &&
-           ic->next->op == IFX &&
-           IC_COND(ic->next)->key == op->key &&
-           OP_SYMBOL(op)->liveTo <= ic->next->seq )
-               return ic->next;
+  if (ic->next &&
+      ic->next->op == IFX &&
+      IC_COND(ic->next)->key == op->key &&
+      OP_SYMBOL(op)->liveTo <= ic->next->seq )
+    return ic->next;
 
-       return NULL;
+  return NULL;
 }
 /*-----------------------------------------------------------------*/
 /* genAndOp - for && operation                                     */
 /*-----------------------------------------------------------------*/
 static void genAndOp (iCode *ic)
 {
-       operand *left,*right, *result;
-       symbol *tlbl;
-       int size , offset;
-
-       /* note here that && operations that are in an
-          if statement are taken away by backPatchLabels
-          only those used in arthmetic operations remain */
-       aopOp((left=IC_LEFT(ic)),ic,FALSE);
-       aopOp((right=IC_RIGHT(ic)),ic,FALSE);
-       aopOp((result=IC_RESULT(ic)),ic,FALSE);
-
-       tlbl = newiTempLabel(NULL);
-       toBoolean(left,"r0",TRUE);    
-       toBoolean(right,"r1",TRUE);
-       emitcode("and","r0,r1");
-       emitcode("ldi","r24,1");
-       emitcode("breq","L%05d",tlbl->key);
-       emitcode("dec","r24");
-       emitcode("","L%05d:",tlbl->key);
-       aopPut(AOP(result),"r24",0);
-       size = AOP_SIZE(result) -1;
-       offset = 1;
-       while (size--) aopPut(AOP(result),zero,offset++);
-    
-       freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(result,NULL,ic,TRUE);
+  operand *left,*right, *result;
+  symbol *tlbl;
+  int size , offset;
+
+  /* note here that && operations that are in an
+     if statement are taken away by backPatchLabels
+     only those used in arthmetic operations remain */
+  aopOp((left=IC_LEFT(ic)),ic,FALSE);
+  aopOp((right=IC_RIGHT(ic)),ic,FALSE);
+  aopOp((result=IC_RESULT(ic)),ic,FALSE);
+
+  tlbl = newiTempLabel(NULL);
+  toBoolean(left,"r0",TRUE);
+  toBoolean(right,"r1",TRUE);
+  emitcode("and","r0,r1");
+  emitcode("ldi","r24,1");
+  emitcode("breq","L%05d",tlbl->key);
+  emitcode("dec","r24");
+  emitcode("","L%05d:",tlbl->key);
+  aopPut(AOP(result),"r24",0);
+  size = AOP_SIZE(result) -1;
+  offset = 1;
+  while (size--) aopPut(AOP(result),zero,offset++);
+
+  freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 
@@ -2274,32 +2274,32 @@ static void genAndOp (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genOrOp (iCode *ic)
 {
-       operand *left,*right, *result;
-       symbol *tlbl;
-       int size , offset;
-
-       /* note here that || operations that are in an
-          if statement are taken away by backPatchLabels
-          only those used in arthmetic operations remain */
-       aopOp((left=IC_LEFT(ic)),ic,FALSE);
-       aopOp((right=IC_RIGHT(ic)),ic,FALSE);
-       aopOp((result=IC_RESULT(ic)),ic,FALSE);
-
-       tlbl = newiTempLabel(NULL);
-       toBoolean(left,"r0",TRUE);    
-       toBoolean(right,"r0",FALSE);
-       emitcode("ldi","r24,1");
-       emitcode("breq","L%05d",tlbl->key);
-       emitcode("dec","r24");
-       emitcode("","L%05d:",tlbl->key);
-       aopPut(AOP(result),"r24",0);
-       size = AOP_SIZE(result) -1;
-       offset = 1;
-       while (size--) aopPut(AOP(result),zero,offset++);
-
-       freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(result,NULL,ic,TRUE);            
+  operand *left,*right, *result;
+  symbol *tlbl;
+  int size , offset;
+
+  /* note here that || operations that are in an
+     if statement are taken away by backPatchLabels
+     only those used in arthmetic operations remain */
+  aopOp((left=IC_LEFT(ic)),ic,FALSE);
+  aopOp((right=IC_RIGHT(ic)),ic,FALSE);
+  aopOp((result=IC_RESULT(ic)),ic,FALSE);
+
+  tlbl = newiTempLabel(NULL);
+  toBoolean(left,"r0",TRUE);
+  toBoolean(right,"r0",FALSE);
+  emitcode("ldi","r24,1");
+  emitcode("breq","L%05d",tlbl->key);
+  emitcode("dec","r24");
+  emitcode("","L%05d:",tlbl->key);
+  aopPut(AOP(result),"r24",0);
+  size = AOP_SIZE(result) -1;
+  offset = 1;
+  while (size--) aopPut(AOP(result),zero,offset++);
+
+  freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2307,19 +2307,19 @@ static void genOrOp (iCode *ic)
 /*-----------------------------------------------------------------*/
 static int isLiteralBit(unsigned long lit)
 {
-       unsigned long pw[32] = {1L,2L,4L,8L,16L,32L,64L,128L,
-                               0x100L,0x200L,0x400L,0x800L,
-                               0x1000L,0x2000L,0x4000L,0x8000L,
-                               0x10000L,0x20000L,0x40000L,0x80000L,
-                               0x100000L,0x200000L,0x400000L,0x800000L,
-                               0x1000000L,0x2000000L,0x4000000L,0x8000000L,
-                               0x10000000L,0x20000000L,0x40000000L,0x80000000L};
-       int idx;
-    
-       for(idx = 0; idx < 32; idx++)
-               if(lit == pw[idx])
-                       return idx+1;
-       return 0;
+  unsigned long pw[32] = {1L,2L,4L,8L,16L,32L,64L,128L,
+        0x100L,0x200L,0x400L,0x800L,
+        0x1000L,0x2000L,0x4000L,0x8000L,
+        0x10000L,0x20000L,0x40000L,0x80000L,
+        0x100000L,0x200000L,0x400000L,0x800000L,
+        0x1000000L,0x2000000L,0x4000000L,0x8000000L,
+        0x10000000L,0x20000000L,0x40000000L,0x80000000L};
+  int idx;
+
+  for(idx = 0; idx < 32; idx++)
+    if(lit == pw[idx])
+      return idx+1;
+  return 0;
 }
 
 enum { AVR_AND = 0, AVR_OR, AVR_XOR };
@@ -2330,202 +2330,202 @@ static char *bopnames[] = {"and","or","eor"};
 /*-----------------------------------------------------------------*/
 static void genBitWise(iCode *ic, iCode *ifx, int bitop)
 {
-       operand *left, *right, *result;
-       int size, offset=0;
-       char *l;
-       symbol *lbl, *lbl1;
-       int samerl, samerr ;
-
-       aopOp((left = IC_LEFT(ic)),ic,FALSE);
-       aopOp((right= IC_RIGHT(ic)),ic,FALSE);
-       aopOp((result=IC_RESULT(ic)),ic,TRUE);
-    
-       size = AOP_SIZE(left);
-       offset = 0;
-       if (ifx) { /* used only for jumps */
-               if (AOP_TYPE(right) == AOP_LIT && 
-                   (bitop == AVR_AND || bitop == AVR_OR)) {
-                       int lit = (int) floatFromVal (AOP(right)->aopu.aop_lit);
-                       int p2 = powof2(lit);
-                       if (bitop == AVR_AND && p2) { /* right side is a power of 2 */
-                               l = aopGet(AOP(left),p2 / 8);
-                               if (IC_TRUE(ifx)) {
-                                       emitcode("sbrc","%s,%d",l,(p2 % 8));
-                                       emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
-                               } else {
-                                       emitcode("sbrs","%s,%d",l,(p2 % 8));
-                                       emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
-                               }
-                       } else { /* right not power of two */
-                               int eh = OP_SYMBOL(left)->liveTo <= ic->seq;
-                               if (size == 1) {
-                                       if (eh) {
-                                               emitcode(bopnames_lit[bitop],"%s,lo8(%d)",
-                                                        aopGet(AOP(IC_LEFT(ic)),0), lit);
-                                       } else {
-                                               MOVR0(aopGet(AOP(IC_LEFT(ic)),0));
-                                               emitcode(bopnames_lit[bitop],"r0,lo8(%d)",lit);
-                                       }
-                                       lbl = newiTempLabel(NULL);
-                                       if (IC_TRUE(ifx)) {
-                                               emitcode("breq","L%05d",lbl->key);
-                                               emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
-                                       } else {                                        
-                                               emitcode("brne","L%05d",lbl->key);
-                                               emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
-                                       }
-                                       emitcode("","L%05d:",lbl->key);
-                               } else if (size == 2) {
-                                       emitcode("mov","r24,%s",aopGet(AOP(IC_LEFT(ic)),0));
-                                       emitcode("mov","r25,%s",aopGet(AOP(IC_LEFT(ic)),1));
-                                       emitcode(bopnames_lit[bitop],"r24,lo8(%d)",lit);
-                                       emitcode(bopnames_lit[bitop],"r25,hi8(%d)",lit);
-                                       emitcode("sbiw","r24,0");
-                                       lbl = newiTempLabel(NULL);
-                                       if (IC_TRUE(ifx)) {
-                                               emitcode("breq","L%05d",lbl->key);
-                                               emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
-                                       } else {                                        
-                                               emitcode("brne","L%05d",lbl->key);
-                                               emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
-                                       }
-                                       emitcode("","L%05d:",lbl->key);                                 
-                               } else {                                        
-                                       lbl = newiTempLabel(NULL);
-                                       lbl1 = newiTempLabel(NULL);                                     
-                                       while (size--) {
-                                               if (eh) {
-                                                       emitcode(bopnames_lit[bitop],"%s,lo8(%d)",
-                                                        aopGet(AOP(IC_LEFT(ic)),offset), lit);
-                                               } else {
-                                                       MOVR0(aopGet(AOP(IC_LEFT(ic)),offset));
-                                                       emitcode("andi","r0,lo8(%d)",lit);
-                                               }
-                                               emitcode("brne","L%05d",lbl->key);
-                                               offset++;
-                                       }
-                                       /* all are zero */
-                                       if (IC_FALSE(ifx)) emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
-                                       else emitcode("rjmp","L%05d",lbl1->key);
-                                       emitcode("","L%05d:",lbl->key);
-                                       /* not zero */
-                                       if (IC_TRUE(ifx)) emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
-                                       emitcode("","L%05d:",lbl1->key);
-                                       
-                               }
-                       }
-               } else { /* right is not a literal */
-                       int eh = OP_SYMBOL(left)->liveTo <= ic->seq;
-                       int reh = OP_SYMBOL(right)->liveTo <= ic->seq;
-                       if (size == 1) {
-                               if (eh) {
-                                       emitcode(bopnames[bitop],"%s,%s",
-                                                aopGet(AOP(IC_LEFT(ic)),0),
-                                                aopGet(AOP(IC_RIGHT(ic)),0));
-                               } else if (reh) {
-                                       emitcode(bopnames[bitop],"%s,%s",
-                                                aopGet(AOP(IC_RIGHT(ic)),0),
-                                                aopGet(AOP(IC_LEFT(ic)),0));
-                               } else {
-                                       MOVR0(aopGet(AOP(IC_LEFT(ic)),0));
-                                       emitcode(bopnames[bitop],"r0,%s",aopGet(AOP(IC_RIGHT(ic)),0));
-                               }
-                               lbl = newiTempLabel(NULL);
-                               if (IC_TRUE(ifx)) {
-                                       emitcode("breq","L%05d",lbl->key);
-                                       emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
-                               } else {                                        
-                                       emitcode("brne","L%05d",lbl->key);
-                                       emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
-                               }
-                               emitcode("","L%05d:",lbl->key);
-                       } else if (size == 2) {
-                               emitcode("mov","r24,%s",aopGet(AOP(IC_LEFT(ic)),0));
-                               emitcode("mov","r25,%s",aopGet(AOP(IC_LEFT(ic)),1));
-                               emitcode(bopnames[bitop],"r24,%s",aopGet(AOP(IC_RIGHT(ic)),0));
-                               emitcode(bopnames[bitop],"r25,%s",aopGet(AOP(IC_RIGHT(ic)),1));
-                               emitcode("sbiw","r24,0");
-                               lbl = newiTempLabel(NULL);
-                               if (IC_TRUE(ifx)) {
-                                       emitcode("breq","L%05d",lbl->key);
-                                       emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
-                               } else {                                        
-                                       emitcode("brne","L%05d",lbl->key);
-                                       emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
-                               }
-                               emitcode("","L%05d:",lbl->key);                                 
-                       } else {                                        
-                               lbl = newiTempLabel(NULL);
-                               lbl1 = newiTempLabel(NULL);                                     
-                               while (size--) {
-                                       if (eh) {
-                                               emitcode(bopnames[bitop],"%s,%s",
-                                                        aopGet(AOP(IC_LEFT(ic)),offset),
-                                                        aopGet(AOP(IC_RIGHT(ic)),offset));
-                                       } else if (reh) {
-                                               emitcode(bopnames[bitop],"%s,%s",
-                                                        aopGet(AOP(IC_RIGHT(ic)),offset),
-                                                        aopGet(AOP(IC_LEFT(ic)),offset));
-                                       } else {
-                                               MOVR0(aopGet(AOP(IC_LEFT(ic)),offset));
-                                               emitcode(bopnames[bitop],"r0,%s",aopGet(AOP(IC_RIGHT(ic)),offset));
-                                       }
-                                       emitcode("brne","L%05d",lbl->key);
-                                       offset++;
-                               }
-                               /* all are zero */
-                               if (IC_FALSE(ifx)) emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
-                               else emitcode("rjmp","L%05d",lbl1->key);
-                               emitcode("","L%05d:",lbl->key);
-                               /* not zero */
-                               if (IC_TRUE(ifx)) emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
-                               emitcode("","L%05d:",lbl1->key);
-                               
-                       }
-               }
-               goto release ;
-       }
-
-       /* result needs to go a register */
-       samerl = sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic)));
-       samerr = sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)));
-       while (size--) {
-               if (AOP_TYPE(right) == AOP_LIT) {
-                       unsigned int lit = (int) floatFromVal (AOP(right)->aopu.aop_lit);
-                       if (((lit >> (8*offset)) & 0xff) == 0) {
-                               if (bitop == AVR_AND) {
-                                       aopPut(AOP(result),zero,offset++);
-                                       continue;
-                               } else if (bitop == AVR_OR) {
-                                       if (!samerl)
-                                               aopPut(AOP(result),aopGet(AOP(left),offset),offset);
-                                       offset++;
-                                       continue;
-                               }
-                       }
-               }
-               if (samerl) {
-                       if (AOP_TYPE(IC_RIGHT(ic)) == AOP_LIT && (bitop == AVR_AND || bitop == AVR_OR)) {
-                               emitcode(bopnames_lit[bitop],"%s,%s(%d)",aopGet(AOP(IC_LEFT(ic)),offset),
-                                        larray[offset],(int) floatFromVal (AOP(right)->aopu.aop_lit));
-                       } else {
-                               emitcode(bopnames[bitop],"%s,%s",aopGet(AOP(IC_LEFT(ic)),offset),
-                                        aopGet(AOP(IC_RIGHT(ic)),offset));
-                       }
-               } else if (samerr) {
-                       emitcode(bopnames[bitop],"%s,%s",aopGet(AOP(IC_RIGHT(ic)),offset),
-                                aopGet(AOP(IC_LEFT(ic)),offset));
-               } else {
-                       aopPut(AOP(IC_RESULT(ic)),aopGet(AOP(IC_LEFT(ic)),offset),offset);
-                       emitcode(bopnames[bitop],aopGet(AOP(IC_RESULT(ic)),offset),
-                                aopGet(AOP(IC_RIGHT(ic)),offset));
-               }
-               offset++;
-       }
+  operand *left, *right, *result;
+  int size, offset=0;
+  char *l;
+  symbol *lbl, *lbl1;
+  int samerl, samerr ;
+
+  aopOp((left = IC_LEFT(ic)),ic,FALSE);
+  aopOp((right= IC_RIGHT(ic)),ic,FALSE);
+  aopOp((result=IC_RESULT(ic)),ic,TRUE);
+
+  size = AOP_SIZE(left);
+  offset = 0;
+  if (ifx) { /* used only for jumps */
+    if (AOP_TYPE(right) == AOP_LIT &&
+        (bitop == AVR_AND || bitop == AVR_OR)) {
+      int lit = (int) floatFromVal (AOP(right)->aopu.aop_lit);
+      int p2 = powof2(lit);
+      if (bitop == AVR_AND && p2) { /* right side is a power of 2 */
+        l = aopGet(AOP(left),p2 / 8);
+        if (IC_TRUE(ifx)) {
+          emitcode("sbrc","%s,%d",l,(p2 % 8));
+          emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
+        } else {
+          emitcode("sbrs","%s,%d",l,(p2 % 8));
+          emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
+        }
+      } else { /* right not power of two */
+        int eh = OP_SYMBOL(left)->liveTo <= ic->seq;
+        if (size == 1) {
+          if (eh) {
+            emitcode(bopnames_lit[bitop],"%s,lo8(%d)",
+               aopGet(AOP(IC_LEFT(ic)),0), lit);
+          } else {
+            MOVR0(aopGet(AOP(IC_LEFT(ic)),0));
+            emitcode(bopnames_lit[bitop],"r0,lo8(%d)",lit);
+          }
+          lbl = newiTempLabel(NULL);
+          if (IC_TRUE(ifx)) {
+            emitcode("breq","L%05d",lbl->key);
+            emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
+          } else {
+            emitcode("brne","L%05d",lbl->key);
+            emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
+          }
+          emitcode("","L%05d:",lbl->key);
+        } else if (size == 2) {
+          emitcode("mov","r24,%s",aopGet(AOP(IC_LEFT(ic)),0));
+          emitcode("mov","r25,%s",aopGet(AOP(IC_LEFT(ic)),1));
+          emitcode(bopnames_lit[bitop],"r24,lo8(%d)",lit);
+          emitcode(bopnames_lit[bitop],"r25,hi8(%d)",lit);
+          emitcode("sbiw","r24,0");
+          lbl = newiTempLabel(NULL);
+          if (IC_TRUE(ifx)) {
+            emitcode("breq","L%05d",lbl->key);
+            emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
+          } else {
+            emitcode("brne","L%05d",lbl->key);
+            emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
+          }
+          emitcode("","L%05d:",lbl->key);
+        } else {
+          lbl = newiTempLabel(NULL);
+          lbl1 = newiTempLabel(NULL);
+          while (size--) {
+            if (eh) {
+              emitcode(bopnames_lit[bitop],"%s,lo8(%d)",
+               aopGet(AOP(IC_LEFT(ic)),offset), lit);
+            } else {
+              MOVR0(aopGet(AOP(IC_LEFT(ic)),offset));
+              emitcode("andi","r0,lo8(%d)",lit);
+            }
+            emitcode("brne","L%05d",lbl->key);
+            offset++;
+          }
+          /* all are zero */
+          if (IC_FALSE(ifx)) emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
+          else emitcode("rjmp","L%05d",lbl1->key);
+          emitcode("","L%05d:",lbl->key);
+          /* not zero */
+          if (IC_TRUE(ifx)) emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
+          emitcode("","L%05d:",lbl1->key);
+
+        }
+      }
+    } else { /* right is not a literal */
+      int eh = OP_SYMBOL(left)->liveTo <= ic->seq;
+      int reh = OP_SYMBOL(right)->liveTo <= ic->seq;
+      if (size == 1) {
+        if (eh) {
+          emitcode(bopnames[bitop],"%s,%s",
+             aopGet(AOP(IC_LEFT(ic)),0),
+             aopGet(AOP(IC_RIGHT(ic)),0));
+        } else if (reh) {
+          emitcode(bopnames[bitop],"%s,%s",
+             aopGet(AOP(IC_RIGHT(ic)),0),
+             aopGet(AOP(IC_LEFT(ic)),0));
+        } else {
+          MOVR0(aopGet(AOP(IC_LEFT(ic)),0));
+          emitcode(bopnames[bitop],"r0,%s",aopGet(AOP(IC_RIGHT(ic)),0));
+        }
+        lbl = newiTempLabel(NULL);
+        if (IC_TRUE(ifx)) {
+          emitcode("breq","L%05d",lbl->key);
+          emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
+        } else {
+          emitcode("brne","L%05d",lbl->key);
+          emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
+        }
+        emitcode("","L%05d:",lbl->key);
+      } else if (size == 2) {
+        emitcode("mov","r24,%s",aopGet(AOP(IC_LEFT(ic)),0));
+        emitcode("mov","r25,%s",aopGet(AOP(IC_LEFT(ic)),1));
+        emitcode(bopnames[bitop],"r24,%s",aopGet(AOP(IC_RIGHT(ic)),0));
+        emitcode(bopnames[bitop],"r25,%s",aopGet(AOP(IC_RIGHT(ic)),1));
+        emitcode("sbiw","r24,0");
+        lbl = newiTempLabel(NULL);
+        if (IC_TRUE(ifx)) {
+          emitcode("breq","L%05d",lbl->key);
+          emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
+        } else {
+          emitcode("brne","L%05d",lbl->key);
+          emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
+        }
+        emitcode("","L%05d:",lbl->key);
+      } else {
+        lbl = newiTempLabel(NULL);
+        lbl1 = newiTempLabel(NULL);
+        while (size--) {
+          if (eh) {
+            emitcode(bopnames[bitop],"%s,%s",
+               aopGet(AOP(IC_LEFT(ic)),offset),
+               aopGet(AOP(IC_RIGHT(ic)),offset));
+          } else if (reh) {
+            emitcode(bopnames[bitop],"%s,%s",
+               aopGet(AOP(IC_RIGHT(ic)),offset),
+               aopGet(AOP(IC_LEFT(ic)),offset));
+          } else {
+            MOVR0(aopGet(AOP(IC_LEFT(ic)),offset));
+            emitcode(bopnames[bitop],"r0,%s",aopGet(AOP(IC_RIGHT(ic)),offset));
+          }
+          emitcode("brne","L%05d",lbl->key);
+          offset++;
+        }
+        /* all are zero */
+        if (IC_FALSE(ifx)) emitcode("rjmp","L%05d",IC_FALSE(ifx)->key);
+        else emitcode("rjmp","L%05d",lbl1->key);
+        emitcode("","L%05d:",lbl->key);
+        /* not zero */
+        if (IC_TRUE(ifx)) emitcode("rjmp","L%05d",IC_TRUE(ifx)->key);
+        emitcode("","L%05d:",lbl1->key);
+
+      }
+    }
+    goto release ;
+  }
+
+  /* result needs to go a register */
+  samerl = sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic)));
+  samerr = sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)));
+  while (size--) {
+    if (AOP_TYPE(right) == AOP_LIT) {
+      unsigned int lit = (int) floatFromVal (AOP(right)->aopu.aop_lit);
+      if (((lit >> (8*offset)) & 0xff) == 0) {
+        if (bitop == AVR_AND) {
+          aopPut(AOP(result),zero,offset++);
+          continue;
+        } else if (bitop == AVR_OR) {
+          if (!samerl)
+            aopPut(AOP(result),aopGet(AOP(left),offset),offset);
+          offset++;
+          continue;
+        }
+      }
+    }
+    if (samerl) {
+      if (AOP_TYPE(IC_RIGHT(ic)) == AOP_LIT && (bitop == AVR_AND || bitop == AVR_OR)) {
+        emitcode(bopnames_lit[bitop],"%s,%s(%d)",aopGet(AOP(IC_LEFT(ic)),offset),
+           larray[offset],(int) floatFromVal (AOP(right)->aopu.aop_lit));
+      } else {
+        emitcode(bopnames[bitop],"%s,%s",aopGet(AOP(IC_LEFT(ic)),offset),
+           aopGet(AOP(IC_RIGHT(ic)),offset));
+      }
+    } else if (samerr) {
+      emitcode(bopnames[bitop],"%s,%s",aopGet(AOP(IC_RIGHT(ic)),offset),
+         aopGet(AOP(IC_LEFT(ic)),offset));
+    } else {
+      aopPut(AOP(IC_RESULT(ic)),aopGet(AOP(IC_LEFT(ic)),offset),offset);
+      emitcode(bopnames[bitop],aopGet(AOP(IC_RESULT(ic)),offset),
+         aopGet(AOP(IC_RIGHT(ic)),offset));
+    }
+    offset++;
+  }
 release :
-       freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-       freeAsmop(result,NULL,ic,TRUE);     
+  freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2533,7 +2533,7 @@ release :
 /*-----------------------------------------------------------------*/
 static void genAnd (iCode *ic, iCode *ifx)
 {
-       genBitWise(ic,ifx,AVR_AND);
+  genBitWise(ic,ifx,AVR_AND);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2541,7 +2541,7 @@ static void genAnd (iCode *ic, iCode *ifx)
 /*-----------------------------------------------------------------*/
 static void genOr (iCode *ic, iCode *ifx)
 {
-       genBitWise(ic,ifx,AVR_OR);
+  genBitWise(ic,ifx,AVR_OR);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2549,7 +2549,7 @@ static void genOr (iCode *ic, iCode *ifx)
 /*-----------------------------------------------------------------*/
 static void genXor (iCode *ic, iCode *ifx)
 {
-       genBitWise(ic,ifx,AVR_XOR);
+  genBitWise(ic,ifx,AVR_XOR);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2557,34 +2557,34 @@ static void genXor (iCode *ic, iCode *ifx)
 /*-----------------------------------------------------------------*/
 static void genInline (iCode *ic)
 {
-       char buffer[MAX_INLINEASM];
-       char *bp = buffer;
-       char *bp1= buffer;
-    
-       _G.inLine += (!options.asmpeep);
-       strcpy(buffer,IC_INLINE(ic));
-
-       /* emit each line as a code */
-       while (*bp) {
-               if (*bp == '\n') {
-                       *bp++ = '\0';
-                       emitcode(bp1,"");
-                       bp1 = bp;
-               } else {
-                       if (*bp == ':') {
-                               bp++;
-                               *bp = '\0';
-                               bp++;
-                               emitcode(bp1,"");
-                               bp1 = bp;
-                       } else
-                               bp++;
-               }
-       }
-       if (bp1 != bp)
-               emitcode(bp1,"");
-       /*     emitcode("",buffer); */
-       _G.inLine -= (!options.asmpeep);
+  char buffer[MAX_INLINEASM];
+  char *bp = buffer;
+  char *bp1= buffer;
+
+  _G.inLine += (!options.asmpeep);
+  strcpy(buffer,IC_INLINE(ic));
+
+  /* emit each line as a code */
+  while (*bp) {
+    if (*bp == '\n') {
+      *bp++ = '\0';
+      emitcode(bp1,"");
+      bp1 = bp;
+    } else {
+      if (*bp == ':') {
+        bp++;
+        *bp = '\0';
+        bp++;
+        emitcode(bp1,"");
+        bp1 = bp;
+      } else
+        bp++;
+    }
+  }
+  if (bp1 != bp)
+    emitcode(bp1,"");
+  /*     emitcode("",buffer); */
+  _G.inLine -= (!options.asmpeep);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2592,42 +2592,42 @@ static void genInline (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genRotC (iCode *ic, int lr)
 {
-       operand *left , *result ;
-       int size, offset = 0;
-
-       /* rotate right with carry */
-       left = IC_LEFT(ic);
-       result=IC_RESULT(ic);
-       aopOp (left,ic,FALSE);
-       aopOp (result,ic,FALSE);
-
-       /* move it to the result */
-       size = AOP_SIZE(result);    
-       if (!sameRegs(AOP(left),AOP(result))) {
-               offset = 0;
-               while (size--) {
-                       aopPut(AOP(result),
-                              aopGet(AOP(left),offset),
-                              offset);
-                       offset++;
-               }
-               size = AOP_SIZE(result);
-       }
-       if (lr) offset = size - 1;
-       else offset = 0;
-       
-       CLRC;
-       emitcode ("sbrc","%s,%d",aopGet(AOP(result),offset),
-                 (lr ? 0 : 7));
-       emitcode("sec","");
-                 
-       while (size--) {
-               emitcode((lr ? "ror" : "rol"),"%s",aopGet(AOP(result),offset));
-               if (lr) offset--;
-               else offset++;
-       }
-       freeAsmop(left,NULL,ic,TRUE);
-       freeAsmop(result,NULL,ic,TRUE);
+  operand *left , *result ;
+  int size, offset = 0;
+
+  /* rotate right with carry */
+  left = IC_LEFT(ic);
+  result=IC_RESULT(ic);
+  aopOp (left,ic,FALSE);
+  aopOp (result,ic,FALSE);
+
+  /* move it to the result */
+  size = AOP_SIZE(result);
+  if (!sameRegs(AOP(left),AOP(result))) {
+    offset = 0;
+    while (size--) {
+      aopPut(AOP(result),
+             aopGet(AOP(left),offset),
+             offset);
+      offset++;
+    }
+    size = AOP_SIZE(result);
+  }
+  if (lr) offset = size - 1;
+  else offset = 0;
+
+  CLRC;
+  emitcode ("sbrc","%s,%d",aopGet(AOP(result),offset),
+      (lr ? 0 : 7));
+  emitcode("sec","");
+
+  while (size--) {
+    emitcode((lr ? "ror" : "rol"),"%s",aopGet(AOP(result),offset));
+    if (lr) offset--;
+    else offset++;
+  }
+  freeAsmop(left,NULL,ic,TRUE);
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2635,15 +2635,15 @@ static void genRotC (iCode *ic, int lr)
 /*-----------------------------------------------------------------*/
 static void genRRC (iCode *ic)
 {
-       genRotC(ic,1);
+  genRotC(ic,1);
 }
 
 /*-----------------------------------------------------------------*/
 /* genRLC - generate code for rotate left with carry               */
 /*-----------------------------------------------------------------*/
 static void genRLC (iCode *ic)
-{    
-       genRotC(ic,0);
+{
+  genRotC(ic,0);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2651,32 +2651,32 @@ static void genRLC (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genGetHbit (iCode *ic)
 {
-       operand *left, *result;
-       int size, offset ;
-
-       left = IC_LEFT(ic);
-       result=IC_RESULT(ic);
-       aopOp (left,ic,FALSE);
-       aopOp (result,ic,FALSE);
-
-       size = AOP_SIZE(result);
-       if (!sameRegs(AOP(left),AOP(result))) {
-               emitcode("clr","%s",aopGet(AOP(result),size -1));
-               emitcode("sbrc","%s,7",aopGet(AOP(left),size -1));
-               emitcode("subi","%s,lo8(-1)",aopGet(AOP(result),size-1));
-       } else {
-               emitcode("clr","r0");
-               emitcode("sbrc","%s,7",aopGet(AOP(left),size-1));
-               emitcode("subi","r0,lo8(-1)");
-               aopPut(AOP(result),"r0",0);
-       }
-       offset = 1;
-       size --;        
-       while (size--) {
-               emitcode("clr",aopGet(AOP(result),offset++));
-       }
-       freeAsmop(left,NULL,ic,TRUE);
-       freeAsmop(result,NULL,ic,TRUE);
+  operand *left, *result;
+  int size, offset ;
+
+  left = IC_LEFT(ic);
+  result=IC_RESULT(ic);
+  aopOp (left,ic,FALSE);
+  aopOp (result,ic,FALSE);
+
+  size = AOP_SIZE(result);
+  if (!sameRegs(AOP(left),AOP(result))) {
+    emitcode("clr","%s",aopGet(AOP(result),size -1));
+    emitcode("sbrc","%s,7",aopGet(AOP(left),size -1));
+    emitcode("subi","%s,lo8(-1)",aopGet(AOP(result),size-1));
+  } else {
+    emitcode("clr","r0");
+    emitcode("sbrc","%s,7",aopGet(AOP(left),size-1));
+    emitcode("subi","r0,lo8(-1)");
+    aopPut(AOP(result),"r0",0);
+  }
+  offset = 1;
+  size --;
+  while (size--) {
+    emitcode("clr",aopGet(AOP(result),offset++));
+  }
+  freeAsmop(left,NULL,ic,TRUE);
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2684,162 +2684,162 @@ static void genGetHbit (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genShiftLeftLit (iCode *ic)
 {
-       operand *left,*right, *result;
-       int size , shCount, offset =0;
-       int lByteZ=0;
-
-       right = IC_RIGHT(ic);
-       left  = IC_LEFT(ic);
-       result = IC_RESULT(ic);
-
-       aopOp(left,ic,FALSE);
-       aopOp(result,ic,FALSE);
-       size = AOP_SIZE(result);
-       shCount = (int)floatFromVal (AOP(right)->aopu.aop_lit);
-
-       if (shCount > (size*8 -1)) {
-               while (size--) aopPut(AOP(result),zero,offset++);
-               goto release;
-       }
-       switch(size) {
-       case 1:
-               if (!sameRegs(AOP(left),AOP(result)))
-                       aopPut(AOP(result),aopGet(AOP(left),0),0);
-               if (shCount >= 4) {
-                       emitcode("swap","%s",aopGet(AOP(result),0));
-                       emitcode("andi","%s,0xf0");
-                       shCount -= 4;
-               }
-               if (shCount == 1) {
-                       emitcode("add","%s,%s",aopGet(AOP(result),0),aopGet(AOP(result),0));
-                       shCount--;
-               }
-               while (shCount--)
-                       emitcode("lsl","%s",aopGet(AOP(result),0));
-               break;
-       case 2:
-               if (shCount >= 12) {
-                       aopPut(AOP(result),aopGet(AOP(left),0),1);
-                       aopPut(AOP(result),zero,0);
-                       emitcode("swap","%s",aopGet(AOP(result),1));
-                       emitcode("andi","%s,0xf0",aopGet(AOP(result),1));
-                       shCount -= 12;
-                       lByteZ = 1;
-               }
-               if (shCount >= 8) {
-                       aopPut(AOP(result),aopGet(AOP(left),0),1);
-                       aopPut(AOP(result),zero,0);
-                       shCount -= 8;
-                       lByteZ = 1;
-               }
-               if (shCount >= 4) {
-                       shCount -= 4;
-                       if (!sameRegs(AOP(left),AOP(result))) {
-                               aopPut(AOP(result),aopGet(AOP(left),0),0);
-                               aopPut(AOP(result),aopGet(AOP(left),1),1);                                      
-                       }
-                       emitcode("mov","r1,%s",aopGet(AOP(result),0));
-                       emitcode("swap","%s",aopGet(AOP(result),0));
-                       emitcode("andi","%s,0xf0",aopGet(AOP(result),0));
-                       emitcode("andi","r1,0x0f");
-                       emitcode("swap","%s",aopGet(AOP(result),1));
-                       emitcode("andi","%s,0xf0",aopGet(AOP(result),1));
-                       emitcode("or","%s,r1",aopGet(AOP(result),1));
-                       while(shCount--) {
-                               emitcode("lsl","%s",aopGet(AOP(result),0));
-                               emitcode("rol","%s",aopGet(AOP(result),1));
-                       }
-               }
-               if (!lByteZ && !sameRegs(AOP(result),AOP(left)) && shCount) {
-                       offset = 0;
-                       while(size--) {
-                               aopPut(AOP(result),aopGet(AOP(left),offset),offset);
-                               offset++;
-                       }
-               }
-               while (shCount--) {
-                       if (lByteZ) {
-                               emitcode("lsl","%s",aopGet(AOP(result),1));
-                       } else {
-                               emitcode("lsl","%s",aopGet(AOP(result),0));
-                               emitcode("rol","%s",aopGet(AOP(result),1));
-                       }
-               }
-               break;
-       case 3:
-               assert("shifting generic pointer ?\n");
-               break;
-       case 4:
-               /* 32 bits we do only byte boundaries */
-               if (shCount >= 24) {
-                       aopPut(AOP(result),aopGet(AOP(left),0),3);
-                       aopPut(AOP(result),zero,2);
-                       aopPut(AOP(result),zero,1);
-                       aopPut(AOP(result),zero,0);
-                       lByteZ = 3;
-                       shCount -= 24;
-               }
-               if (shCount >= 16) {
-                       aopPut(AOP(result),aopGet(AOP(left),0),3);
-                       aopPut(AOP(result),aopGet(AOP(left),1),2);
-                       aopPut(AOP(result),zero,1);
-                       aopPut(AOP(result),zero,0);
-                       lByteZ = 2;
-                       shCount -= 16;
-               }
-               if (shCount >= 8) {
-                       aopPut(AOP(result),aopGet(AOP(left),0),3);
-                       aopPut(AOP(result),aopGet(AOP(left),1),2);
-                       aopPut(AOP(result),aopGet(AOP(left),2),1);
-                       aopPut(AOP(result),zero,0);
-                       shCount -= 8;
-                       lByteZ = 1;
-               }
-               if (!lByteZ && !sameRegs(AOP(left),AOP(right))) {
-                       offset = 0;
-                       while (size--) {
-                               aopPut(AOP(result),aopGet(AOP(left),offset),offset);
-                               offset++;
-                       }
-                       offset = 0;
-                       size = AOP_SIZE(result);
-               }
-               if (shCount) {
-                       switch (lByteZ) {
-                       case 0:
-                               while (shCount--) {
-                                       emitcode("lsl","%s",aopGet(AOP(result),0));
-                                       emitcode("rol","%s",aopGet(AOP(result),1));
-                                       emitcode("rol","%s",aopGet(AOP(result),2));
-                                       emitcode("rol","%s",aopGet(AOP(result),3));
-                               }
-                               break;
-                       case 1:
-                               while (shCount--) {
-                                       emitcode("lsl","%s",aopGet(AOP(result),1));
-                                       emitcode("rol","%s",aopGet(AOP(result),2));
-                                       emitcode("rol","%s",aopGet(AOP(result),3));
-                               }
-                               break;
-                       case 2:
-                               while (shCount--) {
-                                       emitcode("lsl","%s",aopGet(AOP(result),2));
-                                       emitcode("rol","%s",aopGet(AOP(result),3));
-                               }
-                               break;
-                       case 3:
-                               while (shCount--) {
-                                       emitcode("lsl","%s",aopGet(AOP(result),3));
-                               }
-                               break;
-                       }
-               }
-       }
-
- release:      
-       freeAsmop(left,NULL,ic,TRUE);
-       freeAsmop(right,NULL,ic,TRUE);
-       freeAsmop(result,NULL,ic,TRUE);
+  operand *left,*right, *result;
+  int size , shCount, offset =0;
+  int lByteZ=0;
+
+  right = IC_RIGHT(ic);
+  left  = IC_LEFT(ic);
+  result = IC_RESULT(ic);
+
+  aopOp(left,ic,FALSE);
+  aopOp(result,ic,FALSE);
+  size = AOP_SIZE(result);
+  shCount = (int)floatFromVal (AOP(right)->aopu.aop_lit);
+
+  if (shCount > (size*8 -1)) {
+    while (size--) aopPut(AOP(result),zero,offset++);
+    goto release;
+  }
+  switch(size) {
+  case 1:
+    if (!sameRegs(AOP(left),AOP(result)))
+      aopPut(AOP(result),aopGet(AOP(left),0),0);
+    if (shCount >= 4) {
+      emitcode("swap","%s",aopGet(AOP(result),0));
+      emitcode("andi","%s,0xf0");
+      shCount -= 4;
+    }
+    if (shCount == 1) {
+      emitcode("add","%s,%s",aopGet(AOP(result),0),aopGet(AOP(result),0));
+      shCount--;
+    }
+    while (shCount--)
+      emitcode("lsl","%s",aopGet(AOP(result),0));
+    break;
+  case 2:
+    if (shCount >= 12) {
+      aopPut(AOP(result),aopGet(AOP(left),0),1);
+      aopPut(AOP(result),zero,0);
+      emitcode("swap","%s",aopGet(AOP(result),1));
+      emitcode("andi","%s,0xf0",aopGet(AOP(result),1));
+      shCount -= 12;
+      lByteZ = 1;
+    }
+    if (shCount >= 8) {
+      aopPut(AOP(result),aopGet(AOP(left),0),1);
+      aopPut(AOP(result),zero,0);
+      shCount -= 8;
+      lByteZ = 1;
+    }
+    if (shCount >= 4) {
+      shCount -= 4;
+      if (!sameRegs(AOP(left),AOP(result))) {
+        aopPut(AOP(result),aopGet(AOP(left),0),0);
+        aopPut(AOP(result),aopGet(AOP(left),1),1);
+      }
+      emitcode("mov","r1,%s",aopGet(AOP(result),0));
+      emitcode("swap","%s",aopGet(AOP(result),0));
+      emitcode("andi","%s,0xf0",aopGet(AOP(result),0));
+      emitcode("andi","r1,0x0f");
+      emitcode("swap","%s",aopGet(AOP(result),1));
+      emitcode("andi","%s,0xf0",aopGet(AOP(result),1));
+      emitcode("or","%s,r1",aopGet(AOP(result),1));
+      while(shCount--) {
+        emitcode("lsl","%s",aopGet(AOP(result),0));
+        emitcode("rol","%s",aopGet(AOP(result),1));
+      }
+    }
+    if (!lByteZ && !sameRegs(AOP(result),AOP(left)) && shCount) {
+      offset = 0;
+      while(size--) {
+        aopPut(AOP(result),aopGet(AOP(left),offset),offset);
+        offset++;
+      }
+    }
+    while (shCount--) {
+      if (lByteZ) {
+        emitcode("lsl","%s",aopGet(AOP(result),1));
+      } else {
+        emitcode("lsl","%s",aopGet(AOP(result),0));
+        emitcode("rol","%s",aopGet(AOP(result),1));
+      }
+    }
+    break;
+  case 3:
+    assert("shifting generic pointer ?\n");
+    break;
+  case 4:
+    /* 32 bits we do only byte boundaries */
+    if (shCount >= 24) {
+      aopPut(AOP(result),aopGet(AOP(left),0),3);
+      aopPut(AOP(result),zero,2);
+      aopPut(AOP(result),zero,1);
+      aopPut(AOP(result),zero,0);
+      lByteZ = 3;
+      shCount -= 24;
+    }
+    if (shCount >= 16) {
+      aopPut(AOP(result),aopGet(AOP(left),0),3);
+      aopPut(AOP(result),aopGet(AOP(left),1),2);
+      aopPut(AOP(result),zero,1);
+      aopPut(AOP(result),zero,0);
+      lByteZ = 2;
+      shCount -= 16;
+    }
+    if (shCount >= 8) {
+      aopPut(AOP(result),aopGet(AOP(left),0),3);
+      aopPut(AOP(result),aopGet(AOP(left),1),2);
+      aopPut(AOP(result),aopGet(AOP(left),2),1);
+      aopPut(AOP(result),zero,0);
+      shCount -= 8;
+      lByteZ = 1;
+    }
+    if (!lByteZ && !sameRegs(AOP(left),AOP(right))) {
+      offset = 0;
+      while (size--) {
+        aopPut(AOP(result),aopGet(AOP(left),offset),offset);
+        offset++;
+      }
+      offset = 0;
+      size = AOP_SIZE(result);
+    }
+    if (shCount) {
+      switch (lByteZ) {
+      case 0:
+        while (shCount--) {
+          emitcode("lsl","%s",aopGet(AOP(result),0));
+          emitcode("rol","%s",aopGet(AOP(result),1));
+          emitcode("rol","%s",aopGet(AOP(result),2));
+          emitcode("rol","%s",aopGet(AOP(result),3));
+        }
+        break;
+      case 1:
+        while (shCount--) {
+          emitcode("lsl","%s",aopGet(AOP(result),1));
+          emitcode("rol","%s",aopGet(AOP(result),2));
+          emitcode("rol","%s",aopGet(AOP(result),3));
+        }
+        break;
+      case 2:
+        while (shCount--) {
+          emitcode("lsl","%s",aopGet(AOP(result),2));
+          emitcode("rol","%s",aopGet(AOP(result),3));
+        }
+        break;
+      case 3:
+        while (shCount--) {
+          emitcode("lsl","%s",aopGet(AOP(result),3));
+        }
+        break;
+      }
+    }
+  }
+
+ release:
+  freeAsmop(left,NULL,ic,TRUE);
+  freeAsmop(right,NULL,ic,TRUE);
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2847,58 +2847,58 @@ static void genShiftLeftLit (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genLeftShift (iCode *ic)
 {
-       operand *left,*right, *result;
-       int size, offset;
-       symbol *tlbl;
-
-       right = IC_RIGHT(ic);
-       left  = IC_LEFT(ic);
-       result = IC_RESULT(ic);
-
-       aopOp(right,ic,FALSE);
-
-       if (AOP_TYPE(right) == AOP_LIT) {
-               genShiftLeftLit(ic);
-               return ;
-       }
-
-       /* unknown count */
-       aopOp(left,ic,FALSE);
-       aopOp(result,ic,FALSE);
-       size = AOP_SIZE(result);
-       offset = 0;
-       if (AOP_SIZE(right) > 1) {
-               if (isRegPair(AOP(right))) {
-                       emitcode("movw","r24,%s",aopGet(AOP(right),0));
-               } else {
-                       emitcode("mov","r24,%s",aopGet(AOP(right),0));
-                       emitcode("mov","r25,%s",aopGet(AOP(right),1));
-               }
-       } else {
-               emitcode("mov","r24,%s",aopGet(AOP(right),0));
-       }
-       if (!sameRegs(AOP(left),AOP(result))) {
-               while (size--) {
-                       aopPut(AOP(result),aopGet(AOP(left),offset),offset);
-                       offset++;
-               }
-               size = AOP_SIZE(result);
-       }
-       tlbl = newiTempLabel(NULL);
-       emitcode("","L%05d:",tlbl->key);
-       offset = 0;
+  operand *left,*right, *result;
+  int size, offset;
+  symbol *tlbl;
+
+  right = IC_RIGHT(ic);
+  left  = IC_LEFT(ic);
+  result = IC_RESULT(ic);
+
+  aopOp(right,ic,FALSE);
+
+  if (AOP_TYPE(right) == AOP_LIT) {
+    genShiftLeftLit(ic);
+    return ;
+  }
+
+  /* unknown count */
+  aopOp(left,ic,FALSE);
+  aopOp(result,ic,FALSE);
+  size = AOP_SIZE(result);
+  offset = 0;
+  if (AOP_SIZE(right) > 1) {
+    if (isRegPair(AOP(right))) {
+      emitcode("movw","r24,%s",aopGet(AOP(right),0));
+    } else {
+      emitcode("mov","r24,%s",aopGet(AOP(right),0));
+      emitcode("mov","r25,%s",aopGet(AOP(right),1));
+    }
+  } else {
+    emitcode("mov","r24,%s",aopGet(AOP(right),0));
+  }
+  if (!sameRegs(AOP(left),AOP(result))) {
+    while (size--) {
+      aopPut(AOP(result),aopGet(AOP(left),offset),offset);
+      offset++;
+    }
+    size = AOP_SIZE(result);
+  }
+  tlbl = newiTempLabel(NULL);
+  emitcode("","L%05d:",tlbl->key);
+  offset = 0;
         while (size--) {
-               if (offset) emitcode("rol","%s",aopGet(AOP(result),offset));
-               else emitcode("lsl","%s",aopGet(AOP(result),0));
-               offset++;
-       }
-       if (AOP_SIZE(right) > 1) emitcode("sbiw","r24,1");
-       else emitcode("dec","r24");
-       emitcode("brne","L%05d",tlbl->key);
-       
-       freeAsmop(left,NULL,ic,TRUE);
-       freeAsmop(right,NULL,ic,TRUE);
-       freeAsmop(result,NULL,ic,TRUE);
+    if (offset) emitcode("rol","%s",aopGet(AOP(result),offset));
+    else emitcode("lsl","%s",aopGet(AOP(result),0));
+    offset++;
+  }
+  if (AOP_SIZE(right) > 1) emitcode("sbiw","r24,1");
+  else emitcode("dec","r24");
+  emitcode("brne","L%05d",tlbl->key);
+
+  freeAsmop(left,NULL,ic,TRUE);
+  freeAsmop(right,NULL,ic,TRUE);
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2906,204 +2906,204 @@ static void genLeftShift (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genShiftRightLit (iCode *ic)
 {
-       operand *left = IC_LEFT(ic)
-               ,*right= IC_RIGHT(ic)
-               ,*result=IC_RESULT(ic);
-       int size , shCount, offset =0;
-       int hByteZ=0;
-       sym_link *letype = getSpec(operandType(left));
-       int sign = !SPEC_USIGN(letype);
-
-       right = IC_RIGHT(ic);
-       left  = IC_LEFT(ic);
-       result = IC_RESULT(ic);
-
-       aopOp(left,ic,FALSE);
-       aopOp(result,ic,FALSE);
-       size = AOP_SIZE(result);
-       shCount = (int)floatFromVal (AOP(right)->aopu.aop_lit);
-
-       /* if signed then give up and use a loop to shift */    
-       if (sign) {
-               symbol *tlbl ;
-               if (!sameRegs(AOP(left),AOP(result))) {
-                       while (size--) {
-                               aopPut(AOP(result),aopGet(AOP(left),offset),offset);
-                               offset++;
-                       }
-                       size =  size = AOP_SIZE(result);
-                       offset = 0;
-               }                               
-               /* be as economical as possible */
-               if (shCount <= 4) {
-                       offset = size -1;
-                       while (shCount--) {
-                               offset = size -1;
-                               size = AOP_SIZE(result);
-                               while (size--) {
-                                       if (offset == (size-1))
-                                               emitcode("asr","%s",aopGet(AOP(result),offset));
-                                       else
-                                               emitcode("lsr","%s",aopGet(AOP(result),offset));
-                                       offset--;
-                               }
-                       }
-               } else {
-                       emitcode("ldi","r24,lo8(%d)",shCount);
-                       tlbl = newiTempLabel(NULL);
-                       emitcode("","L%05d:",tlbl->key);
-                       offset = size -1;
-                       while (size--) {
-                               if (offset == (size-1)) emitcode("asr","%s",aopGet(AOP(result),offset));
-                               else emitcode("lsr","%s",aopGet(AOP(result),offset));
-                               offset--;
-                       }
-                       emitcode("dec","r24");
-                       emitcode("brne","L%05d",tlbl->key);
-               }
-               goto release;
-       }
-       if (shCount > (size*8 -1)) {
-               while (size--) aopPut(AOP(result),zero,offset++);
-               goto release;
-       }
-       /* for unsigned we can much more efficient */
-       switch (size) {
-       case 1:
-               if (!sameRegs(AOP(left),AOP(result)))
-                       aopPut(AOP(result),aopGet(AOP(left),0),0);
-               if (shCount >= 4) {
-                       emitcode("swap","%s",aopGet(AOP(result),0));
-                       emitcode("andi","%s,0x0f");
-                       shCount -= 4;
-               }
-               while (shCount--)
-                       emitcode("lsr","%s",aopGet(AOP(result),0));
-               break;
-       case 2:
-               if (shCount >= 12) {
-                       aopPut(AOP(result),aopGet(AOP(left),1),0);
-                       aopPut(AOP(result),zero,1);
-                       emitcode("swap","%s",aopGet(AOP(result),0));
-                       emitcode("andi","%s,0x0f",aopGet(AOP(result),0));
-                       shCount -= 12;
-                       hByteZ = 1;
-               }
-               if (shCount >= 8) {
-                       aopPut(AOP(result),aopGet(AOP(left),1),0);
-                       aopPut(AOP(result),zero,1);
-                       shCount -= 8;
-                       hByteZ = 1;
-               }
-               if (shCount >= 4) {
-                       shCount -= 4;
-                       if (!sameRegs(AOP(left),AOP(result))) {
-                               aopPut(AOP(result),aopGet(AOP(left),0),0);
-                               aopPut(AOP(result),aopGet(AOP(left),1),1);                                      
-                       }
-                       emitcode("mov","r1,%s",aopGet(AOP(result),1));
-                       emitcode("swap","%s",aopGet(AOP(result),0));
-                       emitcode("andi","%s,0x0f",aopGet(AOP(result),0));
-                       emitcode("andi","r1,0xf0");
-                       emitcode("or","%s,r1",aopGet(AOP(result),0));
-                       emitcode("swap","%s",aopGet(AOP(result),1));
-                       emitcode("andi","%s,0x0f",aopGet(AOP(result),1));
-                       while(shCount--) {
-                               emitcode("lsr","%s",aopGet(AOP(result),1));
-                               emitcode("ror","%s",aopGet(AOP(result),0));
-                       }
-                       
-               }
-               if (!hByteZ && !sameRegs(AOP(result),AOP(left)) && shCount) {
-                       offset = 0;
-                       while(size--) {
-                               aopPut(AOP(result),aopGet(AOP(left),offset),offset);
-                               offset++;
-                       }
-               }
-               while (shCount--) {
-                       if (hByteZ) {
-                               emitcode("lsr","%s",aopGet(AOP(result),0));
-                       } else {
-                               emitcode("lsr","%s",aopGet(AOP(result),1));
-                               emitcode("ror","%s",aopGet(AOP(result),0));
-                       }
-               }
-               break;
-               
-       case 3:
-               assert("shifting generic pointer ?\n");
-               break;
-       case 4:
-               /* 32 bits we do only byte boundaries */
-               if (shCount >= 24) {
-                       aopPut(AOP(result),aopGet(AOP(left),3),0);
-                       aopPut(AOP(result),zero,1);
-                       aopPut(AOP(result),zero,2);
-                       aopPut(AOP(result),zero,3);
-                       hByteZ = 3;
-                       shCount -= 24;
-               }
-               if (shCount >= 16) {
-                       aopPut(AOP(result),aopGet(AOP(left),3),1);
-                       aopPut(AOP(result),aopGet(AOP(left),2),0);
-                       aopPut(AOP(result),zero,2);
-                       aopPut(AOP(result),zero,3);
-                       hByteZ = 2;
-                       shCount -= 16;
-               }
-               if (shCount >= 8) {
-                       aopPut(AOP(result),aopGet(AOP(left),1),0);
-                       aopPut(AOP(result),aopGet(AOP(left),2),1);
-                       aopPut(AOP(result),aopGet(AOP(left),3),2);
-                       aopPut(AOP(result),zero,3);
-                       shCount -= 8;
-                       hByteZ = 1;
-               }
-               if (!hByteZ && !sameRegs(AOP(left),AOP(right))) {
-                       offset = 0;
-                       while (size--) {
-                               aopPut(AOP(result),aopGet(AOP(left),offset),offset);
-                               offset++;
-                       }
-                       offset = 0;
-                       size = AOP_SIZE(result);
-               }
-               if (shCount) {
-                       switch (hByteZ) {
-                       case 0:
-                               while (shCount--) {
-                                       emitcode("lsr","%s",aopGet(AOP(result),3));
-                                       emitcode("ror","%s",aopGet(AOP(result),2));
-                                       emitcode("ror","%s",aopGet(AOP(result),1));
-                                       emitcode("ror","%s",aopGet(AOP(result),0));
-                               }
-                               break;
-                       case 1:
-                               while (shCount--) {
-                                       emitcode("lsr","%s",aopGet(AOP(result),2));
-                                       emitcode("ror","%s",aopGet(AOP(result),1));
-                                       emitcode("ror","%s",aopGet(AOP(result),0));
-                               }
-                               break;
-                       case 2:
-                               while (shCount--) {
-                                       emitcode("lsr","%s",aopGet(AOP(result),1));
-                                       emitcode("ror","%s",aopGet(AOP(result),0));
-                               }
-                               break;
-                       case 3:
-                               while (shCount--) {
-                                       emitcode("lsr","%s",aopGet(AOP(result),0));
-                               }
-                               break;
-                       }
-               }
-       }               
+  operand *left = IC_LEFT(ic)
+    ,*right= IC_RIGHT(ic)
+    ,*result=IC_RESULT(ic);
+  int size , shCount, offset =0;
+  int hByteZ=0;
+  sym_link *letype = getSpec(operandType(left));
+  int sign = !SPEC_USIGN(letype);
+
+  right = IC_RIGHT(ic);
+  left  = IC_LEFT(ic);
+  result = IC_RESULT(ic);
+
+  aopOp(left,ic,FALSE);
+  aopOp(result,ic,FALSE);
+  size = AOP_SIZE(result);
+  shCount = (int)floatFromVal (AOP(right)->aopu.aop_lit);
+
+  /* if signed then give up and use a loop to shift */
+  if (sign) {
+    symbol *tlbl ;
+    if (!sameRegs(AOP(left),AOP(result))) {
+      while (size--) {
+        aopPut(AOP(result),aopGet(AOP(left),offset),offset);
+        offset++;
+      }
+      size =  size = AOP_SIZE(result);
+      offset = 0;
+    }
+    /* be as economical as possible */
+    if (shCount <= 4) {
+      offset = size -1;
+      while (shCount--) {
+        offset = size -1;
+        size = AOP_SIZE(result);
+        while (size--) {
+          if (offset == (size-1))
+            emitcode("asr","%s",aopGet(AOP(result),offset));
+          else
+            emitcode("lsr","%s",aopGet(AOP(result),offset));
+          offset--;
+        }
+      }
+    } else {
+      emitcode("ldi","r24,lo8(%d)",shCount);
+      tlbl = newiTempLabel(NULL);
+      emitcode("","L%05d:",tlbl->key);
+      offset = size -1;
+      while (size--) {
+        if (offset == (size-1)) emitcode("asr","%s",aopGet(AOP(result),offset));
+        else emitcode("lsr","%s",aopGet(AOP(result),offset));
+        offset--;
+      }
+      emitcode("dec","r24");
+      emitcode("brne","L%05d",tlbl->key);
+    }
+    goto release;
+  }
+  if (shCount > (size*8 -1)) {
+    while (size--) aopPut(AOP(result),zero,offset++);
+    goto release;
+  }
+  /* for unsigned we can much more efficient */
+  switch (size) {
+  case 1:
+    if (!sameRegs(AOP(left),AOP(result)))
+      aopPut(AOP(result),aopGet(AOP(left),0),0);
+    if (shCount >= 4) {
+      emitcode("swap","%s",aopGet(AOP(result),0));
+      emitcode("andi","%s,0x0f");
+      shCount -= 4;
+    }
+    while (shCount--)
+      emitcode("lsr","%s",aopGet(AOP(result),0));
+    break;
+  case 2:
+    if (shCount >= 12) {
+      aopPut(AOP(result),aopGet(AOP(left),1),0);
+      aopPut(AOP(result),zero,1);
+      emitcode("swap","%s",aopGet(AOP(result),0));
+      emitcode("andi","%s,0x0f",aopGet(AOP(result),0));
+      shCount -= 12;
+      hByteZ = 1;
+    }
+    if (shCount >= 8) {
+      aopPut(AOP(result),aopGet(AOP(left),1),0);
+      aopPut(AOP(result),zero,1);
+      shCount -= 8;
+      hByteZ = 1;
+    }
+    if (shCount >= 4) {
+      shCount -= 4;
+      if (!sameRegs(AOP(left),AOP(result))) {
+        aopPut(AOP(result),aopGet(AOP(left),0),0);
+        aopPut(AOP(result),aopGet(AOP(left),1),1);
+      }
+      emitcode("mov","r1,%s",aopGet(AOP(result),1));
+      emitcode("swap","%s",aopGet(AOP(result),0));
+      emitcode("andi","%s,0x0f",aopGet(AOP(result),0));
+      emitcode("andi","r1,0xf0");
+      emitcode("or","%s,r1",aopGet(AOP(result),0));
+      emitcode("swap","%s",aopGet(AOP(result),1));
+      emitcode("andi","%s,0x0f",aopGet(AOP(result),1));
+      while(shCount--) {
+        emitcode("lsr","%s",aopGet(AOP(result),1));
+        emitcode("ror","%s",aopGet(AOP(result),0));
+      }
+
+    }
+    if (!hByteZ && !sameRegs(AOP(result),AOP(left)) && shCount) {
+      offset = 0;
+      while(size--) {
+        aopPut(AOP(result),aopGet(AOP(left),offset),offset);
+        offset++;
+      }
+    }
+    while (shCount--) {
+      if (hByteZ) {
+        emitcode("lsr","%s",aopGet(AOP(result),0));
+      } else {
+        emitcode("lsr","%s",aopGet(AOP(result),1));
+        emitcode("ror","%s",aopGet(AOP(result),0));
+      }
+    }
+    break;
+
+  case 3:
+    assert("shifting generic pointer ?\n");
+    break;
+  case 4:
+    /* 32 bits we do only byte boundaries */
+    if (shCount >= 24) {
+      aopPut(AOP(result),aopGet(AOP(left),3),0);
+      aopPut(AOP(result),zero,1);
+      aopPut(AOP(result),zero,2);
+      aopPut(AOP(result),zero,3);
+      hByteZ = 3;
+      shCount -= 24;
+    }
+    if (shCount >= 16) {
+      aopPut(AOP(result),aopGet(AOP(left),3),1);
+      aopPut(AOP(result),aopGet(AOP(left),2),0);
+      aopPut(AOP(result),zero,2);
+      aopPut(AOP(result),zero,3);
+      hByteZ = 2;
+      shCount -= 16;
+    }
+    if (shCount >= 8) {
+      aopPut(AOP(result),aopGet(AOP(left),1),0);
+      aopPut(AOP(result),aopGet(AOP(left),2),1);
+      aopPut(AOP(result),aopGet(AOP(left),3),2);
+      aopPut(AOP(result),zero,3);
+      shCount -= 8;
+      hByteZ = 1;
+    }
+    if (!hByteZ && !sameRegs(AOP(left),AOP(right))) {
+      offset = 0;
+      while (size--) {
+        aopPut(AOP(result),aopGet(AOP(left),offset),offset);
+        offset++;
+      }
+      offset = 0;
+      size = AOP_SIZE(result);
+    }
+    if (shCount) {
+      switch (hByteZ) {
+      case 0:
+        while (shCount--) {
+          emitcode("lsr","%s",aopGet(AOP(result),3));
+          emitcode("ror","%s",aopGet(AOP(result),2));
+          emitcode("ror","%s",aopGet(AOP(result),1));
+          emitcode("ror","%s",aopGet(AOP(result),0));
+        }
+        break;
+      case 1:
+        while (shCount--) {
+          emitcode("lsr","%s",aopGet(AOP(result),2));
+          emitcode("ror","%s",aopGet(AOP(result),1));
+          emitcode("ror","%s",aopGet(AOP(result),0));
+        }
+        break;
+      case 2:
+        while (shCount--) {
+          emitcode("lsr","%s",aopGet(AOP(result),1));
+          emitcode("ror","%s",aopGet(AOP(result),0));
+        }
+        break;
+      case 3:
+        while (shCount--) {
+          emitcode("lsr","%s",aopGet(AOP(result),0));
+        }
+        break;
+      }
+    }
+  }
  release:
-       freeAsmop(left,NULL,ic,TRUE);
-       freeAsmop(right,NULL,ic,TRUE);
-       freeAsmop(result,NULL,ic,TRUE);
+  freeAsmop(left,NULL,ic,TRUE);
+  freeAsmop(right,NULL,ic,TRUE);
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3111,59 +3111,59 @@ static void genShiftRightLit (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genRightShift (iCode *ic)
 {
-       operand *right, *left, *result;
-       sym_link *letype ;
-       int size, offset;
-       int sign = 0, first =1;
-       symbol *tlbl;
-
-       aopOp(right=IC_RIGHT(ic),ic,FALSE);
-       if (AOP_TYPE(right) == AOP_LIT) {
-               genShiftRightLit(ic);
-               return ;
-       }
-       /* unknown count */
-       if (AOP_SIZE(right) > 1) {
-               if (isRegPair(AOP(right))) {
-                       emitcode("movw","r24,%s",aopGet(AOP(right),0));
-               } else {
-                       emitcode("mov","r24,%s",aopGet(AOP(right),0));
-                       emitcode("mov","r25,%s",aopGet(AOP(right),1));
-               }
-       } else {
-               emitcode("mov","r24,%s",aopGet(AOP(right),0));
-       }
-       aopOp(left=IC_LEFT(ic),ic,FALSE);
-       aopOp(result=IC_RESULT(ic),ic,FALSE);
-       size = AOP_SIZE(result);
-       tlbl = newiTempLabel(NULL);
-       emitcode("","L%05d:",tlbl->key);
-       offset = size -1;
-       letype = getSpec(operandType(left));
-       sign = !SPEC_USIGN(letype);
-       if (!sameRegs(AOP(left),AOP(result))) {
-               while (size--) {
-                       aopPut(AOP(result),aopGet(AOP(left),offset),offset);
-                       offset++;
-               }
-               size = AOP_SIZE(result);
-       }
-       size = AOP_SIZE(result);
-       while (size--) {
-               if (first) {
-                       if (sign) emitcode("asr","%s",aopGet(AOP(result),offset));
-                       else emitcode("lsr","%s",aopGet(AOP(result),offset));
-                       first = 0;
-               }
-               else emitcode("ror","%s",aopGet(AOP(result),offset));
-               offset--;
-       }
-       if (AOP_SIZE(right) > 1) emitcode("sbiw","r24,1");
-       else emitcode("dec","r24");
-       emitcode("brne","L%05d",tlbl->key);
-       
-       freeAsmop(left,NULL,ic,TRUE);
-       freeAsmop(result,NULL,ic,TRUE);
+  operand *right, *left, *result;
+  sym_link *letype ;
+  int size, offset;
+  int sign = 0, first =1;
+  symbol *tlbl;
+
+  aopOp(right=IC_RIGHT(ic),ic,FALSE);
+  if (AOP_TYPE(right) == AOP_LIT) {
+    genShiftRightLit(ic);
+    return ;
+  }
+  /* unknown count */
+  if (AOP_SIZE(right) > 1) {
+    if (isRegPair(AOP(right))) {
+      emitcode("movw","r24,%s",aopGet(AOP(right),0));
+    } else {
+      emitcode("mov","r24,%s",aopGet(AOP(right),0));
+      emitcode("mov","r25,%s",aopGet(AOP(right),1));
+    }
+  } else {
+    emitcode("mov","r24,%s",aopGet(AOP(right),0));
+  }
+  aopOp(left=IC_LEFT(ic),ic,FALSE);
+  aopOp(result=IC_RESULT(ic),ic,FALSE);
+  size = AOP_SIZE(result);
+  tlbl = newiTempLabel(NULL);
+  emitcode("","L%05d:",tlbl->key);
+  offset = size -1;
+  letype = getSpec(operandType(left));
+  sign = !SPEC_USIGN(letype);
+  if (!sameRegs(AOP(left),AOP(result))) {
+    while (size--) {
+      aopPut(AOP(result),aopGet(AOP(left),offset),offset);
+      offset++;
+    }
+    size = AOP_SIZE(result);
+  }
+  size = AOP_SIZE(result);
+  while (size--) {
+    if (first) {
+      if (sign) emitcode("asr","%s",aopGet(AOP(result),offset));
+      else emitcode("lsr","%s",aopGet(AOP(result),offset));
+      first = 0;
+    }
+    else emitcode("ror","%s",aopGet(AOP(result),offset));
+    offset--;
+  }
+  if (AOP_SIZE(right) > 1) emitcode("sbiw","r24,1");
+  else emitcode("dec","r24");
+  emitcode("brne","L%05d",tlbl->key);
+
+  freeAsmop(left,NULL,ic,TRUE);
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3171,478 +3171,478 @@ static void genRightShift (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void R0Rsh (int shCount)
 {
-       shCount &= 0x0007;              // shCount : 0..7
-       switch(shCount){
+  shCount &= 0x0007;              // shCount : 0..7
+  switch(shCount){
         case 0 :
-               break;
+    break;
         case 1 :
-               emitcode("lsr","r0");
-               break;
+    emitcode("lsr","r0");
+    break;
         case 2 :
-               emitcode("lsr","r0");
-               emitcode("lsr","r0");
-               break;
+    emitcode("lsr","r0");
+    emitcode("lsr","r0");
+    break;
         case 3 :
-               emitcode("swap","r0");      
-               emitcode("lsl","r0");
-               break;
+    emitcode("swap","r0");
+    emitcode("lsl","r0");
+    break;
         case 4 :
-               emitcode("swap","r0");
-               break;
+    emitcode("swap","r0");
+    break;
         case 5 :
-               emitcode("swap","r0");
-               emitcode("lsr","r0");
-               break;
+    emitcode("swap","r0");
+    emitcode("lsr","r0");
+    break;
         case 6 :
-               emitcode("swap","r0");
-               emitcode("lsr","r0");
-               emitcode("lsr","r0");
-               break;
+    emitcode("swap","r0");
+    emitcode("lsr","r0");
+    emitcode("lsr","r0");
+    break;
         case 7 :
-               emitcode("swap","r0");
-               emitcode("lsr","r0");
-               emitcode("lsr","r0");
-               emitcode("lsr","r0");
-               break;
-       }
+    emitcode("swap","r0");
+    emitcode("lsr","r0");
+    emitcode("lsr","r0");
+    emitcode("lsr","r0");
+    break;
+  }
 }
 
 /*-----------------------------------------------------------------*/
 /* genUnpackBits - generates code for unpacking bits               */
 /*-----------------------------------------------------------------*/
 static void genUnpackBits (operand *result, char *rname, int ptype)
-{    
-       int shCnt ;
-       int rlen = 0 ;
-       sym_link *etype;
-       int offset = 0 ;
-
-       etype = getSpec(operandType(result));
-
-       /* read the first byte  */
-       switch (ptype) {
-
-       case POINTER:
-       case IPOINTER:
-       case PPOINTER:
-       case FPOINTER:
-               emitcode("ld","r0,%s+",rname);
-               break;
-
-       case CPOINTER:
-               emitcode("ldm","r0,%s+",rname);
-               break;
-
-       case GPOINTER:
-               emitcode("call","__gptrget_pi");
-               break;
-       }
-
-       /* if we have bitdisplacement then it fits   */
-       /* into this byte completely or if length is */
-       /* less than a byte                          */
-       if ((shCnt = SPEC_BSTR(etype)) || (SPEC_BLEN(etype) <= 8))  {
-               
-               /* shift right r0 */
-               R0Rsh(shCnt);
-               emitcode("andi","r0,0x%02x",
-                        ((unsigned char) -1)>>(8 - SPEC_BLEN(etype)));
-
-               aopPut(AOP(result),"r0",offset);
-               return ;
-       }
-
-       /* bit field did not fit in a byte  */
-       rlen = SPEC_BLEN(etype) - 8;
-       aopPut(AOP(result),"a",offset++);
-
-       while (1)  {
-
-               switch (ptype) {
-               case POINTER:
-               case IPOINTER:
-               case PPOINTER:
-               case FPOINTER:
-                       emitcode("ld","r0,%s+",rname);
-                       break;
-           
-               case CPOINTER:
-                       emitcode("ldm","r0,%s+",rname);
-                       break;
-           
-               case GPOINTER:
-                       emitcode("lcall","__gptrget_pi");
-                       break;
-               }
-
-               rlen -= 8;            
-                               /* if we are done */
-               if ( rlen <= 0 )
-                       break ;
-       
-               aopPut(AOP(result),"r0",offset++);
-                                     
-       }
-    
-       if (rlen) {
-               emitcode("andi","r0,#0x%02x",((unsigned char)-1)>>(-rlen));
-               aopPut(AOP(result),"r0",offset);               
-       }
-    
-       return ;
+{
+  int shCnt ;
+  int rlen = 0 ;
+  sym_link *etype;
+  int offset = 0 ;
+
+  etype = getSpec(operandType(result));
+
+  /* read the first byte  */
+  switch (ptype) {
+
+  case POINTER:
+  case IPOINTER:
+  case PPOINTER:
+  case FPOINTER:
+    emitcode("ld","r0,%s+",rname);
+    break;
+
+  case CPOINTER:
+    emitcode("ldm","r0,%s+",rname);
+    break;
+
+  case GPOINTER:
+    emitcode("call","__gptrget_pi");
+    break;
+  }
+
+  /* if we have bitdisplacement then it fits   */
+  /* into this byte completely or if length is */
+  /* less than a byte                          */
+  if ((shCnt = SPEC_BSTR(etype)) || (SPEC_BLEN(etype) <= 8))  {
+
+    /* shift right r0 */
+    R0Rsh(shCnt);
+    emitcode("andi","r0,0x%02x",
+       ((unsigned char) -1)>>(8 - SPEC_BLEN(etype)));
+
+    aopPut(AOP(result),"r0",offset);
+    return ;
+  }
+
+  /* bit field did not fit in a byte  */
+  rlen = SPEC_BLEN(etype) - 8;
+  aopPut(AOP(result),"a",offset++);
+
+  while (1)  {
+
+    switch (ptype) {
+    case POINTER:
+    case IPOINTER:
+    case PPOINTER:
+    case FPOINTER:
+      emitcode("ld","r0,%s+",rname);
+      break;
+
+    case CPOINTER:
+      emitcode("ldm","r0,%s+",rname);
+      break;
+
+    case GPOINTER:
+      emitcode("lcall","__gptrget_pi");
+      break;
+    }
+
+    rlen -= 8;
+        /* if we are done */
+    if ( rlen <= 0 )
+      break ;
+
+    aopPut(AOP(result),"r0",offset++);
+
+  }
+
+  if (rlen) {
+    emitcode("andi","r0,#0x%02x",((unsigned char)-1)>>(-rlen));
+    aopPut(AOP(result),"r0",offset);
+  }
+
+  return ;
 }
 
 
 /*-----------------------------------------------------------------*/
 /* genDataPointerGet - generates code when ptr offset is known     */
 /*-----------------------------------------------------------------*/
-static void genDataPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genDataPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
-       char *l;
-       char buffer[256];
-       int size , offset = 0;
-       aopOp(result,ic,TRUE);
-
-       /* get the string representation of the name */
-       l = aopGet(AOP(left),0);
-       size = AOP_SIZE(result);
-       while (size--) {
-               if (offset)
-                       sprintf(buffer,"(%s + %d)",l+1,offset);
-               else
-                       sprintf(buffer,"%s",l+1);
-               emitcode("lds","%s,%s",aopGet(AOP(result),offset++),buffer);
-       }
-
-       freeAsmop(left,NULL,ic,TRUE);
-       freeAsmop(result,NULL,ic,TRUE);
+  char *l;
+  char buffer[256];
+  int size , offset = 0;
+  aopOp(result,ic,TRUE);
+
+  /* get the string representation of the name */
+  l = aopGet(AOP(left),0);
+  size = AOP_SIZE(result);
+  while (size--) {
+    if (offset)
+      sprintf(buffer,"(%s + %d)",l+1,offset);
+    else
+      sprintf(buffer,"%s",l+1);
+    emitcode("lds","%s,%s",aopGet(AOP(result),offset++),buffer);
+  }
+
+  freeAsmop(left,NULL,ic,TRUE);
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genNearPointerGet - emitcode for near pointer fetch             */
 /*-----------------------------------------------------------------*/
-static void genNearPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genNearPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
-       asmop *aop = NULL;
-       regs *preg = NULL ;
-       char *rname ;
-       sym_link *rtype, *retype;
-       sym_link *ltype = operandType(left);    
-       char buffer[80];
-
-       rtype = operandType(result);
-       retype= getSpec(rtype);
-    
-       aopOp(left,ic,FALSE);
-    
-       /* if left is rematerialisable and
-          result is not bit variable type and
-          the left is pointer to data space i.e
-          lower 128 bytes of space */
-       if (AOP_TYPE(left) == AOP_IMMD &&
-           !IS_BITVAR(retype)         &&
-           DCL_TYPE(ltype) == POINTER) {
-               genDataPointerGet (left,result,ic);
-               return ;
-       }
-    
-       /* if the value is already in a pointer register
-          then don't need anything more */
-       if (!AOP_INPREG(AOP(left))) {
-                               /* otherwise get a free pointer register */
-               aop = newAsmop(0);
-               preg = getFreePtr(ic,&aop,FALSE,0);
-               emitcode("mov","%s,%s",
-                        preg->name,
-                        aopGet(AOP(left),0));
-               rname = preg->name ;
-       } else
-               rname = aopGet(AOP(left),0);
-    
-       freeAsmop(left,NULL,ic,TRUE);
-       aopOp (result,ic,FALSE);
-    
-       /* if bitfield then unpack the bits */
-       if (IS_BITVAR(retype)) 
-               genUnpackBits (result,rname,POINTER);
-       else {
-                               /* we have can just get the values */
-               int size = AOP_SIZE(result);
-               int offset = 0 ;        
-       
-               while (size--) {
-                       if (IS_AOP_PREG(result) || AOP_TYPE(result) == AOP_STK ) {
-
-                               emitcode("mov","a,@%s",rname);
-                               aopPut(AOP(result),"a",offset);
-                       } else {
-                               sprintf(buffer,"@%s",rname);
-                               aopPut(AOP(result),buffer,offset);
-                       }
-                       offset++ ;
-                       if (size)
-                               emitcode("inc","%s",rname);
-               }
-       }
-
-       /* now some housekeeping stuff */
-       if (aop) {
-                               /* we had to allocate for this iCode */
-               freeAsmop(NULL,aop,ic,TRUE);
-       } else { 
-                               /* we did not allocate which means left
-                                  already in a pointer register, then
-                                  if size > 0 && this could be used again
-                                  we have to point it back to where it 
-                                  belongs */
-               if (AOP_SIZE(result) > 1 &&
-                   !OP_SYMBOL(left)->remat &&
-                   ( OP_SYMBOL(left)->liveTo > ic->seq ||
-                     ic->depth )) {
-                       int size = AOP_SIZE(result) - 1;
-                       while (size--)
-                               emitcode("dec","%s",rname);
-               }
-       }
-
-       /* done */
-       freeAsmop(result,NULL,ic,TRUE);
-     
+  asmop *aop = NULL;
+  regs *preg = NULL ;
+  char *rname ;
+  sym_link *rtype, *retype;
+  sym_link *ltype = operandType(left);
+  char buffer[80];
+
+  rtype = operandType(result);
+  retype= getSpec(rtype);
+
+  aopOp(left,ic,FALSE);
+
+  /* if left is rematerialisable and
+     result is not bit variable type and
+     the left is pointer to data space i.e
+     lower 128 bytes of space */
+  if (AOP_TYPE(left) == AOP_IMMD &&
+      !IS_BITVAR(retype)         &&
+      DCL_TYPE(ltype) == POINTER) {
+    genDataPointerGet (left,result,ic);
+    return ;
+  }
+
+  /* if the value is already in a pointer register
+     then don't need anything more */
+  if (!AOP_INPREG(AOP(left))) {
+        /* otherwise get a free pointer register */
+    aop = newAsmop(0);
+    preg = getFreePtr(ic,&aop,FALSE,0);
+    emitcode("mov","%s,%s",
+       preg->name,
+       aopGet(AOP(left),0));
+    rname = preg->name ;
+  } else
+    rname = aopGet(AOP(left),0);
+
+  freeAsmop(left,NULL,ic,TRUE);
+  aopOp (result,ic,FALSE);
+
+  /* if bitfield then unpack the bits */
+  if (IS_BITVAR(retype))
+    genUnpackBits (result,rname,POINTER);
+  else {
+        /* we have can just get the values */
+    int size = AOP_SIZE(result);
+    int offset = 0 ;
+
+    while (size--) {
+      if (IS_AOP_PREG(result) || AOP_TYPE(result) == AOP_STK ) {
+
+        emitcode("mov","a,@%s",rname);
+        aopPut(AOP(result),"a",offset);
+      } else {
+        sprintf(buffer,"@%s",rname);
+        aopPut(AOP(result),buffer,offset);
+      }
+      offset++ ;
+      if (size)
+        emitcode("inc","%s",rname);
+    }
+  }
+
+  /* now some housekeeping stuff */
+  if (aop) {
+        /* we had to allocate for this iCode */
+    freeAsmop(NULL,aop,ic,TRUE);
+  } else {
+        /* we did not allocate which means left
+           already in a pointer register, then
+           if size > 0 && this could be used again
+           we have to point it back to where it
+           belongs */
+    if (AOP_SIZE(result) > 1 &&
+        !OP_SYMBOL(left)->remat &&
+        ( OP_SYMBOL(left)->liveTo > ic->seq ||
+          ic->depth )) {
+      int size = AOP_SIZE(result) - 1;
+      while (size--)
+        emitcode("dec","%s",rname);
+    }
+  }
+
+  /* done */
+  freeAsmop(result,NULL,ic,TRUE);
+
 }
 
 /*-----------------------------------------------------------------*/
 /* genPagedPointerGet - emitcode for paged pointer fetch           */
 /*-----------------------------------------------------------------*/
-static void genPagedPointerGet (operand *left, 
-                               operand *result, 
-                               iCode *ic)
+static void genPagedPointerGet (operand *left,
+        operand *result,
+        iCode *ic)
 {
-       asmop *aop = NULL;
-       regs *preg = NULL ;
-       char *rname ;
-       sym_link *rtype, *retype;    
-
-       rtype = operandType(result);
-       retype= getSpec(rtype);
-    
-       aopOp(left,ic,FALSE);
-
-       /* if the value is already in a pointer register
-          then don't need anything more */
-       if (!AOP_INPREG(AOP(left))) {
-                               /* otherwise get a free pointer register */
-               aop = newAsmop(0);
-               preg = getFreePtr(ic,&aop,FALSE,0);
-               emitcode("mov","%s,%s",
-                        preg->name,
-                        aopGet(AOP(left),0));
-               rname = preg->name ;
-       } else
-               rname = aopGet(AOP(left),0);
-    
-       freeAsmop(left,NULL,ic,TRUE);
-       aopOp (result,ic,FALSE);
-
-       /* if bitfield then unpack the bits */
-       if (IS_BITVAR(retype)) 
-               genUnpackBits (result,rname,PPOINTER);
-       else {
-                               /* we have can just get the values */
-               int size = AOP_SIZE(result);
-               int offset = 0 ;        
-       
-               while (size--) {
-           
-                       emitcode("movx","a,@%s",rname);
-                       aopPut(AOP(result),"a",offset);
-           
-                       offset++ ;
-           
-                       if (size)
-                               emitcode("inc","%s",rname);
-               }
-       }
-
-       /* now some housekeeping stuff */
-       if (aop) {
-                               /* we had to allocate for this iCode */
-               freeAsmop(NULL,aop,ic,TRUE);
-       } else { 
-                               /* we did not allocate which means left
-                                  already in a pointer register, then
-                                  if size > 0 && this could be used again
-                                  we have to point it back to where it 
-                                  belongs */
-               if (AOP_SIZE(result) > 1 &&
-                   !OP_SYMBOL(left)->remat &&
-                   ( OP_SYMBOL(left)->liveTo > ic->seq ||
-                     ic->depth )) {
-                       int size = AOP_SIZE(result) - 1;
-                       while (size--)
-                               emitcode("dec","%s",rname);
-               }
-       }
-
-       /* done */
-       freeAsmop(result,NULL,ic,TRUE);
-    
-       
+  asmop *aop = NULL;
+  regs *preg = NULL ;
+  char *rname ;
+  sym_link *rtype, *retype;
+
+  rtype = operandType(result);
+  retype= getSpec(rtype);
+
+  aopOp(left,ic,FALSE);
+
+  /* if the value is already in a pointer register
+     then don't need anything more */
+  if (!AOP_INPREG(AOP(left))) {
+        /* otherwise get a free pointer register */
+    aop = newAsmop(0);
+    preg = getFreePtr(ic,&aop,FALSE,0);
+    emitcode("mov","%s,%s",
+       preg->name,
+       aopGet(AOP(left),0));
+    rname = preg->name ;
+  } else
+    rname = aopGet(AOP(left),0);
+
+  freeAsmop(left,NULL,ic,TRUE);
+  aopOp (result,ic,FALSE);
+
+  /* if bitfield then unpack the bits */
+  if (IS_BITVAR(retype))
+    genUnpackBits (result,rname,PPOINTER);
+  else {
+        /* we have can just get the values */
+    int size = AOP_SIZE(result);
+    int offset = 0 ;
+
+    while (size--) {
+
+      emitcode("movx","a,@%s",rname);
+      aopPut(AOP(result),"a",offset);
+
+      offset++ ;
+
+      if (size)
+        emitcode("inc","%s",rname);
+    }
+  }
+
+  /* now some housekeeping stuff */
+  if (aop) {
+        /* we had to allocate for this iCode */
+    freeAsmop(NULL,aop,ic,TRUE);
+  } else {
+        /* we did not allocate which means left
+           already in a pointer register, then
+           if size > 0 && this could be used again
+           we have to point it back to where it
+           belongs */
+    if (AOP_SIZE(result) > 1 &&
+        !OP_SYMBOL(left)->remat &&
+        ( OP_SYMBOL(left)->liveTo > ic->seq ||
+          ic->depth )) {
+      int size = AOP_SIZE(result) - 1;
+      while (size--)
+        emitcode("dec","%s",rname);
+    }
+  }
+
+  /* done */
+  freeAsmop(result,NULL,ic,TRUE);
+
+
 }
 
 /*-----------------------------------------------------------------*/
 /* genFarPointerGet - gget value from far space                    */
 /*-----------------------------------------------------------------*/
 static void genFarPointerGet (operand *left,
-                             operand *result, iCode *ic)
+            operand *result, iCode *ic)
 {
-       int size, offset ;
-       sym_link *retype = getSpec(operandType(result));
-
-       aopOp(left,ic,FALSE);
-
-       /* if the operand is already in dptr 
-          then we do nothing else we move the value to dptr */
-       if (AOP_TYPE(left) != AOP_STR) {
-                               /* if this is remateriazable */
-               if (AOP_TYPE(left) == AOP_IMMD)
-                       emitcode("mov","dptr,%s",aopGet(AOP(left),0));
-               else { /* we need to get it byte by byte */
-                       emitcode("mov","dpl,%s",aopGet(AOP(left),0));
-                       emitcode("mov","dph,%s",aopGet(AOP(left),1));
-                       if (options.model == MODEL_FLAT24)
-                               {
-                                       emitcode("mov", "dpx,%s",aopGet(AOP(left),2));
-                               }
-               }
-       }
-       /* so dptr know contains the address */
-       freeAsmop(left,NULL,ic,TRUE);
-       aopOp(result,ic,FALSE);
-
-       /* if bit then unpack */
-       if (IS_BITVAR(retype)) 
-               genUnpackBits(result,"dptr",FPOINTER);
-       else {
-               size = AOP_SIZE(result);
-               offset = 0 ;
-
-               while (size--) {
-                       emitcode("movx","a,@dptr");
-                       aopPut(AOP(result),"a",offset++);
-                       if (size)
-                               emitcode("inc","dptr");
-               }
-       }
-
-       freeAsmop(result,NULL,ic,TRUE);
+  int size, offset ;
+  sym_link *retype = getSpec(operandType(result));
+
+  aopOp(left,ic,FALSE);
+
+  /* if the operand is already in dptr
+     then we do nothing else we move the value to dptr */
+  if (AOP_TYPE(left) != AOP_STR) {
+        /* if this is remateriazable */
+    if (AOP_TYPE(left) == AOP_IMMD)
+      emitcode("mov","dptr,%s",aopGet(AOP(left),0));
+    else { /* we need to get it byte by byte */
+      emitcode("mov","dpl,%s",aopGet(AOP(left),0));
+      emitcode("mov","dph,%s",aopGet(AOP(left),1));
+      if (options.model == MODEL_FLAT24)
+        {
+          emitcode("mov", "dpx,%s",aopGet(AOP(left),2));
+        }
+    }
+  }
+  /* so dptr know contains the address */
+  freeAsmop(left,NULL,ic,TRUE);
+  aopOp(result,ic,FALSE);
+
+  /* if bit then unpack */
+  if (IS_BITVAR(retype))
+    genUnpackBits(result,"dptr",FPOINTER);
+  else {
+    size = AOP_SIZE(result);
+    offset = 0 ;
+
+    while (size--) {
+      emitcode("movx","a,@dptr");
+      aopPut(AOP(result),"a",offset++);
+      if (size)
+        emitcode("inc","dptr");
+    }
+  }
+
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* emitcodePointerGet - gget value from code space                  */
 /*-----------------------------------------------------------------*/
 static void emitcodePointerGet (operand *left,
-                               operand *result, iCode *ic)
+        operand *result, iCode *ic)
 {
-       int size, offset ;
-       sym_link *retype = getSpec(operandType(result));
-
-       aopOp(left,ic,FALSE);
-
-       /* if the operand is already in dptr 
-          then we do nothing else we move the value to dptr */
-       if (AOP_TYPE(left) != AOP_STR) {
-                               /* if this is remateriazable */
-               if (AOP_TYPE(left) == AOP_IMMD)
-                       emitcode("mov","dptr,%s",aopGet(AOP(left),0));
-               else { /* we need to get it byte by byte */
-                       emitcode("mov","dpl,%s",aopGet(AOP(left),0));
-                       emitcode("mov","dph,%s",aopGet(AOP(left),1));
-                       if (options.model == MODEL_FLAT24)
-                               {
-                                       emitcode("mov", "dpx,%s",aopGet(AOP(left),2));
-                               }
-               }
-       }
-       /* so dptr know contains the address */
-       freeAsmop(left,NULL,ic,TRUE);
-       aopOp(result,ic,FALSE);
-
-       /* if bit then unpack */
-       if (IS_BITVAR(retype)) 
-               genUnpackBits(result,"dptr",CPOINTER);
-       else {
-               size = AOP_SIZE(result);
-               offset = 0 ;
-
-               while (size--) {
-                       emitcode("clr","a");
-                       emitcode("movc","a,@a+dptr");
-                       aopPut(AOP(result),"a",offset++);
-                       if (size)
-                               emitcode("inc","dptr");
-               }
-       }
-
-       freeAsmop(result,NULL,ic,TRUE);
+  int size, offset ;
+  sym_link *retype = getSpec(operandType(result));
+
+  aopOp(left,ic,FALSE);
+
+  /* if the operand is already in dptr
+     then we do nothing else we move the value to dptr */
+  if (AOP_TYPE(left) != AOP_STR) {
+        /* if this is remateriazable */
+    if (AOP_TYPE(left) == AOP_IMMD)
+      emitcode("mov","dptr,%s",aopGet(AOP(left),0));
+    else { /* we need to get it byte by byte */
+      emitcode("mov","dpl,%s",aopGet(AOP(left),0));
+      emitcode("mov","dph,%s",aopGet(AOP(left),1));
+      if (options.model == MODEL_FLAT24)
+        {
+          emitcode("mov", "dpx,%s",aopGet(AOP(left),2));
+        }
+    }
+  }
+  /* so dptr know contains the address */
+  freeAsmop(left,NULL,ic,TRUE);
+  aopOp(result,ic,FALSE);
+
+  /* if bit then unpack */
+  if (IS_BITVAR(retype))
+    genUnpackBits(result,"dptr",CPOINTER);
+  else {
+    size = AOP_SIZE(result);
+    offset = 0 ;
+
+    while (size--) {
+      emitcode("clr","a");
+      emitcode("movc","a,@a+dptr");
+      aopPut(AOP(result),"a",offset++);
+      if (size)
+        emitcode("inc","dptr");
+    }
+  }
+
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genGenPointerGet - gget value from generic pointer space        */
 /*-----------------------------------------------------------------*/
 static void genGenPointerGet (operand *left,
-                             operand *result, iCode *ic)
+            operand *result, iCode *ic)
 {
-       int size, offset ;
-       sym_link *retype = getSpec(operandType(result));
-
-       aopOp(left,ic,FALSE);
-
-       /* if the operand is already in dptr 
-          then we do nothing else we move the value to dptr */
-       if (AOP_TYPE(left) != AOP_STR) {
-                               /* if this is remateriazable */
-               if (AOP_TYPE(left) == AOP_IMMD) {
-                       emitcode("mov","dptr,%s",aopGet(AOP(left),0));
-                       emitcode("mov","b,#%d",pointerCode(retype));
-               }
-               else { /* we need to get it byte by byte */
-                       emitcode("mov","dpl,%s",aopGet(AOP(left),0));
-                       emitcode("mov","dph,%s",aopGet(AOP(left),1));
-                       if (options.model == MODEL_FLAT24)
-                               {
-                                       emitcode("mov", "dpx,%s",aopGet(AOP(left),2));
-                                       emitcode("mov","b,%s",aopGet(AOP(left),3));
-                               }
-                       else
-                               {
-                                       emitcode("mov","b,%s",aopGet(AOP(left),2));
-                               }
-               }
-       }
-       /* so dptr know contains the address */
-       freeAsmop(left,NULL,ic,TRUE);
-       aopOp(result,ic,FALSE); 
-
-       /* if bit then unpack */
-       if (IS_BITVAR(retype)) 
-               genUnpackBits(result,"dptr",GPOINTER);
-       else {
-               size = AOP_SIZE(result);
-               offset = 0 ;
-
-               while (size--) {
-                       emitcode("lcall","__gptrget");
-                       aopPut(AOP(result),"a",offset++);
-                       if (size)
-                               emitcode("inc","dptr");
-               }
-       }
-
-       freeAsmop(result,NULL,ic,TRUE);
+  int size, offset ;
+  sym_link *retype = getSpec(operandType(result));
+
+  aopOp(left,ic,FALSE);
+
+  /* if the operand is already in dptr
+     then we do nothing else we move the value to dptr */
+  if (AOP_TYPE(left) != AOP_STR) {
+        /* if this is remateriazable */
+    if (AOP_TYPE(left) == AOP_IMMD) {
+      emitcode("mov","dptr,%s",aopGet(AOP(left),0));
+      emitcode("mov","b,#%d",pointerCode(retype));
+    }
+    else { /* we need to get it byte by byte */
+      emitcode("mov","dpl,%s",aopGet(AOP(left),0));
+      emitcode("mov","dph,%s",aopGet(AOP(left),1));
+      if (options.model == MODEL_FLAT24)
+        {
+          emitcode("mov", "dpx,%s",aopGet(AOP(left),2));
+          emitcode("mov","b,%s",aopGet(AOP(left),3));
+        }
+      else
+        {
+          emitcode("mov","b,%s",aopGet(AOP(left),2));
+        }
+    }
+  }
+  /* so dptr know contains the address */
+  freeAsmop(left,NULL,ic,TRUE);
+  aopOp(result,ic,FALSE);
+
+  /* if bit then unpack */
+  if (IS_BITVAR(retype))
+    genUnpackBits(result,"dptr",GPOINTER);
+  else {
+    size = AOP_SIZE(result);
+    offset = 0 ;
+
+    while (size--) {
+      emitcode("lcall","__gptrget");
+      aopPut(AOP(result),"a",offset++);
+      if (size)
+        emitcode("inc","dptr");
+    }
+  }
+
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3650,65 +3650,65 @@ static void genGenPointerGet (operand *left,
 /*-----------------------------------------------------------------*/
 static void genPointerGet (iCode *ic)
 {
-       operand *left, *result ;
-       sym_link *type, *etype;
-       int p_type;
-
-       left = IC_LEFT(ic);
-       result = IC_RESULT(ic) ;
-
-       /* depending on the type of pointer we need to
-          move it to the correct pointer register */
-       type = operandType(left);
-       etype = getSpec(type);
-       /* if left is of type of pointer then it is simple */
-       if (IS_PTR(type) && !IS_FUNC(type->next)) 
-               p_type = DCL_TYPE(type);
-       else {
-                               /* we have to go by the storage class */
-               p_type = PTR_TYPE(SPEC_OCLS(etype));
-
-                               /*      if (SPEC_OCLS(etype)->codesp ) { */
-                               /*          p_type = CPOINTER ;  */
-                               /*      } */
-                               /*      else */
-                               /*          if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
-                               /*              p_type = FPOINTER ; */
-                               /*          else */
-                               /*              if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
-                               /*                  p_type = PPOINTER; */
-                               /*              else */
-                               /*                  if (SPEC_OCLS(etype) == idata ) */
-                               /*                      p_type = IPOINTER; */
-                               /*                  else */
-                               /*                      p_type = POINTER ; */
-       }
-
-       /* now that we have the pointer type we assign
-          the pointer values */
-       switch (p_type) {
-
-       case POINTER:   
-       case IPOINTER:
-               genNearPointerGet (left,result,ic);
-               break;
-
-       case PPOINTER:
-               genPagedPointerGet(left,result,ic);
-               break;
-
-       case FPOINTER:
-               genFarPointerGet (left,result,ic);
-               break;
-
-       case CPOINTER:
-               emitcodePointerGet (left,result,ic);
-               break;
-
-       case GPOINTER:
-               genGenPointerGet (left,result,ic);
-               break;
-       }
+  operand *left, *result ;
+  sym_link *type, *etype;
+  int p_type;
+
+  left = IC_LEFT(ic);
+  result = IC_RESULT(ic) ;
+
+  /* depending on the type of pointer we need to
+     move it to the correct pointer register */
+  type = operandType(left);
+  etype = getSpec(type);
+  /* if left is of type of pointer then it is simple */
+  if (IS_PTR(type) && !IS_FUNC(type->next))
+    p_type = DCL_TYPE(type);
+  else {
+        /* we have to go by the storage class */
+    p_type = PTR_TYPE(SPEC_OCLS(etype));
+
+        /*  if (SPEC_OCLS(etype)->codesp ) { */
+        /*      p_type = CPOINTER ;  */
+        /*  } */
+        /*  else */
+        /*      if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
+        /*    p_type = FPOINTER ; */
+        /*      else */
+        /*    if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
+        /*        p_type = PPOINTER; */
+        /*    else */
+        /*        if (SPEC_OCLS(etype) == idata ) */
+        /*      p_type = IPOINTER; */
+        /*        else */
+        /*      p_type = POINTER ; */
+  }
+
+  /* now that we have the pointer type we assign
+     the pointer values */
+  switch (p_type) {
+
+  case POINTER:
+  case IPOINTER:
+    genNearPointerGet (left,result,ic);
+    break;
+
+  case PPOINTER:
+    genPagedPointerGet(left,result,ic);
+    break;
+
+  case FPOINTER:
+    genFarPointerGet (left,result,ic);
+    break;
+
+  case CPOINTER:
+    emitcodePointerGet (left,result,ic);
+    break;
+
+  case GPOINTER:
+    genGenPointerGet (left,result,ic);
+    break;
+  }
 
 }
 
@@ -3716,270 +3716,270 @@ static void genPointerGet (iCode *ic)
 /* genPackBits - generates code for packed bit storage             */
 /*-----------------------------------------------------------------*/
 static void genPackBits (sym_link    *etype ,
-                        operand *right ,
-                        char *rname, int p_type)
+       operand *right ,
+       char *rname, int p_type)
 {
-       int shCount = 0 ;
-       int offset = 0  ;
-       int rLen = 0 ;
-       int blen, bstr ;   
-       char *l ;
-
-       blen = SPEC_BLEN(etype);
-       bstr = SPEC_BSTR(etype);
-
-       l = aopGet(AOP(right),offset++);
-       MOVA(l);   
-
-       /* if the bit lenth is less than or    */
-       /* it exactly fits a byte then         */
-       if (SPEC_BLEN(etype) <= 8 )  {
-               shCount = SPEC_BSTR(etype) ;
-
-                               /* shift left acc */
-               //              AccLsh(shCount);
-
-               if (SPEC_BLEN(etype) < 8 ) { /* if smaller than a byte */
-
-
-                       switch (p_type) {
-                       case POINTER:
-                               emitcode ("mov","b,a");
-                               emitcode("mov","a,@%s",rname);
-                               break;
-
-                       case FPOINTER:
-                               emitcode ("mov","b,a");
-                               emitcode("movx","a,@dptr");
-                               break;
-
-                       case GPOINTER:
-                               emitcode ("push","b");
-                               emitcode ("push","acc");
-                               emitcode ("lcall","__gptrget");
-                               emitcode ("pop","b");
-                               break;
-                       }
-
-                       emitcode ("anl","a,#0x%02x",(unsigned char)
-                                 ((unsigned char)(0xFF << (blen+bstr)) | 
-                                  (unsigned char)(0xFF >> (8-bstr)) ) );
-                       emitcode ("orl","a,b");
-                       if (p_type == GPOINTER)
-                               emitcode("pop","b");
-               }
-       }
-
-       switch (p_type) {
-       case POINTER:
-               emitcode("mov","@%s,a",rname);
-               break;
-
-       case FPOINTER:
-               emitcode("movx","@dptr,a");
-               break;
-
-       case GPOINTER:
-               emitcode("lcall","__gptrput");
-               break;
-       }
-
-       /* if we r done */
-       if ( SPEC_BLEN(etype) <= 8 )
-               return ;
-
-       emitcode("inc","%s",rname);
-       rLen = SPEC_BLEN(etype) ;     
-
-       /* now generate for lengths greater than one byte */
-       while (1) {
-
-               l = aopGet(AOP(right),offset++);
-
-               rLen -= 8 ;
-               if (rLen <= 0 )
-                       break ;
-
-               switch (p_type) {
-               case POINTER:
-                       if (*l == '@') {
-                               MOVA(l);
-                               emitcode("mov","@%s,a",rname);
-                       } else
-                               emitcode("mov","@%s,%s",rname,l);
-                       break;
-
-               case FPOINTER:
-                       MOVA(l);
-                       emitcode("movx","@dptr,a");
-                       break;
-
-               case GPOINTER:
-                       MOVA(l);
-                       emitcode("lcall","__gptrput");
-                       break;  
-               }   
-               emitcode ("inc","%s",rname);
-       }
-
-       MOVA(l);
-
-       /* last last was not complete */
-       if (rLen)   {
-                               /* save the byte & read byte */
-               switch (p_type) {
-               case POINTER:
-                       emitcode ("mov","b,a");
-                       emitcode("mov","a,@%s",rname);
-                       break;
-
-               case FPOINTER:
-                       emitcode ("mov","b,a");
-                       emitcode("movx","a,@dptr");
-                       break;
-
-               case GPOINTER:
-                       emitcode ("push","b");
-                       emitcode ("push","acc");
-                       emitcode ("lcall","__gptrget");
-                       emitcode ("pop","b");
-                       break;
-               }
-
-               emitcode ("anl","a,#0x%02x",((unsigned char)-1 << -rLen) );
-               emitcode ("orl","a,b");
-       }
-
-       if (p_type == GPOINTER)
-               emitcode("pop","b");
-
-       switch (p_type) {
-
-       case POINTER:
-               emitcode("mov","@%s,a",rname);
-               break;
-       
-       case FPOINTER:
-               emitcode("movx","@dptr,a");
-               break;
-       
-       case GPOINTER:
-               emitcode("lcall","__gptrput");
-               break;                  
-       }
+  int shCount = 0 ;
+  int offset = 0  ;
+  int rLen = 0 ;
+  int blen, bstr ;
+  char *l ;
+
+  blen = SPEC_BLEN(etype);
+  bstr = SPEC_BSTR(etype);
+
+  l = aopGet(AOP(right),offset++);
+  MOVA(l);
+
+  /* if the bit lenth is less than or    */
+  /* it exactly fits a byte then         */
+  if (SPEC_BLEN(etype) <= 8 )  {
+    shCount = SPEC_BSTR(etype) ;
+
+        /* shift left acc */
+    //    AccLsh(shCount);
+
+    if (SPEC_BLEN(etype) < 8 ) { /* if smaller than a byte */
+
+
+      switch (p_type) {
+      case POINTER:
+        emitcode ("mov","b,a");
+        emitcode("mov","a,@%s",rname);
+        break;
+
+      case FPOINTER:
+        emitcode ("mov","b,a");
+        emitcode("movx","a,@dptr");
+        break;
+
+      case GPOINTER:
+        emitcode ("push","b");
+        emitcode ("push","acc");
+        emitcode ("lcall","__gptrget");
+        emitcode ("pop","b");
+        break;
+      }
+
+      emitcode ("anl","a,#0x%02x",(unsigned char)
+          ((unsigned char)(0xFF << (blen+bstr)) |
+           (unsigned char)(0xFF >> (8-bstr)) ) );
+      emitcode ("orl","a,b");
+      if (p_type == GPOINTER)
+        emitcode("pop","b");
+    }
+  }
+
+  switch (p_type) {
+  case POINTER:
+    emitcode("mov","@%s,a",rname);
+    break;
+
+  case FPOINTER:
+    emitcode("movx","@dptr,a");
+    break;
+
+  case GPOINTER:
+    emitcode("lcall","__gptrput");
+    break;
+  }
+
+  /* if we r done */
+  if ( SPEC_BLEN(etype) <= 8 )
+    return ;
+
+  emitcode("inc","%s",rname);
+  rLen = SPEC_BLEN(etype) ;
+
+  /* now generate for lengths greater than one byte */
+  while (1) {
+
+    l = aopGet(AOP(right),offset++);
+
+    rLen -= 8 ;
+    if (rLen <= 0 )
+      break ;
+
+    switch (p_type) {
+    case POINTER:
+      if (*l == '@') {
+        MOVA(l);
+        emitcode("mov","@%s,a",rname);
+      } else
+        emitcode("mov","@%s,%s",rname,l);
+      break;
+
+    case FPOINTER:
+      MOVA(l);
+      emitcode("movx","@dptr,a");
+      break;
+
+    case GPOINTER:
+      MOVA(l);
+      emitcode("lcall","__gptrput");
+      break;
+    }
+    emitcode ("inc","%s",rname);
+  }
+
+  MOVA(l);
+
+  /* last last was not complete */
+  if (rLen)   {
+        /* save the byte & read byte */
+    switch (p_type) {
+    case POINTER:
+      emitcode ("mov","b,a");
+      emitcode("mov","a,@%s",rname);
+      break;
+
+    case FPOINTER:
+      emitcode ("mov","b,a");
+      emitcode("movx","a,@dptr");
+      break;
+
+    case GPOINTER:
+      emitcode ("push","b");
+      emitcode ("push","acc");
+      emitcode ("lcall","__gptrget");
+      emitcode ("pop","b");
+      break;
+    }
+
+    emitcode ("anl","a,#0x%02x",((unsigned char)-1 << -rLen) );
+    emitcode ("orl","a,b");
+  }
+
+  if (p_type == GPOINTER)
+    emitcode("pop","b");
+
+  switch (p_type) {
+
+  case POINTER:
+    emitcode("mov","@%s,a",rname);
+    break;
+
+  case FPOINTER:
+    emitcode("movx","@dptr,a");
+    break;
+
+  case GPOINTER:
+    emitcode("lcall","__gptrput");
+    break;
+  }
 }
 /*-----------------------------------------------------------------*/
 /* genDataPointerSet - remat pointer to data space                 */
 /*-----------------------------------------------------------------*/
 static void genDataPointerSet(operand *right,
-                             operand *result,
-                             iCode *ic)
+            operand *result,
+            iCode *ic)
 {
-       int size, offset = 0 ;
-       char *l, buffer[256];
-
-       aopOp(right,ic,FALSE);
-    
-       l = aopGet(AOP(result),0);
-       size = AOP_SIZE(right);
-       while (size--) {
-               if (offset)
-                       sprintf(buffer,"(%s + %d)",l+1,offset);
-               else
-                       sprintf(buffer,"%s",l+1);
-               emitcode("mov","%s,%s",buffer,
-                        aopGet(AOP(right),offset++));
-       }
-
-       freeAsmop(right,NULL,ic,TRUE);
-       freeAsmop(result,NULL,ic,TRUE);
+  int size, offset = 0 ;
+  char *l, buffer[256];
+
+  aopOp(right,ic,FALSE);
+
+  l = aopGet(AOP(result),0);
+  size = AOP_SIZE(right);
+  while (size--) {
+    if (offset)
+      sprintf(buffer,"(%s + %d)",l+1,offset);
+    else
+      sprintf(buffer,"%s",l+1);
+    emitcode("mov","%s,%s",buffer,
+       aopGet(AOP(right),offset++));
+  }
+
+  freeAsmop(right,NULL,ic,TRUE);
+  freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genNearPointerSet - emitcode for near pointer put                */
 /*-----------------------------------------------------------------*/
 static void genNearPointerSet (operand *right,
-                              operand *result, 
-                              iCode *ic)
+             operand *result,
+             iCode *ic)
 {
-       asmop *aop = NULL;
-       regs *preg = NULL ;
-       char *rname , *l;
-       sym_link *retype;
-       sym_link *ptype = operandType(result);
-    
-       retype= getSpec(operandType(right));
-
-       aopOp(result,ic,FALSE);
-    
-       /* if the result is rematerializable &
-          in data space & not a bit variable */
-       if (AOP_TYPE(result) == AOP_IMMD &&
-           DCL_TYPE(ptype) == POINTER   &&
-           !IS_BITVAR(retype)) {
-               genDataPointerSet (right,result,ic);
-               return;
-       }
-
-       /* if the value is already in a pointer register
-          then don't need anything more */
-       if (!AOP_INPREG(AOP(result))) {
-                               /* otherwise get a free pointer register */
-               aop = newAsmop(0);
-               preg = getFreePtr(ic,&aop,FALSE,0);
-               emitcode("mov","%s,%s",
-                        preg->name,
-                        aopGet(AOP(result),0));
-               rname = preg->name ;
-       } else
-               rname = aopGet(AOP(result),0);
-
-       freeAsmop(result,NULL,ic,TRUE);
-       aopOp (right,ic,FALSE);
-
-       /* if bitfield then unpack the bits */
-       if (IS_BITVAR(retype)) 
-               genPackBits (retype,right,rname,POINTER);
-       else {
-                               /* we have can just get the values */
-               int size = AOP_SIZE(right);
-               int offset = 0 ;    
-
-               while (size--) {
-                       l = aopGet(AOP(right),offset);
-                       if (*l == '@' ) {
-                               MOVA(l);
-                               emitcode("mov","@%s,a",rname);
-                       } else
-                               emitcode("mov","@%s,%s",rname,l);
-                       if (size)
-                               emitcode("inc","%s",rname);
-                       offset++;
-               }
-       }
-
-       /* now some housekeeping stuff */
-       if (aop) {
-                               /* we had to allocate for this iCode */
-               freeAsmop(NULL,aop,ic,TRUE);
-       } else { 
-                               /* we did not allocate which means left
-                                  already in a pointer register, then
-                                  if size > 0 && this could be used again
-                                  we have to point it back to where it 
-                                  belongs */
-               if (AOP_SIZE(right) > 1 &&
-                   !OP_SYMBOL(result)->remat &&
-                   ( OP_SYMBOL(result)->liveTo > ic->seq ||
-                     ic->depth )) {
-                       int size = AOP_SIZE(right) - 1;
-                       while (size--)
-                               emitcode("dec","%s",rname);
-               }
-       }
-
-       /* done */
-       freeAsmop(right,NULL,ic,TRUE);
+  asmop *aop = NULL;
+  regs *preg = NULL ;
+  char *rname , *l;
+  sym_link *retype;
+  sym_link *ptype = operandType(result);
+
+  retype= getSpec(operandType(right));
+
+  aopOp(result,ic,FALSE);
+
+  /* if the result is rematerializable &
+     in data space & not a bit variable */
+  if (AOP_TYPE(result) == AOP_IMMD &&
+      DCL_TYPE(ptype) == POINTER   &&
+      !IS_BITVAR(retype)) {
+    genDataPointerSet (right,result,ic);
+    return;
+  }
+
+  /* if the value is already in a pointer register
+     then don't need anything more */
+  if (!AOP_INPREG(AOP(result))) {
+        /* otherwise get a free pointer register */
+    aop = newAsmop(0);
+    preg = getFreePtr(ic,&aop,FALSE,0);
+    emitcode("mov","%s,%s",
+       preg->name,
+       aopGet(AOP(result),0));
+    rname = preg->name ;
+  } else
+    rname = aopGet(AOP(result),0);
+
+  freeAsmop(result,NULL,ic,TRUE);
+  aopOp (right,ic,FALSE);
+
+  /* if bitfield then unpack the bits */
+  if (IS_BITVAR(retype))
+    genPackBits (retype,right,rname,POINTER);
+  else {
+        /* we have can just get the values */
+    int size = AOP_SIZE(right);
+    int offset = 0 ;
+
+    while (size--) {
+      l = aopGet(AOP(right),offset);
+      if (*l == '@' ) {
+        MOVA(l);
+        emitcode("mov","@%s,a",rname);
+      } else
+        emitcode("mov","@%s,%s",rname,l);
+      if (size)
+        emitcode("inc","%s",rname);
+      offset++;
+    }
+  }
+
+  /* now some housekeeping stuff */
+  if (aop) {
+        /* we had to allocate for this iCode */
+    freeAsmop(NULL,aop,ic,TRUE);
+  } else {
+        /* we did not allocate which means left
+           already in a pointer register, then
+           if size > 0 && this could be used again
+           we have to point it back to where it
+           belongs */
+    if (AOP_SIZE(right) > 1 &&
+        !OP_SYMBOL(result)->remat &&
+        ( OP_SYMBOL(result)->liveTo > ic->seq ||
+          ic->depth )) {
+      int size = AOP_SIZE(right) - 1;
+      while (size--)
+        emitcode("dec","%s",rname);
+    }
+  }
+
+  /* done */
+  freeAsmop(right,NULL,ic,TRUE);
 
 
 }
@@ -3988,247 +3988,247 @@ static void genNearPointerSet (operand *right,
 /* genPagedPointerSet - emitcode for Paged pointer put             */
 /*-----------------------------------------------------------------*/
 static void genPagedPointerSet (operand *right,
-                               operand *result, 
-                               iCode *ic)
+        operand *result,
+        iCode *ic)
 {
-       asmop *aop = NULL;
-       regs *preg = NULL ;
-       char *rname , *l;
-       sym_link *retype;
-       
-       retype= getSpec(operandType(right));
-    
-       aopOp(result,ic,FALSE);
-    
-       /* if the value is already in a pointer register
-          then don't need anything more */
-       if (!AOP_INPREG(AOP(result))) {
-                               /* otherwise get a free pointer register */
-               aop = newAsmop(0);
-               preg = getFreePtr(ic,&aop,FALSE,0);
-               emitcode("mov","%s,%s",
-                        preg->name,
-                        aopGet(AOP(result),0));
-               rname = preg->name ;
-       } else
-               rname = aopGet(AOP(result),0);
-    
-       freeAsmop(result,NULL,ic,TRUE);
-       aopOp (right,ic,FALSE);
-
-       /* if bitfield then unpack the bits */
-       if (IS_BITVAR(retype)) 
-               genPackBits (retype,right,rname,PPOINTER);
-       else {
-                               /* we have can just get the values */
-               int size = AOP_SIZE(right);
-               int offset = 0 ;        
-       
-               while (size--) {
-                       l = aopGet(AOP(right),offset);
-           
-                       MOVA(l);
-                       emitcode("movx","@%s,a",rname);
-
-                       if (size)
-                               emitcode("inc","%s",rname);
-
-                       offset++;
-               }
-       }
-    
-       /* now some housekeeping stuff */
-       if (aop) {
-                               /* we had to allocate for this iCode */
-               freeAsmop(NULL,aop,ic,TRUE);
-       } else { 
-                               /* we did not allocate which means left
-                                  already in a pointer register, then
-                                  if size > 0 && this could be used again
-                                  we have to point it back to where it 
-                                  belongs */
-               if (AOP_SIZE(right) > 1 &&
-                   !OP_SYMBOL(result)->remat &&
-                   ( OP_SYMBOL(result)->liveTo > ic->seq ||
-                     ic->depth )) {
-                       int size = AOP_SIZE(right) - 1;
-                       while (size--)
-                               emitcode("dec","%s",rname);
-               }
-       }
-
-       /* done */
-       freeAsmop(right,NULL,ic,TRUE);
-    
-       
+  asmop *aop = NULL;
+  regs *preg = NULL ;
+  char *rname , *l;
+  sym_link *retype;
+
+  retype= getSpec(operandType(right));
+
+  aopOp(result,ic,FALSE);
+
+  /* if the value is already in a pointer register
+     then don't need anything more */
+  if (!AOP_INPREG(AOP(result))) {
+        /* otherwise get a free pointer register */
+    aop = newAsmop(0);
+    preg = getFreePtr(ic,&aop,FALSE,0);
+    emitcode("mov","%s,%s",
+       preg->name,
+       aopGet(AOP(result),0));
+    rname = preg->name ;
+  } else
+    rname = aopGet(AOP(result),0);
+
+  freeAsmop(result,NULL,ic,TRUE);
+  aopOp (right,ic,FALSE);
+
+  /* if bitfield then unpack the bits */
+  if (IS_BITVAR(retype))
+    genPackBits (retype,right,rname,PPOINTER);
+  else {
+        /* we have can just get the values */
+    int size = AOP_SIZE(right);
+    int offset = 0 ;
+
+    while (size--) {
+      l = aopGet(AOP(right),offset);
+
+      MOVA(l);
+      emitcode("movx","@%s,a",rname);
+
+      if (size)
+        emitcode("inc","%s",rname);
+
+      offset++;
+    }
+  }
+
+  /* now some housekeeping stuff */
+  if (aop) {
+        /* we had to allocate for this iCode */
+    freeAsmop(NULL,aop,ic,TRUE);
+  } else {
+        /* we did not allocate which means left
+           already in a pointer register, then
+           if size > 0 && this could be used again
+           we have to point it back to where it
+           belongs */
+    if (AOP_SIZE(right) > 1 &&
+        !OP_SYMBOL(result)->remat &&
+        ( OP_SYMBOL(result)->liveTo > ic->seq ||
+          ic->depth )) {
+      int size = AOP_SIZE(right) - 1;
+      while (size--)
+        emitcode("dec","%s",rname);
+    }
+  }
+
+  /* done */
+  freeAsmop(right,NULL,ic,TRUE);
+
+
 }
 
 /*-----------------------------------------------------------------*/
 /* genFarPointerSet - set value from far space                     */
 /*-----------------------------------------------------------------*/
 static void genFarPointerSet (operand *right,
-                             operand *result, iCode *ic)
+            operand *result, iCode *ic)
 {
-       int size, offset ;
-       sym_link *retype = getSpec(operandType(right));
-
-       aopOp(result,ic,FALSE);
-
-       /* if the operand is already in dptr 
-          then we do nothing else we move the value to dptr */
-       if (AOP_TYPE(result) != AOP_STR) {
-                               /* if this is remateriazable */
-               if (AOP_TYPE(result) == AOP_IMMD)
-                       emitcode("mov","dptr,%s",aopGet(AOP(result),0));
-               else { /* we need to get it byte by byte */
-                       emitcode("mov","dpl,%s",aopGet(AOP(result),0));
-                       emitcode("mov","dph,%s",aopGet(AOP(result),1));
-                       if (options.model == MODEL_FLAT24)
-                               {
-                                       emitcode("mov", "dpx,%s",aopGet(AOP(result),2));
-                               }
-               }
-       }
-       /* so dptr know contains the address */
-       freeAsmop(result,NULL,ic,TRUE);
-       aopOp(right,ic,FALSE);
-
-       /* if bit then unpack */
-       if (IS_BITVAR(retype)) 
-               genPackBits(retype,right,"dptr",FPOINTER);
-       else {
-               size = AOP_SIZE(right);
-               offset = 0 ;
-
-               while (size--) {
-                       char *l = aopGet(AOP(right),offset++);
-                       MOVA(l);
-                       emitcode("movx","@dptr,a");
-                       if (size)
-                               emitcode("inc","dptr");
-               }
-       }
-
-       freeAsmop(right,NULL,ic,TRUE);
+  int size, offset ;
+  sym_link *retype = getSpec(operandType(right));
+
+  aopOp(result,ic,FALSE);
+
+  /* if the operand is already in dptr
+     then we do nothing else we move the value to dptr */
+  if (AOP_TYPE(result) != AOP_STR) {
+        /* if this is remateriazable */
+    if (AOP_TYPE(result) == AOP_IMMD)
+      emitcode("mov","dptr,%s",aopGet(AOP(result),0));
+    else { /* we need to get it byte by byte */
+      emitcode("mov","dpl,%s",aopGet(AOP(result),0));
+      emitcode("mov","dph,%s",aopGet(AOP(result),1));
+      if (options.model == MODEL_FLAT24)
+        {
+          emitcode("mov", "dpx,%s",aopGet(AOP(result),2));
+        }
+    }
+  }
+  /* so dptr know contains the address */
+  freeAsmop(result,NULL,ic,TRUE);
+  aopOp(right,ic,FALSE);
+
+  /* if bit then unpack */
+  if (IS_BITVAR(retype))
+    genPackBits(retype,right,"dptr",FPOINTER);
+  else {
+    size = AOP_SIZE(right);
+    offset = 0 ;
+
+    while (size--) {
+      char *l = aopGet(AOP(right),offset++);
+      MOVA(l);
+      emitcode("movx","@dptr,a");
+      if (size)
+        emitcode("inc","dptr");
+    }
+  }
+
+  freeAsmop(right,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genGenPointerSet - set value from generic pointer space         */
 /*-----------------------------------------------------------------*/
 static void genGenPointerSet (operand *right,
-                             operand *result, iCode *ic)
+            operand *result, iCode *ic)
 {
-       int size, offset ;
-       sym_link *retype = getSpec(operandType(right));
-
-       aopOp(result,ic,FALSE);
-
-       /* if the operand is already in dptr 
-          then we do nothing else we move the value to dptr */
-       if (AOP_TYPE(result) != AOP_STR) {
-                               /* if this is remateriazable */
-               if (AOP_TYPE(result) == AOP_IMMD) {
-                       emitcode("mov","dptr,%s",aopGet(AOP(result),0));
-                       emitcode("mov","b,%s + 1",aopGet(AOP(result),0));
-               }
-               else { /* we need to get it byte by byte */
-                       emitcode("mov","dpl,%s",aopGet(AOP(result),0));
-                       emitcode("mov","dph,%s",aopGet(AOP(result),1));
-                       if (options.model == MODEL_FLAT24)
-                               {
-                                       emitcode("mov", "dpx,%s",aopGet(AOP(result),2));
-                                       emitcode("mov","b,%s",aopGet(AOP(result),3));
-                               }
-                       else
-                               {
-                                       emitcode("mov","b,%s",aopGet(AOP(result),2));
-                               }
-               }
-       }
-       /* so dptr know contains the address */
-       freeAsmop(result,NULL,ic,TRUE);
-       aopOp(right,ic,FALSE);
-
-       /* if bit then unpack */
-       if (IS_BITVAR(retype)) 
-               genPackBits(retype,right,"dptr",GPOINTER);
-       else {
-               size = AOP_SIZE(right);
-               offset = 0 ;
-
-               while (size--) {
-                       char *l = aopGet(AOP(right),offset++);
-                       MOVA(l);
-                       emitcode("lcall","__gptrput");
-                       if (size)
-                               emitcode("inc","dptr");
-               }
-       }
-
-       freeAsmop(right,NULL,ic,TRUE);
+  int size, offset ;
+  sym_link *retype = getSpec(operandType(right));
+
+  aopOp(result,ic,FALSE);
+
+  /* if the operand is already in dptr
+     then we do nothing else we move the value to dptr */
+  if (AOP_TYPE(result) != AOP_STR) {
+        /* if this is remateriazable */
+    if (AOP_TYPE(result) == AOP_IMMD) {
+      emitcode("mov","dptr,%s",aopGet(AOP(result),0));
+      emitcode("mov","b,%s + 1",aopGet(AOP(result),0));
+    }
+    else { /* we need to get it byte by byte */
+      emitcode("mov","dpl,%s",aopGet(AOP(result),0));
+      emitcode("mov","dph,%s",aopGet(AOP(result),1));
+      if (options.model == MODEL_FLAT24)
+        {
+          emitcode("mov", "dpx,%s",aopGet(AOP(result),2));
+          emitcode("mov","b,%s",aopGet(AOP(result),3));
+        }
+      else
+        {
+          emitcode("mov","b,%s",aopGet(AOP(result),2));
+        }
+    }
+  }
+  /* so dptr know contains the address */
+  freeAsmop(result,NULL,ic,TRUE);
+  aopOp(right,ic,FALSE);
+
+  /* if bit then unpack */
+  if (IS_BITVAR(retype))
+    genPackBits(retype,right,"dptr",GPOINTER);
+  else {
+    size = AOP_SIZE(right);
+    offset = 0 ;
+
+    while (size--) {
+      char *l = aopGet(AOP(right),offset++);
+      MOVA(l);
+      emitcode("lcall","__gptrput");
+      if (size)
+        emitcode("inc","dptr");
+    }
+  }
+
+  freeAsmop(right,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genPointerSet - stores the value into a pointer location        */
 /*-----------------------------------------------------------------*/
 static void genPointerSet (iCode *ic)
-{    
-       operand *right, *result ;
-       sym_link *type, *etype;
-       int p_type;
-
-       right = IC_RIGHT(ic);
-       result = IC_RESULT(ic) ;
-
-       /* depending on the type of pointer we need to
-          move it to the correct pointer register */
-       type = operandType(result);
-       etype = getSpec(type);
-       /* if left is of type of pointer then it is simple */
-       if (IS_PTR(type) && !IS_FUNC(type->next)) {
-               p_type = DCL_TYPE(type);
-       }
-       else {
-                               /* we have to go by the storage class */
-               p_type = PTR_TYPE(SPEC_OCLS(etype));
-
-                               /*      if (SPEC_OCLS(etype)->codesp ) { */
-                               /*          p_type = CPOINTER ;  */
-                               /*      } */
-                               /*      else */
-                               /*          if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
-                               /*              p_type = FPOINTER ; */
-                               /*          else */
-                               /*              if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
-                               /*                  p_type = PPOINTER ; */
-                               /*              else */
-                               /*                  if (SPEC_OCLS(etype) == idata ) */
-                               /*                      p_type = IPOINTER ; */
-                               /*                  else */
-                               /*                      p_type = POINTER ; */
-       }
-
-       /* now that we have the pointer type we assign
-          the pointer values */
-       switch (p_type) {
-
-       case POINTER:
-       case IPOINTER:
-               genNearPointerSet (right,result,ic);
-               break;
-
-       case PPOINTER:
-               genPagedPointerSet (right,result,ic);
-               break;
-
-       case FPOINTER:
-               genFarPointerSet (right,result,ic);
-               break;
-
-       case GPOINTER:
-               genGenPointerSet (right,result,ic);
-               break;
-       }
+{
+  operand *right, *result ;
+  sym_link *type, *etype;
+  int p_type;
+
+  right = IC_RIGHT(ic);
+  result = IC_RESULT(ic) ;
+
+  /* depending on the type of pointer we need to
+     move it to the correct pointer register */
+  type = operandType(result);
+  etype = getSpec(type);
+  /* if left is of type of pointer then it is simple */
+  if (IS_PTR(type) && !IS_FUNC(type->next)) {
+    p_type = DCL_TYPE(type);
+  }
+  else {
+        /* we have to go by the storage class */
+    p_type = PTR_TYPE(SPEC_OCLS(etype));
+
+        /*  if (SPEC_OCLS(etype)->codesp ) { */
+        /*      p_type = CPOINTER ;  */
+        /*  } */
+        /*  else */
+        /*      if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
+        /*    p_type = FPOINTER ; */
+        /*      else */
+        /*    if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
+        /*        p_type = PPOINTER ; */
+        /*    else */
+        /*        if (SPEC_OCLS(etype) == idata ) */
+        /*      p_type = IPOINTER ; */
+        /*        else */
+        /*      p_type = POINTER ; */
+  }
+
+  /* now that we have the pointer type we assign
+     the pointer values */
+  switch (p_type) {
+
+  case POINTER:
+  case IPOINTER:
+    genNearPointerSet (right,result,ic);
+    break;
+
+  case PPOINTER:
+    genPagedPointerSet (right,result,ic);
+    break;
+
+  case FPOINTER:
+    genFarPointerSet (right,result,ic);
+    break;
+
+  case GPOINTER:
+    genGenPointerSet (right,result,ic);
+    break;
+  }
 
 }
 
@@ -4237,34 +4237,34 @@ static void genPointerSet (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genIfx (iCode *ic, iCode *popIc)
 {
-       operand *cond = IC_COND(ic);
-       int isbit =0;
-
-       aopOp(cond,ic,FALSE);
-
-       /* get the value into acc */
-       if (AOP_TYPE(cond) != AOP_CRY)
-               toBoolean(cond,"",0);
-       else
-               isbit = 1;
-       /* the result is now in the accumulator */
-       freeAsmop(cond,NULL,ic,TRUE);
-
-       /* if there was something to be popped then do it */
-       if (popIc)
-               genIpop(popIc);
-
-       /* if the condition is  a bit variable */
-       /*     if (isbit && IS_ITEMP(cond) && SPIL_LOC(cond)) { */
-       /*      //      genIfxJump(ic,SPIL_LOC(cond)->rname); */
-                       /*     } */
-                       /*     else */
-                       /*      if (isbit && !IS_ITEMP(cond)) */
-                       /*              //          genIfxJump(ic,OP_SYMBOL(cond)->rname); */
-                       /*      else */
-                       /*              // genIfxJump(ic,"a"); */
-
-                       ic->generated = 1;
+  operand *cond = IC_COND(ic);
+  int isbit =0;
+
+  aopOp(cond,ic,FALSE);
+
+  /* get the value into acc */
+  if (AOP_TYPE(cond) != AOP_CRY)
+    toBoolean(cond,"",0);
+  else
+    isbit = 1;
+  /* the result is now in the accumulator */
+  freeAsmop(cond,NULL,ic,TRUE);
+
+  /* if there was something to be popped then do it */
+  if (popIc)
+    genIpop(popIc);
+
+  /* if the condition is  a bit variable */
+  /*     if (isbit && IS_ITEMP(cond) && SPIL_LOC(cond)) { */
+  /*  //  genIfxJump(ic,SPIL_LOC(cond)->rname); */
+      /*     } */
+      /*     else */
+      /*  if (isbit && !IS_ITEMP(cond)) */
+      /*    //      genIfxJump(ic,OP_SYMBOL(cond)->rname); */
+      /*  else */
+      /*    // genIfxJump(ic,"a"); */
+
+      ic->generated = 1;
 }
 
 /*-----------------------------------------------------------------*/
@@ -4272,69 +4272,69 @@ static void genIfx (iCode *ic, iCode *popIc)
 /*-----------------------------------------------------------------*/
 static void genAddrOf (iCode *ic)
 {
-       symbol *sym = OP_SYMBOL(IC_LEFT(ic));
-       int size, offset ;
-
-       aopOp(IC_RESULT(ic),ic,FALSE);
-
-       /* 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",((char) sym->stack & 0xff));
-                       aopPut(AOP(IC_RESULT(ic)),"a",0);       
-               } else {
-                       /* we can just move _bp */
-                       aopPut(AOP(IC_RESULT(ic)),"_bp",0);
-               }
-                               /* fill the result with zero */
-               size = AOP_SIZE(IC_RESULT(ic)) - 1;
-        
-        
-               if (options.stack10bit && size < (FPTRSIZE - 1))
-                       {
-                               fprintf(stderr, 
-                                       "*** warning: pointer to stack var truncated.\n");
-                       }
-        
-               offset = 1;
-               while (size--)
-                       {
-                               /* Yuck! */
-                               if (options.stack10bit && offset == 2)
-                                       {
-                                               aopPut(AOP(IC_RESULT(ic)),"#0x40", offset++);
-                                       }
-                               else
-                                       {
-                                               aopPut(AOP(IC_RESULT(ic)),zero,offset++);
-                                       }
-                       }
-
-               goto release;
-       }
-
-       /* object not on stack then we need the name */
-       size = AOP_SIZE(IC_RESULT(ic));
-       offset = 0;
-
-       while (size--) {
-               char s[SDCC_NAME_MAX];
-               if (offset) 
-                       sprintf(s,"#(%s >> %d)",
-                               sym->rname,
-                               offset*8);
-               else
-                       sprintf(s,"#%s",sym->rname);
-               aopPut(AOP(IC_RESULT(ic)),s,offset++);
-       }
+  symbol *sym = OP_SYMBOL(IC_LEFT(ic));
+  int size, offset ;
+
+  aopOp(IC_RESULT(ic),ic,FALSE);
+
+  /* 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",((char) sym->stack & 0xff));
+      aopPut(AOP(IC_RESULT(ic)),"a",0);
+    } else {
+      /* we can just move _bp */
+      aopPut(AOP(IC_RESULT(ic)),"_bp",0);
+    }
+        /* fill the result with zero */
+    size = AOP_SIZE(IC_RESULT(ic)) - 1;
+
+
+    if (options.stack10bit && size < (FPTRSIZE - 1))
+      {
+        fprintf(stderr,
+          "*** warning: pointer to stack var truncated.\n");
+      }
+
+    offset = 1;
+    while (size--)
+      {
+        /* Yuck! */
+        if (options.stack10bit && offset == 2)
+          {
+            aopPut(AOP(IC_RESULT(ic)),"#0x40", offset++);
+          }
+        else
+          {
+            aopPut(AOP(IC_RESULT(ic)),zero,offset++);
+          }
+      }
+
+    goto release;
+  }
+
+  /* object not on stack then we need the name */
+  size = AOP_SIZE(IC_RESULT(ic));
+  offset = 0;
+
+  while (size--) {
+    char s[SDCC_NAME_MAX];
+    if (offset)
+      sprintf(s,"#(%s >> %d)",
+        sym->rname,
+        offset*8);
+    else
+      sprintf(s,"#%s",sym->rname);
+    aopPut(AOP(IC_RESULT(ic)),s,offset++);
+  }
 
  release:
-       freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
+  freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
 
 }
 
@@ -4343,26 +4343,26 @@ static void genAddrOf (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genFarFarAssign (operand *result, operand *right, iCode *ic)
 {
-       int size = AOP_SIZE(right);
-       int offset = 0;
-       char *l ;
-       /* first push the right side on to the stack */
-       while (size--) {
-               l = aopGet(AOP(right),offset++);
-               MOVA(l);
-               emitcode ("push","acc");
-       }
-    
-       freeAsmop(right,NULL,ic,FALSE);
-       /* now assign DPTR to result */
-       aopOp(result,ic,FALSE);
-       size = AOP_SIZE(result);
-       while (size--) {
-               emitcode ("pop","acc");
-               aopPut(AOP(result),"a",--offset);
-       }
-       freeAsmop(result,NULL,ic,FALSE);
-       
+  int size = AOP_SIZE(right);
+  int offset = 0;
+  char *l ;
+  /* first push the right side on to the stack */
+  while (size--) {
+    l = aopGet(AOP(right),offset++);
+    MOVA(l);
+    emitcode ("push","acc");
+  }
+
+  freeAsmop(right,NULL,ic,FALSE);
+  /* now assign DPTR to result */
+  aopOp(result,ic,FALSE);
+  size = AOP_SIZE(result);
+  while (size--) {
+    emitcode ("pop","acc");
+    aopPut(AOP(result),"a",--offset);
+  }
+  freeAsmop(result,NULL,ic,FALSE);
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -4370,119 +4370,119 @@ static void genFarFarAssign (operand *result, operand *right, iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genAssign (iCode *ic)
 {
-       operand *result, *right;
-       int size, offset ;
-       unsigned long lit = 0L;
-
-       result = IC_RESULT(ic);
-       right  = IC_RIGHT(ic) ;
-
-       /* if they are the same */
-       if (operandsEqu (IC_RESULT(ic),IC_RIGHT(ic)))
-               return ;
-
-       aopOp(right,ic,FALSE);
-    
-       /* special case both in far space */
-       if (AOP_TYPE(right) == AOP_DPTR &&
-           IS_TRUE_SYMOP(result)       &&
-           isOperandInFarSpace(result)) {
-       
-               genFarFarAssign (result,right,ic);
-               return ;
-       }
-
-       aopOp(result,ic,TRUE);
-
-       /* if they are the same registers */
-       if (sameRegs(AOP(right),AOP(result)))
-               goto release;
-
-       /* if the result is a bit */
-       if (AOP_TYPE(result) == AOP_CRY) {
-
-                               /* if the right size is a literal then
-                                  we know what the value is */
-               if (AOP_TYPE(right) == AOP_LIT) {
-                       if (((int) operandLitValue(right))) 
-                               aopPut(AOP(result),one,0);
-                       else
-                               aopPut(AOP(result),zero,0);
-                       goto release;
-               }
-
-                               /* the right is also a bit variable */
-               if (AOP_TYPE(right) == AOP_CRY) {
-                       emitcode("mov","c,%s",AOP(right)->aopu.aop_dir);
-                       aopPut(AOP(result),"c",0);
-                       goto release ;
-               }
-
-                               /* we need to or */
-               toBoolean(right,"",0);
-               aopPut(AOP(result),"a",0);
-               goto release ;
-       }
-
-       /* bit variables done */
-       /* general case */
-       size = AOP_SIZE(result);
-       offset = 0 ;
-       if(AOP_TYPE(right) == AOP_LIT)
-               lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
-       if((size > 1) &&
-          (AOP_TYPE(result) != AOP_REG) &&
-          (AOP_TYPE(right) == AOP_LIT) &&
-          !IS_FLOAT(operandType(right)) &&
-          (lit < 256L)){
-               emitcode("clr","a");
-               while (size--) {
-                       if((unsigned int)((lit >> (size*8)) & 0x0FFL)== 0)
-                               aopPut(AOP(result),"a",size);
-                       else
-                               aopPut(AOP(result),
-                                      aopGet(AOP(right),size),
-                                      size);
-               }
-       } else {
-               while (size--) {
-                       aopPut(AOP(result),
-                              aopGet(AOP(right),offset),
-                              offset);
-                       offset++;
-               }
-       }
-    
+  operand *result, *right;
+  int size, offset ;
+  unsigned long lit = 0L;
+
+  result = IC_RESULT(ic);
+  right  = IC_RIGHT(ic) ;
+
+  /* if they are the same */
+  if (operandsEqu (IC_RESULT(ic),IC_RIGHT(ic)))
+    return ;
+
+  aopOp(right,ic,FALSE);
+
+  /* special case both in far space */
+  if (AOP_TYPE(right) == AOP_DPTR &&
+      IS_TRUE_SYMOP(result)       &&
+      isOperandInFarSpace(result)) {
+
+    genFarFarAssign (result,right,ic);
+    return ;
+  }
+
+  aopOp(result,ic,TRUE);
+
+  /* if they are the same registers */
+  if (sameRegs(AOP(right),AOP(result)))
+    goto release;
+
+  /* if the result is a bit */
+  if (AOP_TYPE(result) == AOP_CRY) {
+
+        /* if the right size is a literal then
+           we know what the value is */
+    if (AOP_TYPE(right) == AOP_LIT) {
+      if (((int) operandLitValue(right)))
+        aopPut(AOP(result),one,0);
+      else
+        aopPut(AOP(result),zero,0);
+      goto release;
+    }
+
+        /* the right is also a bit variable */
+    if (AOP_TYPE(right) == AOP_CRY) {
+      emitcode("mov","c,%s",AOP(right)->aopu.aop_dir);
+      aopPut(AOP(result),"c",0);
+      goto release ;
+    }
+
+        /* we need to or */
+    toBoolean(right,"",0);
+    aopPut(AOP(result),"a",0);
+    goto release ;
+  }
+
+  /* bit variables done */
+  /* general case */
+  size = AOP_SIZE(result);
+  offset = 0 ;
+  if(AOP_TYPE(right) == AOP_LIT)
+    lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
+  if((size > 1) &&
+     (AOP_TYPE(result) != AOP_REG) &&
+     (AOP_TYPE(right) == AOP_LIT) &&
+     !IS_FLOAT(operandType(right)) &&
+     (lit < 256L)){
+    emitcode("clr","a");
+    while (size--) {
+      if((unsigned int)((lit >> (size*8)) & 0x0FFL)== 0)
+        aopPut(AOP(result),"a",size);
+      else
+        aopPut(AOP(result),
+               aopGet(AOP(right),size),
+               size);
+    }
+  } else {
+    while (size--) {
+      aopPut(AOP(result),
+             aopGet(AOP(right),offset),
+             offset);
+      offset++;
+    }
+  }
+
  release:
-       freeAsmop (right,NULL,ic,FALSE);
-       freeAsmop (result,NULL,ic,TRUE);
-}   
+  freeAsmop (right,NULL,ic,FALSE);
+  freeAsmop (result,NULL,ic,TRUE);
+}
 
 /*-----------------------------------------------------------------*/
 /* genJumpTab - genrates code for jump table                       */
 /*-----------------------------------------------------------------*/
 static void genJumpTab (iCode *ic)
 {
-       symbol *jtab;
-       char *l;
-
-       aopOp(IC_JTCOND(ic),ic,FALSE);
-       /* get the condition into accumulator */
-       l = aopGet(AOP(IC_JTCOND(ic)),0);
-       MOVA(l);
-       /* multiply by three */
-       emitcode("add","a,acc");
-       emitcode("add","a,%s",aopGet(AOP(IC_JTCOND(ic)),0));
-       freeAsmop(IC_JTCOND(ic),NULL,ic,TRUE);
-
-       jtab = newiTempLabel(NULL);
-       emitcode("mov","dptr,#%05d$",jtab->key+100);
-       emitcode("jmp","@a+dptr");
-       emitcode("","%05d$:",jtab->key+100);
-       /* now generate the jump labels */
-       for (jtab = setFirstItem(IC_JTLABELS(ic)) ; jtab;
-            jtab = setNextItem(IC_JTLABELS(ic)))
-               emitcode("ljmp","%05d$",jtab->key+100);
+  symbol *jtab;
+  char *l;
+
+  aopOp(IC_JTCOND(ic),ic,FALSE);
+  /* get the condition into accumulator */
+  l = aopGet(AOP(IC_JTCOND(ic)),0);
+  MOVA(l);
+  /* multiply by three */
+  emitcode("add","a,acc");
+  emitcode("add","a,%s",aopGet(AOP(IC_JTCOND(ic)),0));
+  freeAsmop(IC_JTCOND(ic),NULL,ic,TRUE);
+
+  jtab = newiTempLabel(NULL);
+  emitcode("mov","dptr,#%05d$",jtab->key+100);
+  emitcode("jmp","@a+dptr");
+  emitcode("","%05d$:",jtab->key+100);
+  /* now generate the jump labels */
+  for (jtab = setFirstItem(IC_JTLABELS(ic)) ; jtab;
+       jtab = setNextItem(IC_JTLABELS(ic)))
+    emitcode("ljmp","%05d$",jtab->key+100);
 
 }
 
@@ -4491,163 +4491,163 @@ static void genJumpTab (iCode *ic)
 /*-----------------------------------------------------------------*/
 static void genCast (iCode *ic)
 {
-       operand *result = IC_RESULT(ic);
-       sym_link *ctype = operandType(IC_LEFT(ic));
-       sym_link *rtype = operandType(IC_RIGHT(ic));
-       operand *right = IC_RIGHT(ic);
-       int size, offset ;
-
-       /* if they are equivalent then do nothing */
-       if (operandsEqu(IC_RESULT(ic),IC_RIGHT(ic)))
-               return ;
-
-       aopOp(right,ic,FALSE) ;
-       aopOp(result,ic,FALSE);
-
-       /* if the result is a bit */
-       if (AOP_TYPE(result) == AOP_CRY) {
-                               /* if the right size is a literal then
-                                  we know what the value is */
-               if (AOP_TYPE(right) == AOP_LIT) {
-                       if (((int) operandLitValue(right))) 
-                               aopPut(AOP(result),one,0);
-                       else
-                               aopPut(AOP(result),zero,0);
-
-                       goto release;
-               }
-
-                               /* the right is also a bit variable */
-               if (AOP_TYPE(right) == AOP_CRY) {
-                       emitcode("mov","c,%s",AOP(right)->aopu.aop_dir);
-                       aopPut(AOP(result),"c",0);
-                       goto release ;
-               }
-
-                               /* we need to or */
-               toBoolean(right,"",0);
-               aopPut(AOP(result),"a",0);
-               goto release ;
-       }
-
-       /* if they are the same size : or less */
-       if (AOP_SIZE(result) <= AOP_SIZE(right)) {
-
-                               /* if they are in the same place */
-               if (sameRegs(AOP(right),AOP(result)))
-                       goto release;
-
-                               /* if they in different places then copy */
-               size = AOP_SIZE(result);
-               offset = 0 ;
-               while (size--) {
-                       aopPut(AOP(result),
-                              aopGet(AOP(right),offset),
-                              offset);
-                       offset++;
-               }
-               goto release;
-       }
-
-
-       /* if the result is of type pointer */
-       if (IS_PTR(ctype)) {
-
-               int p_type;
-               sym_link *type = operandType(right);
-               sym_link *etype = getSpec(type);
-
-                               /* pointer to generic pointer */
-               if (IS_GENPTR(ctype)) {
-                       char *l = zero;
-           
-                       if (IS_PTR(type)) 
-                               p_type = DCL_TYPE(type);
-                       else {
-                               /* we have to go by the storage class */
-                               p_type = PTR_TYPE(SPEC_OCLS(etype));
-                       }
-               
-                       /* the first two bytes are known */
-                       size = GPTRSIZE - 1; 
-                       offset = 0 ;
-                       while (size--) {
-                               aopPut(AOP(result),
-                                      aopGet(AOP(right),offset),
-                                      offset);
-                               offset++;
-                       }
-                       /* the last byte depending on type */
-                       switch (p_type) {
-                       case IPOINTER:
-                       case POINTER:
-                               l = zero;
-                               break;
-                       case FPOINTER:
-                               l = one;
-                               break;
-                       case CPOINTER:
-                               l = "#0x02";
-                               break;                          
-                       case PPOINTER:
-                               l = "#0x03";
-                               break;
-               
-                       default:
-                               /* this should never happen */
-                               werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                                      "got unknown pointer type");
-                               exit(1);
-                       }
-                       aopPut(AOP(result),l, GPTRSIZE - 1);        
-                       goto release ;
-               }
-       
-                               /* just copy the pointers */
-               size = AOP_SIZE(result);
-               offset = 0 ;
-               while (size--) {
-                       aopPut(AOP(result),
-                              aopGet(AOP(right),offset),
-                              offset);
-                       offset++;
-               }
-               goto release ;
-       }
-    
-       /* so we now know that the size of destination is greater
-          than the size of the source */
-       /* we move to result for the size of source */
-       size = AOP_SIZE(right);
-       offset = 0 ;
-       while (size--) {
-               aopPut(AOP(result),
-                      aopGet(AOP(right),offset),
-                      offset);
-               offset++;
-       }
-
-       /* now depending on the sign of the source && destination */
-       size = AOP_SIZE(result) - AOP_SIZE(right);
-       /* if unsigned or not an integral type */
-       if (SPEC_USIGN(rtype) || !IS_SPEC(rtype)) {
-               while (size--)
-                       aopPut(AOP(result),zero,offset++);
-       } else {
-                               /* we need to extend the sign :{ */
-               char *l = aopGet(AOP(right),AOP_SIZE(right) - 1);
-               MOVA(l);
-               emitcode("rlc","a");
-               emitcode("subb","a,acc");
-               while (size--)
-                       aopPut(AOP(result),"a",offset++);   
-       }
-
-       /* we are done hurray !!!! */
+  operand *result = IC_RESULT(ic);
+  sym_link *ctype = operandType(IC_LEFT(ic));
+  sym_link *rtype = operandType(IC_RIGHT(ic));
+  operand *right = IC_RIGHT(ic);
+  int size, offset ;
+
+  /* if they are equivalent then do nothing */
+  if (operandsEqu(IC_RESULT(ic),IC_RIGHT(ic)))
+    return ;
+
+  aopOp(right,ic,FALSE) ;
+  aopOp(result,ic,FALSE);
+
+  /* if the result is a bit */
+  if (AOP_TYPE(result) == AOP_CRY) {
+        /* if the right size is a literal then
+           we know what the value is */
+    if (AOP_TYPE(right) == AOP_LIT) {
+      if (((int) operandLitValue(right)))
+        aopPut(AOP(result),one,0);
+      else
+        aopPut(AOP(result),zero,0);
+
+      goto release;
+    }
+
+        /* the right is also a bit variable */
+    if (AOP_TYPE(right) == AOP_CRY) {
+      emitcode("mov","c,%s",AOP(right)->aopu.aop_dir);
+      aopPut(AOP(result),"c",0);
+      goto release ;
+    }
+
+        /* we need to or */
+    toBoolean(right,"",0);
+    aopPut(AOP(result),"a",0);
+    goto release ;
+  }
+
+  /* if they are the same size : or less */
+  if (AOP_SIZE(result) <= AOP_SIZE(right)) {
+
+        /* if they are in the same place */
+    if (sameRegs(AOP(right),AOP(result)))
+      goto release;
+
+        /* if they in different places then copy */
+    size = AOP_SIZE(result);
+    offset = 0 ;
+    while (size--) {
+      aopPut(AOP(result),
+             aopGet(AOP(right),offset),
+             offset);
+      offset++;
+    }
+    goto release;
+  }
+
+
+  /* if the result is of type pointer */
+  if (IS_PTR(ctype)) {
+
+    int p_type;
+    sym_link *type = operandType(right);
+    sym_link *etype = getSpec(type);
+
+        /* pointer to generic pointer */
+    if (IS_GENPTR(ctype)) {
+      char *l = zero;
+
+      if (IS_PTR(type))
+        p_type = DCL_TYPE(type);
+      else {
+        /* we have to go by the storage class */
+        p_type = PTR_TYPE(SPEC_OCLS(etype));
+      }
+
+      /* the first two bytes are known */
+      size = GPTRSIZE - 1;
+      offset = 0 ;
+      while (size--) {
+        aopPut(AOP(result),
+               aopGet(AOP(right),offset),
+               offset);
+        offset++;
+      }
+      /* the last byte depending on type */
+      switch (p_type) {
+      case IPOINTER:
+      case POINTER:
+        l = zero;
+        break;
+      case FPOINTER:
+        l = one;
+        break;
+      case CPOINTER:
+        l = "#0x02";
+        break;
+      case PPOINTER:
+        l = "#0x03";
+        break;
+
+      default:
+        /* this should never happen */
+        werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+               "got unknown pointer type");
+        exit(1);
+      }
+      aopPut(AOP(result),l, GPTRSIZE - 1);
+      goto release ;
+    }
+
+        /* just copy the pointers */
+    size = AOP_SIZE(result);
+    offset = 0 ;
+    while (size--) {
+      aopPut(AOP(result),
+             aopGet(AOP(right),offset),
+             offset);
+      offset++;
+    }
+    goto release ;
+  }
+
+  /* so we now know that the size of destination is greater
+     than the size of the source */
+  /* we move to result for the size of source */
+  size = AOP_SIZE(right);
+  offset = 0 ;
+  while (size--) {
+    aopPut(AOP(result),
+           aopGet(AOP(right),offset),
+           offset);
+    offset++;
+  }
+
+  /* now depending on the sign of the source && destination */
+  size = AOP_SIZE(result) - AOP_SIZE(right);
+  /* if unsigned or not an integral type */
+  if (SPEC_USIGN(rtype) || !IS_SPEC(rtype)) {
+    while (size--)
+      aopPut(AOP(result),zero,offset++);
+  } else {
+        /* we need to extend the sign :{ */
+    char *l = aopGet(AOP(right),AOP_SIZE(right) - 1);
+    MOVA(l);
+    emitcode("rlc","a");
+    emitcode("subb","a,acc");
+    while (size--)
+      aopPut(AOP(result),"a",offset++);
+  }
+
+  /* we are done hurray !!!! */
 
  release:
-       freeAsmop(right,NULL,ic,TRUE);
-       freeAsmop(result,NULL,ic,TRUE);
+  freeAsmop(right,NULL,ic,TRUE);
+  freeAsmop(result,NULL,ic,TRUE);
 
 }
 
@@ -4656,57 +4656,57 @@ static void genCast (iCode *ic)
 /*-----------------------------------------------------------------*/
 static int genDjnz (iCode *ic, iCode *ifx)
 {
-       symbol *lbl, *lbl1;
-       if (!ifx)
-               return 0;
-    
-       /* if the if condition has a false label
-          then we cannot save */
-       if (IC_FALSE(ifx))
-               return 0;
-
-       /* if the minus is not of the form 
-          a = a - 1 */
-       if (!isOperandEqual(IC_RESULT(ic),IC_LEFT(ic)) ||
-           !IS_OP_LITERAL(IC_RIGHT(ic)))
-               return 0;
-
-       if (operandLitValue(IC_RIGHT(ic)) != 1)
-               return 0;
-
-       /* if the size of this greater than one then no
-          saving */
-       if (getSize(operandType(IC_RESULT(ic))) > 1)
-               return 0;
-
-       /* otherwise we can save BIG */
-       lbl = newiTempLabel(NULL);
-       lbl1= newiTempLabel(NULL);
-
-       aopOp(IC_RESULT(ic),ic,FALSE);
-    
-       if (IS_AOP_PREG(IC_RESULT(ic))) {
-               emitcode("dec","%s",
-                        aopGet(AOP(IC_RESULT(ic)),0));
-               emitcode("mov","a,%s",aopGet(AOP(IC_RESULT(ic)),0));
-               emitcode("jnz","%05d$",lbl->key+100);
-       } else {        
-               emitcode ("djnz","%s,%05d$",aopGet(AOP(IC_RESULT(ic)),0),
-                         lbl->key+100);
-       }
-       emitcode ("sjmp","%05d$",lbl1->key+100);
-       emitcode ("","%05d$:",lbl->key+100);
-       emitcode ("ljmp","%05d$",IC_TRUE(ifx)->key+100);
-       emitcode ("","%05d$:",lbl1->key+100);
-    
-       freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
-       ifx->generated = 1;
-       return 1;
+  symbol *lbl, *lbl1;
+  if (!ifx)
+    return 0;
+
+  /* if the if condition has a false label
+     then we cannot save */
+  if (IC_FALSE(ifx))
+    return 0;
+
+  /* if the minus is not of the form
+     a = a - 1 */
+  if (!isOperandEqual(IC_RESULT(ic),IC_LEFT(ic)) ||
+      !IS_OP_LITERAL(IC_RIGHT(ic)))
+    return 0;
+
+  if (operandLitValue(IC_RIGHT(ic)) != 1)
+    return 0;
+
+  /* if the size of this greater than one then no
+     saving */
+  if (getSize(operandType(IC_RESULT(ic))) > 1)
+    return 0;
+
+  /* otherwise we can save BIG */
+  lbl = newiTempLabel(NULL);
+  lbl1= newiTempLabel(NULL);
+
+  aopOp(IC_RESULT(ic),ic,FALSE);
+
+  if (IS_AOP_PREG(IC_RESULT(ic))) {
+    emitcode("dec","%s",
+       aopGet(AOP(IC_RESULT(ic)),0));
+    emitcode("mov","a,%s",aopGet(AOP(IC_RESULT(ic)),0));
+    emitcode("jnz","%05d$",lbl->key+100);
+  } else {
+    emitcode ("djnz","%s,%05d$",aopGet(AOP(IC_RESULT(ic)),0),
+        lbl->key+100);
+  }
+  emitcode ("sjmp","%05d$",lbl1->key+100);
+  emitcode ("","%05d$:",lbl->key+100);
+  emitcode ("ljmp","%05d$",IC_TRUE(ifx)->key+100);
+  emitcode ("","%05d$:",lbl1->key+100);
+
+  freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
+  ifx->generated = 1;
+  return 1;
 }
 
-static char *recvregs[8] = 
+static char *recvregs[8] =
 {
-       "r16","r17","r18","r19","r20","r21","r22","r23"
+  "r16","r17","r18","r19","r20","r21","r22","r23"
 };
 static recvCnt = 0;
 
@@ -4714,15 +4714,15 @@ static recvCnt = 0;
 /* genReceive - generate code for a receive iCode                  */
 /*-----------------------------------------------------------------*/
 static void genReceive (iCode *ic)
-{    
-       int size , offset =0;
-       aopOp(IC_RESULT(ic),ic,FALSE);  
-       size = AOP_SIZE(IC_RESULT(ic));
-       while (size--) {
-               aopPut(AOP(IC_RESULT(ic)),recvregs[recvCnt++],offset);
-               offset++;
-       }
-       freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
+{
+  int size , offset =0;
+  aopOp(IC_RESULT(ic),ic,FALSE);
+  size = AOP_SIZE(IC_RESULT(ic));
+  while (size--) {
+    aopPut(AOP(IC_RESULT(ic)),recvregs[recvCnt++],offset);
+    offset++;
+  }
+  freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -4730,251 +4730,251 @@ static void genReceive (iCode *ic)
 /*-----------------------------------------------------------------*/
 void genAVRCode (iCode *lic)
 {
-       iCode *ic;
-       int cln = 0;
-
-       lineHead = lineCurr = NULL;
-       recvCnt =0;
-       /* print the allocation information */
-       if (allocInfo)
-               printAllocInfo( currFunc, codeOutFile);
-       /* if debug information required */
-       /*     if (options.debug && currFunc) { */
-       if (currFunc) {
-               cdbSymbol(currFunc,cdbFile,FALSE,TRUE);
-               _G.debugLine = 1;
-               if (IS_STATIC(currFunc->etype))
-                       emitcode("","F%s$%s$0$0 ==.",moduleName,currFunc->name); 
-               else
-                       emitcode("","G$%s$0$0 ==.",currFunc->name);
-               _G.debugLine = 0;
-       }
-       /* stack pointer name */
-       if (options.useXstack)
-               spname = "_spx";
-       else
-               spname = "sp";
-    
-       for (ic = lic ; ic ; ic = ic->next ) {
-       
-               if ( cln != ic->lineno ) {
-                       if ( options.debug ) {
-                               _G.debugLine = 1;
-                               emitcode("","C$%s$%d$%d$%d ==.",
-                                        ic->filename,ic->lineno,
-                                        ic->level,ic->block);
-                               _G.debugLine = 0;
-                       }
-                       emitcode(";","%s %d",ic->filename,ic->lineno);
-                       cln = ic->lineno ;
-               }
-                               /* if the result is marked as
-                                  spilt and rematerializable or code for
-                                  this has already been generated then
-                                  do nothing */
-               if (resultRemat(ic) || ic->generated ) 
-                       continue ;
-       
-                               /* depending on the operation */
-               switch (ic->op) {
-               case '!' :
-                       genNot(ic);
-                       break;
-           
-               case '~' :
-                       genCpl(ic);
-                       break;
-           
-               case UNARYMINUS:
-                       genUminus (ic);
-                       break;
-           
-               case IPUSH:
-                       genIpush (ic);
-                       break;
-           
-               case IPOP:
-                       /* IPOP happens only when trying to restore a 
-                          spilt live range, if there is an ifx statement
-                          following this pop then the if statement might
-                          be using some of the registers being popped which
-                          would destory the contents of the register so
-                          we need to check for this condition and handle it */
-                       if (ic->next            && 
-                           ic->next->op == IFX &&
-                           regsInCommon(IC_LEFT(ic),IC_COND(ic->next))) 
-                               genIfx (ic->next,ic);
-                       else
-                               genIpop (ic);
-                       break; 
-           
-               case CALL:
-                       genCall (ic);
-                       break;
-           
-               case PCALL:
-                       genPcall (ic);
-                       break;
-           
-               case FUNCTION:
-                       genFunction (ic);
-                       break;
-           
-               case ENDFUNCTION:
-                       genEndFunction (ic);
-                       break;
-           
-               case RETURN:
-                       genRet (ic);
-                       break;
-           
-               case LABEL:
-                       genLabel (ic);
-                       break;
-           
-               case GOTO:
-                       genGoto (ic);
-                       break;
-           
-               case '+' :
-                       genPlus (ic) ;
-                       break;
-           
-               case '-' :
-                       if ( ! genDjnz (ic,ifxForOp(IC_RESULT(ic),ic)))
-                               genMinus (ic);
-                       break;
-           
-               case '*' :
-                       genMult (ic);
-                       break;
-           
-               case '/' :
-                       genDiv (ic) ;
-                       break;
-           
-               case '%' :
-                       genMod (ic);
-                       break;
-           
-               case '>' :
-                       genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic));                     
-                       break;
-           
-               case '<' :
-                       genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic));
-                       break;
-           
-               case LE_OP:
-                       genCmpLe (ic,ifxForOp(IC_RESULT(ic),ic));
-                       break;
-
-               case GE_OP:
-                       genCmpGe (ic,ifxForOp(IC_RESULT(ic),ic));
-                       break;
-
-               case NE_OP:
-                       genCmpNe (ic,ifxForOp(IC_RESULT(ic),ic));           
-                       break;  
-           
-               case EQ_OP:
-                       genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic));
-                       break;      
-           
-               case AND_OP:
-                       genAndOp (ic);
-                       break;
-           
-               case OR_OP:
-                       genOrOp (ic);
-                       break;
-           
-               case '^' :
-                       genXor (ic,ifxForOp(IC_RESULT(ic),ic));
-                       break;
-           
-               case '|' :
-                       genOr (ic,ifxForOp(IC_RESULT(ic),ic));
-                       break;
-           
-               case BITWISEAND:
-                       genAnd (ic,ifxForOp(IC_RESULT(ic),ic));
-                       break;
-           
-               case INLINEASM:
-                       genInline (ic);
-                       break;
-           
-               case RRC:
-                       genRRC (ic);
-                       break;
-           
-               case RLC:
-                       genRLC (ic);
-                       break;
-           
-               case GETHBIT:
-                       genGetHbit (ic);
-                       break;
-           
-               case LEFT_OP:
-                       genLeftShift (ic);
-                       break;
-           
-               case RIGHT_OP:
-                       genRightShift (ic);
-                       break;
-           
-               case GET_VALUE_AT_ADDRESS:
-                       genPointerGet(ic);
-                       break;
-           
-               case '=' :
-                       if (POINTER_SET(ic))
-                               genPointerSet(ic);
-                       else
-                               genAssign(ic);
-                       break;
-           
-               case IFX:
-                       genIfx (ic,NULL);
-                       break;
-           
-               case ADDRESS_OF:
-                       genAddrOf (ic);
-                       break;
-           
-               case JUMPTABLE:
-                       genJumpTab (ic);
-                       break;
-           
-               case CAST:
-                       genCast (ic);
-                       break;
-           
-               case RECEIVE:
-                       genReceive(ic);
-                       break;
-           
-               case SEND:
-                       addSet(&_G.sendSet,ic);
-                       break;
-
-               default :
-                       ic = ic;
-                       /*      piCode(ic,stdout); */
-           
-               }
-       }
-    
-
-       /* now we are ready to call the 
-          peep hole optimizer */
-       if (!options.nopeep)
-               peepHole (&lineHead);
-
-       /* now do the actual printing */
-       printLine (lineHead,codeOutFile);    
-       return;
+  iCode *ic;
+  int cln = 0;
+
+  lineHead = lineCurr = NULL;
+  recvCnt =0;
+  /* print the allocation information */
+  if (allocInfo)
+    printAllocInfo( currFunc, codeOutFile);
+  /* if debug information required */
+  /*     if (options.debug && currFunc) { */
+  if (currFunc) {
+    cdbSymbol(currFunc,cdbFile,FALSE,TRUE);
+    _G.debugLine = 1;
+    if (IS_STATIC(currFunc->etype))
+      emitcode("","F%s$%s$0$0 ==.",moduleName,currFunc->name);
+    else
+      emitcode("","G$%s$0$0 ==.",currFunc->name);
+    _G.debugLine = 0;
+  }
+  /* stack pointer name */
+  if (options.useXstack)
+    spname = "_spx";
+  else
+    spname = "sp";
+
+
+  for (ic = lic ; ic ; ic = ic->next ) {
+
+    if ( cln != ic->lineno ) {
+      if ( options.debug ) {
+        _G.debugLine = 1;
+        emitcode("","C$%s$%d$%d$%d ==.",
+           ic->filename,ic->lineno,
+           ic->level,ic->block);
+        _G.debugLine = 0;
+      }
+      emitcode(";","%s %d",ic->filename,ic->lineno);
+      cln = ic->lineno ;
+    }
+        /* if the result is marked as
+           spilt and rematerializable or code for
+           this has already been generated then
+           do nothing */
+    if (resultRemat(ic) || ic->generated )
+      continue ;
+
+        /* depending on the operation */
+    switch (ic->op) {
+    case '!' :
+      genNot(ic);
+      break;
+
+    case '~' :
+      genCpl(ic);
+      break;
+
+    case UNARYMINUS:
+      genUminus (ic);
+      break;
+
+    case IPUSH:
+      genIpush (ic);
+      break;
+
+    case IPOP:
+      /* IPOP happens only when trying to restore a
+         spilt live range, if there is an ifx statement
+         following this pop then the if statement might
+         be using some of the registers being popped which
+         would destory the contents of the register so
+         we need to check for this condition and handle it */
+      if (ic->next            &&
+          ic->next->op == IFX &&
+          regsInCommon(IC_LEFT(ic),IC_COND(ic->next)))
+        genIfx (ic->next,ic);
+      else
+        genIpop (ic);
+      break;
+
+    case CALL:
+      genCall (ic);
+      break;
+
+    case PCALL:
+      genPcall (ic);
+      break;
+
+    case FUNCTION:
+      genFunction (ic);
+      break;
+
+    case ENDFUNCTION:
+      genEndFunction (ic);
+      break;
+
+    case RETURN:
+      genRet (ic);
+      break;
+
+    case LABEL:
+      genLabel (ic);
+      break;
+
+    case GOTO:
+      genGoto (ic);
+      break;
+
+    case '+' :
+      genPlus (ic) ;
+      break;
+
+    case '-' :
+      if ( ! genDjnz (ic,ifxForOp(IC_RESULT(ic),ic)))
+        genMinus (ic);
+      break;
+
+    case '*' :
+      genMult (ic);
+      break;
+
+    case '/' :
+      genDiv (ic) ;
+      break;
+
+    case '%' :
+      genMod (ic);
+      break;
+
+    case '>' :
+      genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+    case '<' :
+      genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+    case LE_OP:
+      genCmpLe (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+    case GE_OP:
+      genCmpGe (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+    case NE_OP:
+      genCmpNe (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+    case EQ_OP:
+      genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+    case AND_OP:
+      genAndOp (ic);
+      break;
+
+    case OR_OP:
+      genOrOp (ic);
+      break;
+
+    case '^' :
+      genXor (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+    case '|' :
+      genOr (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+    case BITWISEAND:
+      genAnd (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+    case INLINEASM:
+      genInline (ic);
+      break;
+
+    case RRC:
+      genRRC (ic);
+      break;
+
+    case RLC:
+      genRLC (ic);
+      break;
+
+    case GETHBIT:
+      genGetHbit (ic);
+      break;
+
+    case LEFT_OP:
+      genLeftShift (ic);
+      break;
+
+    case RIGHT_OP:
+      genRightShift (ic);
+      break;
+
+    case GET_VALUE_AT_ADDRESS:
+      genPointerGet(ic);
+      break;
+
+    case '=' :
+      if (POINTER_SET(ic))
+        genPointerSet(ic);
+      else
+        genAssign(ic);
+      break;
+
+    case IFX:
+      genIfx (ic,NULL);
+      break;
+
+    case ADDRESS_OF:
+      genAddrOf (ic);
+      break;
+
+    case JUMPTABLE:
+      genJumpTab (ic);
+      break;
+
+    case CAST:
+      genCast (ic);
+      break;
+
+    case RECEIVE:
+      genReceive(ic);
+      break;
+
+    case SEND:
+      addSet(&_G.sendSet,ic);
+      break;
+
+    default :
+      ic = ic;
+      /*      piCode(ic,stdout); */
+
+    }
+  }
+
+
+  /* now we are ready to call the
+     peep hole optimizer */
+  if (!options.nopeep)
+    peepHole (&lineHead);
+
+  /* now do the actual printing */
+  printLine (lineHead,codeOutFile);
+  return;
 }
index 3b33a9d6f055a685ff0811be7ddcb16ad979ad68..bc90edd7b6536451e0055175d6bf416545327b8f 100644 (file)
@@ -1935,7 +1935,7 @@ static void packRegisters (eBBlock *ebp)
              bitVectnBitsOn(OP_DEFS(IC_RESULT(ic))) == 1 &&
             IS_OP_LITERAL(IC_RIGHT(ic))) ) {
 
-           int i = operandLitValue(IC_RIGHT(ic));
+           int i = (int) operandLitValue(IC_RIGHT(ic));
            if ( i < 255 && i > -255) {
                OP_SYMBOL(IC_RESULT(ic))->remat = 1;
                OP_SYMBOL(IC_RESULT(ic))->rematiCode = ic;
index 19f0f08a29e5bac187e05e6ea61337577042f79b..730938df0739f8e585fa4bf03e3a972bf6c81892 100644 (file)
@@ -1,31 +1,31 @@
 /*-------------------------------------------------------------------------
   gen.c - source file for code generation for 8051
-  
+
   Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
          and -  Jean-Louis VERN.jlvern@writeme.com (1999)
   Bug Fixes  -  Wojciech Stryjewski  wstryj1@tiger.lsu.edu (1999 v2.1.9a)
-  
+
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
-  
+
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  
+
   In other words, you are welcome to use, share and improve this program.
   You are forbidden to forbid anyone else to use, share and improve
   what you give them.   Help stamp out software-hoarding!
-  
+
   Notes:
-  000123 mlh   Moved aopLiteral to SDCCglue.c to help the split
-               Made everything static
+  000123 mlh  Moved aopLiteral to SDCCglue.c to help the split
+      Made everything static
 -------------------------------------------------------------------------*/
 
 #include <stdio.h>
@@ -58,7 +58,7 @@ char *aopLiteral (value *val, int offset);
 extern int allocInfo;
 #endif
 
-/* this is the down and dirty file with all kinds of 
+/* this is the down and dirty file with all kinds of
    kludgy & hacky stuff. This is what it is all about
    CODE GENERATION for a specific MCU . some of the
    routines may be reusable, will have to see */
@@ -121,23 +121,23 @@ static unsigned char   SRMask[] = {0xFF, 0x7F, 0x3F, 0x1F, 0x0F,
 static void emitcode (char *inst,char *fmt, ...)
 {
     va_list ap;
-    char lb[MAX_INLINEASM];  
+    char lb[MAX_INLINEASM];
     char *lbp = lb;
 
-    va_start(ap,fmt);   
+    va_start(ap,fmt);
 
     if (inst && *inst) {
-       if (fmt && *fmt)
-           sprintf(lb,"%s\t",inst);
-       else
-           sprintf(lb,"%s",inst);
+  if (fmt && *fmt)
+      sprintf(lb,"%s\t",inst);
+  else
+      sprintf(lb,"%s",inst);
         vsprintf(lb+(strlen(lb)),fmt,ap);
     }  else
         vsprintf(lb,fmt,ap);
 
     while (isspace(*lbp)) lbp++;
 
-    if (lbp && *lbp) 
+    if (lbp && *lbp)
         lineCurr = (lineCurr ?
                     connectLine(lineCurr,newLineNode(lb)) :
                     (lineHead = newLineNode(lb)));
@@ -160,9 +160,9 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
     /* first check if r0 & r1 are used by this
     instruction, in which case we are in trouble */
     if ((r0iu = bitVectBitValue(ic->rUsed,R0_IDX)) &&
-        (r1iu = bitVectBitValue(ic->rUsed,R1_IDX))) 
+        (r1iu = bitVectBitValue(ic->rUsed,R1_IDX)))
     {
-        goto endOfWorld;      
+        goto endOfWorld;
     }
 
     r0ou = bitVectBitValue(ic->rMask,R0_IDX);
@@ -172,7 +172,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
     if (!r0iu && !r0ou) {
         ic->rUsed = bitVectSetBit(ic->rUsed,R0_IDX);
         (*aopp)->type = AOP_R0;
-        
+
         return (*aopp)->aopu.aop_ptr = ds390_regWithIdx(R0_IDX);
     }
 
@@ -182,7 +182,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
         (*aopp)->type = AOP_R1;
 
         return (*aopp)->aopu.aop_ptr = ds390_regWithIdx(R1_IDX);
-    }    
+    }
 
     /* now we know they both have usage */
     /* if r0 not used in this instruction */
@@ -193,7 +193,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
                       ds390_regWithIdx(R0_IDX)->dname);
             _G.r0Pushed++ ;
         }
-        
+
         ic->rUsed = bitVectSetBit(ic->rUsed,R0_IDX);
         (*aopp)->type = AOP_R0;
 
@@ -209,7 +209,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
                       ds390_regWithIdx(R1_IDX)->dname);
             _G.r1Pushed++ ;
         }
-        
+
         ic->rUsed = bitVectSetBit(ic->rUsed,R1_IDX);
         (*aopp)->type = AOP_R1;
         return ds390_regWithIdx(R1_IDX);
@@ -219,7 +219,7 @@ endOfWorld :
     /* I said end of world but not quite end of world yet */
     /* if this is a result then we can push it on the stack*/
     if (result) {
-        (*aopp)->type = AOP_STK;    
+        (*aopp)->type = AOP_STK;
         return NULL;
     }
 
@@ -237,7 +237,7 @@ static asmop *newAsmop (short type)
 {
     asmop *aop;
 
-    aop = Safe_calloc(sizeof(asmop));
+    aop = Safe_calloc(1,sizeof(asmop));
     aop->type = type;
     return aop;
 }
@@ -245,14 +245,14 @@ static asmop *newAsmop (short type)
 /* Turn this off if the world goes to hell. */
 #define LAZY_DPS_OPT
 
-static int _currentDPS;          /* Current processor DPS. */
-static int _desiredDPS;          /* DPS value compiler thinks we should be using. */
+static int _currentDPS;   /* Current processor DPS. */
+static int _desiredDPS;   /* DPS value compiler thinks we should be using. */
 static int _lazyDPS = 0;  /* if non-zero, we are doing lazy evaluation of DPS changes. */
 
 /*-----------------------------------------------------------------*/
 /* genSetDPTR: generate code to select which DPTR is in use (zero  */
-/* selects standard DPTR (DPL/DPH/DPX), non-zero selects DS390            */
-/* alternate DPTR (DPL1/DPH1/DPX1).                               */
+/* selects standard DPTR (DPL/DPH/DPX), non-zero selects DS390     */
+/* alternate DPTR (DPL1/DPH1/DPX1).          */
 /*-----------------------------------------------------------------*/
 static void genSetDPTR(int n)
 {
@@ -280,20 +280,20 @@ static void genSetDPTR(int n)
 
 /*-----------------------------------------------------------------*/
 /* _startLazyDPSEvaluation: call to start doing lazy DPS evaluation*/
-/*                                                                */
-/* Any code that operates on DPTR (NB: not on the individual      */
+/*                   */
+/* Any code that operates on DPTR (NB: not on the individual     */
 /* components, like DPH) *must* call _flushLazyDPS() before using  */
-/* DPTR within a lazy DPS evaluation block.                       */
-/*                                                                */
+/* DPTR within a lazy DPS evaluation block.        */
+/*                   */
 /* Note that aopPut and aopGet already contain the proper calls to */
 /* _flushLazyDPS, so it is safe to use these calls within a lazy   */
-/* DPS evaluation block.                                          */
-/*                                                                */
-/* Also, _flushLazyDPS must be called before any flow control     */
-/* operations that could potentially branch out of the block.     */
-/*                                                                */
-/* Lazy DPS evaluation is simply an optimization (though an       */
-/* important one), so if in doubt, leave it out.                  */
+/* DPS evaluation block.             */
+/*                   */
+/* Also, _flushLazyDPS must be called before any flow control      */
+/* operations that could potentially branch out of the block.    */
+/*                         */
+/* Lazy DPS evaluation is simply an optimization (though an      */
+/* important one), so if in doubt, leave it out.       */
 /*-----------------------------------------------------------------*/
 static void _startLazyDPSEvaluation(void)
 {
@@ -305,7 +305,7 @@ static void _startLazyDPSEvaluation(void)
 /*-----------------------------------------------------------------*/
 /* _flushLazyDPS: emit code to force the actual DPS setting to the */
 /* desired one. Call before using DPTR within a lazy DPS evaluation*/
-/* block.                                                         */
+/* block.                */
 /*-----------------------------------------------------------------*/
 static void _flushLazyDPS(void)
 {
@@ -314,25 +314,25 @@ static void _flushLazyDPS(void)
         /* nothing to do. */
         return;
     }
-    
+
     if (_desiredDPS != _currentDPS)
     {
-       if (_desiredDPS)
-       {
-           emitcode("inc", "dps");
-       }
-       else
-       {
-           emitcode("dec", "dps");
-       }
-       _currentDPS = _desiredDPS;
+      if (_desiredDPS)
+      {
+          emitcode("inc", "dps");
+      }
+      else
+      {
+          emitcode("dec", "dps");
+      }
+      _currentDPS = _desiredDPS;
     }
 }
 
 /*-----------------------------------------------------------------*/
-/* _endLazyDPSEvaluation: end lazy DPS evaluation block.          */
-/*                                                                */
-/* Forces us back to the safe state (standard DPTR selected).     */
+/* _endLazyDPSEvaluation: end lazy DPS evaluation block.     */
+/*                   */
+/* Forces us back to the safe state (standard DPTR selected).    */
 /*-----------------------------------------------------------------*/
 static void _endLazyDPSEvaluation(void)
 {
@@ -372,13 +372,13 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool useDP2)
 
     /* assign depending on the storage class */
     /* if it is on the stack or indirectly addressable */
-    /* space we need to assign either r0 or r1 to it   */    
+    /* space we need to assign either r0 or r1 to it   */
     if ((sym->onStack && !options.stack10bit) || sym->iaccess) {
         sym->aop = aop = newAsmop(0);
         aop->aopu.aop_ptr = getFreePtr(ic,&aop,result);
         aop->size = getSize(sym->type);
 
-        /* now assign the address of the variable to 
+        /* now assign the address of the variable to
         the pointer register */
         if (aop->type != AOP_STK) {
 
@@ -389,8 +389,8 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool useDP2)
                     emitcode("mov","a,_bp");
                     emitcode("add","a,#0x%02x",
                              ((sym->stack < 0) ?
-                             ((char)(sym->stack - _G.nRegsSaved )) :
-                             ((char)sym->stack)) & 0xff);
+            ((char)(sym->stack - _G.nRegsSaved )) :
+            ((char)sym->stack)) & 0xff);
                     emitcode("mov","%s,a",
                              aop->aopu.aop_ptr->name);
 
@@ -405,24 +405,24 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool useDP2)
             aop->aopu.aop_stk = sym->stack;
         return aop;
     }
-    
+
     if (sym->onStack && options.stack10bit)
     {
         /* It's on the 10 bit stack, which is located in
          * far data space.
          */
-         
+
         if ( _G.accInUse )
-               emitcode("push","acc");
+          emitcode("push","acc");
 
         emitcode("mov","a,_bp");
         emitcode("add","a,#0x%02x",
                  ((sym->stack < 0) ?
                    ((char)(sym->stack - _G.nRegsSaved )) :
                    ((char)sym->stack)) & 0xff);
-        
-       if (useDP2)
-       {        
+
+  if (useDP2)
+  {
         /* genSetDPTR(1); */
         emitcode ("mov","dpx1,#0x40");
         emitcode ("mov","dph1,#0x00");
@@ -431,17 +431,17 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool useDP2)
         }
         else
         {
-           emitcode ("mov","dpx,#0x40");
+      emitcode ("mov","dpx,#0x40");
             emitcode ("mov","dph,#0x00");
-            emitcode ("mov","dpl, a");           
+            emitcode ("mov","dpl, a");
         }
-       
+
         if ( _G.accInUse )
             emitcode("pop","acc");
-            
-        sym->aop = aop = newAsmop(useDP2 ? AOP_DPTR2 : AOP_DPTR);
-       aop->size = getSize(sym->type); 
-       return aop;
+
+        sym->aop = aop = newAsmop((short) (useDP2 ? AOP_DPTR2 : AOP_DPTR));
+      aop->size = getSize(sym->type);
+      return aop;
     }
 
     /* if in bit space */
@@ -460,27 +460,27 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool useDP2)
     }
 
     /* special case for a function */
-    if (IS_FUNC(sym->type)) {   
-        sym->aop = aop = newAsmop(AOP_IMMD);    
-        aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
+    if (IS_FUNC(sym->type)) {
+        sym->aop = aop = newAsmop(AOP_IMMD);
+        aop->aopu.aop_immd = Safe_calloc(1,strlen(sym->rname)+1);
         strcpy(aop->aopu.aop_immd,sym->rname);
-        aop->size = FPTRSIZE; 
+        aop->size = FPTRSIZE;
         return aop;
     }
 
     /* only remaining is far space */
     /* in which case DPTR gets the address */
-    sym->aop = aop = newAsmop(useDP2 ? AOP_DPTR2 : AOP_DPTR);
+    sym->aop = aop = newAsmop((short) (useDP2 ? AOP_DPTR2 : AOP_DPTR));
     if (useDP2)
-    {        
+    {
         genSetDPTR(1);
         _flushLazyDPS();
-       emitcode ("mov","dptr,#%s", sym->rname);
+      emitcode ("mov","dptr,#%s", sym->rname);
         genSetDPTR(0);
-    }    
+    }
     else
     {
-       emitcode ("mov","dptr,#%s", sym->rname);
+      emitcode ("mov","dptr,#%s", sym->rname);
     }
     aop->size = getSize(sym->type);
 
@@ -488,7 +488,7 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool useDP2)
     if (IN_CODESPACE(space))
         aop->code = 1;
 
-    return aop;     
+    return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -502,27 +502,27 @@ static asmop *aopForRemat (symbol *sym)
     int val = 0;
 
     for (;;) {
-       if (ic->op == '+')
-           val += operandLitValue(IC_RIGHT(ic));
-       else if (ic->op == '-')
-           val -= operandLitValue(IC_RIGHT(ic));
-       else
-           break;
-       
-       ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode;
+      if (ic->op == '+')
+      val += (int) operandLitValue(IC_RIGHT(ic));
+  else if (ic->op == '-')
+      val -= (int) operandLitValue(IC_RIGHT(ic));
+  else
+      break;
+
+  ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode;
     }
 
     if (val)
-       sprintf(buffer,"(%s %c 0x%04x)",
-               OP_SYMBOL(IC_LEFT(ic))->rname, 
-               val >= 0 ? '+' : '-',
-               abs(val) & 0xffff);
+      sprintf(buffer,"(%s %c 0x%04x)",
+          OP_SYMBOL(IC_LEFT(ic))->rname,
+    val >= 0 ? '+' : '-',
+    abs(val) & 0xffff);
     else
-       strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
+  strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
 
-    aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
-    strcpy(aop->aopu.aop_immd,buffer);    
-    return aop;        
+    aop->aopu.aop_immd = Safe_calloc(1,strlen(buffer)+1);
+    strcpy(aop->aopu.aop_immd,buffer);
+    return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -577,8 +577,8 @@ static bool operandsEqu ( operand *op1, operand *op2)
     /* if both are itemps & one is spilt
        and the other is not then false */
     if (IS_ITEMP(op1) && IS_ITEMP(op2) &&
-       sym1->isspilt != sym2->isspilt )
-       return FALSE ;
+  sym1->isspilt != sym2->isspilt )
+  return FALSE ;
 
     /* if they are the same */
     if (sym1 == sym2)
@@ -589,16 +589,16 @@ static bool operandsEqu ( operand *op1, operand *op2)
 
 
     /* if left is a tmp & right is not */
-    if (IS_ITEMP(op1)  && 
+    if (IS_ITEMP(op1)  &&
         !IS_ITEMP(op2) &&
         sym1->isspilt  &&
         (sym1->usl.spillLoc == sym2))
         return TRUE;
 
-    if (IS_ITEMP(op2)  && 
+    if (IS_ITEMP(op2)  &&
         !IS_ITEMP(op1) &&
         sym2->isspilt  &&
-       sym1->level > 0 &&
+  sym1->level > 0 &&
         (sym2->usl.spillLoc == sym1))
         return TRUE ;
 
@@ -667,7 +667,7 @@ static void aopOp (operand *op, iCode *ic, bool result, bool useDP2)
     }
 
     /* if this is a true symbol */
-    if (IS_TRUE_SYMOP(op)) {    
+    if (IS_TRUE_SYMOP(op)) {
         op->aop = aopForSym(ic,OP_SYMBOL(op),result, useDP2);
         return ;
     }
@@ -676,8 +676,8 @@ static void aopOp (operand *op, iCode *ic, bool result, bool useDP2)
     only four choices :
     a) register
     b) spillocation
-    c) rematerialize 
-    d) conditional   
+    c) rematerialize
+    d) conditional
     e) can be a return use only */
 
     sym = OP_SYMBOL(op);
@@ -691,7 +691,7 @@ static void aopOp (operand *op, iCode *ic, bool result, bool useDP2)
     }
 
     /* if it is spilt then two situations
-    a) is rematerialize 
+    a) is rematerialize
     b) has a spill location */
     if (sym->isspilt || sym->nRegs == 0) {
 
@@ -703,36 +703,36 @@ static void aopOp (operand *op, iCode *ic, bool result, bool useDP2)
             return;
         }
 
-       if (sym->accuse) {
-           int i;
+  if (sym->accuse) {
+      int i;
             aop = op->aop = sym->aop = newAsmop(AOP_ACC);
             aop->size = getSize(sym->type);
             for ( i = 0 ; i < 2 ; i++ )
                 aop->aopu.aop_str[i] = accUse[i];
-            return;  
-       }
+            return;
+  }
 
         if (sym->ruonly) {
             int i;
-            
+
             if (useDP2)
             {
-                /* a AOP_STR uses DPTR, but DPTR is already in use; 
+                /* a AOP_STR uses DPTR, but DPTR is already in use;
                  * we're just hosed.
                  */
                 fprintf(stderr, "*** Internal error: AOP_STR with DPTR in use!\n");
             }
-            
+
             aop = op->aop = sym->aop = newAsmop(AOP_STR);
             aop->size = getSize(sym->type);
-            for ( i = 0 ; i < fReturnSize_390 ; i++ )
-             aop->aopu.aop_str[i] = fReturn[i];
+            for ( i = 0 ; i < (int) fReturnSize_390 ; i++ )
+        aop->aopu.aop_str[i] = fReturn[i];
             return;
         }
 
         /* else spill location  */
-        sym->aop = op->aop = aop = 
-               aopForSym(ic,sym->usl.spillLoc,result, useDP2);
+        sym->aop = op->aop = aop =
+          aopForSym(ic,sym->usl.spillLoc,result, useDP2);
         aop->size = getSize(sym->type);
         return;
     }
@@ -748,19 +748,19 @@ static void aopOp (operand *op, iCode *ic, bool result, bool useDP2)
 /* freeAsmop - free up the asmop given to an operand               */
 /*----------------------------------------------------------------*/
 static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
-{   
+{
     asmop *aop ;
 
     if (!op)
         aop = aaop;
-    else 
+    else
         aop = op->aop;
 
     if (!aop)
         return ;
 
     if (aop->freed)
-        goto dealloc; 
+        goto dealloc;
 
     aop->freed = 1;
 
@@ -770,7 +770,7 @@ static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
         case AOP_R0 :
             if (_G.r0Pushed ) {
                 if (pop) {
-                    emitcode ("pop","ar0");     
+                    emitcode ("pop","ar0");
                     _G.r0Pushed--;
                 }
             }
@@ -784,27 +784,27 @@ static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
                     _G.r1Pushed--;
                 }
             }
-            bitVectUnSetBit(ic->rUsed,R1_IDX);          
+            bitVectUnSetBit(ic->rUsed,R1_IDX);
             break;
 
         case AOP_STK :
         {
-            int sz = aop->size;    
+            int sz = aop->size;
             int stk = aop->aopu.aop_stk + aop->size;
             bitVectUnSetBit(ic->rUsed,R0_IDX);
-            bitVectUnSetBit(ic->rUsed,R1_IDX);          
+            bitVectUnSetBit(ic->rUsed,R1_IDX);
 
             getFreePtr(ic,&aop,FALSE);
-            
+
             if (options.stack10bit)
             {
                 /* I'm not sure what to do here yet... */
                 /* #STUB */
-               fprintf(stderr, 
-                       "*** Warning: probably generating bad code for "
-                       "10 bit stack mode.\n");
+              fprintf(stderr,
+                "*** Warning: probably generating bad code for "
+                "10 bit stack mode.\n");
             }
-            
+
             if (stk) {
                 emitcode ("mov","a,_bp");
                 emitcode ("add","a,#0x%02x",((char)stk) & 0xff);
@@ -829,7 +829,7 @@ static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
             if (_G.r1Pushed) {
                 emitcode("pop","ar1");
                 _G.r1Pushed--;
-            }       
+            }
         }
     }
 
@@ -838,9 +838,9 @@ dealloc:
     if (op ) {
         op->aop = NULL;
         if (IS_SYMOP(op)) {
-            OP_SYMBOL(op)->aop = NULL;    
+            OP_SYMBOL(op)->aop = NULL;
             /* if the symbol has a spill */
-           if (SPIL_LOC(op))
+      if (SPIL_LOC(op))
                 SPIL_LOC(op)->aop = NULL;
         }
     }
@@ -848,17 +848,17 @@ dealloc:
 
 /*------------------------------------------------------------------*/
 /* aopGet - for fetching value of the aop                           */
-/*                                                                 */
+/*                    */
 /* Set canClobberACC if you are aure it is OK to clobber the value  */
 /* in the accumulator. Set it FALSE otherwise; FALSE is always safe,*/
-/* just less efficient.                                                    */
+/* just less efficient.               */
 /*------------------------------------------------------------------*/
 
-static char *aopGet (asmop *aop, 
-                    int offset, 
-                    bool bit16,
-                    bool dname,
-                    bool canClobberACC)
+static char *aopGet (asmop *aop,
+         int offset,
+         bool bit16,
+         bool dname,
+         bool canClobberACC)
 {
     char *s = buffer ;
     char *rs;
@@ -871,135 +871,135 @@ static char *aopGet (asmop *aop,
 
     /* depending on type */
     switch (aop->type) {
-       
+
     case AOP_R0:
     case AOP_R1:
-       /* if we need to increment it */       
-       while (offset > aop->coff) {        
-           emitcode ("inc","%s",aop->aopu.aop_ptr->name);  
-           aop->coff++;
-       }
-       
-       while (offset < aop->coff) {
-           emitcode("dec","%s",aop->aopu.aop_ptr->name);
-           aop->coff--;
-       }
-       
-       aop->coff = offset ;
-       if (aop->paged) {
-           emitcode("movx","a,@%s",aop->aopu.aop_ptr->name);
-           return (dname ? "acc" : "a");
-       }       
-       sprintf(s,"@%s",aop->aopu.aop_ptr->name);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  /* if we need to increment it */
+  while (offset > aop->coff) {
+      emitcode ("inc","%s",aop->aopu.aop_ptr->name);
+      aop->coff++;
+  }
+
+  while (offset < aop->coff) {
+      emitcode("dec","%s",aop->aopu.aop_ptr->name);
+      aop->coff--;
+  }
+
+  aop->coff = offset ;
+  if (aop->paged) {
+      emitcode("movx","a,@%s",aop->aopu.aop_ptr->name);
+      return (dname ? "acc" : "a");
+  }
+  sprintf(s,"@%s",aop->aopu.aop_ptr->name);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_DPTR:
     case AOP_DPTR2:
-    
-       if (aop->type == AOP_DPTR2)
-       {
+
+      if (aop->type == AOP_DPTR2)
+      {
             genSetDPTR(1);
-        
-#ifndef KEVIN_BROKE_IT        
+
+#ifndef KEVIN_BROKE_IT
             if (!canClobberACC)
-#endif        
+#endif
             {
-               emitcode("xch", "a, ap");
+              emitcode("xch", "a, ap");
             }
-       }
-    
-       _flushLazyDPS();
-    
-       while (offset > aop->coff) {
-           emitcode ("inc","dptr");
-           aop->coff++;
-       }
-       
-       while (offset < aop->coff) {        
-           emitcode("lcall","__decdptr");
-           aop->coff--;
-       }
-       
-       aop->coff = offset;
-       if (aop->code) {
-           emitcode("clr","a");
-           emitcode("movc","a,@a+dptr");
+    }
+
+      _flushLazyDPS();
+
+  while (offset > aop->coff) {
+      emitcode ("inc","dptr");
+      aop->coff++;
+  }
+
+  while (offset < aop->coff) {
+      emitcode("lcall","__decdptr");
+      aop->coff--;
+  }
+
+  aop->coff = offset;
+  if (aop->code) {
+      emitcode("clr","a");
+      emitcode("movc","a,@a+dptr");
         }
-       else {
-           emitcode("movx","a,@dptr");
-       }
-           
-       if (aop->type == AOP_DPTR2)
-       {
-           genSetDPTR(0);
-
-#ifndef KEVIN_BROKE_IT        
+      else {
+      emitcode("movx","a,@dptr");
+      }
+
+      if (aop->type == AOP_DPTR2)
+      {
+          genSetDPTR(0);
+
+#ifndef KEVIN_BROKE_IT
             if (!canClobberACC)
-#endif        
+#endif
             {
-               emitcode("xch", "a, ap");
-               return "ap";
+              emitcode("xch", "a, ap");
+              return "ap";
             }
-       }
-           
-       return (dname ? "acc" : "a");
-       
+      }
+
+      return (dname ? "acc" : "a");
+
     case AOP_IMMD:
-       if (bit16) 
-           sprintf (s,"#%s",aop->aopu.aop_immd);
-       else
-           if (offset) 
-               sprintf(s,"#(%s >> %d)",
-                       aop->aopu.aop_immd,
-                       offset*8);
-           else
-               sprintf(s,"#%s",
-                       aop->aopu.aop_immd);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  if (bit16)
+      sprintf (s,"#%s",aop->aopu.aop_immd);
+  else
+      if (offset)
+    sprintf(s,"#(%s >> %d)",
+      aop->aopu.aop_immd,
+      offset*8);
+      else
+    sprintf(s,"#%s",
+      aop->aopu.aop_immd);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_DIR:
-       if (offset)
-           sprintf(s,"(%s + %d)",
-                   aop->aopu.aop_dir,
-                   offset);
-       else
-           sprintf(s,"%s",aop->aopu.aop_dir);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  if (offset)
+      sprintf(s,"(%s + %d)",
+        aop->aopu.aop_dir,
+        offset);
+  else
+      sprintf(s,"%s",aop->aopu.aop_dir);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_REG:
-       if (dname) 
-           return aop->aopu.aop_reg[offset]->dname;
-       else
-           return aop->aopu.aop_reg[offset]->name;
-       
+  if (dname)
+      return aop->aopu.aop_reg[offset]->dname;
+  else
+      return aop->aopu.aop_reg[offset]->name;
+
     case AOP_CRY:
-       emitcode("clr","a");
-       emitcode("mov","c,%s",aop->aopu.aop_dir);
-       emitcode("rlc","a") ;
-       return (dname ? "acc" : "a");
-       
+  emitcode("clr","a");
+  emitcode("mov","c,%s",aop->aopu.aop_dir);
+  emitcode("rlc","a") ;
+  return (dname ? "acc" : "a");
+
     case AOP_ACC:
-       if (!offset && dname)
-           return "acc";
-       return aop->aopu.aop_str[offset];
+  if (!offset && dname)
+      return "acc";
+  return aop->aopu.aop_str[offset];
 
     case AOP_LIT:
-       return aopLiteral (aop->aopu.aop_lit,offset);
-       
+  return aopLiteral (aop->aopu.aop_lit,offset);
+
     case AOP_STR:
-       aop->coff = offset ;
-       if (strcmp(aop->aopu.aop_str[offset],"a") == 0 &&
-           dname)
-           return "acc";
-       
-       return aop->aopu.aop_str[offset];
-       
+  aop->coff = offset ;
+  if (strcmp(aop->aopu.aop_str[offset],"a") == 0 &&
+      dname)
+      return "acc";
+
+  return aop->aopu.aop_str[offset];
+
     }
 
     werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
@@ -1024,170 +1024,170 @@ static void aopPut (asmop *aop, char *s, int offset)
     /* depending on where it is ofcourse */
     switch (aop->type) {
     case AOP_DIR:
-       if (offset)
-           sprintf(d,"(%s + %d)",
-                   aop->aopu.aop_dir,offset);
-       else
-           sprintf(d,"%s",aop->aopu.aop_dir);
-       
-       if (strcmp(d,s))
-           emitcode("mov","%s,%s",d,s);
-       
-       break;
-       
+  if (offset)
+      sprintf(d,"(%s + %d)",
+        aop->aopu.aop_dir,offset);
+  else
+      sprintf(d,"%s",aop->aopu.aop_dir);
+
+  if (strcmp(d,s))
+      emitcode("mov","%s,%s",d,s);
+
+  break;
+
     case AOP_REG:
-       if (strcmp(aop->aopu.aop_reg[offset]->name,s) != 0 &&
-           strcmp(aop->aopu.aop_reg[offset]->dname,s)!= 0){
-           if (*s == '@'           ||
-               strcmp(s,"r0") == 0 ||
-               strcmp(s,"r1") == 0 ||
-               strcmp(s,"r2") == 0 ||
-               strcmp(s,"r3") == 0 ||
-               strcmp(s,"r4") == 0 ||
-               strcmp(s,"r5") == 0 ||
-               strcmp(s,"r6") == 0 || 
-               strcmp(s,"r7") == 0 )
-               emitcode("mov","%s,%s",
-                        aop->aopu.aop_reg[offset]->dname,s);
-           else
-               emitcode("mov","%s,%s",
-                        aop->aopu.aop_reg[offset]->name,s);
-       }
-       break;
-       
+  if (strcmp(aop->aopu.aop_reg[offset]->name,s) != 0 &&
+      strcmp(aop->aopu.aop_reg[offset]->dname,s)!= 0){
+      if (*s == '@'           ||
+    strcmp(s,"r0") == 0 ||
+    strcmp(s,"r1") == 0 ||
+    strcmp(s,"r2") == 0 ||
+    strcmp(s,"r3") == 0 ||
+    strcmp(s,"r4") == 0 ||
+    strcmp(s,"r5") == 0 ||
+    strcmp(s,"r6") == 0 ||
+    strcmp(s,"r7") == 0 )
+    emitcode("mov","%s,%s",
+       aop->aopu.aop_reg[offset]->dname,s);
+      else
+    emitcode("mov","%s,%s",
+       aop->aopu.aop_reg[offset]->name,s);
+  }
+  break;
+
     case AOP_DPTR:
     case AOP_DPTR2:
-    
-       if (aop->type == AOP_DPTR2)
-       {
+
+      if (aop->type == AOP_DPTR2)
+      {
             genSetDPTR(1);
-       }
-       _flushLazyDPS();
-    
-       if (aop->code) {
-           werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                  "aopPut writting to code space");
-           exit(1);
-       }
-       
-       while (offset > aop->coff) {
-           aop->coff++;
-           emitcode ("inc","dptr");
-       }
-       
-       while (offset < aop->coff) {
-           aop->coff-- ;
-           emitcode("lcall","__decdptr");
-       }
-       
-       aop->coff = offset;
-       
-       /* if not in accumulater */
-       MOVA(s);        
-       
-       emitcode ("movx","@dptr,a");
-       
-       if (aop->type == AOP_DPTR2)
-       {
+      }
+      _flushLazyDPS();
+
+  if (aop->code) {
+      werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+       "aopPut writting to code space");
+      exit(1);
+  }
+
+  while (offset > aop->coff) {
+      aop->coff++;
+      emitcode ("inc","dptr");
+  }
+
+  while (offset < aop->coff) {
+      aop->coff-- ;
+      emitcode("lcall","__decdptr");
+  }
+
+  aop->coff = offset;
+
+  /* if not in accumulater */
+  MOVA(s);
+
+  emitcode ("movx","@dptr,a");
+
+      if (aop->type == AOP_DPTR2)
+      {
             genSetDPTR(0);
-       }
-       break;
-       
+      }
+  break;
+
     case AOP_R0:
     case AOP_R1:
-       while (offset > aop->coff) {
-           aop->coff++;
-           emitcode("inc","%s",aop->aopu.aop_ptr->name);
-       }
-       while (offset < aop->coff) {
-           aop->coff-- ;
-           emitcode ("dec","%s",aop->aopu.aop_ptr->name);
-       }
-       aop->coff = offset;
-       
-       if (aop->paged) {
-           MOVA(s);           
-           emitcode("movx","@%s,a",aop->aopu.aop_ptr->name);
-           
-       } else
-           if (*s == '@') {
-               MOVA(s);
-               emitcode("mov","@%s,a",aop->aopu.aop_ptr->name);
-           } else
-               if (strcmp(s,"r0") == 0 ||
-                   strcmp(s,"r1") == 0 ||
-                   strcmp(s,"r2") == 0 ||
-                   strcmp(s,"r3") == 0 ||
-                   strcmp(s,"r4") == 0 ||
-                   strcmp(s,"r5") == 0 ||
-                   strcmp(s,"r6") == 0 || 
-                   strcmp(s,"r7") == 0 ) {
-                   char buffer[10];
-                   sprintf(buffer,"a%s",s);
-                   emitcode("mov","@%s,%s",
-                            aop->aopu.aop_ptr->name,buffer);
-               } else
-                   emitcode("mov","@%s,%s",aop->aopu.aop_ptr->name,s);
-       
-       break;
-       
+  while (offset > aop->coff) {
+      aop->coff++;
+      emitcode("inc","%s",aop->aopu.aop_ptr->name);
+  }
+  while (offset < aop->coff) {
+      aop->coff-- ;
+      emitcode ("dec","%s",aop->aopu.aop_ptr->name);
+  }
+  aop->coff = offset;
+
+  if (aop->paged) {
+      MOVA(s);
+      emitcode("movx","@%s,a",aop->aopu.aop_ptr->name);
+
+  } else
+      if (*s == '@') {
+    MOVA(s);
+    emitcode("mov","@%s,a",aop->aopu.aop_ptr->name);
+      } else
+    if (strcmp(s,"r0") == 0 ||
+        strcmp(s,"r1") == 0 ||
+        strcmp(s,"r2") == 0 ||
+        strcmp(s,"r3") == 0 ||
+        strcmp(s,"r4") == 0 ||
+        strcmp(s,"r5") == 0 ||
+        strcmp(s,"r6") == 0 ||
+        strcmp(s,"r7") == 0 ) {
+        char buffer[10];
+        sprintf(buffer,"a%s",s);
+        emitcode("mov","@%s,%s",
+           aop->aopu.aop_ptr->name,buffer);
+    } else
+        emitcode("mov","@%s,%s",aop->aopu.aop_ptr->name,s);
+
+  break;
+
     case AOP_STK:
-       if (strcmp(s,"a") == 0)
-           emitcode("push","acc");
-       else
-           emitcode("push","%s",s);
-       
-       break;
-       
+  if (strcmp(s,"a") == 0)
+      emitcode("push","acc");
+  else
+      emitcode("push","%s",s);
+
+  break;
+
     case AOP_CRY:
-       /* if bit variable */
-       if (!aop->aopu.aop_dir) {
-           emitcode("clr","a");
-           emitcode("rlc","a");
-       } else {
-           if (s == zero) 
-               emitcode("clr","%s",aop->aopu.aop_dir);
-           else
-               if (s == one)
-                   emitcode("setb","%s",aop->aopu.aop_dir);
-               else
-                   if (!strcmp(s,"c"))
-                       emitcode("mov","%s,c",aop->aopu.aop_dir);
-                   else {
-                       lbl = newiTempLabel(NULL);
-                       
-                       if (strcmp(s,"a")) {
-                           MOVA(s);
-                       }
-                       emitcode("clr","c");
-                       emitcode("jz","%05d$",lbl->key+100);
-                       emitcode("cpl","c");
-                       emitcode("","%05d$:",lbl->key+100);
-                       emitcode("mov","%s,c",aop->aopu.aop_dir);
-                   }
-       }
-       break;
-       
+  /* if bit variable */
+  if (!aop->aopu.aop_dir) {
+      emitcode("clr","a");
+      emitcode("rlc","a");
+  } else {
+      if (s == zero)
+    emitcode("clr","%s",aop->aopu.aop_dir);
+      else
+    if (s == one)
+        emitcode("setb","%s",aop->aopu.aop_dir);
+    else
+        if (!strcmp(s,"c"))
+      emitcode("mov","%s,c",aop->aopu.aop_dir);
+        else {
+      lbl = newiTempLabel(NULL);
+
+      if (strcmp(s,"a")) {
+          MOVA(s);
+      }
+      emitcode("clr","c");
+      emitcode("jz","%05d$",lbl->key+100);
+      emitcode("cpl","c");
+      emitcode("","%05d$:",lbl->key+100);
+      emitcode("mov","%s,c",aop->aopu.aop_dir);
+        }
+  }
+  break;
+
     case AOP_STR:
-       aop->coff = offset;
-       if (strcmp(aop->aopu.aop_str[offset],s))
-           emitcode ("mov","%s,%s",aop->aopu.aop_str[offset],s);
-       break;
-       
+  aop->coff = offset;
+  if (strcmp(aop->aopu.aop_str[offset],s))
+      emitcode ("mov","%s,%s",aop->aopu.aop_str[offset],s);
+  break;
+
     case AOP_ACC:
-       aop->coff = offset;
-       if (!offset && (strcmp(s,"acc") == 0))
-           break;
-       
-       if (strcmp(aop->aopu.aop_str[offset],s))
-           emitcode ("mov","%s,%s",aop->aopu.aop_str[offset],s);
-       break;
+  aop->coff = offset;
+  if (!offset && (strcmp(s,"acc") == 0))
+      break;
+
+  if (strcmp(aop->aopu.aop_str[offset],s))
+      emitcode ("mov","%s,%s",aop->aopu.aop_str[offset],s);
+  break;
 
     default :
-       werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-              "aopPut got unsupported aop->type");
-       exit(1);    
-    }    
+  werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+         "aopPut got unsupported aop->type");
+  exit(1);
+    }
 
 }
 
@@ -1208,26 +1208,26 @@ static void reAdjustPreg (asmop *aop)
         case AOP_R1 :
             while (size--)
                 emitcode("dec","%s",aop->aopu.aop_ptr->name);
-            break;          
+            break;
         case AOP_DPTR :
         case AOP_DPTR2:
             if (aop->type == AOP_DPTR2)
-           {
+          {
                 genSetDPTR(1);
                 _flushLazyDPS();
-           } 
+          }
             while (size--)
             {
                 emitcode("lcall","__decdptr");
             }
-                
-           if (aop->type == AOP_DPTR2)
-           {
+
+          if (aop->type == AOP_DPTR2)
+          {
                 genSetDPTR(0);
-           }                
-            break;  
+          }
+            break;
 
-    }   
+    }
 
 }
 
@@ -1239,7 +1239,7 @@ static void reAdjustPreg (asmop *aop)
 
 #define AOP_NEEDSACC(x) (AOP(x) && (AOP_TYPE(x) == AOP_CRY ||  \
                         AOP_TYPE(x) == AOP_DPTR || AOP_TYPE(x) == AOP_DPTR2 || \
-                         AOP(x)->paged)) 
+                         AOP(x)->paged))
 
 #define AOP_INPREG(x) (x && (x->type == AOP_REG &&                        \
                       (x->aopu.aop_reg[0] == ds390_regWithIdx(R0_IDX) || \
@@ -1250,26 +1250,26 @@ static void reAdjustPreg (asmop *aop)
  *
  * Will be fixed in B4 rev of processor, Dallas claims.
  */
-#define LOAD_AB_FOR_DIV(LEFT, RIGHT, L)                        \
-    if (!AOP_NEEDSACC(RIGHT))                                  \
-    {                                                          \
-       /* We can load A first, then B, since                   \
-        * B (the RIGHT operand) won't clobber A,               \
-        * thus avoiding touching A right before the div.       \
-        */                                                     \
-       D(emitcode(";", "DS80C390 div bug: rearranged ops.");); \
-       L = aopGet(AOP(LEFT),0,FALSE,FALSE,TRUE);               \
-       MOVA(L);                                                \
-       emitcode("mov","b,%s",aopGet(AOP(RIGHT),0,FALSE,FALSE,FALSE));\
-    }                                                          \
-    else                                                       \
-    {                                                          \
-       /* Just stuff in a nop after loading A. */              \
-       emitcode("mov","b,%s",aopGet(AOP(RIGHT),0,FALSE,FALSE,FALSE));\
-       L = aopGet(AOP(LEFT),0,FALSE,FALSE,TRUE);               \
-       MOVA(L);                                                \
-       emitcode("nop", "; workaround for DS80C390 div bug.");  \
+
+#define LOAD_AB_FOR_DIV(LEFT, RIGHT, L)       \
+    if (!AOP_NEEDSACC(RIGHT))         \
+    {               \
+      /* We can load A first, then B, since     \
+       * B (the RIGHT operand) won't clobber A,   \
+       * thus avoiding touching A right before the div. \
+       */             \
+      D(emitcode(";", "DS80C390 div bug: rearranged ops.");); \
+      L = aopGet(AOP(LEFT),0,FALSE,FALSE,TRUE);     \
+      MOVA(L);            \
+      emitcode("mov","b,%s",aopGet(AOP(RIGHT),0,FALSE,FALSE,FALSE));\
+    }               \
+    else              \
+    {               \
+      /* Just stuff in a nop after loading A. */    \
+      emitcode("mov","b,%s",aopGet(AOP(RIGHT),0,FALSE,FALSE,FALSE));\
+      L = aopGet(AOP(LEFT),0,FALSE,FALSE,TRUE);   \
+      MOVA(L);            \
+      emitcode("nop", "; workaround for DS80C390 div bug.");  \
     }
 
 /*-----------------------------------------------------------------*/
@@ -1283,7 +1283,7 @@ static void genNotFloat (operand *op, operand *res)
 
     D(emitcode(";", "genNotFloat "););
 
-    /* we will put 127 in the first byte of 
+    /* we will put 127 in the first byte of
     the result */
     aopPut(AOP(res),"#127",0);
     size = AOP_SIZE(op) - 1;
@@ -1291,7 +1291,7 @@ static void genNotFloat (operand *op, operand *res)
 
     _startLazyDPSEvaluation();
     l = aopGet(op->aop,offset++,FALSE,FALSE,TRUE);
-    MOVA(l);    
+    MOVA(l);
 
     while(size--) {
         emitcode("orl","a,%s",
@@ -1308,25 +1308,25 @@ static void genNotFloat (operand *op, operand *res)
     emitcode("","%05d$:",(tlbl->key+100));
 
     size = res->aop->size - 2;
-    offset = 2;    
+    offset = 2;
     /* put zeros in the rest */
-    while (size--) 
+    while (size--)
         aopPut(res->aop,zero,offset++);
 }
 
 /*-----------------------------------------------------------------*/
-/* opIsGptr: returns non-zero if the passed operand is            */   
-/* a generic pointer type.                                        */
-/*-----------------------------------------------------------------*/ 
+/* opIsGptr: returns non-zero if the passed operand is       */
+/* a generic pointer type.             */
+/*-----------------------------------------------------------------*/
 static int opIsGptr(operand *op)
 {
     sym_link *type = operandType(op);
-    
+
     if ((AOP_SIZE(op) == GPTRSIZE) && IS_GENPTR(type))
     {
         return 1;
     }
-    return 0;        
+    return 0;
 }
 
 /*-----------------------------------------------------------------*/
@@ -1379,7 +1379,7 @@ static void outBitC(operand *result)
     {
         aopPut(AOP(result),"c",0);
     }
-    else 
+    else
     {
         emitcode("clr","a");
         emitcode("rlc","a");
@@ -1402,8 +1402,8 @@ static void toBoolean(operand *oper)
      */
     if (opIsGptr(oper))
     {
-       D(emitcode(";", "toBoolean: generic ptr special case."););
-               size--;
+      D(emitcode(";", "toBoolean: generic ptr special case."););
+        size--;
     }
 
     _startLazyDPSEvaluation();
@@ -1414,21 +1414,21 @@ static void toBoolean(operand *oper)
     }
     else
     {
-       MOVA(aopGet(AOP(oper),0,FALSE,FALSE,TRUE));
+      MOVA(aopGet(AOP(oper),0,FALSE,FALSE,TRUE));
     }
-    while (size--) 
+    while (size--)
     {
-       if (AOP_NEEDSACC(oper))
-       {
-           emitcode("orl","b,%s",aopGet(AOP(oper),offset++,FALSE,FALSE,FALSE));
-       }
-       else
-       {
+      if (AOP_NEEDSACC(oper))
+      {
+          emitcode("orl","b,%s",aopGet(AOP(oper),offset++,FALSE,FALSE,FALSE));
+      }
+      else
+      {
             emitcode("orl","a,%s",aopGet(AOP(oper),offset++,FALSE,FALSE,FALSE));
-       }
+  }
     }
     _endLazyDPSEvaluation();
-    
+
     if (AOP_NEEDSACC(oper))
     {
         emitcode("mov", "a,b");
@@ -1453,8 +1453,8 @@ static void genNot (iCode *ic)
 
     /* if in bit space then a special case */
     if (AOP_TYPE(IC_LEFT(ic)) == AOP_CRY) {
-        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir); 
-        emitcode("cpl","c"); 
+        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir);
+        emitcode("cpl","c");
         outBitC(IC_RESULT(ic));
         goto release;
     }
@@ -1472,7 +1472,7 @@ static void genNot (iCode *ic)
     emitcode("","%05d$:",tlbl->key+100);
     outBitC(IC_RESULT(ic));
 
-release:    
+release:
     /* release the aops */
     freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
     freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
@@ -1494,22 +1494,22 @@ static void genCpl (iCode *ic)
     aopOp (IC_LEFT(ic),ic,FALSE, FALSE);
     aopOp (IC_RESULT(ic),ic,TRUE, AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR);
 
-    /* if both are in bit space then 
+    /* if both are in bit space then
     a special case */
     if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY &&
-        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) { 
+        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) {
 
-        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir); 
-        emitcode("cpl","c"); 
-        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir); 
-        goto release; 
-    } 
+        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir);
+        emitcode("cpl","c");
+        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir);
+        goto release;
+    }
 
     size = AOP_SIZE(IC_RESULT(ic));
     _startLazyDPSEvaluation();
     while (size--) {
         char *l = aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE,TRUE);
-        MOVA(l);       
+        MOVA(l);
         emitcode("cpl","a");
         aopPut(AOP(IC_RESULT(ic)),"a",offset++);
     }
@@ -1529,17 +1529,17 @@ static void genUminusFloat(operand *op,operand *result)
 {
     int size ,offset =0 ;
     char *l;
-    /* for this we just need to flip the 
+    /* for this we just need to flip the
     first it then copy the rest in place */
     D(emitcode(";", "genUminusFloat"););
-    
+
     _startLazyDPSEvaluation();
     size = AOP_SIZE(op) - 1;
     l = aopGet(AOP(op),3,FALSE,FALSE,TRUE);
-    MOVA(l);    
+    MOVA(l);
 
     emitcode("cpl","acc.7");
-    aopPut(AOP(result),"a",3);    
+    aopPut(AOP(result),"a",3);
 
     while(size--) {
         aopPut(AOP(result),
@@ -1568,13 +1568,13 @@ static void genUminus (iCode *ic)
     /* if both in bit space then special
     case */
     if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY &&
-        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) { 
+        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) {
 
-        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir); 
-        emitcode("cpl","c"); 
-        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir); 
-        goto release; 
-    } 
+        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir);
+        emitcode("cpl","c");
+        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir);
+        goto release;
+    }
 
     optype = operandType(IC_LEFT(ic));
     rtype = operandType(IC_RESULT(ic));
@@ -1592,16 +1592,16 @@ static void genUminus (iCode *ic)
     while(size--) {
         char *l = aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE,TRUE);
         if (!strcmp(l,"a")) {
-         if (offset==0)
-           SETC;
-         emitcode("cpl","a");
-         emitcode("addc", "a,#0");
+    if (offset==0)
+      SETC;
+    emitcode("cpl","a");
+    emitcode("addc", "a,#0");
         } else {
-         if (offset==0)
-           CLRC;
-         emitcode("clr","a");
-         emitcode("subb","a,%s",l);
-        }       
+    if (offset==0)
+      CLRC;
+    emitcode("clr","a");
+    emitcode("subb","a,%s",l);
+        }
         aopPut(AOP(IC_RESULT(ic)),"a",offset++);
     }
     _endLazyDPSEvaluation();
@@ -1611,20 +1611,20 @@ static void genUminus (iCode *ic)
     if ((size = (AOP_SIZE(IC_RESULT(ic)) - AOP_SIZE(IC_LEFT(ic))))) {
         emitcode("rlc","a");
         emitcode("subb","a,acc");
-        while (size--) 
+        while (size--)
             aopPut(AOP(IC_RESULT(ic)),"a",offset++);
-    }       
+    }
 
 release:
     /* release the aops */
     freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
-    freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);    
+    freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* saveRegisters - will look for a call and save the registers     */
 /*-----------------------------------------------------------------*/
-static void saveRegisters(iCode *lic) 
+static void saveRegisters(iCode *lic)
 {
     int i;
     iCode *ic;
@@ -1632,7 +1632,7 @@ static void saveRegisters(iCode *lic)
     sym_link *detype;
 
     /* look for call */
-    for (ic = lic ; ic ; ic = ic->next) 
+    for (ic = lic ; ic ; ic = ic->next)
         if (ic->op == CALL || ic->op == PCALL)
             break;
 
@@ -1646,40 +1646,40 @@ static void saveRegisters(iCode *lic)
     if (ic->regsSaved || (OP_SYMBOL(IC_LEFT(ic))->calleeSave))
         return ;
 
-    /* find the registers in use at this time 
+    /* find the registers in use at this time
     and push them away to safety */
     rsave = bitVectCplAnd(bitVectCopy(ic->rMask),
                           ic->rUsed);
 
     ic->regsSaved = 1;
     if (options.useXstack) {
-       if (bitVectBitValue(rsave,R0_IDX))
-           emitcode("mov","b,r0");
-       emitcode("mov","r0,%s",spname);
-       for (i = 0 ; i < ds390_nRegs ; i++) {
-           if (bitVectBitValue(rsave,i)) {
-               if (i == R0_IDX)
-                   emitcode("mov","a,b");
-               else
-                   emitcode("mov","a,%s",ds390_regWithIdx(i)->name);
-               emitcode("movx","@r0,a");
-               emitcode("inc","r0");
-           }
-       }
-       emitcode("mov","%s,r0",spname);
-       if (bitVectBitValue(rsave,R0_IDX))
-           emitcode("mov","r0,b");         
+  if (bitVectBitValue(rsave,R0_IDX))
+      emitcode("mov","b,r0");
+  emitcode("mov","r0,%s",spname);
+  for (i = 0 ; i < ds390_nRegs ; i++) {
+      if (bitVectBitValue(rsave,i)) {
+    if (i == R0_IDX)
+        emitcode("mov","a,b");
+    else
+        emitcode("mov","a,%s",ds390_regWithIdx(i)->name);
+    emitcode("movx","@r0,a");
+    emitcode("inc","r0");
+      }
+  }
+  emitcode("mov","%s,r0",spname);
+  if (bitVectBitValue(rsave,R0_IDX))
+      emitcode("mov","r0,b");
     } else
-       for (i = 0 ; i < ds390_nRegs ; i++) {
-           if (bitVectBitValue(rsave,i))
-               emitcode("push","%s",ds390_regWithIdx(i)->dname);
-       }
+  for (i = 0 ; i < ds390_nRegs ; i++) {
+      if (bitVectBitValue(rsave,i))
+    emitcode("push","%s",ds390_regWithIdx(i)->dname);
+  }
 
     detype = getSpec(operandType(IC_LEFT(ic)));
-    if (detype        && 
+    if (detype        &&
         (SPEC_BANK(currFunc->etype) != SPEC_BANK(detype)) &&
-       IS_ISR(currFunc->etype) &&
-        !ic->bankSaved) 
+  IS_ISR(currFunc->etype) &&
+        !ic->bankSaved)
 
         saverbank(SPEC_BANK(detype),ic,TRUE);
 
@@ -1691,70 +1691,70 @@ static void unsaveRegisters (iCode *ic)
 {
     int i;
     bitVect *rsave;
-    /* find the registers in use at this time 
+    /* find the registers in use at this time
     and push them away to safety */
     rsave = bitVectCplAnd(bitVectCopy(ic->rMask),
                           ic->rUsed);
-    
+
     if (options.useXstack) {
-       emitcode("mov","r0,%s",spname); 
-       for (i =  ds390_nRegs ; i >= 0 ; i--) {
-           if (bitVectBitValue(rsave,i)) {
-               emitcode("dec","r0");
-               emitcode("movx","a,@r0");
-               if (i == R0_IDX)
-                   emitcode("mov","b,a");
-               else
-                   emitcode("mov","%s,a",ds390_regWithIdx(i)->name);
-           }       
-
-       }
-       emitcode("mov","%s,r0",spname);
-       if (bitVectBitValue(rsave,R0_IDX))
-           emitcode("mov","r0,b");
+  emitcode("mov","r0,%s",spname);
+  for (i =  ds390_nRegs ; i >= 0 ; i--) {
+      if (bitVectBitValue(rsave,i)) {
+    emitcode("dec","r0");
+    emitcode("movx","a,@r0");
+    if (i == R0_IDX)
+        emitcode("mov","b,a");
+    else
+        emitcode("mov","%s,a",ds390_regWithIdx(i)->name);
+      }
+
+  }
+  emitcode("mov","%s,r0",spname);
+  if (bitVectBitValue(rsave,R0_IDX))
+      emitcode("mov","r0,b");
     } else
-       for (i =  ds390_nRegs ; i >= 0 ; i--) {
-           if (bitVectBitValue(rsave,i))
-               emitcode("pop","%s",ds390_regWithIdx(i)->dname);
-       }
+  for (i =  ds390_nRegs ; i >= 0 ; i--) {
+      if (bitVectBitValue(rsave,i))
+    emitcode("pop","%s",ds390_regWithIdx(i)->dname);
+  }
 
-}  
+}
 
 
 /*-----------------------------------------------------------------*/
-/* pushSide -                                                     */
+/* pushSide -                */
 /*-----------------------------------------------------------------*/
 static void pushSide(operand * oper, int size)
 {
-       int offset = 0;
-       _startLazyDPSEvaluation();
-       while (size--) {
-               char *l = aopGet(AOP(oper),offset++,FALSE,TRUE,FALSE);
-               if (AOP_TYPE(oper) != AOP_REG &&
-                   AOP_TYPE(oper) != AOP_DIR &&
-                   strcmp(l,"a") ) {
-                       emitcode("mov","a,%s",l);
-                       emitcode("push","acc");
-               } else
-                       emitcode("push","%s",l);
-       }
-       _endLazyDPSEvaluation();
+  int offset = 0;
+  _startLazyDPSEvaluation();
+  while (size--) {
+    char *l = aopGet(AOP(oper),offset++,FALSE,TRUE,FALSE);
+    if (AOP_TYPE(oper) != AOP_REG &&
+        AOP_TYPE(oper) != AOP_DIR &&
+        strcmp(l,"a") ) {
+      emitcode("mov","a,%s",l);
+      emitcode("push","acc");
+    } else
+      emitcode("push","%s",l);
+  }
+  _endLazyDPSEvaluation();
 }
 
 /*-----------------------------------------------------------------*/
-/* assignResultValue -                                            */
+/* assignResultValue -               */
 /*-----------------------------------------------------------------*/
 static void assignResultValue(operand * oper)
 {
-       int offset = 0;
-       int size = AOP_SIZE(oper);
-       
-       _startLazyDPSEvaluation();
-       while (size--) {
-               aopPut(AOP(oper),fReturn[offset],offset);
-               offset++;
-       }
-       _endLazyDPSEvaluation();
+  int offset = 0;
+  int size = AOP_SIZE(oper);
+
+  _startLazyDPSEvaluation();
+  while (size--) {
+    aopPut(AOP(oper),fReturn[offset],offset);
+    offset++;
+  }
+  _endLazyDPSEvaluation();
 }
 
 
@@ -1772,23 +1772,23 @@ static void genXpush (iCode *ic)
     aopOp(IC_LEFT(ic),ic,FALSE, FALSE);
     r = getFreePtr(ic,&aop,FALSE);
 
-    
+
     emitcode("mov","%s,_spx",r->name);
 
     size = AOP_SIZE(IC_LEFT(ic));
     _startLazyDPSEvaluation();
     while(size--) {
 
-       char *l = aopGet(AOP(IC_LEFT(ic)),
-                        offset++,FALSE,FALSE,TRUE);    
-       MOVA(l);            
-       emitcode("movx","@%s,a",r->name);       
-       emitcode("inc","%s",r->name);
+  char *l = aopGet(AOP(IC_LEFT(ic)),
+       offset++,FALSE,FALSE,TRUE);
+  MOVA(l);
+  emitcode("movx","@%s,a",r->name);
+  emitcode("inc","%s",r->name);
 
     }
     _endLazyDPSEvaluation();
 
-       
+
     emitcode("mov","_spx,%s",r->name);
 
     freeAsmop(NULL,aop,ic,TRUE);
@@ -1806,7 +1806,7 @@ static void genIpush (iCode *ic)
     D(emitcode(";", "genIpush "););
 
 
-    /* if this is not a parm push : ie. it is spill push 
+    /* if this is not a parm push : ie. it is spill push
     and spill push is always done on the local stack */
     if (!ic->parmPush) {
 
@@ -1827,12 +1827,12 @@ static void genIpush (iCode *ic)
             emitcode("push","%s",l);
         }
         _endLazyDPSEvaluation();
-        return ;        
+        return ;
     }
 
     /* this is a paramter push: in this case we call
     the routine to find the call and save those
-    registers that need to be saved */   
+    registers that need to be saved */
     saveRegisters(ic);
 
     /* if use external stack then call the external
@@ -1851,7 +1851,7 @@ static void genIpush (iCode *ic)
     _startLazyDPSEvaluation();
     while (size--) {
         l = aopGet(AOP(IC_LEFT(ic)),offset++,FALSE,TRUE,FALSE);
-        if (AOP_TYPE(IC_LEFT(ic)) != AOP_REG && 
+        if (AOP_TYPE(IC_LEFT(ic)) != AOP_REG &&
             AOP_TYPE(IC_LEFT(ic)) != AOP_DIR &&
             strcmp(l,"a") ) {
             emitcode("mov","a,%s",l);
@@ -1902,38 +1902,38 @@ static void unsaverbank (int bank,iCode *ic,bool popPsw)
     regs *r = NULL;
 
     if (popPsw) {
-       if (options.useXstack) {
-           aop = newAsmop(0);
-           r = getFreePtr(ic,&aop,FALSE);
-           
-           
-           emitcode("mov","%s,_spx",r->name);
-           emitcode("movx","a,@%s",r->name);
-           emitcode("mov","psw,a");
-           emitcode("dec","%s",r->name);
-           
-       }else
-           emitcode ("pop","psw");
+  if (options.useXstack) {
+      aop = newAsmop(0);
+      r = getFreePtr(ic,&aop,FALSE);
+
+
+      emitcode("mov","%s,_spx",r->name);
+      emitcode("movx","a,@%s",r->name);
+      emitcode("mov","psw,a");
+      emitcode("dec","%s",r->name);
+
+  }else
+      emitcode ("pop","psw");
     }
 
     for (i = (ds390_nRegs - 1) ; i >= 0 ;i--) {
-        if (options.useXstack) {       
+        if (options.useXstack) {
             emitcode("movx","a,@%s",r->name);
             emitcode("mov","(%s+%d),a",
                      regs390[i].base,8*bank+regs390[i].offset);
             emitcode("dec","%s",r->name);
 
-        } else 
+        } else
             emitcode("pop","(%s+%d)",
                      regs390[i].base,8*bank+regs390[i].offset);
     }
 
     if (options.useXstack) {
 
-       emitcode("mov","_spx,%s",r->name);
-       freeAsmop(NULL,aop,ic,TRUE);
+  emitcode("mov","_spx,%s",r->name);
+  freeAsmop(NULL,aop,ic,TRUE);
 
-    } 
+    }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1947,9 +1947,9 @@ static void saverbank (int bank, iCode *ic, bool pushPsw)
 
     if (options.useXstack) {
 
-       aop = newAsmop(0);
-       r = getFreePtr(ic,&aop,FALSE);  
-       emitcode("mov","%s,_spx",r->name);
+  aop = newAsmop(0);
+  r = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,_spx",r->name);
 
     }
 
@@ -1958,24 +1958,24 @@ static void saverbank (int bank, iCode *ic, bool pushPsw)
             emitcode("inc","%s",r->name);
             emitcode("mov","a,(%s+%d)",
                      regs390[i].base,8*bank+regs390[i].offset);
-            emitcode("movx","@%s,a",r->name);           
-        } else 
+            emitcode("movx","@%s,a",r->name);
+        } else
             emitcode("push","(%s+%d)",
                      regs390[i].base,8*bank+regs390[i].offset);
     }
-    
+
     if (pushPsw) {
-       if (options.useXstack) {
-           emitcode("mov","a,psw");
-           emitcode("movx","@%s,a",r->name);   
-           emitcode("inc","%s",r->name);
-           emitcode("mov","_spx,%s",r->name);       
-           freeAsmop (NULL,aop,ic,TRUE);
-           
-       } else
-           emitcode("push","psw");
-       
-       emitcode("mov","psw,#0x%02x",(bank << 3)&0x00ff);
+  if (options.useXstack) {
+      emitcode("mov","a,psw");
+      emitcode("movx","@%s,a",r->name);
+      emitcode("inc","%s",r->name);
+      emitcode("mov","_spx,%s",r->name);
+      freeAsmop (NULL,aop,ic,TRUE);
+
+  } else
+      emitcode("push","psw");
+
+  emitcode("mov","psw,#0x%02x",(bank << 3)&0x00ff);
     }
     ic->bankSaved = 1;
 
@@ -1986,7 +1986,7 @@ static void saverbank (int bank, iCode *ic, bool pushPsw)
 /*-----------------------------------------------------------------*/
 static void genCall (iCode *ic)
 {
-    sym_link *detype;   
+    sym_link *detype;
 
     D(emitcode(";", "genCall "););
 
@@ -1998,39 +1998,39 @@ static void genCall (iCode *ic)
     the same register bank then we need to save the
     destination registers on the stack */
     detype = getSpec(operandType(IC_LEFT(ic)));
-    if (detype        && 
+    if (detype        &&
         (SPEC_BANK(currFunc->etype) != SPEC_BANK(detype)) &&
-       IS_ISR(currFunc->etype) &&
-        !ic->bankSaved) 
+  IS_ISR(currFunc->etype) &&
+        !ic->bankSaved)
 
         saverbank(SPEC_BANK(detype),ic,TRUE);
 
     /* if send set is not empty the assign */
     if (_G.sendSet) {
-       iCode *sic ;
+  iCode *sic ;
+
+  for (sic = setFirstItem(_G.sendSet) ; sic ;
+       sic = setNextItem(_G.sendSet))
+  {
+      int size, offset = 0;
 
-       for (sic = setFirstItem(_G.sendSet) ; sic ; 
-            sic = setNextItem(_G.sendSet)) 
-       {
-           int size, offset = 0;
-        
             aopOp(IC_LEFT(sic),sic,FALSE, TRUE);
-           size = AOP_SIZE(IC_LEFT(sic));
-           
-           _startLazyDPSEvaluation();
-           while (size--) {
-               char *l = aopGet(AOP(IC_LEFT(sic)),offset,
-                               FALSE, FALSE, TRUE);
-               if (strcmp(l,fReturn[offset]))
-                   emitcode("mov","%s,%s",
-                            fReturn[offset],
-                            l);
-               offset++;
-           }
-           _endLazyDPSEvaluation();
-           freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
-       }
-       _G.sendSet = NULL;
+      size = AOP_SIZE(IC_LEFT(sic));
+
+      _startLazyDPSEvaluation();
+      while (size--) {
+    char *l = aopGet(AOP(IC_LEFT(sic)),offset,
+        FALSE, FALSE, TRUE);
+    if (strcmp(l,fReturn[offset]))
+        emitcode("mov","%s,%s",
+           fReturn[offset],
+           l);
+    offset++;
+      }
+      _endLazyDPSEvaluation();
+      freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
+  }
+  _G.sendSet = NULL;
     }
     /* make the call */
     emitcode("lcall","%s",(OP_SYMBOL(IC_LEFT(ic))->rname[0] ?
@@ -2038,62 +2038,62 @@ static void genCall (iCode *ic)
                            OP_SYMBOL(IC_LEFT(ic))->name));
 
     /* if we need assign a result value */
-    if ((IS_ITEMP(IC_RESULT(ic)) && 
+    if ((IS_ITEMP(IC_RESULT(ic)) &&
          (OP_SYMBOL(IC_RESULT(ic))->nRegs ||
           OP_SYMBOL(IC_RESULT(ic))->spildir )) ||
         IS_TRUE_SYMOP(IC_RESULT(ic)) ) {
 
 #ifdef LAZY_DPS_OPT
-       /* Not really related to LAZY_DPS_OPT, but don't want
-        * another testing flag right now...
-        */
+  /* Not really related to LAZY_DPS_OPT, but don't want
+   * another testing flag right now...
+   */
 #define FAR_RETURN_OPT
-#ifdef FAR_RETURN_OPT   
-       if (isOperandInFarSpace(IC_RESULT(ic))
-        && getSize(operandType(IC_RESULT(ic))) <= 2)
-       {
-           int size =  getSize(operandType(IC_RESULT(ic)));
-           
-            /* Special case for 1 or 2 byte return in far space. */
-           emitcode(";", "Kevin function call abuse #1");
-
-           MOVA(fReturn[0]);
-           if (size > 1)
-           {
-               emitcode("mov", "b,%s", fReturn[1]);
-           }
-    
-           aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
-           aopPut(AOP(IC_RESULT(ic)),"a",0);
-           
-           if (size > 1)
-           {
-               aopPut(AOP(IC_RESULT(ic)),"b",1);
-           }
-           freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);           
-       }
-       else
-#endif 
-       {
+#ifdef FAR_RETURN_OPT
+  if (isOperandInFarSpace(IC_RESULT(ic))
+   && getSize(operandType(IC_RESULT(ic))) <= 2)
+  {
+      int size =  getSize(operandType(IC_RESULT(ic)));
+
+       /* Special case for 1 or 2 byte return in far space. */
+      emitcode(";", "Kevin function call abuse #1");
+
+      MOVA(fReturn[0]);
+          if (size > 1)
+          {
+              emitcode("mov", "b,%s", fReturn[1]);
+          }
+
+          aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
+      aopPut(AOP(IC_RESULT(ic)),"a",0);
+
+      if (size > 1)
+      {
+          aopPut(AOP(IC_RESULT(ic)),"b",1);
+      }
+          freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
+  }
+  else
+#endif
+  {
             _G.accInUse++;
             aopOp(IC_RESULT(ic),ic,FALSE, TRUE);
             _G.accInUse--;
-                                     
+
             assignResultValue(IC_RESULT(ic));
-                                                  
+
             freeAsmop(IC_RESULT(ic),NULL, ic,TRUE);
         }
 #else
-       if (!isOperandInFarSpace(IC_RESULT(ic)))
-       {
+  if (!isOperandInFarSpace(IC_RESULT(ic)))
+  {
             _G.accInUse++;
             aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
             _G.accInUse--;
 
-           assignResultValue(IC_RESULT(ic));
-               
+      assignResultValue(IC_RESULT(ic));
+
             freeAsmop(IC_RESULT(ic),NULL, ic,TRUE);
-       }
+      }
         else
         {
             /* Result is in far space, and requires DPTR to access
@@ -2103,34 +2103,34 @@ static void genCall (iCode *ic)
             int size = getSize(operandType(IC_RESULT(ic)));
             int offset = size - 1;
             char *l;
-           
-           emitcode(";", "Kevin function call abuse #1");
-
-           /* first push the right side on to the stack */
-           /* NB: this relies on the fact that "a" is the last
-            * register in fReturn. If it were not, the MOVA
-            * would potentially clobber a returned byte in A.
-            */
-           while (size--) {
-               l = fReturn[offset--];
-               MOVA(l);
-               emitcode ("push","acc");
-           }
-    
-           /* now assign DPTR to result */
-           aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
-           size = AOP_SIZE(IC_RESULT(ic));
-           aopOp(IC_RESULT(ic),ic,FALSE, FALSE); /* bug? */
-           while (size--) {
-               emitcode ("pop","acc");
-               aopPut(AOP(IC_RESULT(ic)),"a",++offset);
-           }
-           freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
-       }
-#endif 
-    }
-
-    /* adjust the stack for parameters if 
+
+      emitcode(";", "Kevin function call abuse #1");
+
+          /* first push the right side on to the stack */
+          /* NB: this relies on the fact that "a" is the last
+           * register in fReturn. If it were not, the MOVA
+           * would potentially clobber a returned byte in A.
+           */
+          while (size--) {
+          l = fReturn[offset--];
+      MOVA(l);
+    emitcode ("push","acc");
+          }
+
+          /* now assign DPTR to result */
+          aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
+          size = AOP_SIZE(IC_RESULT(ic));
+          aopOp(IC_RESULT(ic),ic,FALSE, FALSE); /* bug? */
+          while (size--) {
+    emitcode ("pop","acc");
+    aopPut(AOP(IC_RESULT(ic)),"a",++offset);
+          }
+          freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
+  }
+#endif
+    }
+
+    /* adjust the stack for parameters if
     required */
     if (IC_LEFT(ic)->parmBytes) {
         int i;
@@ -2138,7 +2138,7 @@ static void genCall (iCode *ic)
             emitcode("mov","a,%s",spname);
             emitcode("add","a,#0x%02x", (- IC_LEFT(ic)->parmBytes) & 0xff);
             emitcode("mov","%s,a",spname);
-        } else 
+        } else
             for ( i = 0 ; i <  IC_LEFT(ic)->parmBytes ;i++)
                 emitcode("dec","%s",spname);
 
@@ -2174,22 +2174,22 @@ static void genPcall (iCode *ic)
     the same register bank then we need to save the
     destination registers on the stack */
     detype = getSpec(operandType(IC_LEFT(ic)));
-    if (detype        && 
-       IS_ISR(currFunc->etype) &&
+    if (detype        &&
+  IS_ISR(currFunc->etype) &&
         (SPEC_BANK(currFunc->etype) != SPEC_BANK(detype)))
         saverbank(SPEC_BANK(detype),ic,TRUE);
 
 
     /* push the return address on to the stack */
     emitcode("mov","a,#%05d$",(rlbl->key+100));
-    emitcode("push","acc");    
+    emitcode("push","acc");
     emitcode("mov","a,#(%05d$ >> 8)",(rlbl->key+100));
     emitcode("push","acc");
-    
+
     if (options.model == MODEL_FLAT24)
     {
-       emitcode("mov","a,#(%05d$ >> 16)",(rlbl->key+100));
-       emitcode("push","acc");    
+      emitcode("mov","a,#(%05d$ >> 16)",(rlbl->key+100));
+      emitcode("push","acc");
     }
 
     /* now push the calling address */
@@ -2197,36 +2197,36 @@ static void genPcall (iCode *ic)
 
     pushSide(IC_LEFT(ic), FPTRSIZE);
 
-    freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); 
+    freeAsmop(IC_LEFT(ic),NULL,ic,TRUE);
 
     /* if send set is not empty the assign */
     if (_G.sendSet) {
-       iCode *sic ;
-
-       for (sic = setFirstItem(_G.sendSet) ; sic ; 
-            sic = setNextItem(_G.sendSet)) 
-            {
-               int size, offset = 0;
-           
-               aopOp(IC_LEFT(sic),sic,FALSE, FALSE);
-               size = AOP_SIZE(IC_LEFT(sic));
-               _startLazyDPSEvaluation();
-               while (size--) 
-               {
-                       char *l = aopGet(AOP(IC_LEFT(sic)),offset,
-                                        FALSE,FALSE,TRUE);
-                       if (strcmp(l,fReturn[offset]))
-                       {
-                               emitcode("mov","%s,%s",
-                                        fReturn[offset],
-                                        l);
-                       }
-                       offset++;
-               }
-               _endLazyDPSEvaluation();
-               freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
-           }
-           _G.sendSet = NULL;
+  iCode *sic ;
+
+  for (sic = setFirstItem(_G.sendSet) ; sic ;
+       sic = setNextItem(_G.sendSet))
+       {
+        int size, offset = 0;
+
+        aopOp(IC_LEFT(sic),sic,FALSE, FALSE);
+        size = AOP_SIZE(IC_LEFT(sic));
+        _startLazyDPSEvaluation();
+        while (size--)
+        {
+      char *l = aopGet(AOP(IC_LEFT(sic)),offset,
+           FALSE,FALSE,TRUE);
+      if (strcmp(l,fReturn[offset]))
+      {
+            emitcode("mov","%s,%s",
+               fReturn[offset],
+               l);
+      }
+      offset++;
+        }
+        _endLazyDPSEvaluation();
+        freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
+      }
+      _G.sendSet = NULL;
     }
 
     emitcode("ret","");
@@ -2242,13 +2242,13 @@ static void genPcall (iCode *ic)
         _G.accInUse++;
         aopOp(IC_RESULT(ic),ic,FALSE, TRUE);
         _G.accInUse--;
-       
-       assignResultValue(IC_RESULT(ic));
+
+  assignResultValue(IC_RESULT(ic));
 
         freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
     }
 
-    /* adjust the stack for parameters if 
+    /* adjust the stack for parameters if
     required */
     if (IC_LEFT(ic)->parmBytes) {
         int i;
@@ -2256,15 +2256,15 @@ static void genPcall (iCode *ic)
             emitcode("mov","a,%s",spname);
             emitcode("add","a,#0x%02x", (- IC_LEFT(ic)->parmBytes) & 0xff);
             emitcode("mov","%s,a",spname);
-        } else 
+        } else
             for ( i = 0 ; i <  IC_LEFT(ic)->parmBytes ;i++)
                 emitcode("dec","%s",spname);
 
     }
 
     /* if register bank was saved then unsave them */
-    if (detype        && 
-        (SPEC_BANK(currFunc->etype) != 
+    if (detype        &&
+        (SPEC_BANK(currFunc->etype) !=
          SPEC_BANK(detype)))
         unsaverbank(SPEC_BANK(detype),ic,TRUE);
 
@@ -2285,7 +2285,7 @@ static int resultRemat (iCode *ic)
 
     if (IC_RESULT(ic) && IS_ITEMP(IC_RESULT(ic))) {
         symbol *sym = OP_SYMBOL(IC_RESULT(ic));
-        if (sym->remat && !POINTER_SET(ic)) 
+        if (sym->remat && !POINTER_SET(ic))
             return 1;
     }
 
@@ -2304,15 +2304,15 @@ static int resultRemat (iCode *ic)
 static bool inExcludeList(char *s)
 {
     int i =0;
-    
+
     if (options.excludeRegs[i] &&
     STRCASECMP(options.excludeRegs[i],"none") == 0)
-       return FALSE ;
+  return FALSE ;
 
     for ( i = 0 ; options.excludeRegs[i]; i++) {
-       if (options.excludeRegs[i] &&
+  if (options.excludeRegs[i] &&
         STRCASECMP(s,options.excludeRegs[i]) == 0)
-           return TRUE;
+      return TRUE;
     }
     return FALSE ;
 }
@@ -2362,125 +2362,125 @@ static void genFunction (iCode *ic)
     /* if this is an interrupt service routine then
     save acc, b, dpl, dph  */
     if (IS_ISR(sym->etype)) {
-        
-       if (!inExcludeList("acc"))          
-           emitcode ("push","acc");    
-       if (!inExcludeList("b"))
-           emitcode ("push","b");
-       if (!inExcludeList("dpl"))
-           emitcode ("push","dpl");
-       if (!inExcludeList("dph"))
-           emitcode ("push","dph");
-       if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
-       {
-           emitcode ("push", "dpx");
-           /* Make sure we're using standard DPTR */
-           emitcode ("push", "dps");
-           emitcode ("mov", "dps, #0x00");
-           if (options.stack10bit)
-           {   
-               /* This ISR could conceivably use DPTR2. Better save it. */
-               emitcode ("push", "dpl1");
-               emitcode ("push", "dph1");
-               emitcode ("push", "dpx1");
+
+  if (!inExcludeList("acc"))
+      emitcode ("push","acc");
+  if (!inExcludeList("b"))
+      emitcode ("push","b");
+  if (!inExcludeList("dpl"))
+      emitcode ("push","dpl");
+  if (!inExcludeList("dph"))
+      emitcode ("push","dph");
+  if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
+  {
+      emitcode ("push", "dpx");
+      /* Make sure we're using standard DPTR */
+      emitcode ("push", "dps");
+      emitcode ("mov", "dps, #0x00");
+      if (options.stack10bit)
+      {
+        /* This ISR could conceivably use DPTR2. Better save it. */
+        emitcode ("push", "dpl1");
+        emitcode ("push", "dph1");
+        emitcode ("push", "dpx1");
             emitcode ("push", "ap");
-           }
-       }
-       /* if this isr has no bank i.e. is going to
-          run with bank 0 , then we need to save more
-          registers :-) */
-       if (!SPEC_BANK(sym->etype)) {
-
-           /* if this function does not call any other
-              function then we can be economical and
-              save only those registers that are used */
-           if (! sym->hasFcall) {
-               int i;
-
-               /* if any registers used */
-               if (sym->regsUsed) {
-                   /* save the registers used */
-                   for ( i = 0 ; i < sym->regsUsed->size ; i++) {
-                       if (bitVectBitValue(sym->regsUsed,i) ||
+      }
+  }
+  /* if this isr has no bank i.e. is going to
+     run with bank 0 , then we need to save more
+     registers :-) */
+  if (!SPEC_BANK(sym->etype)) {
+
+      /* if this function does not call any other
+         function then we can be economical and
+         save only those registers that are used */
+      if (! sym->hasFcall) {
+    int i;
+
+    /* if any registers used */
+    if (sym->regsUsed) {
+        /* save the registers used */
+        for ( i = 0 ; i < sym->regsUsed->size ; i++) {
+      if (bitVectBitValue(sym->regsUsed,i) ||
                           (ds390_ptrRegReq && (i == R0_IDX || i == R1_IDX)) )
-                           emitcode("push","%s",ds390_regWithIdx(i)->dname);                       
-                   }
-               }
-               
-           } else {
-               /* this function has  a function call cannot
-                  determines register usage so we will have the
-                  entire bank */
-               saverbank(0,ic,FALSE);
-           }       
-       }
+          emitcode("push","%s",ds390_regWithIdx(i)->dname);
+        }
+    }
+
+      } else {
+    /* this function has  a function call cannot
+       determines register usage so we will have the
+       entire bank */
+    saverbank(0,ic,FALSE);
+      }
+  }
     } else {
-       /* if callee-save to be used for this function
-          then save the registers being used in this function */
-       if (sym->calleeSave) {
-           int i;
-           
-           /* if any registers used */
-           if (sym->regsUsed) {
-               /* save the registers used */
-               for ( i = 0 ; i < sym->regsUsed->size ; i++) {
-                   if (bitVectBitValue(sym->regsUsed,i) ||
+  /* if callee-save to be used for this function
+     then save the registers being used in this function */
+  if (sym->calleeSave) {
+      int i;
+
+      /* if any registers used */
+      if (sym->regsUsed) {
+    /* save the registers used */
+    for ( i = 0 ; i < sym->regsUsed->size ; i++) {
+        if (bitVectBitValue(sym->regsUsed,i) ||
                       (ds390_ptrRegReq && (i == R0_IDX || i == R1_IDX)) ) {
-                       emitcode("push","%s",ds390_regWithIdx(i)->dname);
-                       _G.nRegsSaved++;
-                   }
-               }
-           }
-       }
+      emitcode("push","%s",ds390_regWithIdx(i)->dname);
+      _G.nRegsSaved++;
+        }
+    }
+      }
+  }
     }
 
     /* set the register bank to the desired value */
     if (SPEC_BANK(sym->etype) || IS_ISR(sym->etype)) {
         emitcode("push","psw");
-        emitcode("mov","psw,#0x%02x",(SPEC_BANK(sym->etype) << 3)&0x00ff);   
+        emitcode("mov","psw,#0x%02x",(SPEC_BANK(sym->etype) << 3)&0x00ff);
     }
 
     if (IS_RENT(sym->etype) || options.stackAuto) {
 
-       if (options.useXstack) {
-           emitcode("mov","r0,%s",spname);
-           emitcode("mov","a,_bp");
-           emitcode("movx","@r0,a");
-           emitcode("inc","%s",spname);
-       }
-       else
-       {
-           /* set up the stack */
-           emitcode ("push","_bp");     /* save the callers stack  */
-       }
-       emitcode ("mov","_bp,%s",spname);
+  if (options.useXstack) {
+      emitcode("mov","r0,%s",spname);
+      emitcode("mov","a,_bp");
+      emitcode("movx","@r0,a");
+      emitcode("inc","%s",spname);
+  }
+  else
+  {
+      /* set up the stack */
+      emitcode ("push","_bp");     /* save the callers stack  */
+  }
+  emitcode ("mov","_bp,%s",spname);
     }
 
     /* adjust the stack for the function */
     if (sym->stack) {
 
-       int i = sym->stack;
-       if (i > 256 ) 
-           werror(W_STACK_OVERFLOW,sym->name);
+  int i = sym->stack;
+  if (i > 256 )
+      werror(W_STACK_OVERFLOW,sym->name);
 
-       if (i > 3 && sym->recvSize < 4) {              
+  if (i > 3 && sym->recvSize < 4) {
 
-           emitcode ("mov","a,sp");
-           emitcode ("add","a,#0x%02x",((char)sym->stack & 0xff));
-           emitcode ("mov","sp,a");
-          
-       }
-       else
-           while(i--)
-               emitcode("inc","sp");
+      emitcode ("mov","a,sp");
+      emitcode ("add","a,#0x%02x",((char)sym->stack & 0xff));
+      emitcode ("mov","sp,a");
+
+  }
+  else
+      while(i--)
+    emitcode("inc","sp");
     }
 
      if (sym->xstack) {
 
-       emitcode ("mov","a,_spx");
-       emitcode ("add","a,#0x%02x",((char)sym->xstack & 0xff));
-       emitcode ("mov","_spx,a");
-    }    
+  emitcode ("mov","a,_spx");
+  emitcode ("add","a,#0x%02x",((char)sym->xstack & 0xff));
+  emitcode ("mov","_spx,a");
+    }
 
 }
 
@@ -2501,7 +2501,7 @@ static void genEndFunction (iCode *ic)
     /* if use external stack but some variables were
     added to the local stack then decrement the
     local stack */
-    if (options.useXstack && sym->stack) {      
+    if (options.useXstack && sym->stack) {
         emitcode("mov","a,sp");
         emitcode("add","a,#0x%02x",((char)-sym->stack) & 0xff);
         emitcode("mov","sp,a");
@@ -2509,125 +2509,125 @@ static void genEndFunction (iCode *ic)
 
 
     if ((IS_RENT(sym->etype) || options.stackAuto)) {
-       if (options.useXstack) {
-           emitcode("mov","r0,%s",spname);
-           emitcode("movx","a,@r0");
-           emitcode("mov","_bp,a");
-           emitcode("dec","%s",spname);
-       }
-       else
-       {
-           emitcode ("pop","_bp");
-       }
-    }
-
-    /* restore the register bank  */    
+  if (options.useXstack) {
+      emitcode("mov","r0,%s",spname);
+      emitcode("movx","a,@r0");
+      emitcode("mov","_bp,a");
+      emitcode("dec","%s",spname);
+  }
+  else
+  {
+      emitcode ("pop","_bp");
+  }
+    }
+
+    /* restore the register bank  */
     if (SPEC_BANK(sym->etype) || IS_ISR(sym->etype))
         emitcode ("pop","psw");
 
     if (IS_ISR(sym->etype)) {
 
-       /* now we need to restore the registers */
-       /* if this isr has no bank i.e. is going to
-          run with bank 0 , then we need to save more
-          registers :-) */
-       if (!SPEC_BANK(sym->etype)) {
-           
-           /* if this function does not call any other
-              function then we can be economical and
-              save only those registers that are used */
-           if (! sym->hasFcall) {
-               int i;
-               
-               /* if any registers used */
-               if (sym->regsUsed) {
-                   /* save the registers used */
-                   for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
-                       if (bitVectBitValue(sym->regsUsed,i) ||
+  /* now we need to restore the registers */
+  /* if this isr has no bank i.e. is going to
+     run with bank 0 , then we need to save more
+     registers :-) */
+  if (!SPEC_BANK(sym->etype)) {
+
+      /* if this function does not call any other
+         function then we can be economical and
+         save only those registers that are used */
+      if (! sym->hasFcall) {
+    int i;
+
+    /* if any registers used */
+    if (sym->regsUsed) {
+        /* save the registers used */
+        for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
+      if (bitVectBitValue(sym->regsUsed,i) ||
                           (ds390_ptrRegReq && (i == R0_IDX || i == R1_IDX)) )
-                           emitcode("pop","%s",ds390_regWithIdx(i)->dname);
-                   }
-               }
-               
-           } else {
-               /* this function has  a function call cannot
-                  determines register usage so we will have the
-                  entire bank */
-               unsaverbank(0,ic,FALSE);
-           }       
-       }
-
-       if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
-       {
-           if (options.stack10bit)
-           {
+          emitcode("pop","%s",ds390_regWithIdx(i)->dname);
+        }
+    }
+
+      } else {
+    /* this function has  a function call cannot
+       determines register usage so we will have the
+       entire bank */
+    unsaverbank(0,ic,FALSE);
+      }
+  }
+
+  if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
+  {
+      if (options.stack10bit)
+      {
             emitcode ("pop", "ap");
-               emitcode ("pop", "dpx1");
-               emitcode ("pop", "dph1");
-               emitcode ("pop", "dpl1");
-           }   
-           emitcode ("pop", "dps");
-           emitcode ("pop", "dpx");
-       }
-       if (!inExcludeList("dph"))
-           emitcode ("pop","dph");
-       if (!inExcludeList("dpl"))
-           emitcode ("pop","dpl");
-       if (!inExcludeList("b"))
-           emitcode ("pop","b");
-       if (!inExcludeList("acc"))
-           emitcode ("pop","acc");
+          emitcode ("pop", "dpx1");
+          emitcode ("pop", "dph1");
+          emitcode ("pop", "dpl1");
+      }
+      emitcode ("pop", "dps");
+      emitcode ("pop", "dpx");
+  }
+  if (!inExcludeList("dph"))
+      emitcode ("pop","dph");
+  if (!inExcludeList("dpl"))
+      emitcode ("pop","dpl");
+  if (!inExcludeList("b"))
+      emitcode ("pop","b");
+  if (!inExcludeList("acc"))
+      emitcode ("pop","acc");
 
         if (SPEC_CRTCL(sym->etype))
             emitcode("setb","ea");
 
-       /* if debug then send end of function */
-/*     if (options.debug && currFunc) { */
-       if (currFunc) {
-           _G.debugLine = 1;
-           emitcode("","C$%s$%d$%d$%d ==.",
-                    ic->filename,currFunc->lastLine,
-                    ic->level,ic->block); 
-           if (IS_STATIC(currFunc->etype))         
-               emitcode("","XF%s$%s$0$0 ==.",moduleName,currFunc->name); 
-           else
-               emitcode("","XG$%s$0$0 ==.",currFunc->name);
-           _G.debugLine = 0;
-       }
-       
+  /* if debug then send end of function */
+/*  if (options.debug && currFunc) { */
+  if (currFunc) {
+      _G.debugLine = 1;
+      emitcode("","C$%s$%d$%d$%d ==.",
+         ic->filename,currFunc->lastLine,
+         ic->level,ic->block);
+      if (IS_STATIC(currFunc->etype))
+    emitcode("","XF%s$%s$0$0 ==.",moduleName,currFunc->name);
+      else
+    emitcode("","XG$%s$0$0 ==.",currFunc->name);
+      _G.debugLine = 0;
+  }
+
         emitcode ("reti","");
     }
     else {
         if (SPEC_CRTCL(sym->etype))
             emitcode("setb","ea");
-       
-       if (sym->calleeSave) {
-           int i;
-           
-           /* if any registers used */
-           if (sym->regsUsed) {
-               /* save the registers used */
-               for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
-                   if (bitVectBitValue(sym->regsUsed,i) ||
+
+  if (sym->calleeSave) {
+      int i;
+
+      /* if any registers used */
+      if (sym->regsUsed) {
+    /* save the registers used */
+    for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
+        if (bitVectBitValue(sym->regsUsed,i) ||
                       (ds390_ptrRegReq && (i == R0_IDX || i == R1_IDX)) )
-                       emitcode("pop","%s",ds390_regWithIdx(i)->dname);
-               }
-           }
-           
-       }
-
-       /* if debug then send end of function */
-       if (currFunc) {
-           _G.debugLine = 1;
-           emitcode("","C$%s$%d$%d$%d ==.",
-                    ic->filename,currFunc->lastLine,
-                    ic->level,ic->block); 
-           if (IS_STATIC(currFunc->etype))         
-               emitcode("","XF%s$%s$0$0 ==.",moduleName,currFunc->name); 
-           else
-               emitcode("","XG$%s$0$0 ==.",currFunc->name);
-           _G.debugLine = 0;
-       }
+      emitcode("pop","%s",ds390_regWithIdx(i)->dname);
+    }
+      }
+
+  }
+
+  /* if debug then send end of function */
+  if (currFunc) {
+      _G.debugLine = 1;
+      emitcode("","C$%s$%d$%d$%d ==.",
+         ic->filename,currFunc->lastLine,
+         ic->level,ic->block);
+      if (IS_STATIC(currFunc->etype))
+    emitcode("","XF%s$%s$0$0 ==.",moduleName,currFunc->name);
+      else
+    emitcode("","XG$%s$0$0 ==.",currFunc->name);
+      _G.debugLine = 0;
+  }
 
         emitcode ("ret","");
     }
@@ -2640,55 +2640,55 @@ static void genEndFunction (iCode *ic)
 static void genRet (iCode *ic)
 {
     int size,offset = 0 , pushed = 0;
-    
+
     D(emitcode(";", "genRet "););
 
     /* if we have no return value then
        just generate the "ret" */
-    if (!IC_LEFT(ic)) 
-       goto jumpret;       
-    
+    if (!IC_LEFT(ic))
+  goto jumpret;
+
     /* we have something to return then
        move the return value into place */
     aopOp(IC_LEFT(ic),ic,FALSE, TRUE);
     size = AOP_SIZE(IC_LEFT(ic));
-    
+
     _startLazyDPSEvaluation();
     while (size--) {
-           char *l ;
-           if (AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR) {
-                   l = aopGet(AOP(IC_LEFT(ic)),offset++,
-                          FALSE,TRUE,FALSE);
-                   emitcode("push","%s",l);
-                   pushed++;
-           } else {
-                   l = aopGet(AOP(IC_LEFT(ic)),offset,
-                              FALSE,FALSE,FALSE);
-                   if (strcmp(fReturn[offset],l))
-                           emitcode("mov","%s,%s",fReturn[offset++],l);
-           }
-    }
-    _endLazyDPSEvaluation();    
+      char *l ;
+      if (AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR) {
+        l = aopGet(AOP(IC_LEFT(ic)),offset++,
+         FALSE,TRUE,FALSE);
+        emitcode("push","%s",l);
+        pushed++;
+      } else {
+        l = aopGet(AOP(IC_LEFT(ic)),offset,
+             FALSE,FALSE,FALSE);
+        if (strcmp(fReturn[offset],l))
+          emitcode("mov","%s,%s",fReturn[offset++],l);
+      }
+    }
+    _endLazyDPSEvaluation();
 
     if (pushed) {
-       while(pushed) {
-           pushed--;
-           if (strcmp(fReturn[pushed],"a"))
-               emitcode("pop",fReturn[pushed]);
-           else
-               emitcode("pop","acc");
-       }
+  while(pushed) {
+      pushed--;
+      if (strcmp(fReturn[pushed],"a"))
+    emitcode("pop",fReturn[pushed]);
+      else
+    emitcode("pop","acc");
+  }
     }
     freeAsmop (IC_LEFT(ic),NULL,ic,TRUE);
-    
+
  jumpret:
-       /* generate a jump to the return label
-          if the next is not the return statement */
+  /* generate a jump to the return label
+     if the next is not the return statement */
     if (!(ic->next && ic->next->op == LABEL &&
-         IC_LABEL(ic->next) == returnLabel))
-       
-       emitcode("ljmp","%05d$",(returnLabel->key+100));
-    
+    IC_LABEL(ic->next) == returnLabel))
+
+  emitcode("ljmp","%05d$",(returnLabel->key+100));
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -2716,26 +2716,26 @@ static void genGoto (iCode *ic)
 
 /*-----------------------------------------------------------------*/
 /* findLabelBackwards: walks back through the iCode chain looking  */
-/* for the given label. Returns number of iCode instructions      */
-/* between that label and given ic.                               */
-/* Returns zero if label not found.                               */
+/* for the given label. Returns number of iCode instructions     */
+/* between that label and given ic.          */
+/* Returns zero if label not found.          */
 /*-----------------------------------------------------------------*/
 static int findLabelBackwards(iCode *ic, int key)
 {
     int count = 0;
-    
+
     while (ic->prev)
     {
         ic = ic->prev;
         count++;
-        
+
         if (ic->op == LABEL && IC_LABEL(ic)->key == key)
         {
             /* printf("findLabelBackwards = %d\n", count); */
             return count;
         }
     }
-    
+
     return 0;
 }
 
@@ -2746,33 +2746,33 @@ static bool genPlusIncr (iCode *ic)
 {
     unsigned int icount ;
     unsigned int size = getDataSize(IC_RESULT(ic));
-    
+
     /* will try to generate an increment */
-    /* if the right side is not a literal 
+    /* if the right side is not a literal
        we cannot */
     if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
         return FALSE ;
-    
+
     /* if the literal value of the right hand side
        is greater than 4 then it is not worth it */
-    if ((icount =  floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit)) > 4)
+    if ((icount =  (unsigned int) floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit)) > 4)
         return FALSE ;
-    
+
     /* if increment 16 bits in register */
     if (
         AOP_TYPE(IC_LEFT(ic)) == AOP_REG &&
         AOP_TYPE(IC_RESULT(ic)) == AOP_REG &&
-       sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) &&
+      sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) &&
         (size > 1) &&
         (icount == 1)) {
         symbol *tlbl;
         int emitTlbl;
         int labelRange;
 
-       /* If the next instruction is a goto and the goto target
-        * is <= 5 instructions previous to this, we can generate
-        * jumps straight to that target.
-        */
+  /* If the next instruction is a goto and the goto target
+   * is <= 5 instructions previous to this, we can generate
+   * jumps straight to that target.
+   */
         if (ic->next && ic->next->op == GOTO
             && (labelRange = findLabelBackwards(ic, IC_LABEL(ic->next)->key)) != 0
             && labelRange <= 5 )
@@ -2786,61 +2786,61 @@ static bool genPlusIncr (iCode *ic)
             tlbl = newiTempLabel(NULL);
             emitTlbl = 1;
         }
-       emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE));
-       if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-          IS_AOP_PREG(IC_RESULT(ic)))
-           emitcode("cjne","%s,#0x00,%05d$"
-                    ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE)
-                    ,tlbl->key+100);
-       else {
-           emitcode("clr","a");
-           emitcode("cjne","a,%s,%05d$"
-                    ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE)
-                    ,tlbl->key+100);
-       }
-    
-       emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE));
-       if (size > 2)
-       {
-           if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-              IS_AOP_PREG(IC_RESULT(ic)))
-               emitcode("cjne","%s,#0x00,%05d$"
-                        ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE)
-                        ,tlbl->key+100);
-           else
-               emitcode("cjne","a,%s,%05d$"
-                        ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE)
-                        ,tlbl->key+100);
-           
-           emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE));
+  emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE));
+  if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+     IS_AOP_PREG(IC_RESULT(ic)))
+      emitcode("cjne","%s,#0x00,%05d$"
+         ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE)
+         ,tlbl->key+100);
+  else {
+      emitcode("clr","a");
+      emitcode("cjne","a,%s,%05d$"
+         ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE)
+         ,tlbl->key+100);
+  }
+
+  emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE));
+  if (size > 2)
+  {
+      if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+         IS_AOP_PREG(IC_RESULT(ic)))
+    emitcode("cjne","%s,#0x00,%05d$"
+       ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE)
+       ,tlbl->key+100);
+      else
+    emitcode("cjne","a,%s,%05d$"
+       ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE)
+       ,tlbl->key+100);
+
+      emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE));
        }
        if (size > 3)
        {
-           if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-              IS_AOP_PREG(IC_RESULT(ic)))
-               emitcode("cjne","%s,#0x00,%05d$"
-                        ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE)
-                        ,tlbl->key+100);
-           else{
-               emitcode("cjne","a,%s,%05d$"
-                        ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE)
-                        ,tlbl->key+100);
-           }
-           emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB32,FALSE,FALSE,FALSE));
-       }
-       
-       if (emitTlbl)
-       {
-           emitcode("","%05d$:",tlbl->key+100);
-       }
+      if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+         IS_AOP_PREG(IC_RESULT(ic)))
+    emitcode("cjne","%s,#0x00,%05d$"
+       ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE)
+       ,tlbl->key+100);
+      else{
+    emitcode("cjne","a,%s,%05d$"
+       ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE)
+       ,tlbl->key+100);
+      }
+      emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB32,FALSE,FALSE,FALSE));
+  }
+
+  if (emitTlbl)
+  {
+      emitcode("","%05d$:",tlbl->key+100);
+  }
         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   )
         return FALSE ;
-    
+
     /* we can if the aops of the left & result match or
        if they are in registers and the registers are the
        same */
@@ -2848,24 +2848,24 @@ static bool genPlusIncr (iCode *ic)
         AOP_TYPE(IC_LEFT(ic)) == AOP_REG &&
         AOP_TYPE(IC_RESULT(ic)) == AOP_REG &&
         sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) ) {
-       
+
         if (icount > 3) {
             MOVA(aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE,TRUE));
             emitcode("add","a,#0x%02x",((char) icount) & 0xff);
             aopPut(AOP(IC_RESULT(ic)),"a",0);
         } else {
-           
-           _startLazyDPSEvaluation();
-            while (icount--) 
+
+      _startLazyDPSEvaluation();
+            while (icount--)
             {
                 emitcode ("inc","%s",aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE,FALSE));
             }
             _endLazyDPSEvaluation();
         }
-       
+
         return TRUE ;
     }
-    
+
     return FALSE ;
 }
 
@@ -2914,31 +2914,31 @@ static void genPlusBits (iCode *ic)
 static void adjustArithmeticResult(iCode *ic)
 {
     if (opIsGptr(IC_RESULT(ic)) &&
-       opIsGptr(IC_LEFT(ic))   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
+      opIsGptr(IC_LEFT(ic))   &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
     {
-       aopPut(AOP(IC_RESULT(ic)),
-              aopGet(AOP(IC_LEFT(ic)), GPTRSIZE - 1,FALSE,FALSE,FALSE),
-              GPTRSIZE - 1);
+  aopPut(AOP(IC_RESULT(ic)),
+         aopGet(AOP(IC_LEFT(ic)), GPTRSIZE - 1,FALSE,FALSE,FALSE),
+         GPTRSIZE - 1);
     }
 
     if (opIsGptr(IC_RESULT(ic)) &&
         opIsGptr(IC_RIGHT(ic))   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
     {
-       aopPut(AOP(IC_RESULT(ic)),
-              aopGet(AOP(IC_RIGHT(ic)),GPTRSIZE - 1,FALSE,FALSE,FALSE),
-              GPTRSIZE - 1);
+  aopPut(AOP(IC_RESULT(ic)),
+         aopGet(AOP(IC_RIGHT(ic)),GPTRSIZE - 1,FALSE,FALSE,FALSE),
+         GPTRSIZE - 1);
     }
 
-    if (opIsGptr(IC_RESULT(ic))           &&
+    if (opIsGptr(IC_RESULT(ic))      &&
         AOP_SIZE(IC_LEFT(ic)) < GPTRSIZE   &&
         AOP_SIZE(IC_RIGHT(ic)) < GPTRSIZE  &&
-        !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
-        !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
-        char buffer[5];
-        sprintf(buffer,"#%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
-        aopPut(AOP(IC_RESULT(ic)),buffer,GPTRSIZE - 1);
+   !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
+   !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
+   char buffer[5];
+   sprintf(buffer,"#%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
+   aopPut(AOP(IC_RESULT(ic)),buffer,GPTRSIZE - 1);
      }
 }
 
@@ -2959,7 +2959,7 @@ static void adjustArithmeticResult(iCode *ic)
     aopOp (IC_RIGHT(ic),ic,FALSE, FALSE); \
     aopOp (IC_LEFT(ic),ic,FALSE, (AOP_TYPE(IC_RIGHT(ic)) == AOP_DPTR)); \
     aopOp (IC_RESULT(ic),ic,TRUE, (AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR) || \
-                                 (AOP_TYPE(IC_RIGHT(ic)) == AOP_DPTR)); \
+              (AOP_TYPE(IC_RIGHT(ic)) == AOP_DPTR)); \
     if (AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR2 && \
         AOP_TYPE(IC_RESULT(ic)) == AOP_DPTR2) \
     { \
@@ -2967,7 +2967,7 @@ static void adjustArithmeticResult(iCode *ic)
         fprintf(stderr,                                  \
                "Ack: three operands in far space! (%s:%d %s:%d)\n", __FILE__, __LINE__, ic->filename, ic->lineno);   \
     }
-    
+
 #define AOP_OP_3_NOFATAL(ic, rc) \
     aopOp (IC_RIGHT(ic),ic,FALSE, FALSE); \
     aopOp (IC_LEFT(ic),ic,FALSE, (AOP_TYPE(IC_RIGHT(ic)) == AOP_DPTR)); \
@@ -2994,7 +2994,7 @@ static void adjustArithmeticResult(iCode *ic)
 #define AOP_OP_2(ic) \
     aopOp (IC_RIGHT(ic),ic,FALSE, FALSE); \
     aopOp (IC_LEFT(ic),ic,FALSE, (AOP_TYPE(IC_RIGHT(ic)) == AOP_DPTR));
-    
+
 #endif
 
 
@@ -3018,8 +3018,8 @@ static void genPlus (iCode *ic)
 
 #if 0
     aopOp (IC_RIGHT(ic),ic,FALSE, FALSE);
-    aopOp (IC_LEFT(ic),ic,FALSE, 
-          (AOP_TYPE(IC_RIGHT(ic)) == AOP_DPTR));
+    aopOp (IC_LEFT(ic),ic,FALSE,
+         (AOP_TYPE(IC_RIGHT(ic)) == AOP_DPTR));
     if ((AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR2) &&
         (AOP_TYPE(IC_RIGHT(ic)) == AOP_DPTR))
     {
@@ -3027,7 +3027,7 @@ static void genPlus (iCode *ic)
     }
     else
     {
-        aopOp (IC_RESULT(ic),ic,TRUE, 
+        aopOp (IC_RESULT(ic),ic,TRUE,
                ((AOP_TYPE(IC_RIGHT(ic)) == AOP_DPTR)
              || (AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR)));
     }
@@ -3037,7 +3037,7 @@ static void genPlus (iCode *ic)
     {
         D(emitcode(";", "genPlus: must push result: 3 ops in far space"););
     }
-#endif    
+#endif
 
     if (!pushResult)
     {
@@ -3045,8 +3045,8 @@ static void genPlus (iCode *ic)
        if left requires ACC or right is already
        in ACC */
     if ((AOP_TYPE(IC_LEFT(ic)) == AOP_LIT)
-       || ((AOP_NEEDSACC(IC_LEFT(ic))) && !(AOP_NEEDSACC(IC_RIGHT(ic)))) 
-       || AOP_TYPE(IC_RIGHT(ic)) == AOP_ACC )
+  || ((AOP_NEEDSACC(IC_LEFT(ic))) && !(AOP_NEEDSACC(IC_RIGHT(ic))))
+  || AOP_TYPE(IC_RIGHT(ic)) == AOP_ACC )
     {
         operand *t = IC_RIGHT(ic);
         IC_RIGHT(ic) = IC_LEFT(ic);
@@ -3089,7 +3089,7 @@ static void genPlus (iCode *ic)
     if (genPlusIncr (ic) == TRUE)
     {
         emitcode(";", "did genPlusIncr");
-        goto release;   
+        goto release;
     }
 
     }
@@ -3098,24 +3098,24 @@ static void genPlus (iCode *ic)
     _startLazyDPSEvaluation();
     while(size--)
     {
-       if (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) 
-       {
-           MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE,TRUE));
-           if(offset == 0)
-               emitcode("add","a,%s",
-                        aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE,FALSE));
-           else
-               emitcode("addc","a,%s",
-                        aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE,FALSE));
-       } else {
-           MOVA(aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE,TRUE));
-           if(offset == 0)
-               emitcode("add","a,%s",
-                        aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE,FALSE));
-           else
-               emitcode("addc","a,%s",
-                        aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE,FALSE));
-       }
+  if (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC)
+  {
+      MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE,TRUE));
+      if(offset == 0)
+    emitcode("add","a,%s",
+       aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE,FALSE));
+      else
+    emitcode("addc","a,%s",
+       aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE,FALSE));
+  } else {
+      MOVA(aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE,TRUE));
+      if(offset == 0)
+    emitcode("add","a,%s",
+       aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE,FALSE));
+      else
+    emitcode("addc","a,%s",
+       aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE,FALSE));
+  }
         if (!pushResult)
         {
             aopPut(AOP(IC_RESULT(ic)),"a",offset);
@@ -3127,41 +3127,41 @@ static void genPlus (iCode *ic)
         offset++;
     }
     _endLazyDPSEvaluation();
-   
+
     if (pushResult)
     {
         aopOp (IC_RESULT(ic),ic,TRUE, FALSE);
 
         size = getDataSize(IC_LEFT(ic));
-       rSize = getDataSize(IC_RESULT(ic));
-       
-       /* If the pushed data is bigger than the result,
-        * simply discard unused bytes. Icky, but works.
-        *
-        * Should we throw a warning here? We're losing data...
-        */
-       while (size > rSize)
-       {
-          D(emitcode(";", "discarding unused result byte."););
-          emitcode("pop", "acc");
-          size--;
-          offset--; 
-       }
-       if (size < rSize)
-       {
-           emitcode("clr", "a");
-           /* Conversly, we haven't pushed enough here.
-            * just zero-pad, and all is well. 
-            */
-           while (size < rSize)
-           {
-               emitcode("push", "acc");
-               size++;
-               offset++;
-           }
-       }
-
-       _startLazyDPSEvaluation();
+  rSize = getDataSize(IC_RESULT(ic));
+
+  /* If the pushed data is bigger than the result,
+   * simply discard unused bytes. Icky, but works.
+   *
+   * Should we throw a warning here? We're losing data...
+   */
+  while (size > rSize)
+  {
+     D(emitcode(";", "discarding unused result byte."););
+     emitcode("pop", "acc");
+     size--;
+     offset--;
+  }
+  if (size < rSize)
+  {
+      emitcode("clr", "a");
+      /* Conversly, we haven't pushed enough here.
+       * just zero-pad, and all is well.
+       */
+      while (size < rSize)
+      {
+        emitcode("push", "acc");
+        size++;
+        offset++;
+      }
+  }
+
+  _startLazyDPSEvaluation();
         while(size--)
         {
             emitcode("pop", "acc");
@@ -3187,7 +3187,7 @@ static bool genMinusDec (iCode *ic)
     unsigned int size = getDataSize(IC_RESULT(ic));
 
     /* will try to generate an increment */
-    /* if the right side is not a literal 
+    /* if the right side is not a literal
     we cannot */
     if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
         return FALSE ;
@@ -3207,14 +3207,14 @@ static bool genMinusDec (iCode *ic)
             int emitTlbl;
             int labelRange;
 
-           /* If the next instruction is a goto and the goto target
+      /* If the next instruction is a goto and the goto target
          * is <= 5 instructions previous to this, we can generate
-            * jumps straight to that target.
-            */
+       * jumps straight to that target.
+       */
             if (ic->next && ic->next->op == GOTO
                 && (labelRange = findLabelBackwards(ic, IC_LABEL(ic->next)->key)) != 0
                 && labelRange <= 5 )
-            {        
+            {
                emitcode(";", "tail decrement optimized (range %d)", labelRange);
                tlbl = IC_LABEL(ic->next);
                emitTlbl = 0;
@@ -3224,55 +3224,55 @@ static bool genMinusDec (iCode *ic)
                 tlbl = newiTempLabel(NULL);
                 emitTlbl = 1;
             }
-        
-               emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE));
-               if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-                  AOP_TYPE(IC_RESULT(ic)) == AOP_DPTR ||
-                  IS_AOP_PREG(IC_RESULT(ic)))
-                       emitcode("cjne","%s,#0xff,%05d$"
-                                        ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE)
-                                        ,tlbl->key+100);
-               else{
-                       emitcode("mov","a,#0xff");
-                       emitcode("cjne","a,%s,%05d$"
-                                        ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE)
-                                        ,tlbl->key+100);
-               }
-               emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE));
-               if (size > 2)
-               {
-                       if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-                          AOP_TYPE(IC_RESULT(ic)) == AOP_DPTR ||
-                          IS_AOP_PREG(IC_RESULT(ic)))
-                               emitcode("cjne","%s,#0xff,%05d$"
-                                                ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE)
-                                                ,tlbl->key+100);
-                       else{
-                               emitcode("cjne","a,%s,%05d$"
-                                                ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE)
-                                                ,tlbl->key+100);
-                       }
-                       emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE));
-               }
-               if (size > 3)
-               {
-                       if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-                          AOP_TYPE(IC_RESULT(ic)) == AOP_DPTR ||
-                          IS_AOP_PREG(IC_RESULT(ic)))
-                               emitcode("cjne","%s,#0xff,%05d$"
-                                                ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE)
-                                                ,tlbl->key+100);
-                       else{
-                               emitcode("cjne","a,%s,%05d$"
-                                                ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE)
-                                                ,tlbl->key+100);
-                       }
-                       emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB32,FALSE,FALSE,FALSE));
-               }
-               if (emitTlbl)
-               {
-                   emitcode("","%05d$:",tlbl->key+100);
-               }
+
+    emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE));
+    if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+       AOP_TYPE(IC_RESULT(ic)) == AOP_DPTR ||
+       IS_AOP_PREG(IC_RESULT(ic)))
+      emitcode("cjne","%s,#0xff,%05d$"
+           ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE)
+           ,tlbl->key+100);
+    else{
+      emitcode("mov","a,#0xff");
+      emitcode("cjne","a,%s,%05d$"
+           ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE,FALSE)
+           ,tlbl->key+100);
+    }
+    emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE));
+    if (size > 2)
+    {
+      if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+         AOP_TYPE(IC_RESULT(ic)) == AOP_DPTR ||
+         IS_AOP_PREG(IC_RESULT(ic)))
+        emitcode("cjne","%s,#0xff,%05d$"
+             ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE)
+             ,tlbl->key+100);
+      else{
+        emitcode("cjne","a,%s,%05d$"
+             ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE,FALSE)
+             ,tlbl->key+100);
+      }
+      emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE));
+    }
+    if (size > 3)
+    {
+      if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+         AOP_TYPE(IC_RESULT(ic)) == AOP_DPTR ||
+         IS_AOP_PREG(IC_RESULT(ic)))
+        emitcode("cjne","%s,#0xff,%05d$"
+             ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE)
+             ,tlbl->key+100);
+      else{
+        emitcode("cjne","a,%s,%05d$"
+             ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE,FALSE)
+             ,tlbl->key+100);
+      }
+      emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB32,FALSE,FALSE,FALSE));
+    }
+    if (emitTlbl)
+    {
+        emitcode("","%05d$:",tlbl->key+100);
+    }
         return TRUE;
     }
 
@@ -3289,8 +3289,8 @@ static bool genMinusDec (iCode *ic)
         AOP_TYPE(IC_RESULT(ic)) == AOP_REG &&
         sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic)))) {
 
-       _startLazyDPSEvaluation();
-        while (icount--) 
+  _startLazyDPSEvaluation();
+        while (icount--)
         {
             emitcode ("dec","%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,FALSE));
         }
@@ -3313,7 +3313,7 @@ static void addSign(operand *result, int offset, int sign)
             emitcode("rlc","a");
             emitcode("subb","a,acc");
             while(size--)
-                aopPut(AOP(result),"a",offset++); 
+                aopPut(AOP(result),"a",offset++);
         } else
             while(size--)
                 aopPut(AOP(result),zero,offset++);
@@ -3326,8 +3326,8 @@ static void addSign(operand *result, int offset, int sign)
 static void genMinusBits (iCode *ic)
 {
     symbol *lbl = newiTempLabel(NULL);
-    
-    D(emitcode(";", "genMinusBits "););    
+
+    D(emitcode(";", "genMinusBits "););
 
     if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY){
         emitcode("mov","c,%s",AOP(IC_LEFT(ic))->aopu.aop_dir);
@@ -3400,7 +3400,7 @@ static void genMinus (iCode *ic)
     _startLazyDPSEvaluation();
     while (size--) {
         MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE,TRUE));
-        if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)  
+        if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
             emitcode("subb","a,%s",
                      aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE,FALSE));
         else{
@@ -3432,31 +3432,31 @@ static void genMinus (iCode *ic)
         size = getDataSize(IC_LEFT(ic));
         rSize = getDataSize(IC_RESULT(ic));
 
-       /* If the pushed data is bigger than the result,
-        * simply discard unused bytes. Icky, but works.
-        *
-        * Should we throw a warning here? We're losing data...
-        */
-       while (size > getDataSize(IC_RESULT(ic)))
-       {
-          emitcode(";", "discarding unused result byte.");
-          emitcode("pop", "acc");
-          size--;
-          offset--; 
-       }
-       if (size < rSize)
-       {
-           emitcode("clr", "a");
-           /* Conversly, we haven't pushed enough here.
-            * just zero-pad, and all is well. 
-            */
-           while (size < rSize)
-           {
-               emitcode("push", "acc");
-               size++;
-               offset++;
-           }
-       }
+  /* If the pushed data is bigger than the result,
+   * simply discard unused bytes. Icky, but works.
+   *
+   * Should we throw a warning here? We're losing data...
+   */
+  while (size > getDataSize(IC_RESULT(ic)))
+  {
+     emitcode(";", "discarding unused result byte.");
+     emitcode("pop", "acc");
+     size--;
+     offset--;
+  }
+  if (size < rSize)
+  {
+      emitcode("clr", "a");
+      /* Conversly, we haven't pushed enough here.
+       * just zero-pad, and all is well.
+       */
+      while (size < rSize)
+      {
+        emitcode("push", "acc");
+        size++;
+        offset++;
+      }
+  }
 
         while(size--)
         {
@@ -3466,7 +3466,7 @@ static void genMinus (iCode *ic)
     }
 
     adjustArithmeticResult(ic);
-        
+
 release:
     freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(IC_RIGHT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
@@ -3477,8 +3477,8 @@ release:
 /*-----------------------------------------------------------------*/
 /* genMultbits :- multiplication of bits                           */
 /*-----------------------------------------------------------------*/
-static void genMultbits (operand *left, 
-                         operand *right, 
+static void genMultbits (operand *left,
+                         operand *right,
                          operand *result)
 {
     emitcode("mov","c,%s",AOP(left)->aopu.aop_dir);
@@ -3511,7 +3511,7 @@ static void genMultOneByte (operand *left,
     /* signed or unsigned */
     emitcode("mov","b,%s", aopGet(AOP(right),0,FALSE,FALSE,FALSE));
     l = aopGet(AOP(left),0,FALSE,FALSE,TRUE);
-    MOVA(l);       
+    MOVA(l);
     emitcode("mul","ab");
     /* if result size = 1, mul signed = mul unsigned */
     aopPut(AOP(result),"a",0);
@@ -3541,8 +3541,8 @@ static void genMultOneByte (operand *left,
                 emitcode("cjne","a,#0x80,%05d$", (lbl->key+100));
                 emitcode("","%05d$:",(lbl->key+100));
                 emitcode("xch","a,%s",aopGet(AOP(right),0,FALSE,FALSE,FALSE));
-                lbl = newiTempLabel(NULL);      
-                emitcode("jc","%05d$",(lbl->key+100));          
+                lbl = newiTempLabel(NULL);
+                emitcode("jc","%05d$",(lbl->key+100));
                 emitcode("subb","a,%s", aopGet(AOP(left),0,FALSE,FALSE,FALSE));
                 emitcode("","%05d$:",(lbl->key+100));
             }
@@ -3552,8 +3552,8 @@ static void genMultOneByte (operand *left,
             emitcode("cjne","a,#0x80,%05d$", (lbl->key+100));
             emitcode("","%05d$:",(lbl->key+100));
             emitcode("xch","a,%s",aopGet(AOP(left),0,FALSE,FALSE,FALSE));
-            lbl = newiTempLabel(NULL);      
-            emitcode("jc","%05d$",(lbl->key+100));          
+            lbl = newiTempLabel(NULL);
+            emitcode("jc","%05d$",(lbl->key+100));
             emitcode("subb","a,%s", aopGet(AOP(right),0,FALSE,FALSE,FALSE));
             emitcode("","%05d$:",(lbl->key+100));
 
@@ -3564,7 +3564,7 @@ static void genMultOneByte (operand *left,
                 emitcode("subb","a,acc");
             }
         }
-        size -= 2;   
+        size -= 2;
         offset = 2;
         if (size > 0)
             while (size--)
@@ -3579,7 +3579,7 @@ static void genMult (iCode *ic)
 {
     operand *left = IC_LEFT(ic);
     operand *right = IC_RIGHT(ic);
-    operand *result= IC_RESULT(ic);   
+    operand *result= IC_RESULT(ic);
 
     D(emitcode(";", "genMult "););
 
@@ -3606,20 +3606,20 @@ static void genMult (iCode *ic)
         goto release ;
     }
 
-    /* should have been converted to function call */       
+    /* should have been converted to function call */
     assert(1) ;
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genDivbits :- division of bits                                  */
 /*-----------------------------------------------------------------*/
-static void genDivbits (operand *left, 
-                        operand *right, 
+static void genDivbits (operand *left,
+                        operand *right,
                         operand *result)
 {
 
@@ -3660,17 +3660,17 @@ static void genDivOneByte (operand *left,
     /* signed is a little bit more difficult */
 
     /* save the signs of the operands */
-    l = aopGet(AOP(left),0,FALSE,FALSE,TRUE);    
-    MOVA(l);    
+    l = aopGet(AOP(left),0,FALSE,FALSE,TRUE);
+    MOVA(l);
     emitcode("xrl","a,%s",aopGet(AOP(right),0,FALSE,TRUE,FALSE));
     emitcode("push","acc"); /* save it on the stack */
 
     /* now sign adjust for both left & right */
     l =  aopGet(AOP(right),0,FALSE,FALSE,TRUE);
-    MOVA(l);       
+    MOVA(l);
     lbl = newiTempLabel(NULL);
-    emitcode("jnb","acc.7,%05d$",(lbl->key+100));   
-    emitcode("cpl","a");   
+    emitcode("jnb","acc.7,%05d$",(lbl->key+100));
+    emitcode("cpl","a");
     emitcode("inc","a");
     emitcode("","%05d$:",(lbl->key+100));
     emitcode("mov","b,a");
@@ -3692,8 +3692,8 @@ static void genDivOneByte (operand *left,
     only */
     emitcode("mov","b,a");
     lbl = newiTempLabel(NULL);
-    emitcode("pop","acc");   
-    /* if there was an over flow we don't 
+    emitcode("pop","acc");
+    /* if there was an over flow we don't
     adjust the sign of the result */
     emitcode("jb","ov,%05d$",(lbl->key+100));
     emitcode("jnb","acc.7,%05d$",(lbl->key+100));
@@ -3707,7 +3707,7 @@ static void genDivOneByte (operand *left,
     aopPut(AOP(result),"b",0);
     if(size > 0){
         emitcode("mov","c,b.7");
-        emitcode("subb","a,acc");   
+        emitcode("subb","a,acc");
     }
     while (size--)
         aopPut(AOP(result),"a",offset++);
@@ -3721,7 +3721,7 @@ static void genDiv (iCode *ic)
 {
     operand *left = IC_LEFT(ic);
     operand *right = IC_RIGHT(ic);
-    operand *result= IC_RESULT(ic);   
+    operand *result= IC_RESULT(ic);
 
     D(emitcode(";", "genDiv "););
 
@@ -3753,20 +3753,20 @@ static void genDiv (iCode *ic)
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genModbits :- modulus of bits                                   */
 /*-----------------------------------------------------------------*/
-static void genModbits (operand *left, 
-                        operand *right, 
+static void genModbits (operand *left,
+                        operand *right,
                         operand *result)
 {
 
     char *l;
 
-    /* the result must be bit */    
+    /* the result must be bit */
     LOAD_AB_FOR_DIV(left, right, l);
     emitcode("div","ab");
     emitcode("mov","a,b");
@@ -3808,11 +3808,11 @@ static void genModOneByte (operand *left,
     MOVA(l);
 
     lbl = newiTempLabel(NULL);
-    emitcode("jnb","acc.7,%05d$",(lbl->key+100));  
-    emitcode("cpl","a");   
+    emitcode("jnb","acc.7,%05d$",(lbl->key+100));
+    emitcode("cpl","a");
     emitcode("inc","a");
     emitcode("","%05d$:",(lbl->key+100));
-    emitcode("mov","b,a"); 
+    emitcode("mov","b,a");
 
     /* sign adjust left side */
     l =  aopGet(AOP(left),0,FALSE,FALSE,TRUE);
@@ -3820,7 +3820,7 @@ static void genModOneByte (operand *left,
 
     lbl = newiTempLabel(NULL);
     emitcode("jnb","acc.7,%05d$",(lbl->key+100));
-    emitcode("cpl","a");   
+    emitcode("cpl","a");
     emitcode("inc","a");
     emitcode("","%05d$:",(lbl->key+100));
 
@@ -3830,8 +3830,8 @@ static void genModOneByte (operand *left,
     /* we are interested in the lower order
     only */
     lbl = newiTempLabel(NULL);
-    emitcode("pop","acc");   
-    /* if there was an over flow we don't 
+    emitcode("pop","acc");
+    /* if there was an over flow we don't
     adjust the sign of the result */
     emitcode("jb","ov,%05d$",(lbl->key+100));
     emitcode("jnb","acc.7,%05d$",(lbl->key+100));
@@ -3853,7 +3853,7 @@ static void genMod (iCode *ic)
 {
     operand *left = IC_LEFT(ic);
     operand *right = IC_RIGHT(ic);
-    operand *result= IC_RESULT(ic);  
+    operand *result= IC_RESULT(ic);
 
     D(emitcode(";", "genMod "););
 
@@ -3886,7 +3886,7 @@ static void genMod (iCode *ic)
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3911,14 +3911,14 @@ static void genIfxJump (iCode *ic, char *jval)
         /* false label is present */
         jlbl = IC_FALSE(ic) ;
         inst = ((strcmp(jval,"a") == 0 ? "jnz" :
-                 (strcmp(jval,"c") == 0 ? "jc" : "jb" )));              
+                 (strcmp(jval,"c") == 0 ? "jc" : "jb" )));
     }
-    if (strcmp(inst,"jb") == 0 || strcmp(inst,"jnb") == 0) 
+    if (strcmp(inst,"jb") == 0 || strcmp(inst,"jnb") == 0)
         emitcode(inst,"%s,%05d$",jval,(tlbl->key+100));
     else
         emitcode(inst,"%05d$",tlbl->key+100);
     emitcode("ljmp","%05d$",jlbl->key+100);
-    emitcode("","%05d$:",tlbl->key+100);                
+    emitcode("","%05d$:",tlbl->key+100);
 
     /* mark the icode as generated */
     ic->generated = 1;
@@ -3928,11 +3928,11 @@ static void genIfxJump (iCode *ic, char *jval)
 /* genCmp :- greater or less than comparison                       */
 /*-----------------------------------------------------------------*/
 static void genCmp (operand *left,operand *right,
-                   iCode *ic, iCode *ifx, int sign)
+        iCode *ic, iCode *ifx, int sign)
 {
-    int                size, offset = 0 ;
-    unsigned long      lit = 0L;
-    operand            *result;
+    int       size, offset = 0 ;
+    unsigned long   lit = 0L;
+    operand             *result;
 
     D(emitcode(";", "genCmp"););
 
@@ -3972,12 +3972,12 @@ static void genCmp (operand *left,operand *right,
                     else
                     {
                         MOVA(aopGet(AOP(left),AOP_SIZE(left)-1,FALSE,FALSE,TRUE));
-                        
-                       freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-                       freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-                        
+
+          freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+            freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
+
                         aopOp(result,ic,FALSE, FALSE);
-                        
+
                         if(!(AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) && ifx)
                         {
                             freeAsmop(result,NULL,ic,TRUE);
@@ -4058,16 +4058,16 @@ release:
 /* Don't need the left & right operands any more; do need the result. */
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-                        
+
     aopOp(result,ic,FALSE, FALSE);
 
 release_freedLR:
 
-    if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) 
+    if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result))
     {
         outBitC(result);
-    } 
-    else 
+    }
+    else
     {
         /* if the result is used in the next
         ifx conditional branch then generate
@@ -4144,28 +4144,28 @@ static void gencjneshort(operand *left, operand *right, symbol *lbl)
 
     D(emitcode(";", "gencjneshort"););
 
-    /* if the left side is a literal or 
-    if the right is in a pointer register and left 
+    /* if the left side is a literal or
+    if the right is in a pointer register and left
     is not */
-    if ((AOP_TYPE(left) == AOP_LIT) || 
+    if ((AOP_TYPE(left) == AOP_LIT) ||
         (IS_AOP_PREG(right) && !IS_AOP_PREG(left))) {
         operand *t = right;
         right = left;
         left = t;
     }
-    
+
     if(AOP_TYPE(right) == AOP_LIT)
         lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
-        
+
     if (opIsGptr(left) || opIsGptr(right))
     {
         /* We are comparing a generic pointer to something.
          * Exclude the generic type byte from the comparison.
          */
         size--;
-        D(emitcode(";", "cjneshort: generic ptr special case.");) 
+        D(emitcode(";", "cjneshort: generic ptr special case.");)
     }
-         
+
 
     /* if the right side is a literal then anything goes */
     if (AOP_TYPE(right) == AOP_LIT &&
@@ -4181,13 +4181,13 @@ static void gencjneshort(operand *left, operand *right, symbol *lbl)
     }
 
     /* if the right side is in a register or in direct space or
-    if the left is a pointer register & right is not */    
+    if the left is a pointer register & right is not */
     else if (AOP_TYPE(right) == AOP_REG ||
-             AOP_TYPE(right) == AOP_DIR || 
+             AOP_TYPE(right) == AOP_DIR ||
              (AOP_TYPE(left) == AOP_DIR && AOP_TYPE(right) == AOP_LIT) ||
-             (IS_AOP_PREG(left) && !IS_AOP_PREG(right))) 
+             (IS_AOP_PREG(left) && !IS_AOP_PREG(right)))
     {
-        while (size--) 
+        while (size--)
         {
             MOVA(aopGet(AOP(left),offset,FALSE,FALSE,TRUE));
             if((AOP_TYPE(left) == AOP_DIR && AOP_TYPE(right) == AOP_LIT) &&
@@ -4206,7 +4206,7 @@ static void gencjneshort(operand *left, operand *right, symbol *lbl)
             if(strcmp(l,"b"))
                 emitcode("mov","b,%s",l);
             MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
-            emitcode("cjne","a,b,%05d$",lbl->key+100);    
+            emitcode("cjne","a,b,%05d$",lbl->key+100);
             offset++;
         }
     }
@@ -4247,18 +4247,18 @@ static void genCmpEq (iCode *ic, iCode *ifx)
     aopOp((result=IC_RESULT(ic)),ic,TRUE, FALSE);
 #endif
 
-    /* if literal, literal on the right or 
-    if the right is in a pointer register and left 
+    /* if literal, literal on the right or
+    if the right is in a pointer register and left
     is not */
-    if ((AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) || 
+    if ((AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) ||
         (IS_AOP_PREG(right) && !IS_AOP_PREG(left))) {
         operand *t = IC_RIGHT(ic);
         IC_RIGHT(ic) = IC_LEFT(ic);
         IC_LEFT(ic) = t;
     }
 
-    if (ifx && /* !AOP_SIZE(result) */ 
-       OP_SYMBOL(result) && 
+    if (ifx && /* !AOP_SIZE(result) */
+       OP_SYMBOL(result) &&
        OP_SYMBOL(result)->regType == REG_CND)
     {
         symbol *tlbl;
@@ -4293,24 +4293,24 @@ static void genCmpEq (iCode *ic, iCode *ifx)
                 emitcode("jc","%05d$",tlbl->key+100);
                 emitcode("ljmp","%05d$",IC_FALSE(ifx)->key+100);
             }
-            emitcode("","%05d$:",tlbl->key+100);                
+            emitcode("","%05d$:",tlbl->key+100);
         } else {
             tlbl = newiTempLabel(NULL);
             gencjneshort(left, right, tlbl);
             if ( IC_TRUE(ifx) ) {
                 emitcode("ljmp","%05d$",IC_TRUE(ifx)->key+100);
-                emitcode("","%05d$:",tlbl->key+100);                
+                emitcode("","%05d$:",tlbl->key+100);
             } else {
                 symbol *lbl = newiTempLabel(NULL);
                 emitcode("sjmp","%05d$",lbl->key+100);
-                emitcode("","%05d$:",tlbl->key+100);                
+                emitcode("","%05d$:",tlbl->key+100);
                 emitcode("ljmp","%05d$",IC_FALSE(ifx)->key+100);
-                emitcode("","%05d$:",lbl->key+100);             
+                emitcode("","%05d$:",lbl->key+100);
             }
         }
         /* mark the icode as generated */
         ifx->generated = 1;
-        
+
         freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
         freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
         return ;
@@ -4337,12 +4337,12 @@ static void genCmpEq (iCode *ic, iCode *ifx)
             emitcode("cpl","c");
             emitcode("","%05d$:",(lbl->key+100));
         }
-        
+
         freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
         freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-               
-       aopOp(result,ic,TRUE, FALSE);
-               
+
+  aopOp(result,ic,TRUE, FALSE);
+
         /* c = 1 if egal */
         if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)){
             outBitC(result);
@@ -4357,12 +4357,12 @@ static void genCmpEq (iCode *ic, iCode *ifx)
         outBitC(result);
     } else {
         gencjne(left,right,newiTempLabel(NULL));
-        
+
         freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
         freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-               
-       aopOp(result,ic,TRUE, FALSE);
-       
+
+  aopOp(result,ic,TRUE, FALSE);
+
         if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) {
             aopPut(AOP(result),"a",0);
             goto release ;
@@ -4373,7 +4373,7 @@ static void genCmpEq (iCode *ic, iCode *ifx)
         }
         /* if the result is used in an arithmetic operation
         then put the result in place */
-        if (AOP_TYPE(result) != AOP_CRY) 
+        if (AOP_TYPE(result) != AOP_CRY)
             outAcc(result);
         /* leave the result in acc */
     }
@@ -4431,7 +4431,7 @@ static void genAndOp (iCode *ic)
         outBitC(result);
     } else {
         tlbl = newiTempLabel(NULL);
-        toBoolean(left);    
+        toBoolean(left);
         emitcode("jz","%05d$",tlbl->key+100);
         toBoolean(right);
         emitcode("","%05d$:",tlbl->key+100);
@@ -4482,7 +4482,7 @@ static void genOrOp (iCode *ic)
 
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);            
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -4498,7 +4498,7 @@ static int isLiteralBit(unsigned long lit)
     0x1000000L,0x2000000L,0x4000000L,0x8000000L,
     0x10000000L,0x20000000L,0x40000000L,0x80000000L};
     int idx;
-    
+
     for(idx = 0; idx < 32; idx++)
         if(lit == pw[idx])
             return idx+1;
@@ -4533,7 +4533,7 @@ static void jmpTrueOrFalse (iCode *ic, symbol *tlbl)
     // ugly but optimized by peephole
     if(IC_TRUE(ic)){
         symbol *nlbl = newiTempLabel(NULL);
-        emitcode("sjmp","%05d$",nlbl->key+100);                 
+        emitcode("sjmp","%05d$",nlbl->key+100);
         emitcode("","%05d$:",tlbl->key+100);
         emitcode("ljmp","%05d$",IC_TRUE(ic)->key+100);
         emitcode("","%05d$:",nlbl->key+100);
@@ -4551,7 +4551,7 @@ static void jmpTrueOrFalse (iCode *ic, symbol *tlbl)
 static void genAnd (iCode *ic, iCode *ifx)
 {
     operand *left, *right, *result;
-    int size, offset=0;  
+    int size, offset=0;
     unsigned long lit = 0L;
     int bytelit = 0;
     char buffer[10];
@@ -4577,7 +4577,7 @@ static void genAnd (iCode *ic, iCode *ifx)
 
     /* if left is a literal & right is not then exchange them */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       AOP_NEEDSACC(left)) {
+  AOP_NEEDSACC(left)) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -4643,7 +4643,7 @@ static void genAnd (iCode *ic, iCode *ifx)
             outBitC(result);
         // if(bit & ...)
         else if((AOP_TYPE(result) == AOP_CRY) && ifx)
-            genIfxJump(ifx, "c");           
+            genIfxJump(ifx, "c");
         goto release ;
     }
 
@@ -4710,31 +4710,31 @@ static void genAnd (iCode *ic, iCode *ifx)
             if(AOP_TYPE(right) == AOP_LIT){
                 if((bytelit = (int)((lit >> (offset*8)) & 0x0FFL)) == 0x0FF)
                     continue;
-                else 
-                   if (bytelit == 0)
-                       aopPut(AOP(result),zero,offset);
-                   else 
-                       if (IS_AOP_PREG(result)) {
-                           MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
-                           emitcode("anl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
-                           aopPut(AOP(result),"a",offset);
-                       } else
-                           emitcode("anl","%s,%s",
-                                    aopGet(AOP(left),offset,FALSE,TRUE,FALSE),
-                                    aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
+                else
+        if (bytelit == 0)
+      aopPut(AOP(result),zero,offset);
+        else
+      if (IS_AOP_PREG(result)) {
+          MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
+          emitcode("anl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
+          aopPut(AOP(result),"a",offset);
+      } else
+          emitcode("anl","%s,%s",
+             aopGet(AOP(left),offset,FALSE,TRUE,FALSE),
+             aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
             } else {
-               if (AOP_TYPE(left) == AOP_ACC)
-                   emitcode("anl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
-               else {
-                   MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
-                   if (IS_AOP_PREG(result)) {
-                       emitcode("anl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
-                       aopPut(AOP(result),"a",offset);
-
-                   } else
-                       emitcode("anl","%s,a",
-                                aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
-               }
+    if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("anl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
+    else {
+        MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
+        if (IS_AOP_PREG(result)) {
+      emitcode("anl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
+      aopPut(AOP(result),"a",offset);
+
+        } else
+      emitcode("anl","%s,a",
+         aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
+    }
             }
         }
     } else {
@@ -4760,57 +4760,57 @@ static void genAnd (iCode *ic, iCode *ifx)
                 outBitC(result);
             } else if(ifx)
                 jmpTrueOrFalse(ifx, tlbl);
-        } else 
+        } else
         {
-           for(;(size--);offset++) 
-           {
-               // normal case
-               // result = left & right
-               if(AOP_TYPE(right) == AOP_LIT)
-               {
-                   if((bytelit = (int)((lit >> (offset*8)) & 0x0FFL)) == 0x0FF)
-                   {
-                       aopPut(AOP(result),
-                              aopGet(AOP(left),offset,FALSE,FALSE,FALSE),
-                              offset);
-                       continue;
-                   } 
-                   else if (bytelit == 0)
-                   {
-                       aopPut(AOP(result),zero,offset);
-                       continue;
-                   }
+      for(;(size--);offset++)
+      {
+    // normal case
+    // result = left & right
+    if(AOP_TYPE(right) == AOP_LIT)
+    {
+        if((bytelit = (int)((lit >> (offset*8)) & 0x0FFL)) == 0x0FF)
+        {
+      aopPut(AOP(result),
+             aopGet(AOP(left),offset,FALSE,FALSE,FALSE),
+             offset);
+      continue;
+        }
+        else if (bytelit == 0)
+        {
+      aopPut(AOP(result),zero,offset);
+      continue;
+        }
                     D(emitcode(";", "better literal AND."););
                     MOVA(aopGet(AOP(left),offset,FALSE,FALSE,TRUE));
                     emitcode("anl", "a, %s", aopGet(AOP(right),offset,
-                                               FALSE,FALSE,FALSE));
-                   
-               }
-               else
-               {
-                   // faster than result <- left, anl result,right
-                   // and better if result is SFR
-                   if (AOP_TYPE(left) == AOP_ACC) 
-                   {
-                       emitcode("anl","a,%s",aopGet(AOP(right),offset,
-                                                    FALSE,FALSE,FALSE));
-                   }
-                   else 
-                   {
-                       MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
-                       emitcode("anl","a,%s",
-                                aopGet(AOP(left),offset,FALSE,FALSE,FALSE));
-                   }
-               }
-               aopPut(AOP(result),"a",offset);
-           }
-       }
+                                  FALSE,FALSE,FALSE));
+
+    }
+    else
+    {
+        // faster than result <- left, anl result,right
+        // and better if result is SFR
+        if (AOP_TYPE(left) == AOP_ACC)
+        {
+          emitcode("anl","a,%s",aopGet(AOP(right),offset,
+                                 FALSE,FALSE,FALSE));
+        }
+        else
+        {
+          MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
+          emitcode("anl","a,%s",
+               aopGet(AOP(left),offset,FALSE,FALSE,FALSE));
+        }
+    }
+    aopPut(AOP(result),"a",offset);
+      }
+  }
     }
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);     
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -4843,7 +4843,7 @@ static void genOr (iCode *ic, iCode *ifx)
 
     /* if left is a literal & right is not then exchange them */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       AOP_NEEDSACC(left)) {
+  AOP_NEEDSACC(left)) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -4919,7 +4919,7 @@ static void genOr (iCode *ic, iCode *ifx)
             outBitC(result);
         // if(bit | ...)
         else if((AOP_TYPE(result) == AOP_CRY) && ifx)
-            genIfxJump(ifx, "c");           
+            genIfxJump(ifx, "c");
         goto release ;
     }
 
@@ -4932,7 +4932,7 @@ static void genOr (iCode *ic, iCode *ifx)
             // result = 1
             if(size)
                 emitcode("setb","%s",AOP(result)->aopu.aop_dir);
-            else 
+            else
                 continueIfTrue(ifx);
             goto release;
         } else {
@@ -4957,49 +4957,49 @@ static void genOr (iCode *ic, iCode *ifx)
     /* if left is same as result */
     if(sameRegs(AOP(result),AOP(left)))
     {
-        for(;size--; offset++) 
+        for(;size--; offset++)
         {
             if(AOP_TYPE(right) == AOP_LIT){
                 if(((lit >> (offset*8)) & 0x0FFL) == 0x00L)
                 {
                     continue;
                 }
-                else 
+                else
                 {
-                   if (IS_AOP_PREG(left)) 
-                   {
-                       MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
-                       emitcode("orl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
-                       aopPut(AOP(result),"a",offset);
-                   } 
-                   else
-                   {
-                       emitcode("orl","%s,%s",
-                                aopGet(AOP(left),offset,FALSE,TRUE,FALSE),
-                                aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
-                   }
-               }
-            } 
-            else 
+        if (IS_AOP_PREG(left))
+        {
+      MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
+      emitcode("orl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
+      aopPut(AOP(result),"a",offset);
+        }
+        else
+        {
+      emitcode("orl","%s,%s",
+         aopGet(AOP(left),offset,FALSE,TRUE,FALSE),
+         aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
+        }
+    }
+            }
+            else
             {
-               if (AOP_TYPE(left) == AOP_ACC)
-               { 
-                   emitcode("orl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
-               }
-               else 
-               {                   
-                   MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
-                   if (IS_AOP_PREG(left)) 
-                   {
-                       emitcode("orl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
-                       aopPut(AOP(result),"a",offset);
-                   } 
-                   else
-                   {
-                       emitcode("orl","%s,a",
-                                aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
-                   }
-               }
+    if (AOP_TYPE(left) == AOP_ACC)
+    {
+        emitcode("orl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
+    }
+    else
+    {
+        MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
+        if (IS_AOP_PREG(left))
+        {
+      emitcode("orl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
+      aopPut(AOP(result),"a",offset);
+        }
+        else
+        {
+      emitcode("orl","%s,a",
+         aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
+        }
+    }
             }
         }
     }
@@ -5028,8 +5028,8 @@ static void genOr (iCode *ic, iCode *ifx)
                 outBitC(result);
             } else if(ifx)
                 jmpTrueOrFalse(ifx, tlbl);
-        } 
-        else 
+        }
+        else
         {
             for(;(size--);offset++)
             {
@@ -5039,7 +5039,7 @@ static void genOr (iCode *ic, iCode *ifx)
                 {
                     if(((lit >> (offset*8)) & 0x0FFL) == 0x00L)
                     {
-                       aopPut(AOP(result),
+                      aopPut(AOP(result),
                                aopGet(AOP(left),offset,FALSE,FALSE,FALSE),
                                offset);
                         continue;
@@ -5047,26 +5047,26 @@ static void genOr (iCode *ic, iCode *ifx)
                     D(emitcode(";", "better literal OR."););
                     MOVA(aopGet(AOP(left),offset,FALSE,FALSE,TRUE));
                     emitcode("orl", "a, %s", aopGet(AOP(right),offset,
-                                               FALSE,FALSE,FALSE));
-                     
+                                  FALSE,FALSE,FALSE));
+
                 }
                 else
                 {
                     // faster than result <- left, anl result,right
                     // and better if result is SFR
-                   if (AOP_TYPE(left) == AOP_ACC) 
-                   {
-                       emitcode("orl","a,%s",aopGet(AOP(right),offset,
-                                                    FALSE,FALSE,FALSE));
-                   }
-                   else 
-                   {
-                       MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
-                       emitcode("orl","a,%s",
-                                aopGet(AOP(left),offset,FALSE,FALSE,FALSE));
-                   }
-               }
-               aopPut(AOP(result),"a",offset);                 
+              if (AOP_TYPE(left) == AOP_ACC)
+              {
+          emitcode("orl","a,%s",aopGet(AOP(right),offset,
+                     FALSE,FALSE,FALSE));
+        }
+              else
+              {
+          MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
+          emitcode("orl","a,%s",
+               aopGet(AOP(left),offset,FALSE,FALSE,FALSE));
+              }
+          }
+          aopPut(AOP(result),"a",offset);
             }
         }
     }
@@ -5074,7 +5074,7 @@ static void genOr (iCode *ic, iCode *ifx)
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);     
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -5108,7 +5108,7 @@ static void genXor (iCode *ic, iCode *ifx)
     /* if left is a literal & right is not ||
        if left needs acc & right does not */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       (AOP_NEEDSACC(left) && !AOP_NEEDSACC(right))) {
+  (AOP_NEEDSACC(left) && !AOP_NEEDSACC(right))) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -5185,7 +5185,7 @@ static void genXor (iCode *ic, iCode *ifx)
                         // test the msb of the lsb
                         emitcode("anl","a,#0xfe");
                     emitcode("jnz","%05d$",tlbl->key+100);
-                   sizer--;
+        sizer--;
                 }
                 // val = (0,1)
                 emitcode("rrc","a");
@@ -5200,7 +5200,7 @@ static void genXor (iCode *ic, iCode *ifx)
             outBitC(result);
         // if(bit | ...)
         else if((AOP_TYPE(result) == AOP_CRY) && ifx)
-            genIfxJump(ifx, "c");           
+            genIfxJump(ifx, "c");
         goto release ;
     }
 
@@ -5211,26 +5211,26 @@ static void genXor (iCode *ic, iCode *ifx)
                 if(((lit >> (offset*8)) & 0x0FFL) == 0x00L)
                     continue;
                 else
-                   if (IS_AOP_PREG(left)) {
-                       MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
-                       emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
-                       aopPut(AOP(result),"a",offset);
-                   } else 
-                       emitcode("xrl","%s,%s",
-                                aopGet(AOP(left),offset,FALSE,TRUE,FALSE),
-                                aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
+        if (IS_AOP_PREG(left)) {
+      MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
+      emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
+            aopPut(AOP(result),"a",offset);
+        } else
+      emitcode("xrl","%s,%s",
+         aopGet(AOP(left),offset,FALSE,TRUE,FALSE),
+         aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
             } else {
-               if (AOP_TYPE(left) == AOP_ACC)
-                   emitcode("xrl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
-               else {
-                   MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
-                   if (IS_AOP_PREG(left)) {
-                       emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
-                       aopPut(AOP(result),"a",offset);
-                   } else
-                       emitcode("xrl","%s,a",
-                                aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
-               }
+    if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("xrl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE,FALSE));
+    else {
+        MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
+        if (IS_AOP_PREG(left)) {
+      emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
+      aopPut(AOP(result),"a",offset);
+        } else
+      emitcode("xrl","%s,a",
+         aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
+    }
             }
         }
     } else {
@@ -5277,32 +5277,32 @@ static void genXor (iCode *ic, iCode *ifx)
                 D(emitcode(";", "better literal XOR."););
                 MOVA(aopGet(AOP(left),offset,FALSE,FALSE,TRUE));
                 emitcode("xrl", "a, %s", aopGet(AOP(right),offset,
-                                               FALSE,FALSE,FALSE));                
+                                  FALSE,FALSE,FALSE));
             }
             else
             {
                 // faster than result <- left, anl result,right
                 // and better if result is SFR
-               if (AOP_TYPE(left) == AOP_ACC)
-               {
-                   emitcode("xrl","a,%s",aopGet(AOP(right),offset,
-                            FALSE,FALSE,FALSE));
-               }
-               else 
-               {
-                   MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
-                   emitcode("xrl","a,%s",
-                            aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
-               }
-           }
-           aopPut(AOP(result),"a",offset);
+          if (AOP_TYPE(left) == AOP_ACC)
+          {
+        emitcode("xrl","a,%s",aopGet(AOP(right),offset,
+               FALSE,FALSE,FALSE));
+    }
+        else
+        {
+        MOVA(aopGet(AOP(right),offset,FALSE,FALSE,TRUE));
+        emitcode("xrl","a,%s",
+           aopGet(AOP(left),offset,FALSE,TRUE,FALSE));
+          }
+      }
+      aopPut(AOP(result),"a",offset);
         }
     }
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);     
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -5313,7 +5313,7 @@ static void genInline (iCode *ic)
     char buffer[MAX_INLINEASM];
     char *bp = buffer;
     char *bp1= buffer;
-    
+
     D(emitcode(";", "genInline "););
 
     _G.inLine += (!options.asmpeep);
@@ -5349,7 +5349,7 @@ static void genRRC (iCode *ic)
 {
     operand *left , *result ;
     int size, offset = 0;
-    char *l;    
+    char *l;
 
     D(emitcode(";", "genRRC "););
 
@@ -5360,10 +5360,10 @@ static void genRRC (iCode *ic)
     aopOp (result,ic,FALSE, AOP_TYPE(left) == AOP_DPTR);
 
     /* move it to the result */
-    size = AOP_SIZE(result);    
+    size = AOP_SIZE(result);
     offset = size - 1 ;
     CLRC;
-    
+
     _startLazyDPSEvaluation();
     while (size--) {
         l = aopGet(AOP(left),offset,FALSE,FALSE,TRUE);
@@ -5373,7 +5373,7 @@ static void genRRC (iCode *ic)
             aopPut(AOP(result),"a",offset--);
     }
     _endLazyDPSEvaluation();
-    
+
     /* now we need to put the carry into the
     highest order byte of the result */
     if (AOP_SIZE(result) > 1) {
@@ -5390,10 +5390,10 @@ static void genRRC (iCode *ic)
 /* genRLC - generate code for rotate left with carry               */
 /*-----------------------------------------------------------------*/
 static void genRLC (iCode *ic)
-{    
+{
     operand *left , *result ;
     int size, offset = 0;
-    char *l;    
+    char *l;
 
     D(emitcode(";", "genRLC "););
 
@@ -5404,7 +5404,7 @@ static void genRLC (iCode *ic)
     aopOp (result,ic,FALSE, AOP_TYPE(left) == AOP_DPTR);
 
     /* move it to the result */
-    size = AOP_SIZE(result);    
+    size = AOP_SIZE(result);
     offset = 0 ;
     if (size--) {
         l = aopGet(AOP(left),offset,FALSE,FALSE,TRUE);
@@ -5414,7 +5414,7 @@ static void genRLC (iCode *ic)
         {
             aopPut(AOP(result),"a",offset++);
         }
-            
+
         _startLazyDPSEvaluation();
         while (size--) {
             l = aopGet(AOP(left),offset,FALSE,FALSE,TRUE);
@@ -5512,8 +5512,8 @@ static void AccLsh (int shCount)
     if(shCount != 0){
         if(shCount == 1)
             emitcode("add","a,acc");
-        else 
-           if(shCount == 2) {
+        else
+      if(shCount == 2) {
             emitcode("add","a,acc");
             emitcode("add","a,acc");
         } else {
@@ -5714,7 +5714,7 @@ static void AccAXLsh (char *x, int shCount)
             emitcode("anl","a,#0x%02x",
                      SLMask[shCount]);  // DDD00000:(BBB^DDD)CCCCC
             emitcode("xch","a,%s",x);   // (BBB^DDD)CCCCC:DDD00000
-            emitcode("xrl","a,%s",x);   // BBBCCCCC:DDD00000            
+            emitcode("xrl","a,%s",x);   // BBBCCCCC:DDD00000
             break;
         case 6 :                        // AAAAAABB:CCCCCCDD
             emitcode("anl","a,#0x%02x",
@@ -5743,7 +5743,7 @@ static void AccAXLsh (char *x, int shCount)
 /* AccAXRsh - right shift a:x known count (0..7)                   */
 /*-----------------------------------------------------------------*/
 static void AccAXRsh (char *x, int shCount)
-{   
+{
     switch(shCount){
         case 0 :
             break;
@@ -5800,7 +5800,7 @@ static void AccAXRsh (char *x, int shCount)
 /* AccAXRshS - right shift signed a:x known count (0..7)           */
 /*-----------------------------------------------------------------*/
 static void AccAXRshS (char *x, int shCount)
-{   
+{
     symbol *tlbl ;
     switch(shCount){
         case 0 :
@@ -5831,7 +5831,7 @@ static void AccAXRshS (char *x, int shCount)
             emitcode("xch","a,%s",x);   // BBB(CCCCC^AAAAA):000AAAAA
             emitcode("xrl","a,%s",x);   // BBBCCCCC:000AAAAA
             emitcode("xch","a,%s",x);   // 000SAAAA:BBBCCCCC
-            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100); 
+            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100);
             emitcode("orl","a,#0x%02x",
                      (unsigned char)~SRMask[shCount]);  // 111AAAAA:BBBCCCCC
             emitcode("","%05d$:",tlbl->key+100);
@@ -5844,7 +5844,7 @@ static void AccAXRshS (char *x, int shCount)
             emitcode("xch","a,%s",x);   // DDDDDDAA:BBBBBBCC
             emitcode("anl","a,#0x%02x",
                      SRMask[shCount]);  // 000000AA:BBBBBBCC
-            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100); 
+            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100);
             emitcode("orl","a,#0x%02x",
                      (unsigned char)~SRMask[shCount]);  // 111111AA:BBBBBBCC
             emitcode("","%05d$:",tlbl->key+100);
@@ -5856,7 +5856,7 @@ static void AccAXRshS (char *x, int shCount)
             emitcode("xch","a,%s",x);   // DDDDDDDA:BBBBBBCC
             emitcode("anl","a,#0x%02x",
                      SRMask[shCount]);  // 0000000A:BBBBBBBC
-            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100); 
+            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100);
             emitcode("orl","a,#0x%02x",
                      (unsigned char)~SRMask[shCount]);  // 1111111A:BBBBBBBC
             emitcode("","%05d$:",tlbl->key+100);
@@ -5877,12 +5877,12 @@ static void shiftL2Left2Result (operand *left, int offl,
 {
     if(sameRegs(AOP(result), AOP(left)) &&
        ((offl + MSB16) == offr)){
-       /* don't crash result[offr] */
-       MOVA(aopGet(AOP(left),offl,FALSE,FALSE,TRUE));
-       emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE,FALSE));
+  /* don't crash result[offr] */
+  MOVA(aopGet(AOP(left),offl,FALSE,FALSE,TRUE));
+  emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE,FALSE));
     } else {
-       movLeft2Result(left,offl, result, offr, 0);
-       MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE,TRUE));
+  movLeft2Result(left,offl, result, offr, 0);
+  MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE,TRUE));
     }
     /* ax << shCount (x = lsb(result))*/
     AccAXLsh( aopGet(AOP(result),offr,FALSE,FALSE,FALSE), shCount);
@@ -5901,12 +5901,12 @@ static void shiftR2Left2Result (operand *left, int offl,
 {
     if(sameRegs(AOP(result), AOP(left)) &&
        ((offl + MSB16) == offr)){
-       /* don't crash result[offr] */
-       MOVA(aopGet(AOP(left),offl,FALSE,FALSE,TRUE));
-       emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE,FALSE));
+  /* don't crash result[offr] */
+  MOVA(aopGet(AOP(left),offl,FALSE,FALSE,TRUE));
+  emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE,FALSE));
     } else {
-       movLeft2Result(left,offl, result, offr, 0);
-       MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE,TRUE));
+  movLeft2Result(left,offl, result, offr, 0);
+  MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE,TRUE));
     }
     /* a:x >> shCount (x = lsb(result))*/
     if(sign)
@@ -5960,7 +5960,7 @@ static void shiftRLeftOrResult (operand *left, int offl,
 /* genlshOne - left shift a one byte quantity by known count       */
 /*-----------------------------------------------------------------*/
 static void genlshOne (operand *result, operand *left, int shCount)
-{       
+{
     D(emitcode(";", "genlshOne "););
     shiftL1Left2Result(left, LSB, result, LSB, shCount);
 }
@@ -5974,7 +5974,7 @@ static void genlshOne (operand *result, operand *left, int shCount)
 static void genlshTwo (operand *result,operand *left, int shCount)
 {
     int size;
-    
+
     D(emitcode(";", "genlshTwo "););
 
     size = getDataSize(result);
@@ -5986,17 +5986,17 @@ static void genlshTwo (operand *result,operand *left, int shCount)
         if (size > 1){
             if (shCount)
                 shiftL1Left2Result(left, LSB, result, MSB16, shCount);
-            else 
+            else
                 movLeft2Result(left, LSB, result, MSB16, 0);
         }
-        aopPut(AOP(result),zero,LSB);   
+        aopPut(AOP(result),zero,LSB);
     }
 
     /*  1 <= shCount <= 7 */
-    else {  
+    else {
         if(size == 1)
-            shiftL1Left2Result(left, LSB, result, LSB, shCount); 
-        else 
+            shiftL1Left2Result(left, LSB, result, LSB, shCount);
+        else
             shiftL2Left2Result(left, LSB, result, LSB, shCount);
     }
 }
@@ -6017,52 +6017,52 @@ static void shiftLLong (operand *left, operand *result, int offr )
         l = aopGet(AOP(left),LSB,FALSE,FALSE,TRUE);
         MOVA(l);
         emitcode("add","a,acc");
-       if (sameRegs(AOP(left),AOP(result)) && 
-           size >= MSB16+offr && offr != LSB )
-           emitcode("xch","a,%s",
-                    aopGet(AOP(left),LSB+offr,FALSE,FALSE,FALSE));
-       else        
-           aopPut(AOP(result),"a",LSB+offr);
+  if (sameRegs(AOP(left),AOP(result)) &&
+      size >= MSB16+offr && offr != LSB )
+      emitcode("xch","a,%s",
+         aopGet(AOP(left),LSB+offr,FALSE,FALSE,FALSE));
+  else
+      aopPut(AOP(result),"a",LSB+offr);
     }
 
     if(size >= MSB16+offr){
-       if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB16+offr && offr != LSB) ) {
-           l = aopGet(AOP(left),MSB16,FALSE,FALSE,TRUE);
-           MOVA(l);
-       }
+  if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB16+offr && offr != LSB) ) {
+      l = aopGet(AOP(left),MSB16,FALSE,FALSE,TRUE);
+      MOVA(l);
+  }
         emitcode("rlc","a");
-       if (sameRegs(AOP(left),AOP(result)) && 
-           size >= MSB24+offr && offr != LSB)
-           emitcode("xch","a,%s",
-                    aopGet(AOP(left),MSB16+offr,FALSE,FALSE,FALSE));
-       else        
-           aopPut(AOP(result),"a",MSB16+offr);
+  if (sameRegs(AOP(left),AOP(result)) &&
+      size >= MSB24+offr && offr != LSB)
+      emitcode("xch","a,%s",
+         aopGet(AOP(left),MSB16+offr,FALSE,FALSE,FALSE));
+  else
+      aopPut(AOP(result),"a",MSB16+offr);
     }
 
     if(size >= MSB24+offr){
-       if (!(sameRegs(AOP(left),AOP(left)) && size >= MSB24+offr && offr != LSB)) {
-           l = aopGet(AOP(left),MSB24,FALSE,FALSE,TRUE);
-           MOVA(l);
-       }
+  if (!(sameRegs(AOP(left),AOP(left)) && size >= MSB24+offr && offr != LSB)) {
+      l = aopGet(AOP(left),MSB24,FALSE,FALSE,TRUE);
+      MOVA(l);
+  }
         emitcode("rlc","a");
-       if (sameRegs(AOP(left),AOP(result)) && 
-           size >= MSB32+offr && offr != LSB )
-           emitcode("xch","a,%s",
-                    aopGet(AOP(left),MSB24+offr,FALSE,FALSE,FALSE));
-       else        
-           aopPut(AOP(result),"a",MSB24+offr);
+  if (sameRegs(AOP(left),AOP(result)) &&
+      size >= MSB32+offr && offr != LSB )
+      emitcode("xch","a,%s",
+         aopGet(AOP(left),MSB24+offr,FALSE,FALSE,FALSE));
+  else
+      aopPut(AOP(result),"a",MSB24+offr);
     }
 
     if(size > MSB32+offr){
-       if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB32+offr && offr != LSB)) {
-           l = aopGet(AOP(left),MSB32,FALSE,FALSE,TRUE);
-           MOVA(l);    
-       }
+  if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB32+offr && offr != LSB)) {
+      l = aopGet(AOP(left),MSB32,FALSE,FALSE,TRUE);
+      MOVA(l);
+  }
         emitcode("rlc","a");
         aopPut(AOP(result),"a",MSB32+offr);
     }
     if(offr != LSB)
-        aopPut(AOP(result),zero,LSB);       
+        aopPut(AOP(result),zero,LSB);
 }
 #endif
 
@@ -6108,7 +6108,7 @@ static void genlshFour (operand *result, operand *left, int shCount)
         aopPut(AOP(result),zero,MSB16);
         aopPut(AOP(result),zero,LSB);
         return;
-    }    
+    }
 
     /* if more than 1 byte */
     else if ( shCount >= 8 ) {
@@ -6162,7 +6162,7 @@ static void genLeftShiftLiteral (operand *left,
                                  operand *right,
                                  operand *result,
                                  iCode *ic)
-{    
+{
     int shCount = (int) floatFromVal (AOP(right)->aopu.aop_lit);
     int size;
 
@@ -6230,7 +6230,7 @@ static void genLeftShift (iCode *ic)
     aopOp(right,ic,FALSE, FALSE);
 
 #if 0
-    /* if the shift count is known then do it 
+    /* if the shift count is known then do it
     as efficiently as possible */
     if (AOP_TYPE(right) == AOP_LIT) {
         genLeftShiftLiteral (left,right,result,ic);
@@ -6238,11 +6238,11 @@ static void genLeftShift (iCode *ic)
     }
 #endif
 
-    /* shift count is unknown then we have to form 
+    /* shift count is unknown then we have to form
     a loop get the loop count in B : Note: we take
     only the lower order byte since shifting
     more that 32 bits make no sense anyway, ( the
-    largest size of an object can be only 32 bits ) */  
+    largest size of an object can be only 32 bits ) */
 
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE,FALSE));
     emitcode("inc","b");
@@ -6252,7 +6252,7 @@ static void genLeftShift (iCode *ic)
 
     /* now move the left to the result if they are not the
     same */
-    if (!sameRegs(AOP(left),AOP(result)) && 
+    if (!sameRegs(AOP(left),AOP(result)) &&
         AOP_SIZE(result) > 1) {
 
         size = AOP_SIZE(result);
@@ -6273,37 +6273,37 @@ static void genLeftShift (iCode *ic)
 
     tlbl = newiTempLabel(NULL);
     size = AOP_SIZE(result);
-    offset = 0 ;   
+    offset = 0 ;
     tlbl1 = newiTempLabel(NULL);
 
     /* if it is only one byte then */
     if (size == 1) {
-       symbol *tlbl1 = newiTempLabel(NULL);
+  symbol *tlbl1 = newiTempLabel(NULL);
 
         l = aopGet(AOP(left),0,FALSE,FALSE,TRUE);
         MOVA(l);
-       emitcode("sjmp","%05d$",tlbl1->key+100); 
+  emitcode("sjmp","%05d$",tlbl1->key+100);
         emitcode("","%05d$:",tlbl->key+100);
         emitcode("add","a,acc");
-       emitcode("","%05d$:",tlbl1->key+100);
-        emitcode("djnz","b,%05d$",tlbl->key+100);      
+  emitcode("","%05d$:",tlbl1->key+100);
+        emitcode("djnz","b,%05d$",tlbl->key+100);
         aopPut(AOP(result),"a",0);
         goto release ;
     }
-    
-    reAdjustPreg(AOP(result));    
-    
-    emitcode("sjmp","%05d$",tlbl1->key+100); 
-    emitcode("","%05d$:",tlbl->key+100);    
+
+    reAdjustPreg(AOP(result));
+
+    emitcode("sjmp","%05d$",tlbl1->key+100);
+    emitcode("","%05d$:",tlbl->key+100);
     l = aopGet(AOP(result),offset,FALSE,FALSE,TRUE);
     MOVA(l);
-    emitcode("add","a,acc");         
+    emitcode("add","a,acc");
     aopPut(AOP(result),"a",offset++);
     _startLazyDPSEvaluation();
     while (--size) {
         l = aopGet(AOP(result),offset,FALSE,FALSE,TRUE);
         MOVA(l);
-        emitcode("rlc","a");         
+        emitcode("rlc","a");
         aopPut(AOP(result),"a",offset++);
     }
     _endLazyDPSEvaluation();
@@ -6345,14 +6345,14 @@ static void genrshTwo (operand *result,operand *left,
         if (shCount)
             shiftR1Left2Result(left, MSB16, result, LSB,
                                shCount, sign);
-        else 
+        else
             movLeft2Result(left, MSB16, result, LSB, sign);
         addSign(result, MSB16, sign);
     }
 
     /*  1 <= shCount <= 7 */
     else
-        shiftR2Left2Result(left, LSB, result, LSB, shCount, sign); 
+        shiftR2Left2Result(left, LSB, result, LSB, shCount, sign);
 }
 #endif
 
@@ -6401,7 +6401,7 @@ static void genrshFour (operand *result, operand *left,
                         int shCount, int sign)
 {
     D(emitcode(";", "genrshFour"););
-    
+
     /* if shifting more that 3 bytes */
     if(shCount >= 24 ) {
         shCount -= 24;
@@ -6464,7 +6464,7 @@ static void genRightShiftLiteral (operand *left,
                                   operand *result,
                                   iCode *ic,
                                   int sign)
-{    
+{
     int shCount = (int) floatFromVal (AOP(right)->aopu.aop_lit);
     int size;
 
@@ -6541,15 +6541,15 @@ static void genSignedRightShift (iCode *ic)
 
 #if 0
     if ( AOP_TYPE(right) == AOP_LIT) {
-       genRightShiftLiteral (left,right,result,ic,1);
-       return ;
+  genRightShiftLiteral (left,right,result,ic,1);
+  return ;
     }
 #endif
-    /* shift count is unknown then we have to form 
+    /* shift count is unknown then we have to form
        a loop get the loop count in B : Note: we take
        only the lower order byte since shifting
        more that 32 bits make no sense anyway, ( the
-       largest size of an object can be only 32 bits ) */  
+       largest size of an object can be only 32 bits ) */
 
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE,FALSE));
     emitcode("inc","b");
@@ -6559,7 +6559,7 @@ static void genSignedRightShift (iCode *ic)
 
     /* now move the left to the result if they are not the
     same */
-    if (!sameRegs(AOP(left),AOP(result)) && 
+    if (!sameRegs(AOP(left),AOP(result)) &&
         AOP_SIZE(result) > 1) {
 
         size = AOP_SIZE(result);
@@ -6578,7 +6578,7 @@ static void genSignedRightShift (iCode *ic)
         _endLazyDPSEvaluation();
     }
 
-    /* mov the highest order bit to OVR */    
+    /* mov the highest order bit to OVR */
     tlbl = newiTempLabel(NULL);
     tlbl1= newiTempLabel(NULL);
 
@@ -6591,11 +6591,11 @@ static void genSignedRightShift (iCode *ic)
     if (size == 1) {
         l = aopGet(AOP(left),0,FALSE,FALSE,TRUE);
         MOVA(l);
-       emitcode("sjmp","%05d$",tlbl1->key+100);
+  emitcode("sjmp","%05d$",tlbl1->key+100);
         emitcode("","%05d$:",tlbl->key+100);
         emitcode("mov","c,ov");
         emitcode("rrc","a");
-       emitcode("","%05d$:",tlbl1->key+100);
+  emitcode("","%05d$:",tlbl1->key+100);
         emitcode("djnz","b,%05d$",tlbl->key+100);
         aopPut(AOP(result),"a",0);
         goto release ;
@@ -6603,13 +6603,13 @@ static void genSignedRightShift (iCode *ic)
 
     reAdjustPreg(AOP(result));
     emitcode("sjmp","%05d$",tlbl1->key+100);
-    emitcode("","%05d$:",tlbl->key+100);    
+    emitcode("","%05d$:",tlbl->key+100);
     emitcode("mov","c,ov");
     _startLazyDPSEvaluation();
     while (size--) {
         l = aopGet(AOP(result),offset,FALSE,FALSE,TRUE);
         MOVA(l);
-        emitcode("rrc","a");         
+        emitcode("rrc","a");
         aopPut(AOP(result),"a",offset--);
     }
     _endLazyDPSEvaluation();
@@ -6658,7 +6658,7 @@ static void genRightShift (iCode *ic)
     aopOp(right,ic,FALSE, FALSE);
 
 #if 0
-    /* if the shift count is known then do it 
+    /* if the shift count is known then do it
     as efficiently as possible */
     if (AOP_TYPE(right) == AOP_LIT) {
         genRightShiftLiteral (left,right,result,ic, 0);
@@ -6666,11 +6666,11 @@ static void genRightShift (iCode *ic)
     }
 #endif
 
-    /* shift count is unknown then we have to form 
+    /* shift count is unknown then we have to form
     a loop get the loop count in B : Note: we take
     only the lower order byte since shifting
     more that 32 bits make no sense anyway, ( the
-    largest size of an object can be only 32 bits ) */  
+    largest size of an object can be only 32 bits ) */
 
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE,FALSE));
     emitcode("inc","b");
@@ -6680,7 +6680,7 @@ static void genRightShift (iCode *ic)
 
     /* now move the left to the result if they are not the
     same */
-    if (!sameRegs(AOP(left),AOP(result)) && 
+    if (!sameRegs(AOP(left),AOP(result)) &&
         AOP_SIZE(result) > 1) {
 
         size = AOP_SIZE(result);
@@ -6708,11 +6708,11 @@ static void genRightShift (iCode *ic)
     if (size == 1) {
         l = aopGet(AOP(left),0,FALSE,FALSE,TRUE);
         MOVA(l);
-       emitcode("sjmp","%05d$",tlbl1->key+100);
+  emitcode("sjmp","%05d$",tlbl1->key+100);
         emitcode("","%05d$:",tlbl->key+100);
         CLRC;
         emitcode("rrc","a");
-       emitcode("","%05d$:",tlbl1->key+100);
+  emitcode("","%05d$:",tlbl1->key+100);
         emitcode("djnz","b,%05d$",tlbl->key+100);
         aopPut(AOP(result),"a",0);
         goto release ;
@@ -6720,13 +6720,13 @@ static void genRightShift (iCode *ic)
 
     reAdjustPreg(AOP(result));
     emitcode("sjmp","%05d$",tlbl1->key+100);
-    emitcode("","%05d$:",tlbl->key+100);    
+    emitcode("","%05d$:",tlbl->key+100);
     CLRC;
     _startLazyDPSEvaluation();
     while (size--) {
         l = aopGet(AOP(result),offset,FALSE,FALSE,TRUE);
         MOVA(l);
-        emitcode("rrc","a");         
+        emitcode("rrc","a");
         aopPut(AOP(result),"a",offset--);
     }
     _endLazyDPSEvaluation();
@@ -6744,7 +6744,7 @@ release:
 /* genUnpackBits - generates code for unpacking bits               */
 /*-----------------------------------------------------------------*/
 static void genUnpackBits (operand *result, char *rname, int ptype)
-{    
+{
     int shCnt ;
     int rlen = 0 ;
     sym_link *etype;
@@ -6759,31 +6759,31 @@ static void genUnpackBits (operand *result, char *rname, int ptype)
 
     case POINTER:
     case IPOINTER:
-       emitcode("mov","a,@%s",rname);
-       break;
-       
+  emitcode("mov","a,@%s",rname);
+  break;
+
     case PPOINTER:
-       emitcode("movx","a,@%s",rname);
-       break;
-       
+  emitcode("movx","a,@%s",rname);
+  break;
+
     case FPOINTER:
-       emitcode("movx","a,@dptr");
-       break;
+  emitcode("movx","a,@dptr");
+  break;
 
     case CPOINTER:
-       emitcode("clr","a");
-       emitcode("movc","a","@a+dptr");
-       break;
+  emitcode("clr","a");
+  emitcode("movc","a","@a+dptr");
+  break;
 
     case GPOINTER:
-       emitcode("lcall","__gptrget");
-       break;
+  emitcode("lcall","__gptrget");
+  break;
     }
 
     /* if we have bitdisplacement then it fits   */
     /* into this byte completely or if length is */
     /* less than a byte                          */
-    if ((shCnt = SPEC_BSTR(etype)) || 
+    if ((shCnt = SPEC_BSTR(etype)) ||
         (SPEC_BLEN(etype) <= 8))  {
 
         /* shift right acc */
@@ -6801,49 +6801,49 @@ static void genUnpackBits (operand *result, char *rname, int ptype)
 
     while (1)  {
 
-       switch (ptype) {
-       case POINTER:
-       case IPOINTER:
-           emitcode("inc","%s",rname);
-           emitcode("mov","a,@%s",rname);
-           break;
-           
-       case PPOINTER:
-           emitcode("inc","%s",rname);
-           emitcode("movx","a,@%s",rname);
-           break;
-
-       case FPOINTER:
-           emitcode("inc","dptr");
-           emitcode("movx","a,@dptr");
-           break;
-           
-       case CPOINTER:
-           emitcode("clr","a");
-           emitcode("inc","dptr");
-           emitcode("movc","a","@a+dptr");
-           break;
-           
-       case GPOINTER:
-           emitcode("inc","dptr");
-           emitcode("lcall","__gptrget");
-           break;
-       }
-
-       rlen -= 8;            
-       /* if we are done */
-       if ( rlen < 8 )
-           break ;
-       
-       aopPut(AOP(result),"a",offset++);
-                                     
-    }
-    
+  switch (ptype) {
+  case POINTER:
+  case IPOINTER:
+      emitcode("inc","%s",rname);
+      emitcode("mov","a,@%s",rname);
+      break;
+
+  case PPOINTER:
+      emitcode("inc","%s",rname);
+      emitcode("movx","a,@%s",rname);
+      break;
+
+  case FPOINTER:
+      emitcode("inc","dptr");
+      emitcode("movx","a,@dptr");
+      break;
+
+  case CPOINTER:
+      emitcode("clr","a");
+      emitcode("inc","dptr");
+      emitcode("movc","a","@a+dptr");
+      break;
+
+  case GPOINTER:
+      emitcode("inc","dptr");
+      emitcode("lcall","__gptrget");
+      break;
+  }
+
+  rlen -= 8;
+  /* if we are done */
+  if ( rlen < 8 )
+      break ;
+
+  aopPut(AOP(result),"a",offset++);
+
+    }
+
     if (rlen) {
-       emitcode("anl","a,#0x%02x",((unsigned char)-1)>>(rlen));
-       aopPut(AOP(result),"a",offset);        
+  emitcode("anl","a,#0x%02x",((unsigned char)-1)>>(rlen));
+  aopPut(AOP(result),"a",offset);
     }
-    
+
     return ;
 }
 
@@ -6851,9 +6851,9 @@ static void genUnpackBits (operand *result, char *rname, int ptype)
 /*-----------------------------------------------------------------*/
 /* genDataPointerGet - generates code when ptr offset is known     */
 /*-----------------------------------------------------------------*/
-static void genDataPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genDataPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
     char *l;
     char buffer[256];
@@ -6865,11 +6865,11 @@ static void genDataPointerGet (operand *left,
     size = AOP_SIZE(result);
     _startLazyDPSEvaluation();
     while (size--) {
-       if (offset)
-           sprintf(buffer,"(%s + %d)",l+1,offset);
-       else
-           sprintf(buffer,"%s",l+1);
-       aopPut(AOP(result),buffer,offset++);
+  if (offset)
+      sprintf(buffer,"(%s + %d)",l+1,offset);
+  else
+      sprintf(buffer,"%s",l+1);
+  aopPut(AOP(result),buffer,offset++);
     }
     _endLazyDPSEvaluation();
 
@@ -6880,15 +6880,15 @@ static void genDataPointerGet (operand *left,
 /*-----------------------------------------------------------------*/
 /* genNearPointerGet - emitcode for near pointer fetch             */
 /*-----------------------------------------------------------------*/
-static void genNearPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genNearPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
     asmop *aop = NULL;
     regs *preg = NULL ;
     char *rname ;
     sym_link *rtype, *retype, *letype;
-    sym_link *ltype = operandType(left);    
+    sym_link *ltype = operandType(left);
     char buffer[80];
 
     rtype = operandType(result);
@@ -6896,94 +6896,94 @@ static void genNearPointerGet (operand *left,
     letype= getSpec(ltype);
 
     aopOp(left,ic,FALSE, FALSE);
-    
+
     /* if left is rematerialisable and
        result is not bit variable type and
        the left is pointer to data space i.e
        lower 128 bytes of space */
     if (AOP_TYPE(left) == AOP_IMMD &&
-       !IS_BITVAR(retype)         &&
-       !IS_BITVAR(letype)         &&
-       DCL_TYPE(ltype) == POINTER) {
-       genDataPointerGet (left,result,ic);
-       return ;
-    }
-    
-       /* if the value is already in a pointer register
+  !IS_BITVAR(retype)         &&
+  !IS_BITVAR(letype)         &&
+  DCL_TYPE(ltype) == POINTER) {
+  genDataPointerGet (left,result,ic);
+  return ;
+    }
+
+  /* if the value is already in a pointer register
        then don't need anything more */
     if (!AOP_INPREG(AOP(left))) {
-       /* otherwise get a free pointer register */
-       aop = newAsmop(0);
-       preg = getFreePtr(ic,&aop,FALSE);
-       emitcode("mov","%s,%s",
-               preg->name,
-               aopGet(AOP(left),0,FALSE,TRUE,FALSE));
-       rname = preg->name ;
+  /* otherwise get a free pointer register */
+  aop = newAsmop(0);
+  preg = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,%s",
+    preg->name,
+    aopGet(AOP(left),0,FALSE,TRUE,FALSE));
+  rname = preg->name ;
     } else
-       rname = aopGet(AOP(left),0,FALSE,FALSE,FALSE);
-    
+  rname = aopGet(AOP(left),0,FALSE,FALSE,FALSE);
+
     freeAsmop(left,NULL,ic,TRUE);
     aopOp (result,ic,FALSE, FALSE);
-    
+
       /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
-       genUnpackBits (result,rname,POINTER);
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
+  genUnpackBits (result,rname,POINTER);
     else {
-       /* we have can just get the values */
-       int size = AOP_SIZE(result);
-       int offset = 0 ;        
-       
-       while (size--) {
-           if (IS_AOP_PREG(result) || AOP_TYPE(result) == AOP_STK ) {
-
-               emitcode("mov","a,@%s",rname);
-               aopPut(AOP(result),"a",offset);
-           } else {
-               sprintf(buffer,"@%s",rname);
-               aopPut(AOP(result),buffer,offset);
-           }
-           offset++ ;
-           if (size)
-               emitcode("inc","%s",rname);
-       }
+  /* we have can just get the values */
+  int size = AOP_SIZE(result);
+  int offset = 0 ;
+
+  while (size--) {
+      if (IS_AOP_PREG(result) || AOP_TYPE(result) == AOP_STK ) {
+
+    emitcode("mov","a,@%s",rname);
+    aopPut(AOP(result),"a",offset);
+      } else {
+    sprintf(buffer,"@%s",rname);
+    aopPut(AOP(result),buffer,offset);
+      }
+      offset++ ;
+      if (size)
+    emitcode("inc","%s",rname);
+  }
     }
 
     /* now some housekeeping stuff */
     if (aop) {
-       /* we had to allocate for this iCode */
-       freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
-       /* we did not allocate which means left
-          already in a pointer register, then
-          if size > 0 && this could be used again
-          we have to point it back to where it 
-          belongs */
-       if (AOP_SIZE(result) > 1 &&
-           !OP_SYMBOL(left)->remat &&
-           ( OP_SYMBOL(left)->liveTo > ic->seq ||
-             ic->depth )) {
-           int size = AOP_SIZE(result) - 1;
-           while (size--)
-               emitcode("dec","%s",rname);
-       }
+  /* we had to allocate for this iCode */
+  freeAsmop(NULL,aop,ic,TRUE);
+    } else {
+  /* we did not allocate which means left
+     already in a pointer register, then
+     if size > 0 && this could be used again
+     we have to point it back to where it
+     belongs */
+  if (AOP_SIZE(result) > 1 &&
+      !OP_SYMBOL(left)->remat &&
+      ( OP_SYMBOL(left)->liveTo > ic->seq ||
+        ic->depth )) {
+      int size = AOP_SIZE(result) - 1;
+      while (size--)
+    emitcode("dec","%s",rname);
+  }
     }
 
     /* done */
     freeAsmop(result,NULL,ic,TRUE);
-     
+
 }
 
 /*-----------------------------------------------------------------*/
 /* genPagedPointerGet - emitcode for paged pointer fetch           */
 /*-----------------------------------------------------------------*/
-static void genPagedPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genPagedPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
     asmop *aop = NULL;
     regs *preg = NULL ;
     char *rname;
-    sym_link *rtype, *retype, *letype;    
+    sym_link *rtype, *retype, *letype;
 
     rtype = operandType(result);
     retype= getSpec(rtype);
@@ -6993,63 +6993,63 @@ static void genPagedPointerGet (operand *left,
   /* if the value is already in a pointer register
        then don't need anything more */
     if (!AOP_INPREG(AOP(left))) {
-       /* otherwise get a free pointer register */
-       aop = newAsmop(0);
-       preg = getFreePtr(ic,&aop,FALSE);
-       emitcode("mov","%s,%s",
-               preg->name,
-               aopGet(AOP(left),0,FALSE,TRUE,FALSE));
-       rname = preg->name ;
+  /* otherwise get a free pointer register */
+  aop = newAsmop(0);
+  preg = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,%s",
+    preg->name,
+    aopGet(AOP(left),0,FALSE,TRUE,FALSE));
+  rname = preg->name ;
     } else
-       rname = aopGet(AOP(left),0,FALSE,FALSE,FALSE);
-    
+  rname = aopGet(AOP(left),0,FALSE,FALSE,FALSE);
+
     freeAsmop(left,NULL,ic,TRUE);
     aopOp (result,ic,FALSE, FALSE);
 
     /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
-       genUnpackBits (result,rname,PPOINTER);
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
+  genUnpackBits (result,rname,PPOINTER);
     else {
-       /* we have can just get the values */
-       int size = AOP_SIZE(result);
-       int offset = 0 ;        
-       
-       while (size--) {
-           
-           emitcode("movx","a,@%s",rname);
-           aopPut(AOP(result),"a",offset);
-           
-           offset++ ;
-           
-           if (size)
-               emitcode("inc","%s",rname);
-       }
+  /* we have can just get the values */
+  int size = AOP_SIZE(result);
+  int offset = 0 ;
+
+  while (size--) {
+
+      emitcode("movx","a,@%s",rname);
+      aopPut(AOP(result),"a",offset);
+
+      offset++ ;
+
+      if (size)
+    emitcode("inc","%s",rname);
+  }
     }
 
     /* now some housekeeping stuff */
     if (aop) {
-       /* we had to allocate for this iCode */
-       freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
-       /* we did not allocate which means left
-          already in a pointer register, then
-          if size > 0 && this could be used again
-          we have to point it back to where it 
-          belongs */
-       if (AOP_SIZE(result) > 1 &&
-           !OP_SYMBOL(left)->remat &&
-           ( OP_SYMBOL(left)->liveTo > ic->seq ||
-             ic->depth )) {
-           int size = AOP_SIZE(result) - 1;
-           while (size--)
-               emitcode("dec","%s",rname);
-       }
+  /* we had to allocate for this iCode */
+  freeAsmop(NULL,aop,ic,TRUE);
+    } else {
+  /* we did not allocate which means left
+     already in a pointer register, then
+     if size > 0 && this could be used again
+     we have to point it back to where it
+     belongs */
+  if (AOP_SIZE(result) > 1 &&
+      !OP_SYMBOL(left)->remat &&
+      ( OP_SYMBOL(left)->liveTo > ic->seq ||
+        ic->depth )) {
+      int size = AOP_SIZE(result) - 1;
+      while (size--)
+    emitcode("dec","%s",rname);
+  }
     }
 
     /* done */
     freeAsmop(result,NULL,ic,TRUE);
-    
-       
+
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -7065,7 +7065,7 @@ static void genFarPointerGet (operand *left,
 
     aopOp(left,ic,FALSE, FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(left) != AOP_STR) {
         /* if this is remateriazable */
@@ -7073,15 +7073,15 @@ static void genFarPointerGet (operand *left,
         {
             emitcode("mov","dptr,%s",aopGet(AOP(left),0,TRUE,FALSE,FALSE));
         }
-        else 
-        { 
+        else
+        {
             /* we need to get it byte by byte */
             _startLazyDPSEvaluation();
-           if (AOP_TYPE(left) != AOP_DPTR)
-           {
-               emitcode("mov","dpl,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
-               emitcode("mov","dph,%s",aopGet(AOP(left),1,FALSE,FALSE,TRUE));
-                       emitcode("mov","dpx,%s",aopGet(AOP(left),2,FALSE,FALSE,TRUE));
+      if (AOP_TYPE(left) != AOP_DPTR)
+      {
+              emitcode("mov","dpl,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
+              emitcode("mov","dph,%s",aopGet(AOP(left),1,FALSE,FALSE,TRUE));
+                emitcode("mov","dpx,%s",aopGet(AOP(left),2,FALSE,FALSE,TRUE));
             }
             else
             {
@@ -7101,21 +7101,21 @@ static void genFarPointerGet (operand *left,
     aopOp(result,ic,FALSE, TRUE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
         genUnpackBits(result,"dptr",FPOINTER);
     else {
         size = AOP_SIZE(result);
         offset = 0 ;
 
-       _startLazyDPSEvaluation();
+  _startLazyDPSEvaluation();
         while (size--) {
-            
+
             genSetDPTR(0);
             _flushLazyDPS();
-            
+
             emitcode("movx","a,@dptr");
             if (size)
-                emitcode("inc","dptr");            
+                emitcode("inc","dptr");
 
             aopPut(AOP(result),"a",offset++);
         }
@@ -7136,7 +7136,7 @@ static void emitcodePointerGet (operand *left,
 
     aopOp(left,ic,FALSE, FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(left) != AOP_STR) {
         /* if this is remateriazable */
@@ -7149,9 +7149,9 @@ static void emitcodePointerGet (operand *left,
             _startLazyDPSEvaluation();
             if (AOP_TYPE(left) != AOP_DPTR)
             {
-               emitcode("mov","dpl,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
-               emitcode("mov","dph,%s",aopGet(AOP(left),1,FALSE,FALSE,TRUE));
-                       emitcode("mov","dpx,%s",aopGet(AOP(left),2,FALSE,FALSE,TRUE));
+              emitcode("mov","dpl,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
+              emitcode("mov","dph,%s",aopGet(AOP(left),1,FALSE,FALSE,TRUE));
+                emitcode("mov","dpx,%s",aopGet(AOP(left),2,FALSE,FALSE,TRUE));
             }
             else
             {
@@ -7162,8 +7162,8 @@ static void emitcodePointerGet (operand *left,
                  emitcode("mov", "dpx,%s",aopGet(AOP(left),2,FALSE,FALSE,TRUE));
                  emitcode("pop", "dph");
                  emitcode("pop", "dpl");
-            }     
-            _endLazyDPSEvaluation();       
+            }
+            _endLazyDPSEvaluation();
         }
     }
     /* so dptr know contains the address */
@@ -7171,22 +7171,22 @@ static void emitcodePointerGet (operand *left,
     aopOp(result,ic,FALSE, TRUE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype)) 
+    if (IS_BITVAR(retype))
         genUnpackBits(result,"dptr",CPOINTER);
     else {
         size = AOP_SIZE(result);
         offset = 0 ;
 
-       _startLazyDPSEvaluation();
-        while (size--) 
+  _startLazyDPSEvaluation();
+        while (size--)
         {
             genSetDPTR(0);
             _flushLazyDPS();
-                              
+
             emitcode("clr","a");
             emitcode("movc","a,@a+dptr");
             if (size)
-                emitcode("inc","dptr");            
+                emitcode("inc","dptr");
             aopPut(AOP(result),"a",offset++);
         }
         _endLazyDPSEvaluation();
@@ -7207,14 +7207,14 @@ static void genGenPointerGet (operand *left,
 
     aopOp(left,ic,FALSE, TRUE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(left) != AOP_STR) {
         /* if this is remateriazable */
         if (AOP_TYPE(left) == AOP_IMMD) {
             emitcode("mov","dptr,%s",aopGet(AOP(left),0,TRUE,FALSE,FALSE));
-           emitcode("mov","b,#%d",pointerCode(retype));
-       }
+      emitcode("mov","b,#%d",pointerCode(retype));
+  }
         else { /* we need to get it byte by byte */
             _startLazyDPSEvaluation();
             emitcode("mov","dpl,%s",aopGet(AOP(left),0,FALSE,FALSE,TRUE));
@@ -7229,7 +7229,7 @@ static void genGenPointerGet (operand *left,
     aopOp(result,ic,FALSE, TRUE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
         genUnpackBits(result,"dptr",GPOINTER);
     else {
         size = AOP_SIZE(result);
@@ -7265,37 +7265,37 @@ static void genPointerGet (iCode *ic)
     type = operandType(left);
     etype = getSpec(type);
     /* if left is of type of pointer then it is simple */
-    if (IS_PTR(type) && !IS_FUNC(type->next)) 
+    if (IS_PTR(type) && !IS_FUNC(type->next))
         p_type = DCL_TYPE(type);
     else {
-       /* we have to go by the storage class */
-       p_type = PTR_TYPE(SPEC_OCLS(etype));
+  /* we have to go by the storage class */
+  p_type = PTR_TYPE(SPEC_OCLS(etype));
     }
 
     /* now that we have the pointer type we assign
     the pointer values */
     switch (p_type) {
 
-    case POINTER:      
+    case POINTER:
     case IPOINTER:
-       genNearPointerGet (left,result,ic);
-       break;
+  genNearPointerGet (left,result,ic);
+  break;
 
     case PPOINTER:
-       genPagedPointerGet(left,result,ic);
-       break;
+  genPagedPointerGet(left,result,ic);
+  break;
 
     case FPOINTER:
-       genFarPointerGet (left,result,ic);
-       break;
+  genFarPointerGet (left,result,ic);
+  break;
 
     case CPOINTER:
-       emitcodePointerGet (left,result,ic);
-       break;
+  emitcodePointerGet (left,result,ic);
+  break;
 
     case GPOINTER:
-       genGenPointerGet (left,result,ic);
-       break;
+  genGenPointerGet (left,result,ic);
+  break;
     }
 
 }
@@ -7310,14 +7310,14 @@ static void genPackBits (sym_link    *etype ,
     int shCount = 0 ;
     int offset = 0  ;
     int rLen = 0 ;
-    int blen, bstr ;   
+    int blen, bstr ;
     char *l ;
 
     blen = SPEC_BLEN(etype);
     bstr = SPEC_BSTR(etype);
 
     l = aopGet(AOP(right),offset++,FALSE,FALSE,TRUE);
-    MOVA(l);   
+    MOVA(l);
 
     /* if the bit lenth is less than or    */
     /* it exactly fits a byte then         */
@@ -7350,7 +7350,7 @@ static void genPackBits (sym_link    *etype ,
             }
 
             emitcode ("anl","a,#0x%02x",(unsigned char)
-                      ((unsigned char)(0xFF << (blen+bstr)) | 
+                      ((unsigned char)(0xFF << (blen+bstr)) |
                        (unsigned char)(0xFF >> (8-bstr)) ) );
             emitcode ("orl","a,b");
             if (p_type == GPOINTER)
@@ -7377,7 +7377,7 @@ static void genPackBits (sym_link    *etype ,
         return ;
 
     emitcode("inc","%s",rname);
-    rLen = SPEC_BLEN(etype) ;     
+    rLen = SPEC_BLEN(etype) ;
 
     /* now generate for lengths greater than one byte */
     while (1) {
@@ -7405,8 +7405,8 @@ static void genPackBits (sym_link    *etype ,
             case GPOINTER:
                 MOVA(l);
                 emitcode("lcall","__gptrput");
-                break;  
-        }   
+                break;
+        }
         emitcode ("inc","%s",rname);
     }
 
@@ -7444,39 +7444,39 @@ static void genPackBits (sym_link    *etype ,
     switch (p_type) {
 
     case POINTER:
-       emitcode("mov","@%s,a",rname);
-       break;
-       
+  emitcode("mov","@%s,a",rname);
+  break;
+
     case FPOINTER:
-       emitcode("movx","@dptr,a");
-       break;
-       
+  emitcode("movx","@dptr,a");
+  break;
+
     case GPOINTER:
-       emitcode("lcall","__gptrput");
-       break;                  
+  emitcode("lcall","__gptrput");
+  break;
     }
 }
 /*-----------------------------------------------------------------*/
 /* genDataPointerSet - remat pointer to data space                 */
 /*-----------------------------------------------------------------*/
 static void genDataPointerSet(operand *right,
-                             operand *result,
-                             iCode *ic)
+            operand *result,
+            iCode *ic)
 {
     int size, offset = 0 ;
     char *l, buffer[256];
 
     aopOp(right,ic,FALSE, FALSE);
-    
+
     l = aopGet(AOP(result),0,FALSE,TRUE,FALSE);
     size = AOP_SIZE(right);
     while (size--) {
-       if (offset)
-           sprintf(buffer,"(%s + %d)",l+1,offset);
-       else
-           sprintf(buffer,"%s",l+1);
-       emitcode("mov","%s,%s",buffer,
-                aopGet(AOP(right),offset++,FALSE,FALSE,FALSE));
+  if (offset)
+      sprintf(buffer,"(%s + %d)",l+1,offset);
+  else
+      sprintf(buffer,"%s",l+1);
+  emitcode("mov","%s,%s",buffer,
+     aopGet(AOP(right),offset++,FALSE,FALSE,FALSE));
     }
 
     freeAsmop(right,NULL,ic,TRUE);
@@ -7487,7 +7487,7 @@ static void genDataPointerSet(operand *right,
 /* genNearPointerSet - emitcode for near pointer put                */
 /*-----------------------------------------------------------------*/
 static void genNearPointerSet (operand *right,
-                               operand *result, 
+                               operand *result,
                                iCode *ic)
 {
     asmop *aop = NULL;
@@ -7495,20 +7495,20 @@ static void genNearPointerSet (operand *right,
     char *rname , *l;
     sym_link *retype, *letype;
     sym_link *ptype = operandType(result);
-    
+
     retype= getSpec(operandType(right));
     letype= getSpec(ptype);
 
     aopOp(result,ic,FALSE, FALSE);
-    
+
     /* if the result is rematerializable &
        in data space & not a bit variable */
     if (AOP_TYPE(result) == AOP_IMMD &&
-       DCL_TYPE(ptype) == POINTER   &&
-       !IS_BITVAR(retype) &&
-       !IS_BITVAR(letype)) {
-       genDataPointerSet (right,result,ic);
-       return;
+  DCL_TYPE(ptype) == POINTER   &&
+  !IS_BITVAR(retype) &&
+  !IS_BITVAR(letype)) {
+  genDataPointerSet (right,result,ic);
+  return;
     }
 
     /* if the value is already in a pointer register
@@ -7528,12 +7528,12 @@ static void genNearPointerSet (operand *right,
     aopOp (right,ic,FALSE, FALSE);
 
     /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
         genPackBits ((IS_BITVAR(retype) ? retype : letype),right,rname,POINTER);
     else {
         /* we have can just get the values */
         int size = AOP_SIZE(right);
-        int offset = 0 ;    
+        int offset = 0 ;
 
         while (size--) {
             l = aopGet(AOP(right),offset,FALSE,TRUE,FALSE);
@@ -7552,11 +7552,11 @@ static void genNearPointerSet (operand *right,
     if (aop) {
         /* we had to allocate for this iCode */
         freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
+    } else {
         /* we did not allocate which means left
         already in a pointer register, then
         if size > 0 && this could be used again
-        we have to point it back to where it 
+        we have to point it back to where it
         belongs */
         if (AOP_SIZE(right) > 1 &&
             !OP_SYMBOL(result)->remat &&
@@ -7578,80 +7578,80 @@ static void genNearPointerSet (operand *right,
 /* genPagedPointerSet - emitcode for Paged pointer put             */
 /*-----------------------------------------------------------------*/
 static void genPagedPointerSet (operand *right,
-                              operand *result, 
-                              iCode *ic)
+             operand *result,
+             iCode *ic)
 {
     asmop *aop = NULL;
     regs *preg = NULL ;
     char *rname , *l;
     sym_link *retype, *letype;
-       
+
     retype= getSpec(operandType(right));
     letype= getSpec(operandType(result));
-    
+
     aopOp(result,ic,FALSE, FALSE);
-    
+
     /* if the value is already in a pointer register
        then don't need anything more */
     if (!AOP_INPREG(AOP(result))) {
-       /* otherwise get a free pointer register */
-       aop = newAsmop(0);
-       preg = getFreePtr(ic,&aop,FALSE);
-       emitcode("mov","%s,%s",
-               preg->name,
-               aopGet(AOP(result),0,FALSE,TRUE,FALSE));
-       rname = preg->name ;
+  /* otherwise get a free pointer register */
+  aop = newAsmop(0);
+  preg = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,%s",
+    preg->name,
+    aopGet(AOP(result),0,FALSE,TRUE,FALSE));
+  rname = preg->name ;
     } else
-       rname = aopGet(AOP(result),0,FALSE,FALSE,FALSE);
-    
+  rname = aopGet(AOP(result),0,FALSE,FALSE,FALSE);
+
     freeAsmop(result,NULL,ic,TRUE);
     aopOp (right,ic,FALSE, FALSE);
 
     /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
-       genPackBits ((IS_BITVAR(retype) ? retype : letype) ,right,rname,PPOINTER);
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
+  genPackBits ((IS_BITVAR(retype) ? retype : letype) ,right,rname,PPOINTER);
     else {
-       /* we have can just get the values */
-       int size = AOP_SIZE(right);
-       int offset = 0 ;        
-       
-       while (size--) {
-           l = aopGet(AOP(right),offset,FALSE,TRUE,TRUE);
-           
-           MOVA(l);
-           emitcode("movx","@%s,a",rname);
-
-           if (size)
-               emitcode("inc","%s",rname);
-
-           offset++;
-       }
-    }
-    
+  /* we have can just get the values */
+  int size = AOP_SIZE(right);
+  int offset = 0 ;
+
+  while (size--) {
+      l = aopGet(AOP(right),offset,FALSE,TRUE,TRUE);
+
+      MOVA(l);
+      emitcode("movx","@%s,a",rname);
+
+      if (size)
+    emitcode("inc","%s",rname);
+
+      offset++;
+  }
+    }
+
     /* now some housekeeping stuff */
     if (aop) {
-       /* we had to allocate for this iCode */
-       freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
-       /* we did not allocate which means left
-          already in a pointer register, then
-          if size > 0 && this could be used again
-          we have to point it back to where it 
-          belongs */
-       if (AOP_SIZE(right) > 1 &&
-           !OP_SYMBOL(result)->remat &&
-           ( OP_SYMBOL(result)->liveTo > ic->seq ||
-             ic->depth )) {
-           int size = AOP_SIZE(right) - 1;
-           while (size--)
-               emitcode("dec","%s",rname);
-       }
+  /* we had to allocate for this iCode */
+  freeAsmop(NULL,aop,ic,TRUE);
+    } else {
+  /* we did not allocate which means left
+     already in a pointer register, then
+     if size > 0 && this could be used again
+     we have to point it back to where it
+     belongs */
+  if (AOP_SIZE(right) > 1 &&
+      !OP_SYMBOL(result)->remat &&
+      ( OP_SYMBOL(result)->liveTo > ic->seq ||
+        ic->depth )) {
+      int size = AOP_SIZE(right) - 1;
+      while (size--)
+    emitcode("dec","%s",rname);
+  }
     }
 
     /* done */
     freeAsmop(right,NULL,ic,TRUE);
-    
-       
+
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -7666,21 +7666,21 @@ static void genFarPointerSet (operand *right,
 
     aopOp(result,ic,FALSE, FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(result) != AOP_STR) {
         /* if this is remateriazable */
         if (AOP_TYPE(result) == AOP_IMMD)
             emitcode("mov","dptr,%s",aopGet(AOP(result),0,TRUE,FALSE,FALSE));
-        else 
+        else
         {
             /* we need to get it byte by byte */
             _startLazyDPSEvaluation();
-           if (AOP_TYPE(result) != AOP_DPTR)
-           {
-               emitcode("mov","dpl,%s",aopGet(AOP(result),0,FALSE,FALSE,TRUE));
-               emitcode("mov","dph,%s",aopGet(AOP(result),1,FALSE,FALSE,TRUE));
-                       emitcode("mov","dpx,%s",aopGet(AOP(result),2,FALSE,FALSE,TRUE));
+      if (AOP_TYPE(result) != AOP_DPTR)
+      {
+              emitcode("mov","dpl,%s",aopGet(AOP(result),0,FALSE,FALSE,TRUE));
+              emitcode("mov","dph,%s",aopGet(AOP(result),1,FALSE,FALSE,TRUE));
+                emitcode("mov","dpx,%s",aopGet(AOP(result),2,FALSE,FALSE,TRUE));
             }
             else
             {
@@ -7700,20 +7700,20 @@ static void genFarPointerSet (operand *right,
     aopOp(right,ic,FALSE, TRUE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
         genPackBits((IS_BITVAR(retype)?retype:letype),right,"dptr",FPOINTER);
     else {
         size = AOP_SIZE(right);
         offset = 0 ;
 
-       _startLazyDPSEvaluation();
+  _startLazyDPSEvaluation();
         while (size--) {
             char *l = aopGet(AOP(right),offset++,FALSE,FALSE,TRUE);
             MOVA(l);
-            
+
             genSetDPTR(0);
             _flushLazyDPS();
-            
+
             emitcode("movx","@dptr,a");
             if (size)
                 emitcode("inc","dptr");
@@ -7736,10 +7736,10 @@ static void genGenPointerSet (operand *right,
 
     aopOp(result,ic,FALSE, TRUE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(result) != AOP_STR) {
-       _startLazyDPSEvaluation();
+      _startLazyDPSEvaluation();
         /* if this is remateriazable */
         if (AOP_TYPE(result) == AOP_IMMD) {
             emitcode("mov","dptr,%s",aopGet(AOP(result),0,TRUE,FALSE,FALSE));
@@ -7758,20 +7758,20 @@ static void genGenPointerSet (operand *right,
     aopOp(right,ic,FALSE, TRUE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
         genPackBits((IS_BITVAR(retype)?retype:letype),right,"dptr",GPOINTER);
     else {
         size = AOP_SIZE(right);
         offset = 0 ;
 
-       _startLazyDPSEvaluation();
+  _startLazyDPSEvaluation();
         while (size--) {
             char *l = aopGet(AOP(right),offset++,FALSE,FALSE,TRUE);
             MOVA(l);
-            
+
             genSetDPTR(0);
             _flushLazyDPS();
-            
+
             emitcode("lcall","__gptrput");
             if (size)
                 emitcode("inc","dptr");
@@ -7786,7 +7786,7 @@ static void genGenPointerSet (operand *right,
 /* genPointerSet - stores the value into a pointer location        */
 /*-----------------------------------------------------------------*/
 static void genPointerSet (iCode *ic)
-{    
+{
     operand *right, *result ;
     sym_link *type, *etype;
     int p_type;
@@ -7805,8 +7805,8 @@ static void genPointerSet (iCode *ic)
         p_type = DCL_TYPE(type);
     }
     else {
-       /* we have to go by the storage class */
-       p_type = PTR_TYPE(SPEC_OCLS(etype));
+  /* we have to go by the storage class */
+  p_type = PTR_TYPE(SPEC_OCLS(etype));
     }
 
     /* now that we have the pointer type we assign
@@ -7815,20 +7815,20 @@ static void genPointerSet (iCode *ic)
 
     case POINTER:
     case IPOINTER:
-       genNearPointerSet (right,result,ic);
-       break;
+  genNearPointerSet (right,result,ic);
+  break;
 
     case PPOINTER:
-       genPagedPointerSet (right,result,ic);
-       break;
+  genPagedPointerSet (right,result,ic);
+  break;
 
     case FPOINTER:
-       genFarPointerSet (right,result,ic);
-       break;
+  genFarPointerSet (right,result,ic);
+  break;
 
     case GPOINTER:
-       genGenPointerSet (right,result,ic);
-       break;
+  genGenPointerSet (right,result,ic);
+  break;
     }
 
 }
@@ -7858,14 +7858,14 @@ static void genIfx (iCode *ic, iCode *popIc)
         genIpop(popIc);
 
     /* if the condition is  a bit variable */
-    if (isbit && IS_ITEMP(cond) && 
-       SPIL_LOC(cond))
-       genIfxJump(ic,SPIL_LOC(cond)->rname);
+    if (isbit && IS_ITEMP(cond) &&
+  SPIL_LOC(cond))
+  genIfxJump(ic,SPIL_LOC(cond)->rname);
     else
-       if (isbit && !IS_ITEMP(cond))
-           genIfxJump(ic,OP_SYMBOL(cond)->rname);
-       else
-           genIfxJump(ic,"a");
+  if (isbit && !IS_ITEMP(cond))
+      genIfxJump(ic,OP_SYMBOL(cond)->rname);
+  else
+      genIfxJump(ic,"a");
 
     ic->generated = 1;
 }
@@ -7882,7 +7882,7 @@ static void genAddrOf (iCode *ic)
 
     aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
 
-    /* if the operand is on the stack then we 
+    /* if the operand is on the stack then we
     need to get the stack offset of this
     variable */
     if (sym->onStack) {
@@ -7891,21 +7891,21 @@ static void genAddrOf (iCode *ic)
         if (sym->stack) {
             emitcode("mov","a,_bp");
             emitcode("add","a,#0x%02x",((char) sym->stack & 0xff));
-            aopPut(AOP(IC_RESULT(ic)),"a",0);       
+            aopPut(AOP(IC_RESULT(ic)),"a",0);
         } else {
             /* we can just move _bp */
             aopPut(AOP(IC_RESULT(ic)),"_bp",0);
         }
         /* fill the result with zero */
         size = AOP_SIZE(IC_RESULT(ic)) - 1;
-        
-        
+
+
         if (options.stack10bit && size < (FPTRSIZE - 1))
         {
-            fprintf(stderr, 
-                   "*** warning: pointer to stack var truncated.\n");
+            fprintf(stderr,
+                  "*** warning: pointer to stack var truncated.\n");
         }
-        
+
         offset = 1;
         while (size--)
         {
@@ -7916,7 +7916,7 @@ static void genAddrOf (iCode *ic)
             }
             else
             {
-               aopPut(AOP(IC_RESULT(ic)),zero,offset++);
+              aopPut(AOP(IC_RESULT(ic)),zero,offset++);
             }
         }
 
@@ -7929,7 +7929,7 @@ static void genAddrOf (iCode *ic)
 
     while (size--) {
         char s[SDCC_NAME_MAX];
-        if (offset) 
+        if (offset)
             sprintf(s,"#(%s >> %d)",
                     sym->rname,
                     offset*8);
@@ -7955,24 +7955,24 @@ static void genFarFarAssign (operand *result, operand *right, iCode *ic)
 #ifdef LAZY_DPS_OPT
     if (size > 1)
     {
-       /* This is a net loss for size == 1, but a big gain
-        * otherwise.
-        */
-       D(emitcode(";", "genFarFarAssign (improved)"););
-
-       aopOp(result,ic,TRUE, TRUE);
-
-       _startLazyDPSEvaluation();
-       while (size--) 
-       {
-           aopPut(AOP(result),
-                  aopGet(AOP(right),offset,FALSE,FALSE,FALSE),
-                  offset);
-           offset++;
-       }
-       _endLazyDPSEvaluation();    
-       freeAsmop(result,NULL,ic,FALSE);
-       freeAsmop(right,NULL,ic,FALSE);
+      /* This is a net loss for size == 1, but a big gain
+       * otherwise.
+       */
+      D(emitcode(";", "genFarFarAssign (improved)"););
+
+      aopOp(result,ic,TRUE, TRUE);
+
+      _startLazyDPSEvaluation();
+  while (size--)
+  {
+      aopPut(AOP(result),
+       aopGet(AOP(right),offset,FALSE,FALSE,FALSE),
+       offset);
+      offset++;
+  }
+      _endLazyDPSEvaluation();
+      freeAsmop(result,NULL,ic,FALSE);
+      freeAsmop(right,NULL,ic,FALSE);
     }
     else
 #endif
@@ -7982,9 +7982,9 @@ static void genFarFarAssign (operand *result, operand *right, iCode *ic)
     /* first push the right side on to the stack */
     _startLazyDPSEvaluation();
     while (size--) {
-       l = aopGet(AOP(right),offset++,FALSE,FALSE,TRUE);
-       MOVA(l);
-       emitcode ("push","acc");
+  l = aopGet(AOP(right),offset++,FALSE,FALSE,TRUE);
+  MOVA(l);
+  emitcode ("push","acc");
     }
 
     freeAsmop(right,NULL,ic,FALSE);
@@ -7992,8 +7992,8 @@ static void genFarFarAssign (operand *result, operand *right, iCode *ic)
     aopOp(result,ic,FALSE, FALSE);
     size = AOP_SIZE(result);
     while (size--) {
-       emitcode ("pop","acc");
-       aopPut(AOP(result),"a",--offset);
+  emitcode ("pop","acc");
+  aopPut(AOP(result),"a",--offset);
     }
     freeAsmop(result,NULL,ic,FALSE);
     _endLazyDPSEvaluation();
@@ -8007,7 +8007,7 @@ static void genAssign (iCode *ic)
 {
     operand *result, *right;
     int size, offset ;
-       unsigned long lit = 0L;
+  unsigned long lit = 0L;
 
     D(emitcode(";", "genAssign "););
 
@@ -8019,7 +8019,7 @@ static void genAssign (iCode *ic)
         return ;
 
     aopOp(right,ic,FALSE, FALSE);
-    
+
     emitcode(";", "genAssign: resultIsFar = %s",
              isOperandInFarSpace(result) ?
              "TRUE" : "FALSE");
@@ -8029,9 +8029,9 @@ static void genAssign (iCode *ic)
          AOP_TYPE(right) == AOP_DPTR2) &&
     /* IS_TRUE_SYMOP(result)       && */
     isOperandInFarSpace(result)) {
-       
-       genFarFarAssign (result,right,ic);
-       return ;
+
+  genFarFarAssign (result,right,ic);
+  return ;
     }
 
     aopOp(result,ic,TRUE, FALSE);
@@ -8046,7 +8046,7 @@ static void genAssign (iCode *ic)
         /* if the right size is a literal then
         we know what the value is */
         if (AOP_TYPE(right) == AOP_LIT) {
-            if (((int) operandLitValue(right))) 
+            if (((int) operandLitValue(right)))
                 aopPut(AOP(result),one,0);
             else
                 aopPut(AOP(result),zero,0);
@@ -8071,71 +8071,71 @@ static void genAssign (iCode *ic)
     size = AOP_SIZE(result);
     offset = 0 ;
     if(AOP_TYPE(right) == AOP_LIT)
-       lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
-    
+  lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
+
     if((size > 1) &&
        (AOP_TYPE(result) != AOP_REG) &&
        (AOP_TYPE(right) == AOP_LIT) &&
-       !IS_FLOAT(operandType(right)) 
+       !IS_FLOAT(operandType(right))
 #ifndef LAZY_DPS_OPT
        && (lit < 256L)
-#endif       
+#endif
        )
     {
 #ifdef LAZY_DPS_OPT
-       D(emitcode(";", "Kevin's better literal load code"););
-       _startLazyDPSEvaluation();
+  D(emitcode(";", "Kevin's better literal load code"););
+  _startLazyDPSEvaluation();
     while (size && ((unsigned int)(lit >> (offset*8)) != 0))
-       {
-           aopPut(AOP(result),
-                  aopGet(AOP(right),offset,FALSE,FALSE,TRUE),
-                  offset);
-           offset++;
-           size--;
-       }
-       /* And now fill the rest with zeros. */
-       if (size)
-       {
-           emitcode("clr","a");
-       }
-       while (size--)
-       {
-           aopPut(AOP(result), "a", offset++);
-       }
-       _endLazyDPSEvaluation();
+  {
+      aopPut(AOP(result),
+             aopGet(AOP(right),offset,FALSE,FALSE,TRUE),
+             offset);
+      offset++;
+      size--;
+  }
+  /* And now fill the rest with zeros. */
+  if (size)
+  {
+      emitcode("clr","a");
+  }
+  while (size--)
+  {
+      aopPut(AOP(result), "a", offset++);
+  }
+  _endLazyDPSEvaluation();
 #else
-       emitcode("clr","a");
-       
-       _startLazyDPSEvaluation();
-       while (size--) 
-       {
-           if((unsigned int)((lit >> (size*8)) & 0x0FFL)== 0)
-               aopPut(AOP(result),"a",size);
-           else
-               aopPut(AOP(result),
-                      aopGet(AOP(right),size,FALSE,FALSE,FALSE),
-                      size);
-       }
-       _endLazyDPSEvaluation();
-#endif 
-    } 
-    else 
+  emitcode("clr","a");
+
+  _startLazyDPSEvaluation();
+  while (size--)
+  {
+      if((unsigned int)((lit >> (size*8)) & 0x0FFL)== 0)
+    aopPut(AOP(result),"a",size);
+      else
+    aopPut(AOP(result),
+           aopGet(AOP(right),size,FALSE,FALSE,FALSE),
+           size);
+  }
+  _endLazyDPSEvaluation();
+#endif
+    }
+    else
     {
-       _startLazyDPSEvaluation();
-       while (size--) 
-       {
-           aopPut(AOP(result),
-                  aopGet(AOP(right),offset,FALSE,FALSE,FALSE),
-                  offset);
-           offset++;
-       }
-       _endLazyDPSEvaluation();
-    }
-    
+  _startLazyDPSEvaluation();
+  while (size--)
+  {
+      aopPut(AOP(result),
+       aopGet(AOP(right),offset,FALSE,FALSE,FALSE),
+       offset);
+      offset++;
+  }
+  _endLazyDPSEvaluation();
+    }
+
 release:
     freeAsmop (right,NULL,ic,FALSE);
     freeAsmop (result,NULL,ic,TRUE);
-}   
+}
 
 /*-----------------------------------------------------------------*/
 /* genJumpTab - generates code for jump table                      */
@@ -8192,7 +8192,7 @@ static void genCast (iCode *ic)
         /* if the right size is a literal then
         we know what the value is */
         if (AOP_TYPE(right) == AOP_LIT) {
-            if (((int) operandLitValue(right))) 
+            if (((int) operandLitValue(right)))
                 aopPut(AOP(result),one,0);
             else
                 aopPut(AOP(result),zero,0);
@@ -8238,110 +8238,110 @@ static void genCast (iCode *ic)
     /* if the result is of type pointer */
     if (IS_PTR(ctype)) {
 
-       int p_type;
-       sym_link *type = operandType(right);
-
-       /* pointer to generic pointer */
-       if (IS_GENPTR(ctype)) {
-           char *l = zero;
-           
-           if (IS_PTR(type)) 
-           {
-               p_type = DCL_TYPE(type);
-           }
-           else 
-           {
+  int p_type;
+  sym_link *type = operandType(right);
+
+  /* pointer to generic pointer */
+  if (IS_GENPTR(ctype)) {
+      char *l = zero;
+
+      if (IS_PTR(type))
+      {
+    p_type = DCL_TYPE(type);
+      }
+      else
+      {
 #if OLD_CAST_BEHAVIOR
-               /* KV: we are converting a non-pointer type to
-                * a generic pointer. This (ifdef'd out) code
-                * says that the resulting generic pointer 
-                * should have the same class as the storage
-                * location of the non-pointer variable.
-                * 
-                * For example, converting an int (which happens
-                * to be stored in DATA space) to a pointer results
-                * in a DATA generic pointer; if the original int
-                * in XDATA space, so will be the resulting pointer.
-                *
-                * I don't like that behavior, and thus this change:
-                * all such conversions will be forced to XDATA and
-                * throw a warning. If you want some non-XDATA
-                * type, or you want to suppress the warning, you
-                * must go through an intermediate cast, like so:
-                *
-                * char _generic *gp = (char _xdata *)(intVar);
-                */
-               sym_link *etype = getSpec(type);                 
-
-               /* we have to go by the storage class */
-               if (SPEC_OCLS(etype) != generic)
-               {
-                   p_type = PTR_TYPE(SPEC_OCLS(etype));
-               }
-               else
-#endif         
-               {
-                   /* Converting unknown class (i.e. register variable)
-                    * to generic pointer. This is not good, but
-                    * we'll make a guess (and throw a warning).
-                    */
-                   p_type = FPOINTER;
-                   werror(W_INT_TO_GEN_PTR_CAST);           
-               }
-           }
-               
-           /* the first two bytes are known */
-           size = GPTRSIZE - 1; 
-           offset = 0 ;
-           _startLazyDPSEvaluation();
-           while (size--) {
-               aopPut(AOP(result),
-                      aopGet(AOP(right),offset,FALSE,FALSE,FALSE),
-                      offset);
-               offset++;
-           }
-           _endLazyDPSEvaluation();
-           
-           /* the last byte depending on type */
-           switch (p_type) {
-           case IPOINTER:
-           case POINTER:
-               l = zero;
-               break;
-           case FPOINTER:
-               l = one;
-               break;
-           case CPOINTER:
-               l = "#0x02";
-               break;                          
-           case PPOINTER:
-               l = "#0x03";
-               break;
-               
-           default:
-               /* this should never happen */
-               werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                      "got unknown pointer type");
-               exit(1);
-           }
-           aopPut(AOP(result),l, GPTRSIZE - 1);            
-           goto release ;
-       }
-       
-       /* just copy the pointers */
-       size = AOP_SIZE(result);
-       offset = 0 ;
-       _startLazyDPSEvaluation();
-       while (size--) {
-           aopPut(AOP(result),
-                  aopGet(AOP(right),offset,FALSE,FALSE,FALSE),
-                  offset);
-           offset++;
-       }
-       _endLazyDPSEvaluation();
-       goto release ;
-    }
-    
+    /* KV: we are converting a non-pointer type to
+     * a generic pointer. This (ifdef'd out) code
+     * says that the resulting generic pointer
+     * should have the same class as the storage
+     * location of the non-pointer variable.
+     *
+     * For example, converting an int (which happens
+     * to be stored in DATA space) to a pointer results
+     * in a DATA generic pointer; if the original int
+     * in XDATA space, so will be the resulting pointer.
+     *
+     * I don't like that behavior, and thus this change:
+     * all such conversions will be forced to XDATA and
+     * throw a warning. If you want some non-XDATA
+     * type, or you want to suppress the warning, you
+     * must go through an intermediate cast, like so:
+     *
+     * char _generic *gp = (char _xdata *)(intVar);
+     */
+    sym_link *etype = getSpec(type);
+
+    /* we have to go by the storage class */
+    if (SPEC_OCLS(etype) != generic)
+    {
+        p_type = PTR_TYPE(SPEC_OCLS(etype));
+    }
+    else
+#endif
+    {
+        /* Converting unknown class (i.e. register variable)
+         * to generic pointer. This is not good, but
+         * we'll make a guess (and throw a warning).
+         */
+        p_type = FPOINTER;
+        werror(W_INT_TO_GEN_PTR_CAST);
+    }
+      }
+
+      /* the first two bytes are known */
+      size = GPTRSIZE - 1;
+      offset = 0 ;
+      _startLazyDPSEvaluation();
+      while (size--) {
+    aopPut(AOP(result),
+           aopGet(AOP(right),offset,FALSE,FALSE,FALSE),
+           offset);
+    offset++;
+      }
+      _endLazyDPSEvaluation();
+
+      /* the last byte depending on type */
+      switch (p_type) {
+      case IPOINTER:
+      case POINTER:
+    l = zero;
+    break;
+      case FPOINTER:
+    l = one;
+    break;
+      case CPOINTER:
+    l = "#0x02";
+    break;
+      case PPOINTER:
+    l = "#0x03";
+    break;
+
+      default:
+    /* this should never happen */
+          werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+           "got unknown pointer type");
+    exit(1);
+      }
+      aopPut(AOP(result),l, GPTRSIZE - 1);
+      goto release ;
+  }
+
+  /* just copy the pointers */
+  size = AOP_SIZE(result);
+  offset = 0 ;
+  _startLazyDPSEvaluation();
+  while (size--) {
+      aopPut(AOP(result),
+       aopGet(AOP(right),offset,FALSE,FALSE,FALSE),
+       offset);
+      offset++;
+  }
+  _endLazyDPSEvaluation();
+  goto release ;
+    }
+
     /* so we now know that the size of destination is greater
     than the size of the source */
     /* we move to result for the size of source */
@@ -8362,14 +8362,14 @@ static void genCast (iCode *ic)
     /* also, if the source is a bit, we don't need to sign extend, because
      * it can't possibly have set the sign bit.
      */
-    if (SPEC_USIGN(rtype) || !IS_SPEC(rtype) || AOP_TYPE(right) == AOP_CRY) 
+    if (SPEC_USIGN(rtype) || !IS_SPEC(rtype) || AOP_TYPE(right) == AOP_CRY)
     {
         while (size--)
         {
             aopPut(AOP(result),zero,offset++);
         }
-    } 
-    else 
+    }
+    else
     {
         /* we need to extend the sign :{ */
         char *l = aopGet(AOP(right),AOP_SIZE(right) - 1,
@@ -8378,7 +8378,7 @@ static void genCast (iCode *ic)
         emitcode("rlc","a");
         emitcode("subb","a,acc");
         while (size--)
-            aopPut(AOP(result),"a",offset++);   
+            aopPut(AOP(result),"a",offset++);
     }
 
     /* we are done hurray !!!! */
@@ -8396,47 +8396,47 @@ static int genDjnz (iCode *ic, iCode *ifx)
 {
     symbol *lbl, *lbl1;
     if (!ifx)
-       return 0;
-    
+  return 0;
+
     /* if the if condition has a false label
        then we cannot save */
     if (IC_FALSE(ifx))
-       return 0;
+  return 0;
 
-    /* if the minus is not of the form 
+    /* if the minus is not of the form
        a = a - 1 */
     if (!isOperandEqual(IC_RESULT(ic),IC_LEFT(ic)) ||
-       !IS_OP_LITERAL(IC_RIGHT(ic)))
-       return 0;
+  !IS_OP_LITERAL(IC_RIGHT(ic)))
+  return 0;
 
     if (operandLitValue(IC_RIGHT(ic)) != 1)
-       return 0;
+  return 0;
 
     /* if the size of this greater than one then no
        saving */
     if (getSize(operandType(IC_RESULT(ic))) > 1)
-       return 0;
+  return 0;
 
     /* otherwise we can save BIG */
     lbl = newiTempLabel(NULL);
     lbl1= newiTempLabel(NULL);
 
     aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
-    
+
     if (IS_AOP_PREG(IC_RESULT(ic))) {
-       emitcode("dec","%s",
-                aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,FALSE));
-       emitcode("mov","a,%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,FALSE));
-       emitcode("jnz","%05d$",lbl->key+100);
-    } else {   
-       emitcode ("djnz","%s,%05d$",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,FALSE),
-                 lbl->key+100);
+  emitcode("dec","%s",
+     aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,FALSE));
+  emitcode("mov","a,%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,FALSE));
+  emitcode("jnz","%05d$",lbl->key+100);
+    } else {
+  emitcode ("djnz","%s,%05d$",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE,FALSE),
+      lbl->key+100);
     }
     emitcode ("sjmp","%05d$",lbl1->key+100);
     emitcode ("","%05d$:",lbl->key+100);
     emitcode ("ljmp","%05d$",IC_TRUE(ifx)->key+100);
     emitcode ("","%05d$:",lbl1->key+100);
-    
+
     freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
     ifx->generated = 1;
     return 1;
@@ -8446,33 +8446,33 @@ static int genDjnz (iCode *ic, iCode *ifx)
 /* genReceive - generate code for a receive iCode                  */
 /*-----------------------------------------------------------------*/
 static void genReceive (iCode *ic)
-{    
+{
 
     D(emitcode(";", "genReceive "););
 
-    if (isOperandInFarSpace(IC_RESULT(ic)) && 
-       ( OP_SYMBOL(IC_RESULT(ic))->isspilt ||
-         IS_TRUE_SYMOP(IC_RESULT(ic))) ) {
-       int size = getSize(operandType(IC_RESULT(ic)));
-       int offset =  fReturnSize_390 - size;
-       while (size--) {
-           emitcode ("push","%s", (strcmp(fReturn[fReturnSize_390 - offset - 1],"a") ?
-                                   fReturn[fReturnSize_390 - offset - 1] : "acc"));
-           offset++;
-       }
-       aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
-       size = AOP_SIZE(IC_RESULT(ic));
-       offset = 0;
-       while (size--) {
-           emitcode ("pop","acc");
-           aopPut (AOP(IC_RESULT(ic)),"a",offset++);
-       }
-       
+    if (isOperandInFarSpace(IC_RESULT(ic)) &&
+  ( OP_SYMBOL(IC_RESULT(ic))->isspilt ||
+    IS_TRUE_SYMOP(IC_RESULT(ic))) ) {
+  int size = getSize(operandType(IC_RESULT(ic)));
+  int offset =  fReturnSize_390 - size;
+  while (size--) {
+      emitcode ("push","%s", (strcmp(fReturn[fReturnSize_390 - offset - 1],"a") ?
+            fReturn[fReturnSize_390 - offset - 1] : "acc"));
+      offset++;
+  }
+  aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
+  size = AOP_SIZE(IC_RESULT(ic));
+  offset = 0;
+  while (size--) {
+      emitcode ("pop","acc");
+      aopPut (AOP(IC_RESULT(ic)),"a",offset++);
+  }
+
     } else {
-       _G.accInUse++;
-       aopOp(IC_RESULT(ic),ic,FALSE, FALSE);  
-       _G.accInUse--;
-       assignResultValue(IC_RESULT(ic));       
+  _G.accInUse++;
+  aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
+  _G.accInUse--;
+  assignResultValue(IC_RESULT(ic));
     }
 
     freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
@@ -8492,243 +8492,243 @@ void gen390Code (iCode *lic)
     //REMOVE ME!!!
     /* print the allocation information */
     if (allocInfo)
-       printAllocInfo( currFunc, codeOutFile);
+  printAllocInfo( currFunc, codeOutFile);
 #endif
     /* if debug information required */
     if (options.debug && currFunc) {
     //jwk if (currFunc) {
-       cdbSymbol(currFunc,cdbFile,FALSE,TRUE);
-       _G.debugLine = 1;
-       if (IS_STATIC(currFunc->etype))
-           emitcode("","F%s$%s$0$0 ==.",moduleName,currFunc->name); 
-       else
-           emitcode("","G$%s$0$0 ==.",currFunc->name);
-       _G.debugLine = 0;
+  cdbSymbol(currFunc,cdbFile,FALSE,TRUE);
+  _G.debugLine = 1;
+  if (IS_STATIC(currFunc->etype))
+      emitcode("","F%s$%s$0$0 ==.",moduleName,currFunc->name);
+  else
+      emitcode("","G$%s$0$0 ==.",currFunc->name);
+  _G.debugLine = 0;
     }
     /* stack pointer name */
     if (options.useXstack)
-       spname = "_spx";
+  spname = "_spx";
     else
-       spname = "sp";
-    
+  spname = "sp";
+
+
     for (ic = lic ; ic ; ic = ic->next ) {
-       
-       if ( cln != ic->lineno ) {
-           if ( options.debug ) {
-               _G.debugLine = 1;
-               emitcode("","C$%s$%d$%d$%d ==.",
-                        ic->filename,ic->lineno,
-                        ic->level,ic->block);
-               _G.debugLine = 0;
-           }
-           emitcode(";","%s %d",ic->filename,ic->lineno);
-           cln = ic->lineno ;
-       }
-       /* if the result is marked as
-          spilt and rematerializable or code for
-          this has already been generated then
-          do nothing */
-       if (resultRemat(ic) || ic->generated ) 
-           continue ;
-       
-       /* depending on the operation */
-       switch (ic->op) {
-       case '!' :
-           genNot(ic);
-           break;
-           
-       case '~' :
-           genCpl(ic);
-           break;
-           
-       case UNARYMINUS:
-           genUminus (ic);
-           break;
-           
-       case IPUSH:
-           genIpush (ic);
-           break;
-           
-       case IPOP:
-           /* IPOP happens only when trying to restore a 
-              spilt live range, if there is an ifx statement
-              following this pop then the if statement might
-              be using some of the registers being popped which
-              would destory the contents of the register so
-              we need to check for this condition and handle it */
-           if (ic->next            && 
-               ic->next->op == IFX &&
-               regsInCommon(IC_LEFT(ic),IC_COND(ic->next))) 
-               genIfx (ic->next,ic);
-           else
-               genIpop (ic);
-           break; 
-           
-       case CALL:
-           genCall (ic);
-           break;
-           
-       case PCALL:
-           genPcall (ic);
-           break;
-           
-       case FUNCTION:
-           genFunction (ic);
-           break;
-           
-       case ENDFUNCTION:
-           genEndFunction (ic);
-           break;
-           
-       case RETURN:
-           genRet (ic);
-           break;
-           
-       case LABEL:
-           genLabel (ic);
-           break;
-           
-       case GOTO:
-           genGoto (ic);
-           break;
-           
-       case '+' :
-           genPlus (ic) ;
-           break;
-           
-       case '-' :
-           if ( ! genDjnz (ic,ifxForOp(IC_RESULT(ic),ic)))
-               genMinus (ic);
-           break;
-           
-       case '*' :
-           genMult (ic);
-           break;
-           
-       case '/' :
-           genDiv (ic) ;
-           break;
-           
-       case '%' :
-           genMod (ic);
-           break;
-           
-       case '>' :
-           genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic));                 
-           break;
-           
-       case '<' :
-           genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case LE_OP:
-       case GE_OP:
-       case NE_OP:
-           
-           /* note these two are xlated by algebraic equivalence
-              during parsing SDCC.y */
-           werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                  "got '>=' or '<=' shouldn't have come here");
-           break;      
-           
-       case EQ_OP:
-           genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;          
-           
-       case AND_OP:
-           genAndOp (ic);
-           break;
-           
-       case OR_OP:
-           genOrOp (ic);
-           break;
-           
-       case '^' :
-           genXor (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case '|' :
-               genOr (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case BITWISEAND:
+
+  if ( cln != ic->lineno ) {
+      if ( options.debug ) {
+    _G.debugLine = 1;
+    emitcode("","C$%s$%d$%d$%d ==.",
+       ic->filename,ic->lineno,
+       ic->level,ic->block);
+    _G.debugLine = 0;
+      }
+      emitcode(";","%s %d",ic->filename,ic->lineno);
+      cln = ic->lineno ;
+  }
+  /* if the result is marked as
+     spilt and rematerializable or code for
+     this has already been generated then
+     do nothing */
+  if (resultRemat(ic) || ic->generated )
+      continue ;
+
+  /* depending on the operation */
+  switch (ic->op) {
+  case '!' :
+      genNot(ic);
+      break;
+
+  case '~' :
+      genCpl(ic);
+      break;
+
+  case UNARYMINUS:
+      genUminus (ic);
+      break;
+
+  case IPUSH:
+      genIpush (ic);
+      break;
+
+  case IPOP:
+      /* IPOP happens only when trying to restore a
+         spilt live range, if there is an ifx statement
+         following this pop then the if statement might
+         be using some of the registers being popped which
+         would destory the contents of the register so
+         we need to check for this condition and handle it */
+      if (ic->next            &&
+    ic->next->op == IFX &&
+    regsInCommon(IC_LEFT(ic),IC_COND(ic->next)))
+    genIfx (ic->next,ic);
+      else
+    genIpop (ic);
+      break;
+
+  case CALL:
+      genCall (ic);
+      break;
+
+  case PCALL:
+      genPcall (ic);
+      break;
+
+  case FUNCTION:
+      genFunction (ic);
+      break;
+
+  case ENDFUNCTION:
+      genEndFunction (ic);
+      break;
+
+  case RETURN:
+      genRet (ic);
+      break;
+
+  case LABEL:
+      genLabel (ic);
+      break;
+
+  case GOTO:
+      genGoto (ic);
+      break;
+
+  case '+' :
+      genPlus (ic) ;
+      break;
+
+  case '-' :
+      if ( ! genDjnz (ic,ifxForOp(IC_RESULT(ic),ic)))
+    genMinus (ic);
+      break;
+
+  case '*' :
+      genMult (ic);
+      break;
+
+  case '/' :
+      genDiv (ic) ;
+      break;
+
+  case '%' :
+      genMod (ic);
+      break;
+
+  case '>' :
+      genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case '<' :
+      genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case LE_OP:
+  case GE_OP:
+  case NE_OP:
+
+      /* note these two are xlated by algebraic equivalence
+         during parsing SDCC.y */
+      werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+       "got '>=' or '<=' shouldn't have come here");
+      break;
+
+  case EQ_OP:
+      genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case AND_OP:
+      genAndOp (ic);
+      break;
+
+  case OR_OP:
+      genOrOp (ic);
+      break;
+
+  case '^' :
+      genXor (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case '|' :
+    genOr (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case BITWISEAND:
             genAnd (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case INLINEASM:
-           genInline (ic);
-           break;
-           
-       case RRC:
-           genRRC (ic);
-           break;
-           
-       case RLC:
-           genRLC (ic);
-           break;
-           
-       case GETHBIT:
-           genGetHbit (ic);
-           break;
-           
-       case LEFT_OP:
-           genLeftShift (ic);
-           break;
-           
-       case RIGHT_OP:
-           genRightShift (ic);
-           break;
-           
-       case GET_VALUE_AT_ADDRESS:
-           genPointerGet(ic);
-           break;
-           
-       case '=' :
-           if (POINTER_SET(ic))
-               genPointerSet(ic);
-           else
-               genAssign(ic);
-           break;
-           
-       case IFX:
-           genIfx (ic,NULL);
-           break;
-           
-       case ADDRESS_OF:
-           genAddrOf (ic);
-           break;
-           
-       case JUMPTABLE:
-           genJumpTab (ic);
-           break;
-           
-       case CAST:
-           genCast (ic);
-           break;
-           
-       case RECEIVE:
-           genReceive(ic);
-           break;
-           
-       case SEND:
-           addSet(&_G.sendSet,ic);
-           break;
-
-       default :
-           ic = ic;
-           /*      piCode(ic,stdout); */
-           
+      break;
+
+  case INLINEASM:
+      genInline (ic);
+      break;
+
+  case RRC:
+      genRRC (ic);
+      break;
+
+  case RLC:
+      genRLC (ic);
+      break;
+
+  case GETHBIT:
+      genGetHbit (ic);
+      break;
+
+  case LEFT_OP:
+      genLeftShift (ic);
+      break;
+
+  case RIGHT_OP:
+      genRightShift (ic);
+      break;
+
+  case GET_VALUE_AT_ADDRESS:
+      genPointerGet(ic);
+      break;
+
+  case '=' :
+      if (POINTER_SET(ic))
+    genPointerSet(ic);
+      else
+    genAssign(ic);
+      break;
+
+  case IFX:
+      genIfx (ic,NULL);
+      break;
+
+  case ADDRESS_OF:
+      genAddrOf (ic);
+      break;
+
+  case JUMPTABLE:
+      genJumpTab (ic);
+      break;
+
+  case CAST:
+      genCast (ic);
+      break;
+
+  case RECEIVE:
+      genReceive(ic);
+      break;
+
+  case SEND:
+      addSet(&_G.sendSet,ic);
+      break;
+
+  default :
+      ic = ic;
+      /*      piCode(ic,stdout); */
+
         }
     }
-    
 
-    /* now we are ready to call the 
+
+    /* now we are ready to call the
        peep hole optimizer */
     if (!options.nopeep)
-       peepHole (&lineHead);
+  peepHole (&lineHead);
 
     /* now do the actual printing */
-    printLine (lineHead,codeOutFile);    
+    printLine (lineHead,codeOutFile);
     return;
 }
index 22f17582ade1aa0a3994ccbe72555a1c0d8ad3c0..634d2fa6dea68594ade84c0d893b9b237d4495af 100644 (file)
@@ -1,31 +1,31 @@
 /*-------------------------------------------------------------------------
   SDCCgen51.c - source file for code generation for 8051
-  
+
   Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
          and -  Jean-Louis VERN.jlvern@writeme.com (1999)
   Bug Fixes  -  Wojciech Stryjewski  wstryj1@tiger.lsu.edu (1999 v2.1.9a)
-  
+
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
-  
+
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  
+
   In other words, you are welcome to use, share and improve this program.
   You are forbidden to forbid anyone else to use, share and improve
   what you give them.   Help stamp out software-hoarding!
-  
+
   Notes:
-  000123 mlh   Moved aopLiteral to SDCCglue.c to help the split
-               Made everything static
+  000123 mlh  Moved aopLiteral to SDCCglue.c to help the split
+      Made everything static
 -------------------------------------------------------------------------*/
 
 #include <stdio.h>
@@ -56,7 +56,7 @@
 char *aopLiteral (value *val, int offset);
 extern int allocInfo;
 
-/* this is the down and dirty file with all kinds of 
+/* this is the down and dirty file with all kinds of
    kludgy & hacky stuff. This is what it is all about
    CODE GENERATION for a specific MCU . some of the
    routines may be reusable, will have to see */
@@ -114,23 +114,23 @@ static unsigned char   SRMask[] = {0xFF, 0x7F, 0x3F, 0x1F, 0x0F,
 static void emitcode (char *inst,char *fmt, ...)
 {
     va_list ap;
-    char lb[MAX_INLINEASM];  
+    char lb[MAX_INLINEASM];
     char *lbp = lb;
 
-    va_start(ap,fmt);   
+    va_start(ap,fmt);
 
     if (inst && *inst) {
-       if (fmt && *fmt)
-           sprintf(lb,"%s\t",inst);
-       else
-           sprintf(lb,"%s",inst);
+  if (fmt && *fmt)
+      sprintf(lb,"%s\t",inst);
+  else
+      sprintf(lb,"%s",inst);
         vsprintf(lb+(strlen(lb)),fmt,ap);
     }  else
         vsprintf(lb,fmt,ap);
 
     while (isspace(*lbp)) lbp++;
 
-    if (lbp && *lbp) 
+    if (lbp && *lbp)
         lineCurr = (lineCurr ?
                     connectLine(lineCurr,newLineNode(lb)) :
                     (lineHead = newLineNode(lb)));
@@ -153,9 +153,9 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
     /* first check if r0 & r1 are used by this
     instruction, in which case we are in trouble */
     if ((r0iu = bitVectBitValue(ic->rUsed,R0_IDX)) &&
-        (r1iu = bitVectBitValue(ic->rUsed,R1_IDX))) 
+        (r1iu = bitVectBitValue(ic->rUsed,R1_IDX)))
     {
-        goto endOfWorld;      
+        goto endOfWorld;
     }
 
     r0ou = bitVectBitValue(ic->rMask,R0_IDX);
@@ -165,7 +165,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
     if (!r0iu && !r0ou) {
         ic->rUsed = bitVectSetBit(ic->rUsed,R0_IDX);
         (*aopp)->type = AOP_R0;
-        
+
         return (*aopp)->aopu.aop_ptr = mcs51_regWithIdx(R0_IDX);
     }
 
@@ -175,7 +175,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
         (*aopp)->type = AOP_R1;
 
         return (*aopp)->aopu.aop_ptr = mcs51_regWithIdx(R1_IDX);
-    }    
+    }
 
     /* now we know they both have usage */
     /* if r0 not used in this instruction */
@@ -186,7 +186,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
                       mcs51_regWithIdx(R0_IDX)->dname);
             _G.r0Pushed++ ;
         }
-        
+
         ic->rUsed = bitVectSetBit(ic->rUsed,R0_IDX);
         (*aopp)->type = AOP_R0;
 
@@ -202,7 +202,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
                       mcs51_regWithIdx(R1_IDX)->dname);
             _G.r1Pushed++ ;
         }
-        
+
         ic->rUsed = bitVectSetBit(ic->rUsed,R1_IDX);
         (*aopp)->type = AOP_R1;
         return mcs51_regWithIdx(R1_IDX);
@@ -212,7 +212,7 @@ endOfWorld :
     /* I said end of world but not quite end of world yet */
     /* if this is a result then we can push it on the stack*/
     if (result) {
-        (*aopp)->type = AOP_STK;    
+        (*aopp)->type = AOP_STK;
         return NULL;
     }
 
@@ -230,7 +230,7 @@ static asmop *newAsmop (short type)
 {
     asmop *aop;
 
-    aop = Safe_calloc(sizeof(asmop));
+    aop = Safe_calloc(1,sizeof(asmop));
     aop->type = type;
     return aop;
 }
@@ -273,13 +273,13 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
 
     /* assign depending on the storage class */
     /* if it is on the stack or indirectly addressable */
-    /* space we need to assign either r0 or r1 to it   */    
+    /* space we need to assign either r0 or r1 to it   */
     if ((sym->onStack && !options.stack10bit) || sym->iaccess) {
         sym->aop = aop = newAsmop(0);
         aop->aopu.aop_ptr = getFreePtr(ic,&aop,result);
         aop->size = getSize(sym->type);
 
-        /* now assign the address of the variable to 
+        /* now assign the address of the variable to
         the pointer register */
         if (aop->type != AOP_STK) {
 
@@ -290,8 +290,8 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
                     emitcode("mov","a,_bp");
                     emitcode("add","a,#0x%02x",
                              ((sym->stack < 0) ?
-                             ((char)(sym->stack - _G.nRegsSaved )) :
-                             ((char)sym->stack)) & 0xff);
+            ((char)(sym->stack - _G.nRegsSaved )) :
+            ((char)sym->stack)) & 0xff);
                     emitcode("mov","%s,a",
                              aop->aopu.aop_ptr->name);
 
@@ -306,34 +306,34 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
             aop->aopu.aop_stk = sym->stack;
         return aop;
     }
-    
+
     if (sym->onStack && options.stack10bit)
     {
         /* It's on the 10 bit stack, which is located in
          * far data space.
          */
-         
+
         if ( _G.accInUse )
-               emitcode("push","acc");
+          emitcode("push","acc");
 
         emitcode("mov","a,_bp");
         emitcode("add","a,#0x%02x",
                  ((sym->stack < 0) ?
                    ((char)(sym->stack - _G.nRegsSaved )) :
                    ((char)sym->stack)) & 0xff);
-        
+
         genSetDPTR(1);
         emitcode ("mov","dpx1,#0x40");
         emitcode ("mov","dph1,#0x00");
         emitcode ("mov","dpl1, a");
         genSetDPTR(0);
-       
+
         if ( _G.accInUse )
             emitcode("pop","acc");
-            
+
         sym->aop = aop = newAsmop(AOP_DPTR2);
-       aop->size = getSize(sym->type); 
-       return aop;
+      aop->size = getSize(sym->type);
+      return aop;
     }
 
     /* if in bit space */
@@ -352,11 +352,11 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
     }
 
     /* special case for a function */
-    if (IS_FUNC(sym->type)) {   
-        sym->aop = aop = newAsmop(AOP_IMMD);    
-        aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
+    if (IS_FUNC(sym->type)) {
+        sym->aop = aop = newAsmop(AOP_IMMD);
+        aop->aopu.aop_immd = Safe_calloc(1,strlen(sym->rname)+1);
         strcpy(aop->aopu.aop_immd,sym->rname);
-        aop->size = FPTRSIZE; 
+        aop->size = FPTRSIZE;
         return aop;
     }
 
@@ -370,7 +370,7 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
     if (IN_CODESPACE(space))
         aop->code = 1;
 
-    return aop;     
+    return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -383,27 +383,27 @@ static asmop *aopForRemat (symbol *sym)
     int val = 0;
 
     for (;;) {
-       if (ic->op == '+')
-           val += operandLitValue(IC_RIGHT(ic));
-       else if (ic->op == '-')
-           val -= operandLitValue(IC_RIGHT(ic));
-       else
-           break;
-       
-       ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode;
+      if (ic->op == '+')
+      val += operandLitValue(IC_RIGHT(ic));
+  else if (ic->op == '-')
+      val -= operandLitValue(IC_RIGHT(ic));
+  else
+      break;
+
+  ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode;
     }
 
     if (val)
-       sprintf(buffer,"(%s %c 0x%04x)",
-               OP_SYMBOL(IC_LEFT(ic))->rname, 
-               val >= 0 ? '+' : '-',
-               abs(val) & 0xffff);
+      sprintf(buffer,"(%s %c 0x%04x)",
+          OP_SYMBOL(IC_LEFT(ic))->rname,
+    val >= 0 ? '+' : '-',
+    abs(val) & 0xffff);
     else
-       strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
+  strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
 
-    aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
-    strcpy(aop->aopu.aop_immd,buffer);    
-    return aop;        
+    aop->aopu.aop_immd = Safe_calloc(1,strlen(buffer)+1);
+    strcpy(aop->aopu.aop_immd,buffer);
+    return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -458,8 +458,8 @@ static bool operandsEqu ( operand *op1, operand *op2)
     /* if both are itemps & one is spilt
        and the other is not then false */
     if (IS_ITEMP(op1) && IS_ITEMP(op2) &&
-       sym1->isspilt != sym2->isspilt )
-       return FALSE ;
+  sym1->isspilt != sym2->isspilt )
+  return FALSE ;
 
     /* if they are the same */
     if (sym1 == sym2)
@@ -470,16 +470,16 @@ static bool operandsEqu ( operand *op1, operand *op2)
 
 
     /* if left is a tmp & right is not */
-    if (IS_ITEMP(op1)  && 
+    if (IS_ITEMP(op1)  &&
         !IS_ITEMP(op2) &&
         sym1->isspilt  &&
         (sym1->usl.spillLoc == sym2))
         return TRUE;
 
-    if (IS_ITEMP(op2)  && 
+    if (IS_ITEMP(op2)  &&
         !IS_ITEMP(op1) &&
         sym2->isspilt  &&
-       sym1->level > 0 &&
+  sym1->level > 0 &&
         (sym2->usl.spillLoc == sym1))
         return TRUE ;
 
@@ -542,7 +542,7 @@ static void aopOp (operand *op, iCode *ic, bool result)
     }
 
     /* if this is a true symbol */
-    if (IS_TRUE_SYMOP(op)) {    
+    if (IS_TRUE_SYMOP(op)) {
         op->aop = aopForSym(ic,OP_SYMBOL(op),result);
         return ;
     }
@@ -551,8 +551,8 @@ static void aopOp (operand *op, iCode *ic, bool result)
     only four choices :
     a) register
     b) spillocation
-    c) rematerialize 
-    d) conditional   
+    c) rematerialize
+    d) conditional
     e) can be a return use only */
 
     sym = OP_SYMBOL(op);
@@ -566,7 +566,7 @@ static void aopOp (operand *op, iCode *ic, bool result)
     }
 
     /* if it is spilt then two situations
-    a) is rematerialize 
+    a) is rematerialize
     b) has a spill location */
     if (sym->isspilt || sym->nRegs == 0) {
 
@@ -578,14 +578,14 @@ static void aopOp (operand *op, iCode *ic, bool result)
             return;
         }
 
-       if (sym->accuse) {
-           int i;
+  if (sym->accuse) {
+      int i;
             aop = op->aop = sym->aop = newAsmop(AOP_ACC);
             aop->size = getSize(sym->type);
             for ( i = 0 ; i < 2 ; i++ )
                 aop->aopu.aop_str[i] = accUse[i];
-            return;  
-       }
+            return;
+  }
 
         if (sym->ruonly ) {
             int i;
@@ -597,7 +597,7 @@ static void aopOp (operand *op, iCode *ic, bool result)
         }
 
         /* else spill location  */
-        sym->aop = op->aop = aop = 
+        sym->aop = op->aop = aop =
                                   aopForSym(ic,sym->usl.spillLoc,result);
         aop->size = getSize(sym->type);
         return;
@@ -614,19 +614,19 @@ static void aopOp (operand *op, iCode *ic, bool result)
 /* freeAsmop - free up the asmop given to an operand               */
 /*----------------------------------------------------------------*/
 static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
-{   
+{
     asmop *aop ;
 
     if (!op)
         aop = aaop;
-    else 
+    else
         aop = op->aop;
 
     if (!aop)
         return ;
 
     if (aop->freed)
-        goto dealloc; 
+        goto dealloc;
 
     aop->freed = 1;
 
@@ -636,7 +636,7 @@ static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
         case AOP_R0 :
             if (_G.r0Pushed ) {
                 if (pop) {
-                    emitcode ("pop","ar0");     
+                    emitcode ("pop","ar0");
                     _G.r0Pushed--;
                 }
             }
@@ -650,27 +650,27 @@ static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
                     _G.r1Pushed--;
                 }
             }
-            bitVectUnSetBit(ic->rUsed,R1_IDX);          
+            bitVectUnSetBit(ic->rUsed,R1_IDX);
             break;
 
         case AOP_STK :
         {
-            int sz = aop->size;    
+            int sz = aop->size;
             int stk = aop->aopu.aop_stk + aop->size;
             bitVectUnSetBit(ic->rUsed,R0_IDX);
-            bitVectUnSetBit(ic->rUsed,R1_IDX);          
+            bitVectUnSetBit(ic->rUsed,R1_IDX);
 
             getFreePtr(ic,&aop,FALSE);
-            
+
             if (options.stack10bit)
             {
                 /* I'm not sure what to do here yet... */
                 /* #STUB */
-               fprintf(stderr, 
-                       "*** Warning: probably generating bad code for "
-                       "10 bit stack mode.\n");
+              fprintf(stderr,
+                "*** Warning: probably generating bad code for "
+                "10 bit stack mode.\n");
             }
-            
+
             if (stk) {
                 emitcode ("mov","a,_bp");
                 emitcode ("add","a,#0x%02x",((char)stk) & 0xff);
@@ -695,7 +695,7 @@ static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
             if (_G.r1Pushed) {
                 emitcode("pop","ar1");
                 _G.r1Pushed--;
-            }       
+            }
         }
     }
 
@@ -704,9 +704,9 @@ dealloc:
     if (op ) {
         op->aop = NULL;
         if (IS_SYMOP(op)) {
-            OP_SYMBOL(op)->aop = NULL;    
+            OP_SYMBOL(op)->aop = NULL;
             /* if the symbol has a spill */
-           if (SPIL_LOC(op))
+      if (SPIL_LOC(op))
                 SPIL_LOC(op)->aop = NULL;
         }
     }
@@ -728,119 +728,119 @@ static char *aopGet (asmop *aop, int offset, bool bit16, bool dname)
 
     /* depending on type */
     switch (aop->type) {
-       
+
     case AOP_R0:
     case AOP_R1:
-       /* if we need to increment it */       
-       while (offset > aop->coff) {        
-           emitcode ("inc","%s",aop->aopu.aop_ptr->name);  
-           aop->coff++;
-       }
-       
-       while (offset < aop->coff) {
-           emitcode("dec","%s",aop->aopu.aop_ptr->name);
-           aop->coff--;
-       }
-       
-       aop->coff = offset ;
-       if (aop->paged) {
-           emitcode("movx","a,@%s",aop->aopu.aop_ptr->name);
-           return (dname ? "acc" : "a");
-       }       
-       sprintf(s,"@%s",aop->aopu.aop_ptr->name);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  /* if we need to increment it */
+  while (offset > aop->coff) {
+      emitcode ("inc","%s",aop->aopu.aop_ptr->name);
+      aop->coff++;
+  }
+
+  while (offset < aop->coff) {
+      emitcode("dec","%s",aop->aopu.aop_ptr->name);
+      aop->coff--;
+  }
+
+  aop->coff = offset ;
+  if (aop->paged) {
+      emitcode("movx","a,@%s",aop->aopu.aop_ptr->name);
+      return (dname ? "acc" : "a");
+  }
+  sprintf(s,"@%s",aop->aopu.aop_ptr->name);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_DPTR:
     case AOP_DPTR2:
-    
+
     if (aop->type == AOP_DPTR2)
     {
         genSetDPTR(1);
     }
-    
-       while (offset > aop->coff) {
-           emitcode ("inc","dptr");
-           aop->coff++;
-       }
-       
-       while (offset < aop->coff) {        
-           emitcode("lcall","__decdptr");
-           aop->coff--;
-       }
-       
-       aop->coff = offset;
-       if (aop->code) {
-           emitcode("clr","a");
-           emitcode("movc","a,@a+dptr");
+
+  while (offset > aop->coff) {
+      emitcode ("inc","dptr");
+      aop->coff++;
+  }
+
+  while (offset < aop->coff) {
+      emitcode("lcall","__decdptr");
+      aop->coff--;
+  }
+
+  aop->coff = offset;
+  if (aop->code) {
+      emitcode("clr","a");
+      emitcode("movc","a,@a+dptr");
         }
     else {
-           emitcode("movx","a,@dptr");
+      emitcode("movx","a,@dptr");
     }
-           
+
     if (aop->type == AOP_DPTR2)
     {
         genSetDPTR(0);
     }
-           
+
     return (dname ? "acc" : "a");
-       
-       
+
+
     case AOP_IMMD:
-       if (bit16) 
-           sprintf (s,"#%s",aop->aopu.aop_immd);
-       else
-           if (offset) 
-               sprintf(s,"#(%s >> %d)",
-                       aop->aopu.aop_immd,
-                       offset*8);
-           else
-               sprintf(s,"#%s",
-                       aop->aopu.aop_immd);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  if (bit16)
+      sprintf (s,"#%s",aop->aopu.aop_immd);
+  else
+      if (offset)
+    sprintf(s,"#(%s >> %d)",
+      aop->aopu.aop_immd,
+      offset*8);
+      else
+    sprintf(s,"#%s",
+      aop->aopu.aop_immd);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_DIR:
-       if (offset)
-           sprintf(s,"(%s + %d)",
-                   aop->aopu.aop_dir,
-                   offset);
-       else
-           sprintf(s,"%s",aop->aopu.aop_dir);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  if (offset)
+      sprintf(s,"(%s + %d)",
+        aop->aopu.aop_dir,
+        offset);
+  else
+      sprintf(s,"%s",aop->aopu.aop_dir);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_REG:
-       if (dname) 
-           return aop->aopu.aop_reg[offset]->dname;
-       else
-           return aop->aopu.aop_reg[offset]->name;
-       
+  if (dname)
+      return aop->aopu.aop_reg[offset]->dname;
+  else
+      return aop->aopu.aop_reg[offset]->name;
+
     case AOP_CRY:
-       emitcode("clr","a");
-       emitcode("mov","c,%s",aop->aopu.aop_dir);
-       emitcode("rlc","a") ;
-       return (dname ? "acc" : "a");
-       
+  emitcode("clr","a");
+  emitcode("mov","c,%s",aop->aopu.aop_dir);
+  emitcode("rlc","a") ;
+  return (dname ? "acc" : "a");
+
     case AOP_ACC:
-       if (!offset && dname)
-           return "acc";
-       return aop->aopu.aop_str[offset];
+  if (!offset && dname)
+      return "acc";
+  return aop->aopu.aop_str[offset];
 
     case AOP_LIT:
-       return aopLiteral (aop->aopu.aop_lit,offset);
-       
+  return aopLiteral (aop->aopu.aop_lit,offset);
+
     case AOP_STR:
-       aop->coff = offset ;
-       if (strcmp(aop->aopu.aop_str[offset],"a") == 0 &&
-           dname)
-           return "acc";
-       
-       return aop->aopu.aop_str[offset];
-       
+  aop->coff = offset ;
+  if (strcmp(aop->aopu.aop_str[offset],"a") == 0 &&
+      dname)
+      return "acc";
+
+  return aop->aopu.aop_str[offset];
+
     }
 
     werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
@@ -865,169 +865,169 @@ static void aopPut (asmop *aop, char *s, int offset)
     /* depending on where it is ofcourse */
     switch (aop->type) {
     case AOP_DIR:
-       if (offset)
-           sprintf(d,"(%s + %d)",
-                   aop->aopu.aop_dir,offset);
-       else
-           sprintf(d,"%s",aop->aopu.aop_dir);
-       
-       if (strcmp(d,s))
-           emitcode("mov","%s,%s",d,s);
-       
-       break;
-       
+  if (offset)
+      sprintf(d,"(%s + %d)",
+        aop->aopu.aop_dir,offset);
+  else
+      sprintf(d,"%s",aop->aopu.aop_dir);
+
+  if (strcmp(d,s))
+      emitcode("mov","%s,%s",d,s);
+
+  break;
+
     case AOP_REG:
-       if (strcmp(aop->aopu.aop_reg[offset]->name,s) != 0 &&
-           strcmp(aop->aopu.aop_reg[offset]->dname,s)!= 0){
-           if (*s == '@'           ||
-               strcmp(s,"r0") == 0 ||
-               strcmp(s,"r1") == 0 ||
-               strcmp(s,"r2") == 0 ||
-               strcmp(s,"r3") == 0 ||
-               strcmp(s,"r4") == 0 ||
-               strcmp(s,"r5") == 0 ||
-               strcmp(s,"r6") == 0 || 
-               strcmp(s,"r7") == 0 )
-               emitcode("mov","%s,%s",
-                        aop->aopu.aop_reg[offset]->dname,s);
-           else
-               emitcode("mov","%s,%s",
-                        aop->aopu.aop_reg[offset]->name,s);
-       }
-       break;
-       
+  if (strcmp(aop->aopu.aop_reg[offset]->name,s) != 0 &&
+      strcmp(aop->aopu.aop_reg[offset]->dname,s)!= 0){
+      if (*s == '@'           ||
+    strcmp(s,"r0") == 0 ||
+    strcmp(s,"r1") == 0 ||
+    strcmp(s,"r2") == 0 ||
+    strcmp(s,"r3") == 0 ||
+    strcmp(s,"r4") == 0 ||
+    strcmp(s,"r5") == 0 ||
+    strcmp(s,"r6") == 0 ||
+    strcmp(s,"r7") == 0 )
+    emitcode("mov","%s,%s",
+       aop->aopu.aop_reg[offset]->dname,s);
+      else
+    emitcode("mov","%s,%s",
+       aop->aopu.aop_reg[offset]->name,s);
+  }
+  break;
+
     case AOP_DPTR:
     case AOP_DPTR2:
-    
+
     if (aop->type == AOP_DPTR2)
     {
         genSetDPTR(1);
     }
-    
-       if (aop->code) {
-           werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                  "aopPut writting to code space");
-           exit(0);
-       }
-       
-       while (offset > aop->coff) {
-           aop->coff++;
-           emitcode ("inc","dptr");
-       }
-       
-       while (offset < aop->coff) {
-           aop->coff-- ;
-           emitcode("lcall","__decdptr");
-       }
-       
-       aop->coff = offset;
-       
-       /* if not in accumulater */
-       MOVA(s);        
-       
-       emitcode ("movx","@dptr,a");
-       
+
+  if (aop->code) {
+      werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+       "aopPut writting to code space");
+      exit(0);
+  }
+
+  while (offset > aop->coff) {
+      aop->coff++;
+      emitcode ("inc","dptr");
+  }
+
+  while (offset < aop->coff) {
+      aop->coff-- ;
+      emitcode("lcall","__decdptr");
+  }
+
+  aop->coff = offset;
+
+  /* if not in accumulater */
+  MOVA(s);
+
+  emitcode ("movx","@dptr,a");
+
     if (aop->type == AOP_DPTR2)
     {
         genSetDPTR(0);
     }
-       break;
-       
+  break;
+
     case AOP_R0:
     case AOP_R1:
-       while (offset > aop->coff) {
-           aop->coff++;
-           emitcode("inc","%s",aop->aopu.aop_ptr->name);
-       }
-       while (offset < aop->coff) {
-           aop->coff-- ;
-           emitcode ("dec","%s",aop->aopu.aop_ptr->name);
-       }
-       aop->coff = offset;
-       
-       if (aop->paged) {
-           MOVA(s);           
-           emitcode("movx","@%s,a",aop->aopu.aop_ptr->name);
-           
-       } else
-           if (*s == '@') {
-               MOVA(s);
-               emitcode("mov","@%s,a",aop->aopu.aop_ptr->name);
-           } else
-               if (strcmp(s,"r0") == 0 ||
-                   strcmp(s,"r1") == 0 ||
-                   strcmp(s,"r2") == 0 ||
-                   strcmp(s,"r3") == 0 ||
-                   strcmp(s,"r4") == 0 ||
-                   strcmp(s,"r5") == 0 ||
-                   strcmp(s,"r6") == 0 || 
-                   strcmp(s,"r7") == 0 ) {
-                   char buffer[10];
-                   sprintf(buffer,"a%s",s);
-                   emitcode("mov","@%s,%s",
-                            aop->aopu.aop_ptr->name,buffer);
-               } else
-                   emitcode("mov","@%s,%s",aop->aopu.aop_ptr->name,s);
-       
-       break;
-       
+  while (offset > aop->coff) {
+      aop->coff++;
+      emitcode("inc","%s",aop->aopu.aop_ptr->name);
+  }
+  while (offset < aop->coff) {
+      aop->coff-- ;
+      emitcode ("dec","%s",aop->aopu.aop_ptr->name);
+  }
+  aop->coff = offset;
+
+  if (aop->paged) {
+      MOVA(s);
+      emitcode("movx","@%s,a",aop->aopu.aop_ptr->name);
+
+  } else
+      if (*s == '@') {
+    MOVA(s);
+    emitcode("mov","@%s,a",aop->aopu.aop_ptr->name);
+      } else
+    if (strcmp(s,"r0") == 0 ||
+        strcmp(s,"r1") == 0 ||
+        strcmp(s,"r2") == 0 ||
+        strcmp(s,"r3") == 0 ||
+        strcmp(s,"r4") == 0 ||
+        strcmp(s,"r5") == 0 ||
+        strcmp(s,"r6") == 0 ||
+        strcmp(s,"r7") == 0 ) {
+        char buffer[10];
+        sprintf(buffer,"a%s",s);
+        emitcode("mov","@%s,%s",
+           aop->aopu.aop_ptr->name,buffer);
+    } else
+        emitcode("mov","@%s,%s",aop->aopu.aop_ptr->name,s);
+
+  break;
+
     case AOP_STK:
-       if (strcmp(s,"a") == 0)
-           emitcode("push","acc");
-       else
-           emitcode("push","%s",s);
-       
-       break;
-       
+  if (strcmp(s,"a") == 0)
+      emitcode("push","acc");
+  else
+      emitcode("push","%s",s);
+
+  break;
+
     case AOP_CRY:
-       /* if bit variable */
-       if (!aop->aopu.aop_dir) {
-           emitcode("clr","a");
-           emitcode("rlc","a");
-       } else {
-           if (s == zero) 
-               emitcode("clr","%s",aop->aopu.aop_dir);
-           else
-               if (s == one)
-                   emitcode("setb","%s",aop->aopu.aop_dir);
-               else
-                   if (!strcmp(s,"c"))
-                       emitcode("mov","%s,c",aop->aopu.aop_dir);
-                   else {
-                       lbl = newiTempLabel(NULL);
-                       
-                       if (strcmp(s,"a")) {
-                           MOVA(s);
-                       }
-                       emitcode("clr","c");
-                       emitcode("jz","%05d$",lbl->key+100);
-                       emitcode("cpl","c");
-                       emitcode("","%05d$:",lbl->key+100);
-                       emitcode("mov","%s,c",aop->aopu.aop_dir);
-                   }
-       }
-       break;
-       
+  /* if bit variable */
+  if (!aop->aopu.aop_dir) {
+      emitcode("clr","a");
+      emitcode("rlc","a");
+  } else {
+      if (s == zero)
+    emitcode("clr","%s",aop->aopu.aop_dir);
+      else
+    if (s == one)
+        emitcode("setb","%s",aop->aopu.aop_dir);
+    else
+        if (!strcmp(s,"c"))
+      emitcode("mov","%s,c",aop->aopu.aop_dir);
+        else {
+      lbl = newiTempLabel(NULL);
+
+      if (strcmp(s,"a")) {
+          MOVA(s);
+      }
+      emitcode("clr","c");
+      emitcode("jz","%05d$",lbl->key+100);
+      emitcode("cpl","c");
+      emitcode("","%05d$:",lbl->key+100);
+      emitcode("mov","%s,c",aop->aopu.aop_dir);
+        }
+  }
+  break;
+
     case AOP_STR:
-       aop->coff = offset;
-       if (strcmp(aop->aopu.aop_str[offset],s))
-           emitcode ("mov","%s,%s",aop->aopu.aop_str[offset],s);
-       break;
-       
+  aop->coff = offset;
+  if (strcmp(aop->aopu.aop_str[offset],s))
+      emitcode ("mov","%s,%s",aop->aopu.aop_str[offset],s);
+  break;
+
     case AOP_ACC:
-       aop->coff = offset;
-       if (!offset && (strcmp(s,"acc") == 0))
-           break;
-       
-       if (strcmp(aop->aopu.aop_str[offset],s))
-           emitcode ("mov","%s,%s",aop->aopu.aop_str[offset],s);
-       break;
+  aop->coff = offset;
+  if (!offset && (strcmp(s,"acc") == 0))
+      break;
+
+  if (strcmp(aop->aopu.aop_str[offset],s))
+      emitcode ("mov","%s,%s",aop->aopu.aop_str[offset],s);
+  break;
 
     default :
-       werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-              "aopPut got unsupported aop->type");
-       exit(0);    
-    }    
+  werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+         "aopPut got unsupported aop->type");
+  exit(0);
+    }
 
 }
 
@@ -1074,25 +1074,25 @@ static void reAdjustPreg (asmop *aop)
         case AOP_R1 :
             while (size--)
                 emitcode("dec","%s",aop->aopu.aop_ptr->name);
-            break;          
+            break;
         case AOP_DPTR :
         case AOP_DPTR2:
             if (aop->type == AOP_DPTR2)
-           {
+          {
                 genSetDPTR(1);
-           } 
+          }
             while (size--)
             {
                 emitcode("lcall","__decdptr");
             }
-                
-           if (aop->type == AOP_DPTR2)
-           {
+
+          if (aop->type == AOP_DPTR2)
+          {
                 genSetDPTR(0);
-           }                
-            break;  
+          }
+            break;
 
-    }   
+    }
 
 }
 
@@ -1104,7 +1104,7 @@ static void reAdjustPreg (asmop *aop)
 
 #define AOP_NEEDSACC(x) (AOP(x) && (AOP_TYPE(x) == AOP_CRY ||  \
                         AOP_TYPE(x) == AOP_DPTR || AOP_TYPE(x) == AOP_DPTR2 || \
-                         AOP(x)->paged)) 
+                         AOP(x)->paged))
 
 #define AOP_INPREG(x) (x && (x->type == AOP_REG &&                        \
                       (x->aopu.aop_reg[0] == mcs51_regWithIdx(R0_IDX) || \
@@ -1119,14 +1119,14 @@ static void genNotFloat (operand *op, operand *res)
     char *l;
     symbol *tlbl ;
 
-    /* we will put 127 in the first byte of 
+    /* we will put 127 in the first byte of
     the result */
     aopPut(AOP(res),"#127",0);
     size = AOP_SIZE(op) - 1;
     offset = 1;
 
     l = aopGet(op->aop,offset++,FALSE,FALSE);
-    MOVA(l);    
+    MOVA(l);
 
     while(size--) {
         emitcode("orl","a,%s",
@@ -1142,25 +1142,25 @@ static void genNotFloat (operand *op, operand *res)
     emitcode("","%05d$:",(tlbl->key+100));
 
     size = res->aop->size - 2;
-    offset = 2;    
+    offset = 2;
     /* put zeros in the rest */
-    while (size--) 
+    while (size--)
         aopPut(res->aop,zero,offset++);
 }
 
 /*-----------------------------------------------------------------*/
-/* opIsGptr: returns non-zero if the passed operand is            */   
-/* a generic pointer type.                                        */
-/*-----------------------------------------------------------------*/ 
+/* opIsGptr: returns non-zero if the passed operand is       */
+/* a generic pointer type.             */
+/*-----------------------------------------------------------------*/
 static int opIsGptr(operand *op)
 {
     sym_link *type = operandType(op);
-    
+
     if ((AOP_SIZE(op) == GPTRSIZE) && IS_GENPTR(type))
     {
         return 1;
     }
-    return 0;        
+    return 0;
 }
 
 /*-----------------------------------------------------------------*/
@@ -1208,7 +1208,7 @@ static void outAcc(operand *result)
 static void outBitC(operand *result)
 {
     /* if the result is bit */
-    if (AOP_TYPE(result) == AOP_CRY) 
+    if (AOP_TYPE(result) == AOP_CRY)
         aopPut(AOP(result),"c",0);
     else {
         emitcode("clr","a");
@@ -1225,7 +1225,7 @@ static void toBoolean(operand *oper)
     int size = AOP_SIZE(oper) - 1;
     int offset = 1;
     MOVA(aopGet(AOP(oper),0,FALSE,FALSE));
-    while (size--) 
+    while (size--)
         emitcode("orl","a,%s",aopGet(AOP(oper),offset++,FALSE,FALSE));
 }
 
@@ -1244,8 +1244,8 @@ static void genNot (iCode *ic)
 
     /* if in bit space then a special case */
     if (AOP_TYPE(IC_LEFT(ic)) == AOP_CRY) {
-        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir); 
-        emitcode("cpl","c"); 
+        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir);
+        emitcode("cpl","c");
         outBitC(IC_RESULT(ic));
         goto release;
     }
@@ -1263,7 +1263,7 @@ static void genNot (iCode *ic)
     emitcode("","%05d$:",tlbl->key+100);
     outBitC(IC_RESULT(ic));
 
-release:    
+release:
     /* release the aops */
     freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
     freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
@@ -1283,21 +1283,21 @@ static void genCpl (iCode *ic)
     aopOp (IC_LEFT(ic),ic,FALSE);
     aopOp (IC_RESULT(ic),ic,TRUE);
 
-    /* if both are in bit space then 
+    /* if both are in bit space then
     a special case */
     if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY &&
-        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) { 
+        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) {
 
-        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir); 
-        emitcode("cpl","c"); 
-        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir); 
-        goto release; 
-    } 
+        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir);
+        emitcode("cpl","c");
+        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir);
+        goto release;
+    }
 
     size = AOP_SIZE(IC_RESULT(ic));
     while (size--) {
         char *l = aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE);
-        MOVA(l);       
+        MOVA(l);
         emitcode("cpl","a");
         aopPut(AOP(IC_RESULT(ic)),"a",offset++);
     }
@@ -1316,22 +1316,22 @@ static void genUminusFloat(operand *op,operand *result)
 {
     int size ,offset =0 ;
     char *l;
-    /* for this we just need to flip the 
+    /* for this we just need to flip the
     first it then copy the rest in place */
     size = AOP_SIZE(op) - 1;
     l = aopGet(AOP(op),3,FALSE,FALSE);
 
-    MOVA(l);    
+    MOVA(l);
 
     emitcode("cpl","acc.7");
-    aopPut(AOP(result),"a",3);    
+    aopPut(AOP(result),"a",3);
 
     while(size--) {
         aopPut(AOP(result),
                aopGet(AOP(op),offset,FALSE,FALSE),
                offset);
         offset++;
-    }          
+    }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1350,13 +1350,13 @@ static void genUminus (iCode *ic)
     /* if both in bit space then special
     case */
     if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY &&
-        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) { 
+        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) {
 
-        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir); 
-        emitcode("cpl","c"); 
-        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir); 
-        goto release; 
-    } 
+        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir);
+        emitcode("cpl","c");
+        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir);
+        goto release;
+    }
 
     optype = operandType(IC_LEFT(ic));
     rtype = operandType(IC_RESULT(ic));
@@ -1374,16 +1374,16 @@ static void genUminus (iCode *ic)
     while(size--) {
         char *l = aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE);
         if (!strcmp(l,"a")) {
-         if (offset==0)
-           SETC;
-         emitcode("cpl","a");
-         emitcode("addc","a,#0");
+    if (offset==0)
+      SETC;
+    emitcode("cpl","a");
+    emitcode("addc","a,#0");
         } else {
-         if (offset==0)
-           CLRC;
-         emitcode("clr","a");
-         emitcode("subb","a,%s",l);
-        }       
+    if (offset==0)
+      CLRC;
+    emitcode("clr","a");
+    emitcode("subb","a,%s",l);
+        }
         aopPut(AOP(IC_RESULT(ic)),"a",offset++);
     }
 
@@ -1392,20 +1392,20 @@ static void genUminus (iCode *ic)
     if ((size = (AOP_SIZE(IC_RESULT(ic)) - AOP_SIZE(IC_LEFT(ic))))) {
         emitcode("rlc","a");
         emitcode("subb","a,acc");
-        while (size--) 
+        while (size--)
             aopPut(AOP(IC_RESULT(ic)),"a",offset++);
-    }       
+    }
 
 release:
     /* release the aops */
     freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
-    freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);    
+    freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* saveRegisters - will look for a call and save the registers     */
 /*-----------------------------------------------------------------*/
-static void saveRegisters(iCode *lic) 
+static void saveRegisters(iCode *lic)
 {
     int i;
     iCode *ic;
@@ -1413,7 +1413,7 @@ static void saveRegisters(iCode *lic)
     sym_link *detype;
 
     /* look for call */
-    for (ic = lic ; ic ; ic = ic->next) 
+    for (ic = lic ; ic ; ic = ic->next)
         if (ic->op == CALL || ic->op == PCALL)
             break;
 
@@ -1427,40 +1427,40 @@ static void saveRegisters(iCode *lic)
     if (ic->regsSaved || (OP_SYMBOL(IC_LEFT(ic))->calleeSave))
         return ;
 
-    /* find the registers in use at this time 
+    /* find the registers in use at this time
     and push them away to safety */
     rsave = bitVectCplAnd(bitVectCopy(ic->rMask),
                           ic->rUsed);
 
     ic->regsSaved = 1;
     if (options.useXstack) {
-       if (bitVectBitValue(rsave,R0_IDX))
-           emitcode("mov","b,r0");
-       emitcode("mov","r0,%s",spname);
-       for (i = 0 ; i < mcs51_nRegs ; i++) {
-           if (bitVectBitValue(rsave,i)) {
-               if (i == R0_IDX)
-                   emitcode("mov","a,b");
-               else
-                   emitcode("mov","a,%s",mcs51_regWithIdx(i)->name);
-               emitcode("movx","@r0,a");
-               emitcode("inc","r0");
-           }
-       }
-       emitcode("mov","%s,r0",spname);
-       if (bitVectBitValue(rsave,R0_IDX))
-           emitcode("mov","r0,b");         
+  if (bitVectBitValue(rsave,R0_IDX))
+      emitcode("mov","b,r0");
+  emitcode("mov","r0,%s",spname);
+  for (i = 0 ; i < mcs51_nRegs ; i++) {
+      if (bitVectBitValue(rsave,i)) {
+    if (i == R0_IDX)
+        emitcode("mov","a,b");
+    else
+        emitcode("mov","a,%s",mcs51_regWithIdx(i)->name);
+    emitcode("movx","@r0,a");
+    emitcode("inc","r0");
+      }
+  }
+  emitcode("mov","%s,r0",spname);
+  if (bitVectBitValue(rsave,R0_IDX))
+      emitcode("mov","r0,b");
     } else
-       for (i = 0 ; i < mcs51_nRegs ; i++) {
-           if (bitVectBitValue(rsave,i))
-               emitcode("push","%s",mcs51_regWithIdx(i)->dname);
-       }
+  for (i = 0 ; i < mcs51_nRegs ; i++) {
+      if (bitVectBitValue(rsave,i))
+    emitcode("push","%s",mcs51_regWithIdx(i)->dname);
+  }
 
     detype = getSpec(operandType(IC_LEFT(ic)));
-    if (detype        && 
+    if (detype        &&
         (SPEC_BANK(currFunc->etype) != SPEC_BANK(detype)) &&
-       IS_ISR(currFunc->etype) &&
-        !ic->bankSaved) 
+  IS_ISR(currFunc->etype) &&
+        !ic->bankSaved)
 
         saverbank(SPEC_BANK(detype),ic,TRUE);
 
@@ -1472,65 +1472,65 @@ static void unsaveRegisters (iCode *ic)
 {
     int i;
     bitVect *rsave;
-    /* find the registers in use at this time 
+    /* find the registers in use at this time
     and push them away to safety */
     rsave = bitVectCplAnd(bitVectCopy(ic->rMask),
                           ic->rUsed);
-    
+
     if (options.useXstack) {
-       emitcode("mov","r0,%s",spname); 
-       for (i =  mcs51_nRegs ; i >= 0 ; i--) {
-           if (bitVectBitValue(rsave,i)) {
-               emitcode("dec","r0");
-               emitcode("movx","a,@r0");
-               if (i == R0_IDX)
-                   emitcode("mov","b,a");
-               else
-                   emitcode("mov","%s,a",mcs51_regWithIdx(i)->name);
-           }       
-
-       }
-       emitcode("mov","%s,r0",spname);
-       if (bitVectBitValue(rsave,R0_IDX))
-           emitcode("mov","r0,b");
+  emitcode("mov","r0,%s",spname);
+  for (i =  mcs51_nRegs ; i >= 0 ; i--) {
+      if (bitVectBitValue(rsave,i)) {
+    emitcode("dec","r0");
+    emitcode("movx","a,@r0");
+    if (i == R0_IDX)
+        emitcode("mov","b,a");
+    else
+        emitcode("mov","%s,a",mcs51_regWithIdx(i)->name);
+      }
+
+  }
+  emitcode("mov","%s,r0",spname);
+  if (bitVectBitValue(rsave,R0_IDX))
+      emitcode("mov","r0,b");
     } else
-       for (i =  mcs51_nRegs ; i >= 0 ; i--) {
-           if (bitVectBitValue(rsave,i))
-               emitcode("pop","%s",mcs51_regWithIdx(i)->dname);
-       }
+  for (i =  mcs51_nRegs ; i >= 0 ; i--) {
+      if (bitVectBitValue(rsave,i))
+    emitcode("pop","%s",mcs51_regWithIdx(i)->dname);
+  }
 
-}  
+}
 
 
 /*-----------------------------------------------------------------*/
-/* pushSide -                                                     */
+/* pushSide -                */
 /*-----------------------------------------------------------------*/
 static void pushSide(operand * oper, int size)
 {
-       int offset = 0;
-       while (size--) {
-               char *l = aopGet(AOP(oper),offset++,FALSE,TRUE);
-               if (AOP_TYPE(oper) != AOP_REG &&
-                   AOP_TYPE(oper) != AOP_DIR &&
-                   strcmp(l,"a") ) {
-                       emitcode("mov","a,%s",l);
-                       emitcode("push","acc");
-               } else
-                       emitcode("push","%s",l);
-       }
+  int offset = 0;
+  while (size--) {
+    char *l = aopGet(AOP(oper),offset++,FALSE,TRUE);
+    if (AOP_TYPE(oper) != AOP_REG &&
+        AOP_TYPE(oper) != AOP_DIR &&
+        strcmp(l,"a") ) {
+      emitcode("mov","a,%s",l);
+      emitcode("push","acc");
+    } else
+      emitcode("push","%s",l);
+  }
 }
 
 /*-----------------------------------------------------------------*/
-/* assignResultValue -                                            */
+/* assignResultValue -               */
 /*-----------------------------------------------------------------*/
 static void assignResultValue(operand * oper)
 {
-       int offset = 0;
-       int size = AOP_SIZE(oper);
-       while (size--) {
-               aopPut(AOP(oper),fReturn[offset],offset);
-               offset++;
-       }
+  int offset = 0;
+  int size = AOP_SIZE(oper);
+  while (size--) {
+    aopPut(AOP(oper),fReturn[offset],offset);
+    offset++;
+  }
 }
 
 
@@ -1546,21 +1546,21 @@ static void genXpush (iCode *ic)
     aopOp(IC_LEFT(ic),ic,FALSE);
     r = getFreePtr(ic,&aop,FALSE);
 
-    
+
     emitcode("mov","%s,_spx",r->name);
 
     size = AOP_SIZE(IC_LEFT(ic));
     while(size--) {
 
-       char *l = aopGet(AOP(IC_LEFT(ic)),
-                        offset++,FALSE,FALSE); 
-       MOVA(l);            
-       emitcode("movx","@%s,a",r->name);       
-       emitcode("inc","%s",r->name);
+  char *l = aopGet(AOP(IC_LEFT(ic)),
+       offset++,FALSE,FALSE);
+  MOVA(l);
+  emitcode("movx","@%s,a",r->name);
+  emitcode("inc","%s",r->name);
 
     }
 
-       
+
     emitcode("mov","_spx,%s",r->name);
 
     freeAsmop(NULL,aop,ic,TRUE);
@@ -1576,7 +1576,7 @@ static void genIpush (iCode *ic)
     char *l;
 
 
-    /* if this is not a parm push : ie. it is spill push 
+    /* if this is not a parm push : ie. it is spill push
     and spill push is always done on the local stack */
     if (!ic->parmPush) {
 
@@ -1595,12 +1595,12 @@ static void genIpush (iCode *ic)
             }
             emitcode("push","%s",l);
         }
-        return ;        
+        return ;
     }
 
     /* this is a paramter push: in this case we call
     the routine to find the call and save those
-    registers that need to be saved */   
+    registers that need to be saved */
     saveRegisters(ic);
 
     /* if use external stack then call the external
@@ -1614,19 +1614,19 @@ static void genIpush (iCode *ic)
     aopOp(IC_LEFT(ic),ic,FALSE);
 
 
-       // pushSide(IC_LEFT(ic), AOP_SIZE(IC_LEFT(ic)));
+  // pushSide(IC_LEFT(ic), AOP_SIZE(IC_LEFT(ic)));
     size = AOP_SIZE(IC_LEFT(ic));
 
     while (size--) {
         l = aopGet(AOP(IC_LEFT(ic)),offset++,FALSE,TRUE);
-        if (AOP_TYPE(IC_LEFT(ic)) != AOP_REG && 
+        if (AOP_TYPE(IC_LEFT(ic)) != AOP_REG &&
             AOP_TYPE(IC_LEFT(ic)) != AOP_DIR &&
             strcmp(l,"a") ) {
             emitcode("mov","a,%s",l);
             emitcode("push","acc");
         } else
             emitcode("push","%s",l);
-    }       
+    }
 
     freeAsmop(IC_LEFT(ic),NULL,ic,TRUE);
 }
@@ -1646,7 +1646,7 @@ static void genIpop (iCode *ic)
     aopOp(IC_LEFT(ic),ic,FALSE);
     size = AOP_SIZE(IC_LEFT(ic));
     offset = (size-1);
-    while (size--) 
+    while (size--)
         emitcode("pop","%s",aopGet(AOP(IC_LEFT(ic)),offset--,
                                    FALSE,TRUE));
 
@@ -1663,38 +1663,38 @@ static void unsaverbank (int bank,iCode *ic,bool popPsw)
     regs *r = NULL;
 
     if (popPsw) {
-       if (options.useXstack) {
-           aop = newAsmop(0);
-           r = getFreePtr(ic,&aop,FALSE);
-           
-           
-           emitcode("mov","%s,_spx",r->name);
-           emitcode("movx","a,@%s",r->name);
-           emitcode("mov","psw,a");
-           emitcode("dec","%s",r->name);
-           
-       }else
-           emitcode ("pop","psw");
+  if (options.useXstack) {
+      aop = newAsmop(0);
+      r = getFreePtr(ic,&aop,FALSE);
+
+
+      emitcode("mov","%s,_spx",r->name);
+      emitcode("movx","a,@%s",r->name);
+      emitcode("mov","psw,a");
+      emitcode("dec","%s",r->name);
+
+  }else
+      emitcode ("pop","psw");
     }
 
     for (i = (mcs51_nRegs - 1) ; i >= 0 ;i--) {
-        if (options.useXstack) {       
+        if (options.useXstack) {
             emitcode("movx","a,@%s",r->name);
             emitcode("mov","(%s+%d),a",
                      regs8051[i].base,8*bank+regs8051[i].offset);
             emitcode("dec","%s",r->name);
 
-        } else 
+        } else
             emitcode("pop","(%s+%d)",
                      regs8051[i].base,8*bank+regs8051[i].offset);
     }
 
     if (options.useXstack) {
 
-       emitcode("mov","_spx,%s",r->name);
-       freeAsmop(NULL,aop,ic,TRUE);
+  emitcode("mov","_spx,%s",r->name);
+  freeAsmop(NULL,aop,ic,TRUE);
 
-    } 
+    }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1708,9 +1708,9 @@ static void saverbank (int bank, iCode *ic, bool pushPsw)
 
     if (options.useXstack) {
 
-       aop = newAsmop(0);
-       r = getFreePtr(ic,&aop,FALSE);  
-       emitcode("mov","%s,_spx",r->name);
+  aop = newAsmop(0);
+  r = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,_spx",r->name);
 
     }
 
@@ -1719,24 +1719,24 @@ static void saverbank (int bank, iCode *ic, bool pushPsw)
             emitcode("inc","%s",r->name);
             emitcode("mov","a,(%s+%d)",
                      regs8051[i].base,8*bank+regs8051[i].offset);
-            emitcode("movx","@%s,a",r->name);           
-        } else 
+            emitcode("movx","@%s,a",r->name);
+        } else
             emitcode("push","(%s+%d)",
                      regs8051[i].base,8*bank+regs8051[i].offset);
     }
-    
+
     if (pushPsw) {
-       if (options.useXstack) {
-           emitcode("mov","a,psw");
-           emitcode("movx","@%s,a",r->name);   
-           emitcode("inc","%s",r->name);
-           emitcode("mov","_spx,%s",r->name);       
-           freeAsmop (NULL,aop,ic,TRUE);
-           
-       } else
-           emitcode("push","psw");
-       
-       emitcode("mov","psw,#0x%02x",(bank << 3)&0x00ff);
+  if (options.useXstack) {
+      emitcode("mov","a,psw");
+      emitcode("movx","@%s,a",r->name);
+      emitcode("inc","%s",r->name);
+      emitcode("mov","_spx,%s",r->name);
+      freeAsmop (NULL,aop,ic,TRUE);
+
+  } else
+      emitcode("push","psw");
+
+  emitcode("mov","psw,#0x%02x",(bank << 3)&0x00ff);
     }
     ic->bankSaved = 1;
 
@@ -1747,7 +1747,7 @@ static void saverbank (int bank, iCode *ic, bool pushPsw)
 /*-----------------------------------------------------------------*/
 static void genCall (iCode *ic)
 {
-    sym_link *detype;   
+    sym_link *detype;
 
     /* if caller saves & we have not saved then */
     if (!ic->regsSaved)
@@ -1757,34 +1757,34 @@ static void genCall (iCode *ic)
     the same register bank then we need to save the
     destination registers on the stack */
     detype = getSpec(operandType(IC_LEFT(ic)));
-    if (detype        && 
+    if (detype        &&
         (SPEC_BANK(currFunc->etype) != SPEC_BANK(detype)) &&
-       IS_ISR(currFunc->etype) &&
-        !ic->bankSaved) 
+  IS_ISR(currFunc->etype) &&
+        !ic->bankSaved)
 
         saverbank(SPEC_BANK(detype),ic,TRUE);
 
     /* if send set is not empty the assign */
     if (_G.sendSet) {
-       iCode *sic ;
-
-       for (sic = setFirstItem(_G.sendSet) ; sic ; 
-            sic = setNextItem(_G.sendSet)) {
-           int size, offset = 0;
-           aopOp(IC_LEFT(sic),sic,FALSE);
-           size = AOP_SIZE(IC_LEFT(sic));
-           while (size--) {
-               char *l = aopGet(AOP(IC_LEFT(sic)),offset,
-                               FALSE,FALSE);
-               if (strcmp(l,fReturn[offset]))
-                   emitcode("mov","%s,%s",
-                            fReturn[offset],
-                            l);
-               offset++;
-           }
-           freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
-       }
-       _G.sendSet = NULL;
+  iCode *sic ;
+
+  for (sic = setFirstItem(_G.sendSet) ; sic ;
+       sic = setNextItem(_G.sendSet)) {
+      int size, offset = 0;
+      aopOp(IC_LEFT(sic),sic,FALSE);
+      size = AOP_SIZE(IC_LEFT(sic));
+      while (size--) {
+    char *l = aopGet(AOP(IC_LEFT(sic)),offset,
+        FALSE,FALSE);
+    if (strcmp(l,fReturn[offset]))
+        emitcode("mov","%s,%s",
+           fReturn[offset],
+           l);
+    offset++;
+      }
+      freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
+  }
+  _G.sendSet = NULL;
     }
     /* make the call */
     emitcode("lcall","%s",(OP_SYMBOL(IC_LEFT(ic))->rname[0] ?
@@ -1792,7 +1792,7 @@ static void genCall (iCode *ic)
                            OP_SYMBOL(IC_LEFT(ic))->name));
 
     /* if we need assign a result value */
-    if ((IS_ITEMP(IC_RESULT(ic)) && 
+    if ((IS_ITEMP(IC_RESULT(ic)) &&
          (OP_SYMBOL(IC_RESULT(ic))->nRegs ||
           OP_SYMBOL(IC_RESULT(ic))->spildir )) ||
         IS_TRUE_SYMOP(IC_RESULT(ic)) ) {
@@ -1801,12 +1801,12 @@ static void genCall (iCode *ic)
         aopOp(IC_RESULT(ic),ic,FALSE);
         _G.accInUse--;
 
-       assignResultValue(IC_RESULT(ic));
-               
+  assignResultValue(IC_RESULT(ic));
+
         freeAsmop(IC_RESULT(ic),NULL, ic,TRUE);
     }
 
-    /* adjust the stack for parameters if 
+    /* adjust the stack for parameters if
     required */
     if (IC_LEFT(ic)->parmBytes) {
         int i;
@@ -1814,7 +1814,7 @@ static void genCall (iCode *ic)
             emitcode("mov","a,%s",spname);
             emitcode("add","a,#0x%02x", (- IC_LEFT(ic)->parmBytes) & 0xff);
             emitcode("mov","%s,a",spname);
-        } else 
+        } else
             for ( i = 0 ; i <  IC_LEFT(ic)->parmBytes ;i++)
                 emitcode("dec","%s",spname);
 
@@ -1848,22 +1848,22 @@ static void genPcall (iCode *ic)
     the same register bank then we need to save the
     destination registers on the stack */
     detype = getSpec(operandType(IC_LEFT(ic)));
-    if (detype        && 
-       IS_ISR(currFunc->etype) &&
+    if (detype        &&
+  IS_ISR(currFunc->etype) &&
         (SPEC_BANK(currFunc->etype) != SPEC_BANK(detype)))
         saverbank(SPEC_BANK(detype),ic,TRUE);
 
 
     /* push the return address on to the stack */
     emitcode("mov","a,#%05d$",(rlbl->key+100));
-    emitcode("push","acc");    
+    emitcode("push","acc");
     emitcode("mov","a,#(%05d$ >> 8)",(rlbl->key+100));
     emitcode("push","acc");
-    
+
     if (options.model == MODEL_FLAT24)
     {
-       emitcode("mov","a,#(%05d$ >> 16)",(rlbl->key+100));
-       emitcode("push","acc");    
+      emitcode("mov","a,#(%05d$ >> 16)",(rlbl->key+100));
+      emitcode("push","acc");
     }
 
     /* now push the calling address */
@@ -1871,29 +1871,29 @@ static void genPcall (iCode *ic)
 
     pushSide(IC_LEFT(ic), FPTRSIZE);
 
-    freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); 
+    freeAsmop(IC_LEFT(ic),NULL,ic,TRUE);
 
     /* if send set is not empty the assign */
     if (_G.sendSet) {
-       iCode *sic ;
-
-       for (sic = setFirstItem(_G.sendSet) ; sic ; 
-            sic = setNextItem(_G.sendSet)) {
-           int size, offset = 0;
-           aopOp(IC_LEFT(sic),sic,FALSE);
-           size = AOP_SIZE(IC_LEFT(sic));
-           while (size--) {
-               char *l = aopGet(AOP(IC_LEFT(sic)),offset,
-                               FALSE,FALSE);
-               if (strcmp(l,fReturn[offset]))
-                   emitcode("mov","%s,%s",
-                            fReturn[offset],
-                            l);
-               offset++;
-           }
-           freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
-       }
-       _G.sendSet = NULL;
+  iCode *sic ;
+
+  for (sic = setFirstItem(_G.sendSet) ; sic ;
+       sic = setNextItem(_G.sendSet)) {
+      int size, offset = 0;
+      aopOp(IC_LEFT(sic),sic,FALSE);
+      size = AOP_SIZE(IC_LEFT(sic));
+      while (size--) {
+    char *l = aopGet(AOP(IC_LEFT(sic)),offset,
+        FALSE,FALSE);
+    if (strcmp(l,fReturn[offset]))
+        emitcode("mov","%s,%s",
+           fReturn[offset],
+           l);
+    offset++;
+      }
+      freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
+  }
+  _G.sendSet = NULL;
     }
 
     emitcode("ret","");
@@ -1909,13 +1909,13 @@ static void genPcall (iCode *ic)
         _G.accInUse++;
         aopOp(IC_RESULT(ic),ic,FALSE);
         _G.accInUse--;
-       
-       assignResultValue(IC_RESULT(ic));
+
+  assignResultValue(IC_RESULT(ic));
 
         freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
     }
 
-    /* adjust the stack for parameters if 
+    /* adjust the stack for parameters if
     required */
     if (IC_LEFT(ic)->parmBytes) {
         int i;
@@ -1923,15 +1923,15 @@ static void genPcall (iCode *ic)
             emitcode("mov","a,%s",spname);
             emitcode("add","a,#0x%02x", (- IC_LEFT(ic)->parmBytes) & 0xff);
             emitcode("mov","%s,a",spname);
-        } else 
+        } else
             for ( i = 0 ; i <  IC_LEFT(ic)->parmBytes ;i++)
                 emitcode("dec","%s",spname);
 
     }
 
     /* if register bank was saved then unsave them */
-    if (detype        && 
-        (SPEC_BANK(currFunc->etype) != 
+    if (detype        &&
+        (SPEC_BANK(currFunc->etype) !=
          SPEC_BANK(detype)))
         unsaverbank(SPEC_BANK(detype),ic,TRUE);
 
@@ -1952,7 +1952,7 @@ static int resultRemat (iCode *ic)
 
     if (IC_RESULT(ic) && IS_ITEMP(IC_RESULT(ic))) {
         symbol *sym = OP_SYMBOL(IC_RESULT(ic));
-        if (sym->remat && !POINTER_SET(ic)) 
+        if (sym->remat && !POINTER_SET(ic))
             return 1;
     }
 
@@ -1971,15 +1971,15 @@ static int resultRemat (iCode *ic)
 static bool inExcludeList(char *s)
 {
     int i =0;
-    
+
     if (options.excludeRegs[i] &&
     STRCASECMP(options.excludeRegs[i],"none") == 0)
-       return FALSE ;
+  return FALSE ;
 
     for ( i = 0 ; options.excludeRegs[i]; i++) {
-       if (options.excludeRegs[i] &&
+  if (options.excludeRegs[i] &&
         STRCASECMP(s,options.excludeRegs[i]) == 0)
-           return TRUE;
+      return TRUE;
     }
     return FALSE ;
 }
@@ -2027,124 +2027,124 @@ static void genFunction (iCode *ic)
     /* if this is an interrupt service routine then
     save acc, b, dpl, dph  */
     if (IS_ISR(sym->etype)) {
-        
-       if (!inExcludeList("acc"))          
-           emitcode ("push","acc");    
-       if (!inExcludeList("b"))
-           emitcode ("push","b");
-       if (!inExcludeList("dpl"))
-           emitcode ("push","dpl");
-       if (!inExcludeList("dph"))
-           emitcode ("push","dph");
-       if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
-       {
-           emitcode ("push", "dpx");
-           /* Make sure we're using standard DPTR */
-           emitcode ("push", "dps");
-           emitcode ("mov", "dps, #0x00");
-           if (options.stack10bit)
-           {   
-               /* This ISR could conceivably use DPTR2. Better save it. */
-               emitcode ("push", "dpl1");
-               emitcode ("push", "dph1");
-               emitcode ("push", "dpx1");
-           }
-       }
-       /* if this isr has no bank i.e. is going to
-          run with bank 0 , then we need to save more
-          registers :-) */
-       if (!SPEC_BANK(sym->etype)) {
-
-           /* if this function does not call any other
-              function then we can be economical and
-              save only those registers that are used */
-           if (! sym->hasFcall) {
-               int i;
-
-               /* if any registers used */
-               if (sym->regsUsed) {
-                   /* save the registers used */
-                   for ( i = 0 ; i < sym->regsUsed->size ; i++) {
-                       if (bitVectBitValue(sym->regsUsed,i) ||
+
+  if (!inExcludeList("acc"))
+      emitcode ("push","acc");
+  if (!inExcludeList("b"))
+      emitcode ("push","b");
+  if (!inExcludeList("dpl"))
+      emitcode ("push","dpl");
+  if (!inExcludeList("dph"))
+      emitcode ("push","dph");
+  if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
+  {
+      emitcode ("push", "dpx");
+      /* Make sure we're using standard DPTR */
+      emitcode ("push", "dps");
+      emitcode ("mov", "dps, #0x00");
+      if (options.stack10bit)
+      {
+        /* This ISR could conceivably use DPTR2. Better save it. */
+        emitcode ("push", "dpl1");
+        emitcode ("push", "dph1");
+        emitcode ("push", "dpx1");
+      }
+  }
+  /* if this isr has no bank i.e. is going to
+     run with bank 0 , then we need to save more
+     registers :-) */
+  if (!SPEC_BANK(sym->etype)) {
+
+      /* if this function does not call any other
+         function then we can be economical and
+         save only those registers that are used */
+      if (! sym->hasFcall) {
+    int i;
+
+    /* if any registers used */
+    if (sym->regsUsed) {
+        /* save the registers used */
+        for ( i = 0 ; i < sym->regsUsed->size ; i++) {
+      if (bitVectBitValue(sym->regsUsed,i) ||
                           (mcs51_ptrRegReq && (i == R0_IDX || i == R1_IDX)) )
-                           emitcode("push","%s",mcs51_regWithIdx(i)->dname);                       
-                   }
-               }
-               
-           } else {
-               /* this function has  a function call cannot
-                  determines register usage so we will have the
-                  entire bank */
-               saverbank(0,ic,FALSE);
-           }       
-       }
+          emitcode("push","%s",mcs51_regWithIdx(i)->dname);
+        }
+    }
+
+      } else {
+    /* this function has  a function call cannot
+       determines register usage so we will have the
+       entire bank */
+    saverbank(0,ic,FALSE);
+      }
+  }
     } else {
-       /* if callee-save to be used for this function
-          then save the registers being used in this function */
-       if (sym->calleeSave) {
-           int i;
-           
-           /* if any registers used */
-           if (sym->regsUsed) {
-               /* save the registers used */
-               for ( i = 0 ; i < sym->regsUsed->size ; i++) {
-                   if (bitVectBitValue(sym->regsUsed,i) ||
+  /* if callee-save to be used for this function
+     then save the registers being used in this function */
+  if (sym->calleeSave) {
+      int i;
+
+      /* if any registers used */
+      if (sym->regsUsed) {
+    /* save the registers used */
+    for ( i = 0 ; i < sym->regsUsed->size ; i++) {
+        if (bitVectBitValue(sym->regsUsed,i) ||
                       (mcs51_ptrRegReq && (i == R0_IDX || i == R1_IDX)) ) {
-                       emitcode("push","%s",mcs51_regWithIdx(i)->dname);
-                       _G.nRegsSaved++;
-                   }
-               }
-           }
-       }
+      emitcode("push","%s",mcs51_regWithIdx(i)->dname);
+      _G.nRegsSaved++;
+        }
+    }
+      }
+  }
     }
 
     /* set the register bank to the desired value */
     if (SPEC_BANK(sym->etype) || IS_ISR(sym->etype)) {
         emitcode("push","psw");
-        emitcode("mov","psw,#0x%02x",(SPEC_BANK(sym->etype) << 3)&0x00ff);   
+        emitcode("mov","psw,#0x%02x",(SPEC_BANK(sym->etype) << 3)&0x00ff);
     }
 
     if (IS_RENT(sym->etype) || options.stackAuto) {
 
-       if (options.useXstack) {
-           emitcode("mov","r0,%s",spname);
-           emitcode("mov","a,_bp");
-           emitcode("movx","@r0,a");
-           emitcode("inc","%s",spname);
-       }
-       else
-       {
-           /* set up the stack */
-           emitcode ("push","_bp");     /* save the callers stack  */
-       }
-       emitcode ("mov","_bp,%s",spname);
+  if (options.useXstack) {
+      emitcode("mov","r0,%s",spname);
+      emitcode("mov","a,_bp");
+      emitcode("movx","@r0,a");
+      emitcode("inc","%s",spname);
+  }
+  else
+  {
+      /* set up the stack */
+      emitcode ("push","_bp");     /* save the callers stack  */
+  }
+  emitcode ("mov","_bp,%s",spname);
     }
 
     /* adjust the stack for the function */
     if (sym->stack) {
 
-       int i = sym->stack;
-       if (i > 256 ) 
-           werror(W_STACK_OVERFLOW,sym->name);
+  int i = sym->stack;
+  if (i > 256 )
+      werror(W_STACK_OVERFLOW,sym->name);
+
+  if (i > 3 && sym->recvSize < 4) {
 
-       if (i > 3 && sym->recvSize < 4) {              
+      emitcode ("mov","a,sp");
+      emitcode ("add","a,#0x%02x",((char)sym->stack & 0xff));
+      emitcode ("mov","sp,a");
 
-           emitcode ("mov","a,sp");
-           emitcode ("add","a,#0x%02x",((char)sym->stack & 0xff));
-           emitcode ("mov","sp,a");
-          
-       }
-       else
-           while(i--)
-               emitcode("inc","sp");
+  }
+  else
+      while(i--)
+    emitcode("inc","sp");
     }
 
      if (sym->xstack) {
 
-       emitcode ("mov","a,_spx");
-       emitcode ("add","a,#0x%02x",((char)sym->xstack & 0xff));
-       emitcode ("mov","_spx,a");
-    }    
+  emitcode ("mov","a,_spx");
+  emitcode ("add","a,#0x%02x",((char)sym->xstack & 0xff));
+  emitcode ("mov","_spx,a");
+    }
 
 }
 
@@ -2163,7 +2163,7 @@ static void genEndFunction (iCode *ic)
     /* if use external stack but some variables were
     added to the local stack then decrement the
     local stack */
-    if (options.useXstack && sym->stack) {      
+    if (options.useXstack && sym->stack) {
         emitcode("mov","a,sp");
         emitcode("add","a,#0x%02x",((char)-sym->stack) & 0xff);
         emitcode("mov","sp,a");
@@ -2171,124 +2171,124 @@ static void genEndFunction (iCode *ic)
 
 
     if ((IS_RENT(sym->etype) || options.stackAuto)) {
-       if (options.useXstack) {
-           emitcode("mov","r0,%s",spname);
-           emitcode("movx","a,@r0");
-           emitcode("mov","_bp,a");
-           emitcode("dec","%s",spname);
-       }
-       else
-       {
-           emitcode ("pop","_bp");
-       }
-    }
-
-    /* restore the register bank  */    
+  if (options.useXstack) {
+      emitcode("mov","r0,%s",spname);
+      emitcode("movx","a,@r0");
+      emitcode("mov","_bp,a");
+      emitcode("dec","%s",spname);
+  }
+  else
+  {
+      emitcode ("pop","_bp");
+  }
+    }
+
+    /* restore the register bank  */
     if (SPEC_BANK(sym->etype) || IS_ISR(sym->etype))
         emitcode ("pop","psw");
 
     if (IS_ISR(sym->etype)) {
 
-       /* now we need to restore the registers */
-       /* if this isr has no bank i.e. is going to
-          run with bank 0 , then we need to save more
-          registers :-) */
-       if (!SPEC_BANK(sym->etype)) {
-           
-           /* if this function does not call any other
-              function then we can be economical and
-              save only those registers that are used */
-           if (! sym->hasFcall) {
-               int i;
-               
-               /* if any registers used */
-               if (sym->regsUsed) {
-                   /* save the registers used */
-                   for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
-                       if (bitVectBitValue(sym->regsUsed,i) ||
+  /* now we need to restore the registers */
+  /* if this isr has no bank i.e. is going to
+     run with bank 0 , then we need to save more
+     registers :-) */
+  if (!SPEC_BANK(sym->etype)) {
+
+      /* if this function does not call any other
+         function then we can be economical and
+         save only those registers that are used */
+      if (! sym->hasFcall) {
+    int i;
+
+    /* if any registers used */
+    if (sym->regsUsed) {
+        /* save the registers used */
+        for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
+      if (bitVectBitValue(sym->regsUsed,i) ||
                           (mcs51_ptrRegReq && (i == R0_IDX || i == R1_IDX)) )
-                           emitcode("pop","%s",mcs51_regWithIdx(i)->dname);
-                   }
-               }
-               
-           } else {
-               /* this function has  a function call cannot
-                  determines register usage so we will have the
-                  entire bank */
-               unsaverbank(0,ic,FALSE);
-           }       
-       }
-
-       if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
-       {
-           if (options.stack10bit)
-           {
-               emitcode ("pop", "dpx1");
-               emitcode ("pop", "dph1");
-               emitcode ("pop", "dpl1");
-           }   
-           emitcode ("pop", "dps");
-           emitcode ("pop", "dpx");
-       }
-       if (!inExcludeList("dph"))
-           emitcode ("pop","dph");
-       if (!inExcludeList("dpl"))
-           emitcode ("pop","dpl");
-       if (!inExcludeList("b"))
-           emitcode ("pop","b");
-       if (!inExcludeList("acc"))
-           emitcode ("pop","acc");
+          emitcode("pop","%s",mcs51_regWithIdx(i)->dname);
+        }
+    }
+
+      } else {
+    /* this function has  a function call cannot
+       determines register usage so we will have the
+       entire bank */
+    unsaverbank(0,ic,FALSE);
+      }
+  }
+
+  if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
+  {
+      if (options.stack10bit)
+      {
+          emitcode ("pop", "dpx1");
+          emitcode ("pop", "dph1");
+          emitcode ("pop", "dpl1");
+      }
+      emitcode ("pop", "dps");
+      emitcode ("pop", "dpx");
+  }
+  if (!inExcludeList("dph"))
+      emitcode ("pop","dph");
+  if (!inExcludeList("dpl"))
+      emitcode ("pop","dpl");
+  if (!inExcludeList("b"))
+      emitcode ("pop","b");
+  if (!inExcludeList("acc"))
+      emitcode ("pop","acc");
 
         if (SPEC_CRTCL(sym->etype))
             emitcode("setb","ea");
 
-       /* if debug then send end of function */
-/*     if (options.debug && currFunc) { */
-       if (currFunc) {
-           _G.debugLine = 1;
-           emitcode("","C$%s$%d$%d$%d ==.",
-                    ic->filename,currFunc->lastLine,
-                    ic->level,ic->block); 
-           if (IS_STATIC(currFunc->etype))         
-               emitcode("","XF%s$%s$0$0 ==.",moduleName,currFunc->name); 
-           else
-               emitcode("","XG$%s$0$0 ==.",currFunc->name);
-           _G.debugLine = 0;
-       }
-       
+  /* if debug then send end of function */
+/*  if (options.debug && currFunc) { */
+  if (currFunc) {
+      _G.debugLine = 1;
+      emitcode("","C$%s$%d$%d$%d ==.",
+         ic->filename,currFunc->lastLine,
+         ic->level,ic->block);
+      if (IS_STATIC(currFunc->etype))
+    emitcode("","XF%s$%s$0$0 ==.",moduleName,currFunc->name);
+      else
+    emitcode("","XG$%s$0$0 ==.",currFunc->name);
+      _G.debugLine = 0;
+  }
+
         emitcode ("reti","");
     }
     else {
         if (SPEC_CRTCL(sym->etype))
             emitcode("setb","ea");
-       
-       if (sym->calleeSave) {
-           int i;
-           
-           /* if any registers used */
-           if (sym->regsUsed) {
-               /* save the registers used */
-               for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
-                   if (bitVectBitValue(sym->regsUsed,i) ||
+
+  if (sym->calleeSave) {
+      int i;
+
+      /* if any registers used */
+      if (sym->regsUsed) {
+    /* save the registers used */
+    for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
+        if (bitVectBitValue(sym->regsUsed,i) ||
                       (mcs51_ptrRegReq && (i == R0_IDX || i == R1_IDX)) )
-                       emitcode("pop","%s",mcs51_regWithIdx(i)->dname);
-               }
-           }
-           
-       }
-
-       /* if debug then send end of function */
-       if (currFunc) {
-           _G.debugLine = 1;
-           emitcode("","C$%s$%d$%d$%d ==.",
-                    ic->filename,currFunc->lastLine,
-                    ic->level,ic->block); 
-           if (IS_STATIC(currFunc->etype))         
-               emitcode("","XF%s$%s$0$0 ==.",moduleName,currFunc->name); 
-           else
-               emitcode("","XG$%s$0$0 ==.",currFunc->name);
-           _G.debugLine = 0;
-       }
+      emitcode("pop","%s",mcs51_regWithIdx(i)->dname);
+    }
+      }
+
+  }
+
+  /* if debug then send end of function */
+  if (currFunc) {
+      _G.debugLine = 1;
+      emitcode("","C$%s$%d$%d$%d ==.",
+         ic->filename,currFunc->lastLine,
+         ic->level,ic->block);
+      if (IS_STATIC(currFunc->etype))
+    emitcode("","XF%s$%s$0$0 ==.",moduleName,currFunc->name);
+      else
+    emitcode("","XG$%s$0$0 ==.",currFunc->name);
+      _G.debugLine = 0;
+  }
 
         emitcode ("ret","");
     }
@@ -2301,52 +2301,52 @@ static void genEndFunction (iCode *ic)
 static void genRet (iCode *ic)
 {
     int size,offset = 0 , pushed = 0;
-    
+
     /* if we have no return value then
        just generate the "ret" */
-    if (!IC_LEFT(ic)) 
-       goto jumpret;       
-    
+    if (!IC_LEFT(ic))
+  goto jumpret;
+
     /* we have something to return then
        move the return value into place */
     aopOp(IC_LEFT(ic),ic,FALSE);
     size = AOP_SIZE(IC_LEFT(ic));
-    
+
     while (size--) {
-           char *l ;
-           if (AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR) {
-                   /* #NOCHANGE */
-                   l = aopGet(AOP(IC_LEFT(ic)),offset++,
-                          FALSE,TRUE);
-                   emitcode("push","%s",l);
-                   pushed++;
-           } else {
-                   l = aopGet(AOP(IC_LEFT(ic)),offset,
-                              FALSE,FALSE);
-                   if (strcmp(fReturn[offset],l))
-                           emitcode("mov","%s,%s",fReturn[offset++],l);
-           }
-    }    
+      char *l ;
+      if (AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR) {
+            /* #NOCHANGE */
+        l = aopGet(AOP(IC_LEFT(ic)),offset++,
+         FALSE,TRUE);
+        emitcode("push","%s",l);
+        pushed++;
+      } else {
+        l = aopGet(AOP(IC_LEFT(ic)),offset,
+             FALSE,FALSE);
+        if (strcmp(fReturn[offset],l))
+          emitcode("mov","%s,%s",fReturn[offset++],l);
+      }
+    }
 
     if (pushed) {
-       while(pushed) {
-           pushed--;
-           if (strcmp(fReturn[pushed],"a"))
-               emitcode("pop",fReturn[pushed]);
-           else
-               emitcode("pop","acc");
-       }
+  while(pushed) {
+      pushed--;
+      if (strcmp(fReturn[pushed],"a"))
+    emitcode("pop",fReturn[pushed]);
+      else
+    emitcode("pop","acc");
+  }
     }
     freeAsmop (IC_LEFT(ic),NULL,ic,TRUE);
-    
+
  jumpret:
-       /* generate a jump to the return label
-          if the next is not the return statement */
+  /* generate a jump to the return label
+     if the next is not the return statement */
     if (!(ic->next && ic->next->op == LABEL &&
-         IC_LABEL(ic->next) == returnLabel))
-       
-       emitcode("ljmp","%05d$",(returnLabel->key+100));
-    
+    IC_LABEL(ic->next) == returnLabel))
+
+  emitcode("ljmp","%05d$",(returnLabel->key+100));
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -2371,26 +2371,26 @@ static void genGoto (iCode *ic)
 
 /*-----------------------------------------------------------------*/
 /* findLabelBackwards: walks back through the iCode chain looking  */
-/* for the given label. Returns number of iCode instructions      */
-/* between that label and given ic.                               */
-/* Returns zero if label not found.                               */
+/* for the given label. Returns number of iCode instructions     */
+/* between that label and given ic.          */
+/* Returns zero if label not found.          */
 /*-----------------------------------------------------------------*/
 static int findLabelBackwards(iCode *ic, int key)
 {
     int count = 0;
-    
+
     while (ic->prev)
     {
         ic = ic->prev;
         count++;
-        
+
         if (ic->op == LABEL && IC_LABEL(ic)->key == key)
         {
             /* printf("findLabelBackwards = %d\n", count); */
             return count;
         }
     }
-    
+
     return 0;
 }
 
@@ -2401,18 +2401,18 @@ static bool genPlusIncr (iCode *ic)
 {
     unsigned int icount ;
     unsigned int size = getDataSize(IC_RESULT(ic));
-    
+
     /* will try to generate an increment */
-    /* if the right side is not a literal 
+    /* if the right side is not a literal
        we cannot */
     if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
         return FALSE ;
-    
+
     /* if the literal value of the right hand side
        is greater than 4 then it is not worth it */
     if ((icount =  floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit)) > 4)
         return FALSE ;
-    
+
     /* if increment 16 bits in register */
     if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) &&
         (size > 1) &&
@@ -2421,10 +2421,10 @@ static bool genPlusIncr (iCode *ic)
         int emitTlbl;
         int labelRange;
 
-       /* If the next instruction is a goto and the goto target
-        * is < 10 instructions previous to this, we can generate
-        * jumps straight to that target.
-        */
+  /* If the next instruction is a goto and the goto target
+   * is < 10 instructions previous to this, we can generate
+   * jumps straight to that target.
+   */
         if (ic->next && ic->next->op == GOTO
             && (labelRange = findLabelBackwards(ic, IC_LABEL(ic->next)->key)) != 0
             && labelRange <= 10 )
@@ -2438,79 +2438,79 @@ static bool genPlusIncr (iCode *ic)
             tlbl = newiTempLabel(NULL);
             emitTlbl = 1;
         }
-       emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
-       if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-          IS_AOP_PREG(IC_RESULT(ic)))
-           emitcode("cjne","%s,#0x00,%05d$"
-                    ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE)
-                    ,tlbl->key+100);
-       else {
-           emitcode("clr","a");
-           emitcode("cjne","a,%s,%05d$"
-                    ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE)
-                    ,tlbl->key+100);
-       }
-    
-       emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE));
-       if (size > 2)
-       {
-           if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-              IS_AOP_PREG(IC_RESULT(ic)))
-               emitcode("cjne","%s,#0x00,%05d$"
-                        ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE)
-                        ,tlbl->key+100);
-           else
-               emitcode("cjne","a,%s,%05d$"
-                        ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE)
-                        ,tlbl->key+100);
-           
-           emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE));
+  emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
+  if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+     IS_AOP_PREG(IC_RESULT(ic)))
+      emitcode("cjne","%s,#0x00,%05d$"
+         ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE)
+         ,tlbl->key+100);
+  else {
+      emitcode("clr","a");
+      emitcode("cjne","a,%s,%05d$"
+         ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE)
+         ,tlbl->key+100);
+  }
+
+  emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE));
+  if (size > 2)
+  {
+      if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+         IS_AOP_PREG(IC_RESULT(ic)))
+    emitcode("cjne","%s,#0x00,%05d$"
+       ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE)
+       ,tlbl->key+100);
+      else
+    emitcode("cjne","a,%s,%05d$"
+       ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE)
+       ,tlbl->key+100);
+
+      emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE));
        }
        if (size > 3)
        {
-           if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-              IS_AOP_PREG(IC_RESULT(ic)))
-               emitcode("cjne","%s,#0x00,%05d$"
-                        ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE)
-                        ,tlbl->key+100);
-           else{
-               emitcode("cjne","a,%s,%05d$"
-                        ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE)
-                        ,tlbl->key+100);
-           }
-           emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB32,FALSE,FALSE));
-       }
-       
-       if (emitTlbl)
-       {
-           emitcode("","%05d$:",tlbl->key+100);
-       }
+      if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+         IS_AOP_PREG(IC_RESULT(ic)))
+    emitcode("cjne","%s,#0x00,%05d$"
+       ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE)
+       ,tlbl->key+100);
+      else{
+    emitcode("cjne","a,%s,%05d$"
+       ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE)
+       ,tlbl->key+100);
+      }
+      emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB32,FALSE,FALSE));
+  }
+
+  if (emitTlbl)
+  {
+      emitcode("","%05d$:",tlbl->key+100);
+  }
         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   )
         return FALSE ;
-    
+
     /* we can if the aops of the left & result match or
        if they are in registers and the registers are the
        same */
     if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) ) {
-       
+
         if (icount > 3) {
-            MOVA(aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));       
+            MOVA(aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
             emitcode("add","a,#0x%02x",((char) icount) & 0xff);
             aopPut(AOP(IC_RESULT(ic)),"a",0);
         } else {
-           
-            while (icount--) 
+
+            while (icount--)
                 emitcode ("inc","%s",aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
         }
-       
+
         return TRUE ;
     }
-    
+
     return FALSE ;
 }
 
@@ -2558,68 +2558,68 @@ static void genPlusBits (iCode *ic)
 #if 0
 /* This is the original version of this code.
  *
- * This is being kept around for reference, 
+ * This is being kept around for reference,
  * because I am not entirely sure I got it right...
  */
 static void adjustArithmeticResult(iCode *ic)
 {
-    if (AOP_SIZE(IC_RESULT(ic)) == 3 && 
-       AOP_SIZE(IC_LEFT(ic)) == 3   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
-       aopPut(AOP(IC_RESULT(ic)),
-              aopGet(AOP(IC_LEFT(ic)),2,FALSE,FALSE),
-              2);
-
-    if (AOP_SIZE(IC_RESULT(ic)) == 3 && 
-       AOP_SIZE(IC_RIGHT(ic)) == 3   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
-       aopPut(AOP(IC_RESULT(ic)),
-              aopGet(AOP(IC_RIGHT(ic)),2,FALSE,FALSE),
-              2);
-    
     if (AOP_SIZE(IC_RESULT(ic)) == 3 &&
-       AOP_SIZE(IC_LEFT(ic)) < 3    &&
-       AOP_SIZE(IC_RIGHT(ic)) < 3   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
-       char buffer[5];
-       sprintf(buffer,"#%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
-       aopPut(AOP(IC_RESULT(ic)),buffer,2);
+  AOP_SIZE(IC_LEFT(ic)) == 3   &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
+  aopPut(AOP(IC_RESULT(ic)),
+         aopGet(AOP(IC_LEFT(ic)),2,FALSE,FALSE),
+         2);
+
+    if (AOP_SIZE(IC_RESULT(ic)) == 3 &&
+  AOP_SIZE(IC_RIGHT(ic)) == 3   &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
+  aopPut(AOP(IC_RESULT(ic)),
+         aopGet(AOP(IC_RIGHT(ic)),2,FALSE,FALSE),
+         2);
+
+    if (AOP_SIZE(IC_RESULT(ic)) == 3 &&
+  AOP_SIZE(IC_LEFT(ic)) < 3    &&
+  AOP_SIZE(IC_RIGHT(ic)) < 3   &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
+  char buffer[5];
+  sprintf(buffer,"#%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
+  aopPut(AOP(IC_RESULT(ic)),buffer,2);
     }
 }
 #else
 /* This is the pure and virtuous version of this code.
- * I'm pretty certain it's right, but not enough to toss the old 
+ * I'm pretty certain it's right, but not enough to toss the old
  * code just yet...
  */
 static void adjustArithmeticResult(iCode *ic)
 {
     if (opIsGptr(IC_RESULT(ic)) &&
-       opIsGptr(IC_LEFT(ic))   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
+      opIsGptr(IC_LEFT(ic))   &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
     {
-       aopPut(AOP(IC_RESULT(ic)),
-              aopGet(AOP(IC_LEFT(ic)), GPTRSIZE - 1,FALSE,FALSE),
-              GPTRSIZE - 1);
+  aopPut(AOP(IC_RESULT(ic)),
+         aopGet(AOP(IC_LEFT(ic)), GPTRSIZE - 1,FALSE,FALSE),
+         GPTRSIZE - 1);
     }
 
     if (opIsGptr(IC_RESULT(ic)) &&
         opIsGptr(IC_RIGHT(ic))   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
     {
-       aopPut(AOP(IC_RESULT(ic)),
-              aopGet(AOP(IC_RIGHT(ic)),GPTRSIZE - 1,FALSE,FALSE),
-              GPTRSIZE - 1);
+  aopPut(AOP(IC_RESULT(ic)),
+         aopGet(AOP(IC_RIGHT(ic)),GPTRSIZE - 1,FALSE,FALSE),
+         GPTRSIZE - 1);
     }
 
-    if (opIsGptr(IC_RESULT(ic))           &&
+    if (opIsGptr(IC_RESULT(ic))      &&
         AOP_SIZE(IC_LEFT(ic)) < GPTRSIZE   &&
         AOP_SIZE(IC_RIGHT(ic)) < GPTRSIZE  &&
-        !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
-        !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
-        char buffer[5];
-        sprintf(buffer,"#%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
-        aopPut(AOP(IC_RESULT(ic)),buffer,GPTRSIZE - 1);
+   !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
+   !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
+   char buffer[5];
+   sprintf(buffer,"#%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
+   aopPut(AOP(IC_RESULT(ic)),buffer,GPTRSIZE - 1);
      }
 }
 #endif
@@ -2641,8 +2641,8 @@ static void genPlus (iCode *ic)
        if left requires ACC or right is already
        in ACC */
     if ((AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) ||
-       (AOP_NEEDSACC(IC_LEFT(ic))) ||
-       AOP_TYPE(IC_RIGHT(ic)) == AOP_ACC ){
+  (AOP_NEEDSACC(IC_LEFT(ic))) ||
+  AOP_TYPE(IC_RIGHT(ic)) == AOP_ACC ){
         operand *t = IC_RIGHT(ic);
         IC_RIGHT(ic) = IC_LEFT(ic);
         IC_LEFT(ic) = t;
@@ -2668,7 +2668,7 @@ static void genPlus (iCode *ic)
         } else {
             size = getDataSize(IC_RESULT(ic));
             while (size--) {
-                MOVA(aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));  
+                MOVA(aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
                 emitcode("addc","a,#00");
                 aopPut(AOP(IC_RESULT(ic)),"a",offset++);
             }
@@ -2679,29 +2679,29 @@ static void genPlus (iCode *ic)
     /* if I can do an increment instead
     of add then GOOD for ME */
     if (genPlusIncr (ic) == TRUE)
-        goto release;   
+        goto release;
 
     size = getDataSize(IC_RESULT(ic));
 
     while(size--){
-       if (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) {
-           MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-           if(offset == 0)
-               emitcode("add","a,%s",
-                        aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
-           else
-               emitcode("addc","a,%s",
-                        aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
-       } else {
-           MOVA(aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
-           if(offset == 0)
-               emitcode("add","a,%s",
-                        aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-           else
-               emitcode("addc","a,%s",
-                        aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-       }
-        aopPut(AOP(IC_RESULT(ic)),"a",offset++);      
+  if (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) {
+      MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+      if(offset == 0)
+    emitcode("add","a,%s",
+       aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+      else
+    emitcode("addc","a,%s",
+       aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+  } else {
+      MOVA(aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+      if(offset == 0)
+    emitcode("add","a,%s",
+       aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+      else
+    emitcode("addc","a,%s",
+       aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+  }
+        aopPut(AOP(IC_RESULT(ic)),"a",offset++);
     }
 
     adjustArithmeticResult(ic);
@@ -2721,7 +2721,7 @@ static bool genMinusDec (iCode *ic)
     unsigned int size = getDataSize(IC_RESULT(ic));
 
     /* will try to generate an increment */
-    /* if the right side is not a literal 
+    /* if the right side is not a literal
     we cannot */
     if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
         return FALSE ;
@@ -2739,14 +2739,14 @@ static bool genMinusDec (iCode *ic)
             int emitTlbl;
             int labelRange;
 
-           /* If the next instruction is a goto and the goto target
-            * is <= 10 instructions previous to this, we can generate
-            * jumps straight to that target.
-            */
+      /* If the next instruction is a goto and the goto target
+       * is <= 10 instructions previous to this, we can generate
+       * jumps straight to that target.
+       */
             if (ic->next && ic->next->op == GOTO
                 && (labelRange = findLabelBackwards(ic, IC_LABEL(ic->next)->key)) != 0
                 && labelRange <= 10 )
-            {        
+            {
                emitcode(";", "tail decrement optimized");
                tlbl = IC_LABEL(ic->next);
                emitTlbl = 0;
@@ -2756,52 +2756,52 @@ static bool genMinusDec (iCode *ic)
                 tlbl = newiTempLabel(NULL);
                 emitTlbl = 1;
             }
-        
-               emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
-               if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-                  IS_AOP_PREG(IC_RESULT(ic)))
-                       emitcode("cjne","%s,#0xff,%05d$"
-                                        ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE)
-                                        ,tlbl->key+100);
-               else{
-                       emitcode("mov","a,#0xff");
-                       emitcode("cjne","a,%s,%05d$"
-                                        ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE)
-                                        ,tlbl->key+100);
-               }
-               emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE));
-               if (size > 2)
-               {
-                       if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-                          IS_AOP_PREG(IC_RESULT(ic)))
-                               emitcode("cjne","%s,#0xff,%05d$"
-                                                ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE)
-                                                ,tlbl->key+100);
-                       else{
-                               emitcode("cjne","a,%s,%05d$"
-                                                ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE)
-                                                ,tlbl->key+100);
-                       }
-                       emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE));
-               }
-               if (size > 3)
-               {
-                       if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
-                          IS_AOP_PREG(IC_RESULT(ic)))
-                               emitcode("cjne","%s,#0xff,%05d$"
-                                                ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE)
-                                                ,tlbl->key+100);
-                       else{
-                               emitcode("cjne","a,%s,%05d$"
-                                                ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE)
-                                                ,tlbl->key+100);
-                       }
-                       emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB32,FALSE,FALSE));
-               }
-               if (emitTlbl)
-               {
-                   emitcode("","%05d$:",tlbl->key+100);
-               }
+
+    emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
+    if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+       IS_AOP_PREG(IC_RESULT(ic)))
+      emitcode("cjne","%s,#0xff,%05d$"
+           ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE)
+           ,tlbl->key+100);
+    else{
+      emitcode("mov","a,#0xff");
+      emitcode("cjne","a,%s,%05d$"
+           ,aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE)
+           ,tlbl->key+100);
+    }
+    emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE));
+    if (size > 2)
+    {
+      if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+         IS_AOP_PREG(IC_RESULT(ic)))
+        emitcode("cjne","%s,#0xff,%05d$"
+             ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE)
+             ,tlbl->key+100);
+      else{
+        emitcode("cjne","a,%s,%05d$"
+             ,aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE)
+             ,tlbl->key+100);
+      }
+      emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE));
+    }
+    if (size > 3)
+    {
+      if(AOP_TYPE(IC_RESULT(ic)) == AOP_REG ||
+         IS_AOP_PREG(IC_RESULT(ic)))
+        emitcode("cjne","%s,#0xff,%05d$"
+             ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE)
+             ,tlbl->key+100);
+      else{
+        emitcode("cjne","a,%s,%05d$"
+             ,aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE)
+             ,tlbl->key+100);
+      }
+      emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB32,FALSE,FALSE));
+    }
+    if (emitTlbl)
+    {
+        emitcode("","%05d$:",tlbl->key+100);
+    }
         return TRUE;
     }
 
@@ -2815,7 +2815,7 @@ static bool genMinusDec (iCode *ic)
     same */
     if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic)))) {
 
-        while (icount--) 
+        while (icount--)
             emitcode ("dec","%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
 
         return TRUE ;
@@ -2835,7 +2835,7 @@ static void addSign(operand *result, int offset, int sign)
             emitcode("rlc","a");
             emitcode("subb","a,acc");
             while(size--)
-                aopPut(AOP(result),"a",offset++); 
+                aopPut(AOP(result),"a",offset++);
         } else
             while(size--)
                 aopPut(AOP(result),zero,offset++);
@@ -2889,9 +2889,9 @@ static void genMinus (iCode *ic)
     /* if I can do an decrement instead
     of subtract then GOOD for ME */
     if (genMinusDec (ic) == TRUE)
-        goto release;   
+        goto release;
 
-    size = getDataSize(IC_RESULT(ic));   
+    size = getDataSize(IC_RESULT(ic));
 
     if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT){
         CLRC;
@@ -2903,8 +2903,8 @@ static void genMinus (iCode *ic)
 
     /* if literal, add a,#-lit, else normal subb */
     while (size--) {
-        MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));    
-        if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)  
+        MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+        if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
             emitcode("subb","a,%s",
                      aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
         else{
@@ -2916,11 +2916,11 @@ static void genMinus (iCode *ic)
                 emitcode("addc","a,#0x%02x",
                          (unsigned int)((lit >> (offset*8)) & 0x0FFL));
         }
-        aopPut(AOP(IC_RESULT(ic)),"a",offset++);      
+        aopPut(AOP(IC_RESULT(ic)),"a",offset++);
     }
 
     adjustArithmeticResult(ic);
-        
+
 release:
     freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(IC_RIGHT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
@@ -2931,8 +2931,8 @@ release:
 /*-----------------------------------------------------------------*/
 /* genMultbits :- multiplication of bits                           */
 /*-----------------------------------------------------------------*/
-static void genMultbits (operand *left, 
-                         operand *right, 
+static void genMultbits (operand *left,
+                         operand *right,
                          operand *result)
 {
     emitcode("mov","c,%s",AOP(left)->aopu.aop_dir);
@@ -2965,7 +2965,7 @@ static void genMultOneByte (operand *left,
     /* signed or unsigned */
     emitcode("mov","b,%s", aopGet(AOP(right),0,FALSE,FALSE));
     l = aopGet(AOP(left),0,FALSE,FALSE);
-    MOVA(l);       
+    MOVA(l);
     emitcode("mul","ab");
     /* if result size = 1, mul signed = mul unsigned */
     aopPut(AOP(result),"a",0);
@@ -2995,8 +2995,8 @@ static void genMultOneByte (operand *left,
                 emitcode("cjne","a,#0x80,%05d$", (lbl->key+100));
                 emitcode("","%05d$:",(lbl->key+100));
                 emitcode("xch","a,%s",aopGet(AOP(right),0,FALSE,FALSE));
-                lbl = newiTempLabel(NULL);      
-                emitcode("jc","%05d$",(lbl->key+100));          
+                lbl = newiTempLabel(NULL);
+                emitcode("jc","%05d$",(lbl->key+100));
                 emitcode("subb","a,%s", aopGet(AOP(left),0,FALSE,FALSE));
                 emitcode("","%05d$:",(lbl->key+100));
             }
@@ -3006,8 +3006,8 @@ static void genMultOneByte (operand *left,
             emitcode("cjne","a,#0x80,%05d$", (lbl->key+100));
             emitcode("","%05d$:",(lbl->key+100));
             emitcode("xch","a,%s",aopGet(AOP(left),0,FALSE,FALSE));
-            lbl = newiTempLabel(NULL);      
-            emitcode("jc","%05d$",(lbl->key+100));          
+            lbl = newiTempLabel(NULL);
+            emitcode("jc","%05d$",(lbl->key+100));
             emitcode("subb","a,%s", aopGet(AOP(right),0,FALSE,FALSE));
             emitcode("","%05d$:",(lbl->key+100));
 
@@ -3018,7 +3018,7 @@ static void genMultOneByte (operand *left,
                 emitcode("subb","a,acc");
             }
         }
-        size -= 2;   
+        size -= 2;
         offset = 2;
         if (size > 0)
             while (size--)
@@ -3033,7 +3033,7 @@ static void genMult (iCode *ic)
 {
     operand *left = IC_LEFT(ic);
     operand *right = IC_RIGHT(ic);
-    operand *result= IC_RESULT(ic);   
+    operand *result= IC_RESULT(ic);
 
     /* assign the amsops */
     aopOp (left,ic,FALSE);
@@ -3055,30 +3055,30 @@ static void genMult (iCode *ic)
         goto release ;
     }
 
-    /* should have been converted to function call */       
+    /* should have been converted to function call */
     assert(1) ;
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genDivbits :- division of bits                                  */
 /*-----------------------------------------------------------------*/
-static void genDivbits (operand *left, 
-                        operand *right, 
+static void genDivbits (operand *left,
+                        operand *right,
                         operand *result)
 {
 
     char *l;
 
-    /* the result must be bit */    
+    /* the result must be bit */
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE));
     l = aopGet(AOP(left),0,FALSE,FALSE);
 
-    MOVA(l);    
+    MOVA(l);
 
     emitcode("div","ab");
     emitcode("rrc","a");
@@ -3104,7 +3104,7 @@ static void genDivOneByte (operand *left,
         /* unsigned is easy */
         emitcode("mov","b,%s", aopGet(AOP(right),0,FALSE,FALSE));
         l = aopGet(AOP(left),0,FALSE,FALSE);
-        MOVA(l);        
+        MOVA(l);
         emitcode("div","ab");
         aopPut(AOP(result),"a",0);
         while (size--)
@@ -3115,23 +3115,23 @@ static void genDivOneByte (operand *left,
     /* signed is a little bit more difficult */
 
     /* save the signs of the operands */
-    l = aopGet(AOP(left),0,FALSE,FALSE);    
-    MOVA(l);    
+    l = aopGet(AOP(left),0,FALSE,FALSE);
+    MOVA(l);
     emitcode("xrl","a,%s",aopGet(AOP(right),0,FALSE,TRUE));
     emitcode("push","acc"); /* save it on the stack */
 
     /* now sign adjust for both left & right */
-    l =  aopGet(AOP(right),0,FALSE,FALSE);    
-    MOVA(l);       
+    l =  aopGet(AOP(right),0,FALSE,FALSE);
+    MOVA(l);
     lbl = newiTempLabel(NULL);
-    emitcode("jnb","acc.7,%05d$",(lbl->key+100));   
-    emitcode("cpl","a");   
+    emitcode("jnb","acc.7,%05d$",(lbl->key+100));
+    emitcode("cpl","a");
     emitcode("inc","a");
     emitcode("","%05d$:",(lbl->key+100));
     emitcode("mov","b,a");
 
     /* sign adjust left side */
-    l =  aopGet(AOP(left),0,FALSE,FALSE);    
+    l =  aopGet(AOP(left),0,FALSE,FALSE);
     MOVA(l);
 
     lbl = newiTempLabel(NULL);
@@ -3146,8 +3146,8 @@ static void genDivOneByte (operand *left,
     only */
     emitcode("mov","b,a");
     lbl = newiTempLabel(NULL);
-    emitcode("pop","acc");   
-    /* if there was an over flow we don't 
+    emitcode("pop","acc");
+    /* if there was an over flow we don't
     adjust the sign of the result */
     emitcode("jb","ov,%05d$",(lbl->key+100));
     emitcode("jnb","acc.7,%05d$",(lbl->key+100));
@@ -3161,7 +3161,7 @@ static void genDivOneByte (operand *left,
     aopPut(AOP(result),"b",0);
     if(size > 0){
         emitcode("mov","c,b.7");
-        emitcode("subb","a,acc");   
+        emitcode("subb","a,acc");
     }
     while (size--)
         aopPut(AOP(result),"a",offset++);
@@ -3175,7 +3175,7 @@ static void genDiv (iCode *ic)
 {
     operand *left = IC_LEFT(ic);
     operand *right = IC_RIGHT(ic);
-    operand *result= IC_RESULT(ic);   
+    operand *result= IC_RESULT(ic);
 
     /* assign the amsops */
     aopOp (left,ic,FALSE);
@@ -3202,24 +3202,24 @@ static void genDiv (iCode *ic)
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genModbits :- modulus of bits                                   */
 /*-----------------------------------------------------------------*/
-static void genModbits (operand *left, 
-                        operand *right, 
+static void genModbits (operand *left,
+                        operand *right,
                         operand *result)
 {
 
     char *l;
 
-    /* the result must be bit */    
+    /* the result must be bit */
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE));
     l = aopGet(AOP(left),0,FALSE,FALSE);
 
-    MOVA(l);       
+    MOVA(l);
 
     emitcode("div","ab");
     emitcode("mov","a,b");
@@ -3243,7 +3243,7 @@ static void genModOneByte (operand *left,
         /* unsigned is easy */
         emitcode("mov","b,%s", aopGet(AOP(right),0,FALSE,FALSE));
         l = aopGet(AOP(left),0,FALSE,FALSE);
-        MOVA(l);    
+        MOVA(l);
         emitcode("div","ab");
         aopPut(AOP(result),"b",0);
         return ;
@@ -3252,30 +3252,30 @@ static void genModOneByte (operand *left,
     /* signed is a little bit more difficult */
 
     /* save the signs of the operands */
-    l = aopGet(AOP(left),0,FALSE,FALSE);    
+    l = aopGet(AOP(left),0,FALSE,FALSE);
     MOVA(l);
 
     emitcode("xrl","a,%s",aopGet(AOP(right),0,FALSE,FALSE));
     emitcode("push","acc"); /* save it on the stack */
 
     /* now sign adjust for both left & right */
-    l =  aopGet(AOP(right),0,FALSE,FALSE);    
+    l =  aopGet(AOP(right),0,FALSE,FALSE);
     MOVA(l);
 
     lbl = newiTempLabel(NULL);
-    emitcode("jnb","acc.7,%05d$",(lbl->key+100));  
-    emitcode("cpl","a");   
+    emitcode("jnb","acc.7,%05d$",(lbl->key+100));
+    emitcode("cpl","a");
     emitcode("inc","a");
     emitcode("","%05d$:",(lbl->key+100));
-    emitcode("mov","b,a"); 
+    emitcode("mov","b,a");
 
     /* sign adjust left side */
-    l =  aopGet(AOP(left),0,FALSE,FALSE);    
+    l =  aopGet(AOP(left),0,FALSE,FALSE);
     MOVA(l);
 
     lbl = newiTempLabel(NULL);
     emitcode("jnb","acc.7,%05d$",(lbl->key+100));
-    emitcode("cpl","a");   
+    emitcode("cpl","a");
     emitcode("inc","a");
     emitcode("","%05d$:",(lbl->key+100));
 
@@ -3284,8 +3284,8 @@ static void genModOneByte (operand *left,
     /* we are interested in the lower order
     only */
     lbl = newiTempLabel(NULL);
-    emitcode("pop","acc");   
-    /* if there was an over flow we don't 
+    emitcode("pop","acc");
+    /* if there was an over flow we don't
     adjust the sign of the result */
     emitcode("jb","ov,%05d$",(lbl->key+100));
     emitcode("jnb","acc.7,%05d$",(lbl->key+100));
@@ -3307,7 +3307,7 @@ static void genMod (iCode *ic)
 {
     operand *left = IC_LEFT(ic);
     operand *right = IC_RIGHT(ic);
-    operand *result= IC_RESULT(ic);  
+    operand *result= IC_RESULT(ic);
 
     /* assign the amsops */
     aopOp (left,ic,FALSE);
@@ -3335,7 +3335,7 @@ static void genMod (iCode *ic)
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3358,14 +3358,14 @@ static void genIfxJump (iCode *ic, char *jval)
         /* false label is present */
         jlbl = IC_FALSE(ic) ;
         inst = ((strcmp(jval,"a") == 0 ? "jnz" :
-                 (strcmp(jval,"c") == 0 ? "jc" : "jb" )));              
+                 (strcmp(jval,"c") == 0 ? "jc" : "jb" )));
     }
-    if (strcmp(inst,"jb") == 0 || strcmp(inst,"jnb") == 0) 
+    if (strcmp(inst,"jb") == 0 || strcmp(inst,"jnb") == 0)
         emitcode(inst,"%s,%05d$",jval,(tlbl->key+100));
     else
         emitcode(inst,"%05d$",tlbl->key+100);
     emitcode("ljmp","%05d$",jlbl->key+100);
-    emitcode("","%05d$:",tlbl->key+100);                
+    emitcode("","%05d$:",tlbl->key+100);
 
     /* mark the icode as generated */
     ic->generated = 1;
@@ -3414,7 +3414,7 @@ static void genCmp (operand *left,operand *right,
                             genIfxJump (ifx,"acc.7");
                             return;
                         }
-                        else    
+                        else
                             emitcode("rlc","a");
                     }
                     goto release;
@@ -3427,15 +3427,15 @@ static void genCmp (operand *left,operand *right,
                     emitcode("xrl","a,#0x80");
                     if (AOP_TYPE(right) == AOP_LIT){
                         unsigned long lit = (unsigned long)
-                           floatFromVal(AOP(right)->aopu.aop_lit);
+          floatFromVal(AOP(right)->aopu.aop_lit);
                         emitcode("subb","a,#0x%02x",
-                                0x80 ^ (unsigned int)((lit >> (offset*8)) & 0x0FFL));                       
+         0x80 ^ (unsigned int)((lit >> (offset*8)) & 0x0FFL));
                     } else {
                         emitcode("mov","b,%s",aopGet(AOP(right),offset++,FALSE,FALSE));
                         emitcode("xrl","b,#0x80");
                         emitcode("subb","a,b");
                     }
-                } else      
+                } else
                     emitcode("subb","a,%s",aopGet(AOP(right),offset++,FALSE,FALSE));
             }
         }
@@ -3481,7 +3481,7 @@ static void genCmpGt (iCode *ic, iCode *ifx)
 
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3510,7 +3510,7 @@ static void genCmpLt (iCode *ic, iCode *ifx)
 
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3522,10 +3522,10 @@ static void gencjneshort(operand *left, operand *right, symbol *lbl)
     int offset = 0;
     unsigned long lit = 0L;
 
-    /* if the left side is a literal or 
-    if the right is in a pointer register and left 
+    /* if the left side is a literal or
+    if the right is in a pointer register and left
     is not */
-    if ((AOP_TYPE(left) == AOP_LIT) || 
+    if ((AOP_TYPE(left) == AOP_LIT) ||
         (IS_AOP_PREG(right) && !IS_AOP_PREG(left))) {
         operand *t = right;
         right = left;
@@ -3547,9 +3547,9 @@ static void gencjneshort(operand *left, operand *right, symbol *lbl)
     }
 
     /* if the right side is in a register or in direct space or
-    if the left is a pointer register & right is not */    
+    if the left is a pointer register & right is not */
     else if (AOP_TYPE(right) == AOP_REG ||
-             AOP_TYPE(right) == AOP_DIR || 
+             AOP_TYPE(right) == AOP_DIR ||
              (AOP_TYPE(left) == AOP_DIR && AOP_TYPE(right) == AOP_LIT) ||
              (IS_AOP_PREG(left) && !IS_AOP_PREG(right))) {
         while (size--) {
@@ -3570,7 +3570,7 @@ static void gencjneshort(operand *left, operand *right, symbol *lbl)
             if(strcmp(l,"b"))
                 emitcode("mov","b,%s",l);
             MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-            emitcode("cjne","a,b,%05d$",lbl->key+100);    
+            emitcode("cjne","a,b,%05d$",lbl->key+100);
             offset++;
         }
     }
@@ -3603,10 +3603,10 @@ static void genCmpEq (iCode *ic, iCode *ifx)
     aopOp((right=IC_RIGHT(ic)),ic,FALSE);
     aopOp((result=IC_RESULT(ic)),ic,TRUE);
 
-    /* if literal, literal on the right or 
-    if the right is in a pointer register and left 
+    /* if literal, literal on the right or
+    if the right is in a pointer register and left
     is not */
-    if ((AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) || 
+    if ((AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) ||
         (IS_AOP_PREG(right) && !IS_AOP_PREG(left))) {
         operand *t = IC_RIGHT(ic);
         IC_RIGHT(ic) = IC_LEFT(ic);
@@ -3646,19 +3646,19 @@ static void genCmpEq (iCode *ic, iCode *ifx)
                 emitcode("jc","%05d$",tlbl->key+100);
                 emitcode("ljmp","%05d$",IC_FALSE(ifx)->key+100);
             }
-            emitcode("","%05d$:",tlbl->key+100);                
+            emitcode("","%05d$:",tlbl->key+100);
         } else {
             tlbl = newiTempLabel(NULL);
             gencjneshort(left, right, tlbl);
             if ( IC_TRUE(ifx) ) {
                 emitcode("ljmp","%05d$",IC_TRUE(ifx)->key+100);
-                emitcode("","%05d$:",tlbl->key+100);                
+                emitcode("","%05d$:",tlbl->key+100);
             } else {
                 symbol *lbl = newiTempLabel(NULL);
                 emitcode("sjmp","%05d$",lbl->key+100);
-                emitcode("","%05d$:",tlbl->key+100);                
+                emitcode("","%05d$:",tlbl->key+100);
                 emitcode("ljmp","%05d$",IC_FALSE(ifx)->key+100);
-                emitcode("","%05d$:",lbl->key+100);             
+                emitcode("","%05d$:",lbl->key+100);
             }
         }
         /* mark the icode as generated */
@@ -3700,7 +3700,7 @@ static void genCmpEq (iCode *ic, iCode *ifx)
         then put the result in place */
         outBitC(result);
     } else {
-        gencjne(left,right,newiTempLabel(NULL));    
+        gencjne(left,right,newiTempLabel(NULL));
         if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) {
             aopPut(AOP(result),"a",0);
             goto release ;
@@ -3711,7 +3711,7 @@ static void genCmpEq (iCode *ic, iCode *ifx)
         }
         /* if the result is used in an arithmetic operation
         then put the result in place */
-        if (AOP_TYPE(result) != AOP_CRY) 
+        if (AOP_TYPE(result) != AOP_CRY)
             outAcc(result);
         /* leave the result in acc */
     }
@@ -3765,7 +3765,7 @@ static void genAndOp (iCode *ic)
         outBitC(result);
     } else {
         tlbl = newiTempLabel(NULL);
-        toBoolean(left);    
+        toBoolean(left);
         emitcode("jz","%05d$",tlbl->key+100);
         toBoolean(right);
         emitcode("","%05d$:",tlbl->key+100);
@@ -3810,7 +3810,7 @@ static void genOrOp (iCode *ic)
 
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);            
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3826,7 +3826,7 @@ static int isLiteralBit(unsigned long lit)
     0x1000000L,0x2000000L,0x4000000L,0x8000000L,
     0x10000000L,0x20000000L,0x40000000L,0x80000000L};
     int idx;
-    
+
     for(idx = 0; idx < 32; idx++)
         if(lit == pw[idx])
             return idx+1;
@@ -3861,7 +3861,7 @@ static void jmpTrueOrFalse (iCode *ic, symbol *tlbl)
     // ugly but optimized by peephole
     if(IC_TRUE(ic)){
         symbol *nlbl = newiTempLabel(NULL);
-        emitcode("sjmp","%05d$",nlbl->key+100);                 
+        emitcode("sjmp","%05d$",nlbl->key+100);
         emitcode("","%05d$:",tlbl->key+100);
         emitcode("ljmp","%05d$",IC_TRUE(ic)->key+100);
         emitcode("","%05d$:",nlbl->key+100);
@@ -3879,7 +3879,7 @@ static void jmpTrueOrFalse (iCode *ic, symbol *tlbl)
 static void genAnd (iCode *ic, iCode *ifx)
 {
     operand *left, *right, *result;
-    int size, offset=0;  
+    int size, offset=0;
     unsigned long lit = 0L;
     int bytelit = 0;
     char buffer[10];
@@ -3899,7 +3899,7 @@ static void genAnd (iCode *ic, iCode *ifx)
 
     /* if left is a literal & right is not then exchange them */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       AOP_NEEDSACC(left)) {
+  AOP_NEEDSACC(left)) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -3965,7 +3965,7 @@ static void genAnd (iCode *ic, iCode *ifx)
             outBitC(result);
         // if(bit & ...)
         else if((AOP_TYPE(result) == AOP_CRY) && ifx)
-            genIfxJump(ifx, "c");           
+            genIfxJump(ifx, "c");
         goto release ;
     }
 
@@ -4032,31 +4032,31 @@ static void genAnd (iCode *ic, iCode *ifx)
             if(AOP_TYPE(right) == AOP_LIT){
                 if((bytelit = (int)((lit >> (offset*8)) & 0x0FFL)) == 0x0FF)
                     continue;
-                else 
-                   if (bytelit == 0)
-                       aopPut(AOP(result),zero,offset);
-                   else 
-                       if (IS_AOP_PREG(result)) {
-                           MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-                           emitcode("anl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
-                           aopPut(AOP(result),"a",offset);
-                       } else
-                           emitcode("anl","%s,%s",
-                                    aopGet(AOP(left),offset,FALSE,TRUE),
-                                    aopGet(AOP(right),offset,FALSE,FALSE));
+                else
+        if (bytelit == 0)
+      aopPut(AOP(result),zero,offset);
+        else
+      if (IS_AOP_PREG(result)) {
+          MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+          emitcode("anl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
+          aopPut(AOP(result),"a",offset);
+      } else
+          emitcode("anl","%s,%s",
+             aopGet(AOP(left),offset,FALSE,TRUE),
+             aopGet(AOP(right),offset,FALSE,FALSE));
             } else {
-               if (AOP_TYPE(left) == AOP_ACC)
-                   emitcode("anl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
-               else {
-                   MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-                   if (IS_AOP_PREG(result)) {
-                       emitcode("anl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
-                       aopPut(AOP(result),"a",offset);
-
-                   } else
-                       emitcode("anl","%s,a",
-                                aopGet(AOP(left),offset,FALSE,TRUE));
-               }
+    if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("anl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
+    else {
+        MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+        if (IS_AOP_PREG(result)) {
+      emitcode("anl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
+      aopPut(AOP(result),"a",offset);
+
+        } else
+      emitcode("anl","%s,a",
+         aopGet(AOP(left),offset,FALSE,TRUE));
+    }
             }
         }
     } else {
@@ -4083,38 +4083,38 @@ static void genAnd (iCode *ic, iCode *ifx)
             } else if(ifx)
                 jmpTrueOrFalse(ifx, tlbl);
         } else {
-           for(;(size--);offset++) {
-               // normal case
-               // result = left & right
-               if(AOP_TYPE(right) == AOP_LIT){
-                   if((bytelit = (int)((lit >> (offset*8)) & 0x0FFL)) == 0x0FF){
-                       aopPut(AOP(result),
-                              aopGet(AOP(left),offset,FALSE,FALSE),
-                              offset);
-                       continue;
-                   } else if(bytelit == 0){
-                       aopPut(AOP(result),zero,offset);
-                       continue;
-                   }
-               }
-               // faster than result <- left, anl result,right
-               // and better if result is SFR
-               if (AOP_TYPE(left) == AOP_ACC) 
-                   emitcode("anl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
-               else {
-                   MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-                   emitcode("anl","a,%s",
-                            aopGet(AOP(left),offset,FALSE,FALSE));
-               }
-               aopPut(AOP(result),"a",offset);
-           }
-       }
+      for(;(size--);offset++) {
+    // normal case
+    // result = left & right
+    if(AOP_TYPE(right) == AOP_LIT){
+        if((bytelit = (int)((lit >> (offset*8)) & 0x0FFL)) == 0x0FF){
+      aopPut(AOP(result),
+             aopGet(AOP(left),offset,FALSE,FALSE),
+             offset);
+      continue;
+        } else if(bytelit == 0){
+      aopPut(AOP(result),zero,offset);
+      continue;
+        }
+    }
+    // faster than result <- left, anl result,right
+    // and better if result is SFR
+    if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("anl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
+    else {
+        MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+        emitcode("anl","a,%s",
+           aopGet(AOP(left),offset,FALSE,FALSE));
+    }
+    aopPut(AOP(result),"a",offset);
+      }
+  }
     }
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);     
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -4141,7 +4141,7 @@ static void genOr (iCode *ic, iCode *ifx)
 
     /* if left is a literal & right is not then exchange them */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       AOP_NEEDSACC(left)) {
+  AOP_NEEDSACC(left)) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -4217,7 +4217,7 @@ static void genOr (iCode *ic, iCode *ifx)
             outBitC(result);
         // if(bit | ...)
         else if((AOP_TYPE(result) == AOP_CRY) && ifx)
-            genIfxJump(ifx, "c");           
+            genIfxJump(ifx, "c");
         goto release ;
     }
 
@@ -4230,7 +4230,7 @@ static void genOr (iCode *ic, iCode *ifx)
             // result = 1
             if(size)
                 emitcode("setb","%s",AOP(result)->aopu.aop_dir);
-            else 
+            else
                 continueIfTrue(ifx);
             goto release;
         } else {
@@ -4258,27 +4258,27 @@ static void genOr (iCode *ic, iCode *ifx)
             if(AOP_TYPE(right) == AOP_LIT){
                 if(((lit >> (offset*8)) & 0x0FFL) == 0x00L)
                     continue;
-                else 
-                   if (IS_AOP_PREG(left)) {
-                       MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-                       emitcode("orl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
-                       aopPut(AOP(result),"a",offset);
-                   } else
-                       emitcode("orl","%s,%s",
-                                aopGet(AOP(left),offset,FALSE,TRUE),
-                                aopGet(AOP(right),offset,FALSE,FALSE));
+                else
+        if (IS_AOP_PREG(left)) {
+      MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+      emitcode("orl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
+      aopPut(AOP(result),"a",offset);
+        } else
+      emitcode("orl","%s,%s",
+         aopGet(AOP(left),offset,FALSE,TRUE),
+         aopGet(AOP(right),offset,FALSE,FALSE));
             } else {
-               if (AOP_TYPE(left) == AOP_ACC) 
-                   emitcode("orl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
-               else {              
-                   MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-                   if (IS_AOP_PREG(left)) {
-                       emitcode("orl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
-                       aopPut(AOP(result),"a",offset);
-                   } else
-                       emitcode("orl","%s,a",
-                                aopGet(AOP(left),offset,FALSE,TRUE));
-               }
+    if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("orl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
+    else {
+        MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+        if (IS_AOP_PREG(left)) {
+      emitcode("orl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
+      aopPut(AOP(result),"a",offset);
+        } else
+      emitcode("orl","%s,a",
+         aopGet(AOP(left),offset,FALSE,TRUE));
+    }
             }
         }
     } else {
@@ -4317,21 +4317,21 @@ static void genOr (iCode *ic, iCode *ifx)
             }
             // faster than result <- left, anl result,right
             // and better if result is SFR
-           if (AOP_TYPE(left) == AOP_ACC) 
-               emitcode("orl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
-           else {
-               MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-               emitcode("orl","a,%s",
-                        aopGet(AOP(left),offset,FALSE,FALSE));
-           }
-           aopPut(AOP(result),"a",offset);                     
+      if (AOP_TYPE(left) == AOP_ACC)
+    emitcode("orl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
+      else {
+    MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+    emitcode("orl","a,%s",
+       aopGet(AOP(left),offset,FALSE,FALSE));
+      }
+      aopPut(AOP(result),"a",offset);
         }
     }
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);     
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -4359,7 +4359,7 @@ static void genXor (iCode *ic, iCode *ifx)
     /* if left is a literal & right is not ||
        if left needs acc & right does not */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       (AOP_NEEDSACC(left) && !AOP_NEEDSACC(right))) {
+  (AOP_NEEDSACC(left) && !AOP_NEEDSACC(right))) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -4436,7 +4436,7 @@ static void genXor (iCode *ic, iCode *ifx)
                         // test the msb of the lsb
                         emitcode("anl","a,#0xfe");
                     emitcode("jnz","%05d$",tlbl->key+100);
-                   sizer--;
+        sizer--;
                 }
                 // val = (0,1)
                 emitcode("rrc","a");
@@ -4451,7 +4451,7 @@ static void genXor (iCode *ic, iCode *ifx)
             outBitC(result);
         // if(bit | ...)
         else if((AOP_TYPE(result) == AOP_CRY) && ifx)
-            genIfxJump(ifx, "c");           
+            genIfxJump(ifx, "c");
         goto release ;
     }
 
@@ -4462,26 +4462,26 @@ static void genXor (iCode *ic, iCode *ifx)
                 if(((lit >> (offset*8)) & 0x0FFL) == 0x00L)
                     continue;
                 else
-                   if (IS_AOP_PREG(left)) {
-                       MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-                       emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
-                       aopPut(AOP(result),"a",offset);
-                   } else 
-                       emitcode("xrl","%s,%s",
-                                aopGet(AOP(left),offset,FALSE,TRUE),
-                                aopGet(AOP(right),offset,FALSE,FALSE));
+        if (IS_AOP_PREG(left)) {
+      MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+      emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
+            aopPut(AOP(result),"a",offset);
+        } else
+      emitcode("xrl","%s,%s",
+         aopGet(AOP(left),offset,FALSE,TRUE),
+         aopGet(AOP(right),offset,FALSE,FALSE));
             } else {
-               if (AOP_TYPE(left) == AOP_ACC)
-                   emitcode("xrl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
-               else {
-                   MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-                   if (IS_AOP_PREG(left)) {
-                       emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
-                       aopPut(AOP(result),"a",offset);
-                   } else
-                       emitcode("xrl","%s,a",
-                                aopGet(AOP(left),offset,FALSE,TRUE));
-               }
+    if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("xrl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
+    else {
+        MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+        if (IS_AOP_PREG(left)) {
+      emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
+      aopPut(AOP(result),"a",offset);
+        } else
+      emitcode("xrl","%s,a",
+         aopGet(AOP(left),offset,FALSE,TRUE));
+    }
             }
         }
     } else {
@@ -4525,21 +4525,21 @@ static void genXor (iCode *ic, iCode *ifx)
             }
             // faster than result <- left, anl result,right
             // and better if result is SFR
-           if (AOP_TYPE(left) == AOP_ACC)
-               emitcode("xrl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
-           else {
-               MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-               emitcode("xrl","a,%s",
-                        aopGet(AOP(left),offset,FALSE,TRUE));
-           }
-           aopPut(AOP(result),"a",offset);
+      if (AOP_TYPE(left) == AOP_ACC)
+    emitcode("xrl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
+      else {
+    MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+    emitcode("xrl","a,%s",
+       aopGet(AOP(left),offset,FALSE,TRUE));
+      }
+      aopPut(AOP(result),"a",offset);
         }
     }
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);     
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -4550,7 +4550,7 @@ static void genInline (iCode *ic)
     char buffer[MAX_INLINEASM];
     char *bp = buffer;
     char *bp1= buffer;
-    
+
     _G.inLine += (!options.asmpeep);
     strcpy(buffer,IC_INLINE(ic));
 
@@ -4584,7 +4584,7 @@ static void genRRC (iCode *ic)
 {
     operand *left , *result ;
     int size, offset = 0;
-    char *l;    
+    char *l;
 
     /* rotate right with carry */
     left = IC_LEFT(ic);
@@ -4593,7 +4593,7 @@ static void genRRC (iCode *ic)
     aopOp (result,ic,FALSE);
 
     /* move it to the result */
-    size = AOP_SIZE(result);    
+    size = AOP_SIZE(result);
     offset = size - 1 ;
     CLRC;
     while (size--) {
@@ -4619,10 +4619,10 @@ static void genRRC (iCode *ic)
 /* genRLC - generate code for rotate left with carry               */
 /*-----------------------------------------------------------------*/
 static void genRLC (iCode *ic)
-{    
+{
     operand *left , *result ;
     int size, offset = 0;
-    char *l;    
+    char *l;
 
     /* rotate right with carry */
     left = IC_LEFT(ic);
@@ -4631,7 +4631,7 @@ static void genRLC (iCode *ic)
     aopOp (result,ic,FALSE);
 
     /* move it to the result */
-    size = AOP_SIZE(result);    
+    size = AOP_SIZE(result);
     offset = 0 ;
     if (size--) {
         l = aopGet(AOP(left),offset,FALSE,FALSE);
@@ -4732,8 +4732,8 @@ static void AccLsh (int shCount)
     if(shCount != 0){
         if(shCount == 1)
             emitcode("add","a,acc");
-        else 
-           if(shCount == 2) {
+        else
+      if(shCount == 2) {
             emitcode("add","a,acc");
             emitcode("add","a,acc");
         } else {
@@ -4911,7 +4911,7 @@ static void AccAXLsh (char *x, int shCount)
             emitcode("anl","a,#0x%02x",
                      SLMask[shCount]);  // DDD00000:(BBB^DDD)CCCCC
             emitcode("xch","a,%s",x);   // (BBB^DDD)CCCCC:DDD00000
-            emitcode("xrl","a,%s",x);   // BBBCCCCC:DDD00000            
+            emitcode("xrl","a,%s",x);   // BBBCCCCC:DDD00000
             break;
         case 6 :                        // AAAAAABB:CCCCCCDD
             emitcode("anl","a,#0x%02x",
@@ -4937,7 +4937,7 @@ static void AccAXLsh (char *x, int shCount)
 /* AccAXRsh - right shift a:x known count (0..7)                   */
 /*-----------------------------------------------------------------*/
 static void AccAXRsh (char *x, int shCount)
-{   
+{
     switch(shCount){
         case 0 :
             break;
@@ -4991,7 +4991,7 @@ static void AccAXRsh (char *x, int shCount)
 /* AccAXRshS - right shift signed a:x known count (0..7)           */
 /*-----------------------------------------------------------------*/
 static void AccAXRshS (char *x, int shCount)
-{   
+{
     symbol *tlbl ;
     switch(shCount){
         case 0 :
@@ -5022,7 +5022,7 @@ static void AccAXRshS (char *x, int shCount)
             emitcode("xch","a,%s",x);   // BBB(CCCCC^AAAAA):000AAAAA
             emitcode("xrl","a,%s",x);   // BBBCCCCC:000AAAAA
             emitcode("xch","a,%s",x);   // 000SAAAA:BBBCCCCC
-            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100); 
+            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100);
             emitcode("orl","a,#0x%02x",
                      (unsigned char)~SRMask[shCount]);  // 111AAAAA:BBBCCCCC
             emitcode("","%05d$:",tlbl->key+100);
@@ -5035,7 +5035,7 @@ static void AccAXRshS (char *x, int shCount)
             emitcode("xch","a,%s",x);   // DDDDDDAA:BBBBBBCC
             emitcode("anl","a,#0x%02x",
                      SRMask[shCount]);  // 000000AA:BBBBBBCC
-            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100); 
+            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100);
             emitcode("orl","a,#0x%02x",
                      (unsigned char)~SRMask[shCount]);  // 111111AA:BBBBBBCC
             emitcode("","%05d$:",tlbl->key+100);
@@ -5047,7 +5047,7 @@ static void AccAXRshS (char *x, int shCount)
             emitcode("xch","a,%s",x);   // DDDDDDDA:BBBBBBCC
             emitcode("anl","a,#0x%02x",
                      SRMask[shCount]);  // 0000000A:BBBBBBBC
-            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100); 
+            emitcode("jnb","acc.%d,%05d$",7-shCount,tlbl->key+100);
             emitcode("orl","a,#0x%02x",
                      (unsigned char)~SRMask[shCount]);  // 1111111A:BBBBBBBC
             emitcode("","%05d$:",tlbl->key+100);
@@ -5065,12 +5065,12 @@ static void shiftL2Left2Result (operand *left, int offl,
 {
     if(sameRegs(AOP(result), AOP(left)) &&
        ((offl + MSB16) == offr)){
-       /* don't crash result[offr] */
-       MOVA(aopGet(AOP(left),offl,FALSE,FALSE));
-       emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
+  /* don't crash result[offr] */
+  MOVA(aopGet(AOP(left),offl,FALSE,FALSE));
+  emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
     } else {
-       movLeft2Result(left,offl, result, offr, 0);
-       MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
+  movLeft2Result(left,offl, result, offr, 0);
+  MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
     }
     /* ax << shCount (x = lsb(result))*/
     AccAXLsh( aopGet(AOP(result),offr,FALSE,FALSE) , shCount);
@@ -5087,12 +5087,12 @@ static void shiftR2Left2Result (operand *left, int offl,
 {
     if(sameRegs(AOP(result), AOP(left)) &&
        ((offl + MSB16) == offr)){
-       /* don't crash result[offr] */
-       MOVA(aopGet(AOP(left),offl,FALSE,FALSE));
-       emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
+  /* don't crash result[offr] */
+  MOVA(aopGet(AOP(left),offl,FALSE,FALSE));
+  emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
     } else {
-       movLeft2Result(left,offl, result, offr, 0);
-       MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
+  movLeft2Result(left,offl, result, offr, 0);
+  MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
     }
     /* a:x >> shCount (x = lsb(result))*/
     if(sign)
@@ -5137,7 +5137,7 @@ static void shiftRLeftOrResult (operand *left, int offl,
 /* genlshOne - left shift a one byte quantity by known count       */
 /*-----------------------------------------------------------------*/
 static void genlshOne (operand *result, operand *left, int shCount)
-{       
+{
     shiftL1Left2Result(left, LSB, result, LSB, shCount);
 }
 
@@ -5147,7 +5147,7 @@ static void genlshOne (operand *result, operand *left, int shCount)
 static void genlshTwo (operand *result,operand *left, int shCount)
 {
     int size;
-    
+
     size = getDataSize(result);
 
     /* if shCount >= 8 */
@@ -5157,17 +5157,17 @@ static void genlshTwo (operand *result,operand *left, int shCount)
         if (size > 1){
             if (shCount)
                 shiftL1Left2Result(left, LSB, result, MSB16, shCount);
-            else 
+            else
                 movLeft2Result(left, LSB, result, MSB16, 0);
         }
-        aopPut(AOP(result),zero,LSB);   
+        aopPut(AOP(result),zero,LSB);
     }
 
     /*  1 <= shCount <= 7 */
-    else {  
+    else {
         if(size == 1)
-            shiftL1Left2Result(left, LSB, result, LSB, shCount); 
-        else 
+            shiftL1Left2Result(left, LSB, result, LSB, shCount);
+        else
             shiftL2Left2Result(left, LSB, result, LSB, shCount);
     }
 }
@@ -5185,52 +5185,52 @@ static void shiftLLong (operand *left, operand *result, int offr )
         l = aopGet(AOP(left),LSB,FALSE,FALSE);
         MOVA(l);
         emitcode("add","a,acc");
-       if (sameRegs(AOP(left),AOP(result)) && 
-           size >= MSB16+offr && offr != LSB )
-           emitcode("xch","a,%s",
-                    aopGet(AOP(left),LSB+offr,FALSE,FALSE));
-       else        
-           aopPut(AOP(result),"a",LSB+offr);
+  if (sameRegs(AOP(left),AOP(result)) &&
+      size >= MSB16+offr && offr != LSB )
+      emitcode("xch","a,%s",
+         aopGet(AOP(left),LSB+offr,FALSE,FALSE));
+  else
+      aopPut(AOP(result),"a",LSB+offr);
     }
 
     if(size >= MSB16+offr){
-       if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB16+offr && offr != LSB) ) {
-           l = aopGet(AOP(left),MSB16,FALSE,FALSE);
-           MOVA(l);
-       }
+  if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB16+offr && offr != LSB) ) {
+      l = aopGet(AOP(left),MSB16,FALSE,FALSE);
+      MOVA(l);
+  }
         emitcode("rlc","a");
-       if (sameRegs(AOP(left),AOP(result)) && 
-           size >= MSB24+offr && offr != LSB)
-           emitcode("xch","a,%s",
-                    aopGet(AOP(left),MSB16+offr,FALSE,FALSE));
-       else        
-           aopPut(AOP(result),"a",MSB16+offr);
+  if (sameRegs(AOP(left),AOP(result)) &&
+      size >= MSB24+offr && offr != LSB)
+      emitcode("xch","a,%s",
+         aopGet(AOP(left),MSB16+offr,FALSE,FALSE));
+  else
+      aopPut(AOP(result),"a",MSB16+offr);
     }
 
     if(size >= MSB24+offr){
-       if (!(sameRegs(AOP(left),AOP(left)) && size >= MSB24+offr && offr != LSB)) {
-           l = aopGet(AOP(left),MSB24,FALSE,FALSE);
-           MOVA(l);
-       }
+  if (!(sameRegs(AOP(left),AOP(left)) && size >= MSB24+offr && offr != LSB)) {
+      l = aopGet(AOP(left),MSB24,FALSE,FALSE);
+      MOVA(l);
+  }
         emitcode("rlc","a");
-       if (sameRegs(AOP(left),AOP(result)) && 
-           size >= MSB32+offr && offr != LSB )
-           emitcode("xch","a,%s",
-                    aopGet(AOP(left),MSB24+offr,FALSE,FALSE));
-       else        
-           aopPut(AOP(result),"a",MSB24+offr);
+  if (sameRegs(AOP(left),AOP(result)) &&
+      size >= MSB32+offr && offr != LSB )
+      emitcode("xch","a,%s",
+         aopGet(AOP(left),MSB24+offr,FALSE,FALSE));
+  else
+      aopPut(AOP(result),"a",MSB24+offr);
     }
 
     if(size > MSB32+offr){
-       if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB32+offr && offr != LSB)) {
-           l = aopGet(AOP(left),MSB32,FALSE,FALSE);
-           MOVA(l);    
-       }
+  if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB32+offr && offr != LSB)) {
+      l = aopGet(AOP(left),MSB32,FALSE,FALSE);
+      MOVA(l);
+  }
         emitcode("rlc","a");
         aopPut(AOP(result),"a",MSB32+offr);
     }
     if(offr != LSB)
-        aopPut(AOP(result),zero,LSB);       
+        aopPut(AOP(result),zero,LSB);
 }
 
 /*-----------------------------------------------------------------*/
@@ -5271,7 +5271,7 @@ static void genlshFour (operand *result, operand *left, int shCount)
         aopPut(AOP(result),zero,MSB16);
         aopPut(AOP(result),zero,LSB);
         return;
-    }    
+    }
 
     /* if more than 1 byte */
     else if ( shCount >= 8 ) {
@@ -5322,7 +5322,7 @@ static void genLeftShiftLiteral (operand *left,
                                  operand *right,
                                  operand *result,
                                  iCode *ic)
-{    
+{
     int shCount = (int) floatFromVal (AOP(right)->aopu.aop_lit);
     int size;
 
@@ -5384,18 +5384,18 @@ static void genLeftShift (iCode *ic)
 
     aopOp(right,ic,FALSE);
 
-    /* if the shift count is known then do it 
+    /* if the shift count is known then do it
     as efficiently as possible */
     if (AOP_TYPE(right) == AOP_LIT) {
         genLeftShiftLiteral (left,right,result,ic);
         return ;
     }
 
-    /* shift count is unknown then we have to form 
+    /* shift count is unknown then we have to form
     a loop get the loop count in B : Note: we take
     only the lower order byte since shifting
     more that 32 bits make no sense anyway, ( the
-    largest size of an object can be only 32 bits ) */  
+    largest size of an object can be only 32 bits ) */
 
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE));
     emitcode("inc","b");
@@ -5405,7 +5405,7 @@ static void genLeftShift (iCode *ic)
 
     /* now move the left to the result if they are not the
     same */
-    if (!sameRegs(AOP(left),AOP(result)) && 
+    if (!sameRegs(AOP(left),AOP(result)) &&
         AOP_SIZE(result) > 1) {
 
         size = AOP_SIZE(result);
@@ -5424,36 +5424,36 @@ static void genLeftShift (iCode *ic)
 
     tlbl = newiTempLabel(NULL);
     size = AOP_SIZE(result);
-    offset = 0 ;   
+    offset = 0 ;
     tlbl1 = newiTempLabel(NULL);
 
     /* if it is only one byte then */
     if (size == 1) {
-       symbol *tlbl1 = newiTempLabel(NULL);
+  symbol *tlbl1 = newiTempLabel(NULL);
 
         l = aopGet(AOP(left),0,FALSE,FALSE);
         MOVA(l);
-       emitcode("sjmp","%05d$",tlbl1->key+100); 
+  emitcode("sjmp","%05d$",tlbl1->key+100);
         emitcode("","%05d$:",tlbl->key+100);
         emitcode("add","a,acc");
-       emitcode("","%05d$:",tlbl1->key+100);
-        emitcode("djnz","b,%05d$",tlbl->key+100);      
+  emitcode("","%05d$:",tlbl1->key+100);
+        emitcode("djnz","b,%05d$",tlbl->key+100);
         aopPut(AOP(result),"a",0);
         goto release ;
     }
-    
-    reAdjustPreg(AOP(result));    
-    
-    emitcode("sjmp","%05d$",tlbl1->key+100); 
-    emitcode("","%05d$:",tlbl->key+100);    
+
+    reAdjustPreg(AOP(result));
+
+    emitcode("sjmp","%05d$",tlbl1->key+100);
+    emitcode("","%05d$:",tlbl->key+100);
     l = aopGet(AOP(result),offset,FALSE,FALSE);
     MOVA(l);
-    emitcode("add","a,acc");         
+    emitcode("add","a,acc");
     aopPut(AOP(result),"a",offset++);
     while (--size) {
         l = aopGet(AOP(result),offset,FALSE,FALSE);
         MOVA(l);
-        emitcode("rlc","a");         
+        emitcode("rlc","a");
         aopPut(AOP(result),"a",offset++);
     }
     reAdjustPreg(AOP(result));
@@ -5486,14 +5486,14 @@ static void genrshTwo (operand *result,operand *left,
         if (shCount)
             shiftR1Left2Result(left, MSB16, result, LSB,
                                shCount, sign);
-        else 
+        else
             movLeft2Result(left, MSB16, result, LSB, sign);
         addSign(result, MSB16, sign);
     }
 
     /*  1 <= shCount <= 7 */
     else
-        shiftR2Left2Result(left, LSB, result, LSB, shCount, sign); 
+        shiftR2Left2Result(left, LSB, result, LSB, shCount, sign);
 }
 
 /*-----------------------------------------------------------------*/
@@ -5594,7 +5594,7 @@ static void genRightShiftLiteral (operand *left,
                                   operand *result,
                                   iCode *ic,
                                   int sign)
-{    
+{
     int shCount = (int) floatFromVal (AOP(right)->aopu.aop_lit);
     int size;
 
@@ -5662,18 +5662,18 @@ static void genSignedRightShift (iCode *ic)
     left  = IC_LEFT(ic);
     result = IC_RESULT(ic);
 
-    aopOp(right,ic,FALSE);  
+    aopOp(right,ic,FALSE);
 
 
     if ( AOP_TYPE(right) == AOP_LIT) {
-       genRightShiftLiteral (left,right,result,ic,1);
-       return ;
+  genRightShiftLiteral (left,right,result,ic,1);
+  return ;
     }
-        /* shift count is unknown then we have to form 
+        /* shift count is unknown then we have to form
        a loop get the loop count in B : Note: we take
        only the lower order byte since shifting
        more that 32 bits make no sense anyway, ( the
-       largest size of an object can be only 32 bits ) */  
+       largest size of an object can be only 32 bits ) */
 
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE));
     emitcode("inc","b");
@@ -5683,7 +5683,7 @@ static void genSignedRightShift (iCode *ic)
 
     /* now move the left to the result if they are not the
     same */
-    if (!sameRegs(AOP(left),AOP(result)) && 
+    if (!sameRegs(AOP(left),AOP(result)) &&
         AOP_SIZE(result) > 1) {
 
         size = AOP_SIZE(result);
@@ -5700,7 +5700,7 @@ static void genSignedRightShift (iCode *ic)
         }
     }
 
-    /* mov the highest order bit to OVR */    
+    /* mov the highest order bit to OVR */
     tlbl = newiTempLabel(NULL);
     tlbl1= newiTempLabel(NULL);
 
@@ -5713,11 +5713,11 @@ static void genSignedRightShift (iCode *ic)
     if (size == 1) {
         l = aopGet(AOP(left),0,FALSE,FALSE);
         MOVA(l);
-       emitcode("sjmp","%05d$",tlbl1->key+100);
+  emitcode("sjmp","%05d$",tlbl1->key+100);
         emitcode("","%05d$:",tlbl->key+100);
         emitcode("mov","c,ov");
         emitcode("rrc","a");
-       emitcode("","%05d$:",tlbl1->key+100);
+  emitcode("","%05d$:",tlbl1->key+100);
         emitcode("djnz","b,%05d$",tlbl->key+100);
         aopPut(AOP(result),"a",0);
         goto release ;
@@ -5725,12 +5725,12 @@ static void genSignedRightShift (iCode *ic)
 
     reAdjustPreg(AOP(result));
     emitcode("sjmp","%05d$",tlbl1->key+100);
-    emitcode("","%05d$:",tlbl->key+100);    
+    emitcode("","%05d$:",tlbl->key+100);
     emitcode("mov","c,ov");
     while (size--) {
         l = aopGet(AOP(result),offset,FALSE,FALSE);
         MOVA(l);
-        emitcode("rrc","a");         
+        emitcode("rrc","a");
         aopPut(AOP(result),"a",offset--);
     }
     reAdjustPreg(AOP(result));
@@ -5775,18 +5775,18 @@ static void genRightShift (iCode *ic)
 
     aopOp(right,ic,FALSE);
 
-    /* if the shift count is known then do it 
+    /* if the shift count is known then do it
     as efficiently as possible */
     if (AOP_TYPE(right) == AOP_LIT) {
         genRightShiftLiteral (left,right,result,ic, 0);
         return ;
     }
 
-    /* shift count is unknown then we have to form 
+    /* shift count is unknown then we have to form
     a loop get the loop count in B : Note: we take
     only the lower order byte since shifting
     more that 32 bits make no sense anyway, ( the
-    largest size of an object can be only 32 bits ) */  
+    largest size of an object can be only 32 bits ) */
 
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE));
     emitcode("inc","b");
@@ -5796,7 +5796,7 @@ static void genRightShift (iCode *ic)
 
     /* now move the left to the result if they are not the
     same */
-    if (!sameRegs(AOP(left),AOP(result)) && 
+    if (!sameRegs(AOP(left),AOP(result)) &&
         AOP_SIZE(result) > 1) {
 
         size = AOP_SIZE(result);
@@ -5822,11 +5822,11 @@ static void genRightShift (iCode *ic)
     if (size == 1) {
         l = aopGet(AOP(left),0,FALSE,FALSE);
         MOVA(l);
-       emitcode("sjmp","%05d$",tlbl1->key+100);
+  emitcode("sjmp","%05d$",tlbl1->key+100);
         emitcode("","%05d$:",tlbl->key+100);
         CLRC;
         emitcode("rrc","a");
-       emitcode("","%05d$:",tlbl1->key+100);
+  emitcode("","%05d$:",tlbl1->key+100);
         emitcode("djnz","b,%05d$",tlbl->key+100);
         aopPut(AOP(result),"a",0);
         goto release ;
@@ -5834,12 +5834,12 @@ static void genRightShift (iCode *ic)
 
     reAdjustPreg(AOP(result));
     emitcode("sjmp","%05d$",tlbl1->key+100);
-    emitcode("","%05d$:",tlbl->key+100);    
+    emitcode("","%05d$:",tlbl->key+100);
     CLRC;
     while (size--) {
         l = aopGet(AOP(result),offset,FALSE,FALSE);
         MOVA(l);
-        emitcode("rrc","a");         
+        emitcode("rrc","a");
         aopPut(AOP(result),"a",offset--);
     }
     reAdjustPreg(AOP(result));
@@ -5856,7 +5856,7 @@ release:
 /* genUnpackBits - generates code for unpacking bits               */
 /*-----------------------------------------------------------------*/
 static void genUnpackBits (operand *result, char *rname, int ptype)
-{    
+{
     int shCnt ;
     int rlen = 0 ;
     sym_link *etype;
@@ -5870,33 +5870,33 @@ static void genUnpackBits (operand *result, char *rname, int ptype)
 
     case POINTER:
     case IPOINTER:
-       emitcode("mov","a,@%s",rname);
-       break;
-       
+  emitcode("mov","a,@%s",rname);
+  break;
+
     case PPOINTER:
-       emitcode("movx","a,@%s",rname);
-       break;
-       
+  emitcode("movx","a,@%s",rname);
+  break;
+
     case FPOINTER:
-       emitcode("movx","a,@dptr");
-       break;
+  emitcode("movx","a,@dptr");
+  break;
 
     case CPOINTER:
-       emitcode("clr","a");
-       emitcode("movc","a","@a+dptr");
-       break;
+  emitcode("clr","a");
+  emitcode("movc","a","@a+dptr");
+  break;
 
     case GPOINTER:
-       emitcode("lcall","__gptrget");
-       break;
+  emitcode("lcall","__gptrget");
+  break;
     }
 
     rlen = SPEC_BLEN(etype) ;
-    
+
     /* if we have bitdisplacement then it fits   */
     /* into this byte completely or if length is */
     /* less than a byte                          */
-    if ((shCnt = SPEC_BSTR(etype)) || 
+    if ((shCnt = SPEC_BSTR(etype)) ||
         (SPEC_BLEN(etype) <= 8))  {
 
         /* shift right acc */
@@ -5913,54 +5913,54 @@ static void genUnpackBits (operand *result, char *rname, int ptype)
 
     while (1)  {
 
-       switch (ptype) {
-       case POINTER:
-       case IPOINTER:
-           emitcode("inc","%s",rname);
-           emitcode("mov","a,@%s",rname);
-           break;
-           
-       case PPOINTER:
-           emitcode("inc","%s",rname);
-           emitcode("movx","a,@%s",rname);
-           break;
-
-       case FPOINTER:
-           emitcode("inc","dptr");
-           emitcode("movx","a,@dptr");
-           break;
-           
-       case CPOINTER:
-           emitcode("clr","a");
-           emitcode("inc","dptr");
-           emitcode("movc","a","@a+dptr");
-           break;
-           
-       case GPOINTER:
-           emitcode("inc","dptr");
-           emitcode("lcall","__gptrget");
-           break;
-       }
-
-       rlen -= 8;            
-       /* if we are done */
-       if ( rlen < 8 )
-           break ;
-       
-       aopPut(AOP(result),"a",offset++);
-                                     
-    }
-    
+  switch (ptype) {
+  case POINTER:
+  case IPOINTER:
+      emitcode("inc","%s",rname);
+      emitcode("mov","a,@%s",rname);
+      break;
+
+  case PPOINTER:
+      emitcode("inc","%s",rname);
+      emitcode("movx","a,@%s",rname);
+      break;
+
+  case FPOINTER:
+      emitcode("inc","dptr");
+      emitcode("movx","a,@dptr");
+      break;
+
+  case CPOINTER:
+      emitcode("clr","a");
+      emitcode("inc","dptr");
+      emitcode("movc","a","@a+dptr");
+      break;
+
+  case GPOINTER:
+      emitcode("inc","dptr");
+      emitcode("lcall","__gptrget");
+      break;
+  }
+
+  rlen -= 8;
+  /* if we are done */
+  if ( rlen < 8 )
+      break ;
+
+  aopPut(AOP(result),"a",offset++);
+
+    }
+
     if (rlen) {
-           //  emitcode("anl","a,#0x%02x",((unsigned char)-1)>>(rlen));
-       AccLsh(8-rlen);
-       aopPut(AOP(result),"a",offset++);
+      //  emitcode("anl","a,#0x%02x",((unsigned char)-1)>>(rlen));
+  AccLsh(8-rlen);
+  aopPut(AOP(result),"a",offset++);
     }
-    
+
  finish:
     if (offset < rsize) {
-           rsize -= offset;
-           while (rsize--) aopPut(AOP(result),zero,offset++);
+      rsize -= offset;
+      while (rsize--) aopPut(AOP(result),zero,offset++);
     }
     return ;
 }
@@ -5969,9 +5969,9 @@ static void genUnpackBits (operand *result, char *rname, int ptype)
 /*-----------------------------------------------------------------*/
 /* genDataPointerGet - generates code when ptr offset is known     */
 /*-----------------------------------------------------------------*/
-static void genDataPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genDataPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
     char *l;
     char buffer[256];
@@ -5982,11 +5982,11 @@ static void genDataPointerGet (operand *left,
     l = aopGet(AOP(left),0,FALSE,TRUE);
     size = AOP_SIZE(result);
     while (size--) {
-       if (offset)
-           sprintf(buffer,"(%s + %d)",l+1,offset);
-       else
-           sprintf(buffer,"%s",l+1);
-       aopPut(AOP(result),buffer,offset++);
+  if (offset)
+      sprintf(buffer,"(%s + %d)",l+1,offset);
+  else
+      sprintf(buffer,"%s",l+1);
+  aopPut(AOP(result),buffer,offset++);
     }
 
     freeAsmop(left,NULL,ic,TRUE);
@@ -5996,174 +5996,174 @@ static void genDataPointerGet (operand *left,
 /*-----------------------------------------------------------------*/
 /* genNearPointerGet - emitcode for near pointer fetch             */
 /*-----------------------------------------------------------------*/
-static void genNearPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genNearPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
     asmop *aop = NULL;
     regs *preg = NULL ;
     char *rname ;
     sym_link *rtype, *retype;
-    sym_link *ltype = operandType(left);    
+    sym_link *ltype = operandType(left);
     char buffer[80];
 
     rtype = operandType(result);
     retype= getSpec(rtype);
-    
+
     aopOp(left,ic,FALSE);
-    
+
     /* if left is rematerialisable and
        result is not bit variable type and
        the left is pointer to data space i.e
        lower 128 bytes of space */
     if (AOP_TYPE(left) == AOP_IMMD &&
-       !IS_BITVAR(retype)         &&
-       DCL_TYPE(ltype) == POINTER) {
-       genDataPointerGet (left,result,ic);
-       return ;
+  !IS_BITVAR(retype)         &&
+  DCL_TYPE(ltype) == POINTER) {
+  genDataPointerGet (left,result,ic);
+  return ;
     }
-    
-       /* if the value is already in a pointer register
+
+  /* if the value is already in a pointer register
        then don't need anything more */
     if (!AOP_INPREG(AOP(left))) {
-       /* otherwise get a free pointer register */
-       aop = newAsmop(0);
-       preg = getFreePtr(ic,&aop,FALSE);
-       emitcode("mov","%s,%s",
-               preg->name,
-               aopGet(AOP(left),0,FALSE,TRUE));
-       rname = preg->name ;
+  /* otherwise get a free pointer register */
+  aop = newAsmop(0);
+  preg = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,%s",
+    preg->name,
+    aopGet(AOP(left),0,FALSE,TRUE));
+  rname = preg->name ;
     } else
-       rname = aopGet(AOP(left),0,FALSE,FALSE);
-    
+  rname = aopGet(AOP(left),0,FALSE,FALSE);
+
     freeAsmop(left,NULL,ic,TRUE);
     aopOp (result,ic,FALSE);
-    
+
       /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype)) 
-       genUnpackBits (result,rname,POINTER);
+    if (IS_BITVAR(retype))
+  genUnpackBits (result,rname,POINTER);
     else {
-       /* we have can just get the values */
-       int size = AOP_SIZE(result);
-       int offset = 0 ;        
-       
-       while (size--) {
-           if (IS_AOP_PREG(result) || AOP_TYPE(result) == AOP_STK ) {
-
-               emitcode("mov","a,@%s",rname);
-               aopPut(AOP(result),"a",offset);
-           } else {
-               sprintf(buffer,"@%s",rname);
-               aopPut(AOP(result),buffer,offset);
-           }
-           offset++ ;
-           if (size)
-               emitcode("inc","%s",rname);
-       }
+  /* we have can just get the values */
+  int size = AOP_SIZE(result);
+  int offset = 0 ;
+
+  while (size--) {
+      if (IS_AOP_PREG(result) || AOP_TYPE(result) == AOP_STK ) {
+
+    emitcode("mov","a,@%s",rname);
+    aopPut(AOP(result),"a",offset);
+      } else {
+    sprintf(buffer,"@%s",rname);
+    aopPut(AOP(result),buffer,offset);
+      }
+      offset++ ;
+      if (size)
+    emitcode("inc","%s",rname);
+  }
     }
 
     /* now some housekeeping stuff */
     if (aop) {
-       /* we had to allocate for this iCode */
-       freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
-       /* we did not allocate which means left
-          already in a pointer register, then
-          if size > 0 && this could be used again
-          we have to point it back to where it 
-          belongs */
-       if (AOP_SIZE(result) > 1 &&
-           !OP_SYMBOL(left)->remat &&
-           ( OP_SYMBOL(left)->liveTo > ic->seq ||
-             ic->depth )) {
-           int size = AOP_SIZE(result) - 1;
-           while (size--)
-               emitcode("dec","%s",rname);
-       }
+  /* we had to allocate for this iCode */
+  freeAsmop(NULL,aop,ic,TRUE);
+    } else {
+  /* we did not allocate which means left
+     already in a pointer register, then
+     if size > 0 && this could be used again
+     we have to point it back to where it
+     belongs */
+  if (AOP_SIZE(result) > 1 &&
+      !OP_SYMBOL(left)->remat &&
+      ( OP_SYMBOL(left)->liveTo > ic->seq ||
+        ic->depth )) {
+      int size = AOP_SIZE(result) - 1;
+      while (size--)
+    emitcode("dec","%s",rname);
+  }
     }
 
     /* done */
     freeAsmop(result,NULL,ic,TRUE);
-     
+
 }
 
 /*-----------------------------------------------------------------*/
 /* genPagedPointerGet - emitcode for paged pointer fetch           */
 /*-----------------------------------------------------------------*/
-static void genPagedPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genPagedPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
     asmop *aop = NULL;
     regs *preg = NULL ;
     char *rname ;
-    sym_link *rtype, *retype;    
+    sym_link *rtype, *retype;
 
     rtype = operandType(result);
     retype= getSpec(rtype);
-    
+
     aopOp(left,ic,FALSE);
 
   /* if the value is already in a pointer register
        then don't need anything more */
     if (!AOP_INPREG(AOP(left))) {
-       /* otherwise get a free pointer register */
-       aop = newAsmop(0);
-       preg = getFreePtr(ic,&aop,FALSE);
-       emitcode("mov","%s,%s",
-               preg->name,
-               aopGet(AOP(left),0,FALSE,TRUE));
-       rname = preg->name ;
+  /* otherwise get a free pointer register */
+  aop = newAsmop(0);
+  preg = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,%s",
+    preg->name,
+    aopGet(AOP(left),0,FALSE,TRUE));
+  rname = preg->name ;
     } else
-       rname = aopGet(AOP(left),0,FALSE,FALSE);
-    
+  rname = aopGet(AOP(left),0,FALSE,FALSE);
+
     freeAsmop(left,NULL,ic,TRUE);
     aopOp (result,ic,FALSE);
 
     /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype)) 
-       genUnpackBits (result,rname,PPOINTER);
+    if (IS_BITVAR(retype))
+  genUnpackBits (result,rname,PPOINTER);
     else {
-       /* we have can just get the values */
-       int size = AOP_SIZE(result);
-       int offset = 0 ;        
-       
-       while (size--) {
-           
-           emitcode("movx","a,@%s",rname);
-           aopPut(AOP(result),"a",offset);
-           
-           offset++ ;
-           
-           if (size)
-               emitcode("inc","%s",rname);
-       }
+  /* we have can just get the values */
+  int size = AOP_SIZE(result);
+  int offset = 0 ;
+
+  while (size--) {
+
+      emitcode("movx","a,@%s",rname);
+      aopPut(AOP(result),"a",offset);
+
+      offset++ ;
+
+      if (size)
+    emitcode("inc","%s",rname);
+  }
     }
 
     /* now some housekeeping stuff */
     if (aop) {
-       /* we had to allocate for this iCode */
-       freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
-       /* we did not allocate which means left
-          already in a pointer register, then
-          if size > 0 && this could be used again
-          we have to point it back to where it 
-          belongs */
-       if (AOP_SIZE(result) > 1 &&
-           !OP_SYMBOL(left)->remat &&
-           ( OP_SYMBOL(left)->liveTo > ic->seq ||
-             ic->depth )) {
-           int size = AOP_SIZE(result) - 1;
-           while (size--)
-               emitcode("dec","%s",rname);
-       }
+  /* we had to allocate for this iCode */
+  freeAsmop(NULL,aop,ic,TRUE);
+    } else {
+  /* we did not allocate which means left
+     already in a pointer register, then
+     if size > 0 && this could be used again
+     we have to point it back to where it
+     belongs */
+  if (AOP_SIZE(result) > 1 &&
+      !OP_SYMBOL(left)->remat &&
+      ( OP_SYMBOL(left)->liveTo > ic->seq ||
+        ic->depth )) {
+      int size = AOP_SIZE(result) - 1;
+      while (size--)
+    emitcode("dec","%s",rname);
+  }
     }
 
     /* done */
     freeAsmop(result,NULL,ic,TRUE);
-    
-       
+
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -6177,7 +6177,7 @@ static void genFarPointerGet (operand *left,
 
     aopOp(left,ic,FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(left) != AOP_STR) {
         /* if this is remateriazable */
@@ -6197,7 +6197,7 @@ static void genFarPointerGet (operand *left,
     aopOp(result,ic,FALSE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype)) 
+    if (IS_BITVAR(retype))
         genUnpackBits(result,"dptr",FPOINTER);
     else {
         size = AOP_SIZE(result);
@@ -6225,7 +6225,7 @@ static void emitcodePointerGet (operand *left,
 
     aopOp(left,ic,FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(left) != AOP_STR) {
         /* if this is remateriazable */
@@ -6245,7 +6245,7 @@ static void emitcodePointerGet (operand *left,
     aopOp(result,ic,FALSE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype)) 
+    if (IS_BITVAR(retype))
         genUnpackBits(result,"dptr",CPOINTER);
     else {
         size = AOP_SIZE(result);
@@ -6274,14 +6274,14 @@ static void genGenPointerGet (operand *left,
 
     aopOp(left,ic,FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(left) != AOP_STR) {
         /* if this is remateriazable */
         if (AOP_TYPE(left) == AOP_IMMD) {
             emitcode("mov","dptr,%s",aopGet(AOP(left),0,TRUE,FALSE));
-           emitcode("mov","b,#%d",pointerCode(retype));
-       }
+      emitcode("mov","b,#%d",pointerCode(retype));
+  }
         else { /* we need to get it byte by byte */
             emitcode("mov","dpl,%s",aopGet(AOP(left),0,FALSE,FALSE));
             emitcode("mov","dph,%s",aopGet(AOP(left),1,FALSE,FALSE));
@@ -6292,16 +6292,16 @@ static void genGenPointerGet (operand *left,
             }
             else
             {
-               emitcode("mov","b,%s",aopGet(AOP(left),2,FALSE,FALSE));
+              emitcode("mov","b,%s",aopGet(AOP(left),2,FALSE,FALSE));
             }
         }
     }
     /* so dptr know contains the address */
     freeAsmop(left,NULL,ic,TRUE);
-    aopOp(result,ic,FALSE); 
+    aopOp(result,ic,FALSE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype)) 
+    if (IS_BITVAR(retype))
         genUnpackBits(result,"dptr",GPOINTER);
     else {
         size = AOP_SIZE(result);
@@ -6335,52 +6335,52 @@ static void genPointerGet (iCode *ic)
     type = operandType(left);
     etype = getSpec(type);
     /* if left is of type of pointer then it is simple */
-    if (IS_PTR(type) && !IS_FUNC(type->next)) 
+    if (IS_PTR(type) && !IS_FUNC(type->next))
         p_type = DCL_TYPE(type);
     else {
-       /* we have to go by the storage class */
-       p_type = PTR_TYPE(SPEC_OCLS(etype));
-
-/*     if (SPEC_OCLS(etype)->codesp ) { */
-/*         p_type = CPOINTER ;  */
-/*     } */
-/*     else */
-/*         if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
-/*             p_type = FPOINTER ; */
-/*         else */
-/*             if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
-/*                 p_type = PPOINTER; */
-/*             else */
-/*                 if (SPEC_OCLS(etype) == idata ) */
-/*                     p_type = IPOINTER; */
-/*                 else */
-/*                     p_type = POINTER ; */
+  /* we have to go by the storage class */
+  p_type = PTR_TYPE(SPEC_OCLS(etype));
+
+/*  if (SPEC_OCLS(etype)->codesp ) { */
+/*      p_type = CPOINTER ;  */
+/*  } */
+/*  else */
+/*      if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
+/*    p_type = FPOINTER ; */
+/*      else */
+/*    if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
+/*        p_type = PPOINTER; */
+/*    else */
+/*        if (SPEC_OCLS(etype) == idata ) */
+/*      p_type = IPOINTER; */
+/*        else */
+/*      p_type = POINTER ; */
     }
 
     /* now that we have the pointer type we assign
     the pointer values */
     switch (p_type) {
 
-    case POINTER:      
+    case POINTER:
     case IPOINTER:
-       genNearPointerGet (left,result,ic);
-       break;
+  genNearPointerGet (left,result,ic);
+  break;
 
     case PPOINTER:
-       genPagedPointerGet(left,result,ic);
-       break;
+  genPagedPointerGet(left,result,ic);
+  break;
 
     case FPOINTER:
-       genFarPointerGet (left,result,ic);
-       break;
+  genFarPointerGet (left,result,ic);
+  break;
 
     case CPOINTER:
-       emitcodePointerGet (left,result,ic);
-       break;
+  emitcodePointerGet (left,result,ic);
+  break;
 
     case GPOINTER:
-       genGenPointerGet (left,result,ic);
-       break;
+  genGenPointerGet (left,result,ic);
+  break;
     }
 
 }
@@ -6395,14 +6395,14 @@ static void genPackBits (sym_link    *etype ,
     int shCount = 0 ;
     int offset = 0  ;
     int rLen = 0 ;
-    int blen, bstr ;   
+    int blen, bstr ;
     char *l ;
 
     blen = SPEC_BLEN(etype);
     bstr = SPEC_BSTR(etype);
 
     l = aopGet(AOP(right),offset++,FALSE,FALSE);
-    MOVA(l);   
+    MOVA(l);
 
     /* if the bit lenth is less than or    */
     /* it exactly fits a byte then         */
@@ -6435,7 +6435,7 @@ static void genPackBits (sym_link    *etype ,
             }
 
             emitcode ("anl","a,#0x%02x",(unsigned char)
-                      ((unsigned char)(0xFF << (blen+bstr)) | 
+                      ((unsigned char)(0xFF << (blen+bstr)) |
                        (unsigned char)(0xFF >> (8-bstr)) ) );
             emitcode ("orl","a,b");
             if (p_type == GPOINTER)
@@ -6462,7 +6462,7 @@ static void genPackBits (sym_link    *etype ,
         return ;
 
     emitcode("inc","%s",rname);
-    rLen = SPEC_BLEN(etype) ;     
+    rLen = SPEC_BLEN(etype) ;
 
     /* now generate for lengths greater than one byte */
     while (1) {
@@ -6490,8 +6490,8 @@ static void genPackBits (sym_link    *etype ,
             case GPOINTER:
                 MOVA(l);
                 emitcode("lcall","__gptrput");
-                break;  
-        }   
+                break;
+        }
         emitcode ("inc","%s",rname);
     }
 
@@ -6529,39 +6529,39 @@ static void genPackBits (sym_link    *etype ,
     switch (p_type) {
 
     case POINTER:
-       emitcode("mov","@%s,a",rname);
-       break;
-       
+  emitcode("mov","@%s,a",rname);
+  break;
+
     case FPOINTER:
-       emitcode("movx","@dptr,a");
-       break;
-       
+  emitcode("movx","@dptr,a");
+  break;
+
     case GPOINTER:
-       emitcode("lcall","__gptrput");
-       break;                  
+  emitcode("lcall","__gptrput");
+  break;
     }
 }
 /*-----------------------------------------------------------------*/
 /* genDataPointerSet - remat pointer to data space                 */
 /*-----------------------------------------------------------------*/
 static void genDataPointerSet(operand *right,
-                             operand *result,
-                             iCode *ic)
+            operand *result,
+            iCode *ic)
 {
     int size, offset = 0 ;
     char *l, buffer[256];
 
     aopOp(right,ic,FALSE);
-    
+
     l = aopGet(AOP(result),0,FALSE,TRUE);
     size = AOP_SIZE(right);
     while (size--) {
-       if (offset)
-           sprintf(buffer,"(%s + %d)",l+1,offset);
-       else
-           sprintf(buffer,"%s",l+1);
-       emitcode("mov","%s,%s",buffer,
-                aopGet(AOP(right),offset++,FALSE,FALSE));
+  if (offset)
+      sprintf(buffer,"(%s + %d)",l+1,offset);
+  else
+      sprintf(buffer,"%s",l+1);
+  emitcode("mov","%s,%s",buffer,
+     aopGet(AOP(right),offset++,FALSE,FALSE));
     }
 
     freeAsmop(right,NULL,ic,TRUE);
@@ -6572,7 +6572,7 @@ static void genDataPointerSet(operand *right,
 /* genNearPointerSet - emitcode for near pointer put                */
 /*-----------------------------------------------------------------*/
 static void genNearPointerSet (operand *right,
-                               operand *result, 
+                               operand *result,
                                iCode *ic)
 {
     asmop *aop = NULL;
@@ -6580,19 +6580,19 @@ static void genNearPointerSet (operand *right,
     char *rname , *l;
     sym_link *retype, *letype;
     sym_link *ptype = operandType(result);
-    
+
     retype= getSpec(operandType(right));
     letype= getSpec(ptype);
     aopOp(result,ic,FALSE);
-    
+
     /* if the result is rematerializable &
        in data space & not a bit variable */
     if (AOP_TYPE(result) == AOP_IMMD &&
-       DCL_TYPE(ptype) == POINTER   &&
-       !IS_BITVAR(retype) &&
-       !IS_BITVAR(letype)) {
-       genDataPointerSet (right,result,ic);
-       return;
+  DCL_TYPE(ptype) == POINTER   &&
+  !IS_BITVAR(retype) &&
+  !IS_BITVAR(letype)) {
+  genDataPointerSet (right,result,ic);
+  return;
     }
 
     /* if the value is already in a pointer register
@@ -6612,12 +6612,12 @@ static void genNearPointerSet (operand *right,
     aopOp (right,ic,FALSE);
 
     /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
         genPackBits ((IS_BITVAR(retype) ? retype : letype),right,rname,POINTER);
     else {
         /* we have can just get the values */
         int size = AOP_SIZE(right);
-        int offset = 0 ;    
+        int offset = 0 ;
 
         while (size--) {
             l = aopGet(AOP(right),offset,FALSE,TRUE);
@@ -6636,11 +6636,11 @@ static void genNearPointerSet (operand *right,
     if (aop) {
         /* we had to allocate for this iCode */
         freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
+    } else {
         /* we did not allocate which means left
         already in a pointer register, then
         if size > 0 && this could be used again
-        we have to point it back to where it 
+        we have to point it back to where it
         belongs */
         if (AOP_SIZE(right) > 1 &&
             !OP_SYMBOL(result)->remat &&
@@ -6662,80 +6662,80 @@ static void genNearPointerSet (operand *right,
 /* genPagedPointerSet - emitcode for Paged pointer put             */
 /*-----------------------------------------------------------------*/
 static void genPagedPointerSet (operand *right,
-                              operand *result, 
-                              iCode *ic)
+             operand *result,
+             iCode *ic)
 {
     asmop *aop = NULL;
     regs *preg = NULL ;
     char *rname , *l;
     sym_link *retype, *letype;
-       
+
     retype= getSpec(operandType(right));
     letype= getSpec(operandType(result));
-    
+
     aopOp(result,ic,FALSE);
-    
+
     /* if the value is already in a pointer register
        then don't need anything more */
     if (!AOP_INPREG(AOP(result))) {
-       /* otherwise get a free pointer register */
-       aop = newAsmop(0);
-       preg = getFreePtr(ic,&aop,FALSE);
-       emitcode("mov","%s,%s",
-               preg->name,
-               aopGet(AOP(result),0,FALSE,TRUE));
-       rname = preg->name ;
+  /* otherwise get a free pointer register */
+  aop = newAsmop(0);
+  preg = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,%s",
+    preg->name,
+    aopGet(AOP(result),0,FALSE,TRUE));
+  rname = preg->name ;
     } else
-       rname = aopGet(AOP(result),0,FALSE,FALSE);
-    
+  rname = aopGet(AOP(result),0,FALSE,FALSE);
+
     freeAsmop(result,NULL,ic,TRUE);
     aopOp (right,ic,FALSE);
 
     /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
-       genPackBits ((IS_BITVAR(retype) ? retype : letype),right,rname,PPOINTER);
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
+  genPackBits ((IS_BITVAR(retype) ? retype : letype),right,rname,PPOINTER);
     else {
-       /* we have can just get the values */
-       int size = AOP_SIZE(right);
-       int offset = 0 ;        
-       
-       while (size--) {
-           l = aopGet(AOP(right),offset,FALSE,TRUE);
-           
-           MOVA(l);
-           emitcode("movx","@%s,a",rname);
-
-           if (size)
-               emitcode("inc","%s",rname);
-
-           offset++;
-       }
-    }
-    
+  /* we have can just get the values */
+  int size = AOP_SIZE(right);
+  int offset = 0 ;
+
+  while (size--) {
+      l = aopGet(AOP(right),offset,FALSE,TRUE);
+
+      MOVA(l);
+      emitcode("movx","@%s,a",rname);
+
+      if (size)
+    emitcode("inc","%s",rname);
+
+      offset++;
+  }
+    }
+
     /* now some housekeeping stuff */
     if (aop) {
-       /* we had to allocate for this iCode */
-       freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
-       /* we did not allocate which means left
-          already in a pointer register, then
-          if size > 0 && this could be used again
-          we have to point it back to where it 
-          belongs */
-       if (AOP_SIZE(right) > 1 &&
-           !OP_SYMBOL(result)->remat &&
-           ( OP_SYMBOL(result)->liveTo > ic->seq ||
-             ic->depth )) {
-           int size = AOP_SIZE(right) - 1;
-           while (size--)
-               emitcode("dec","%s",rname);
-       }
+  /* we had to allocate for this iCode */
+  freeAsmop(NULL,aop,ic,TRUE);
+    } else {
+  /* we did not allocate which means left
+     already in a pointer register, then
+     if size > 0 && this could be used again
+     we have to point it back to where it
+     belongs */
+  if (AOP_SIZE(right) > 1 &&
+      !OP_SYMBOL(result)->remat &&
+      ( OP_SYMBOL(result)->liveTo > ic->seq ||
+        ic->depth )) {
+      int size = AOP_SIZE(right) - 1;
+      while (size--)
+    emitcode("dec","%s",rname);
+  }
     }
 
     /* done */
     freeAsmop(right,NULL,ic,TRUE);
-    
-       
+
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -6749,7 +6749,7 @@ static void genFarPointerSet (operand *right,
     sym_link *letype = getSpec(operandType(result));
     aopOp(result,ic,FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(result) != AOP_STR) {
         /* if this is remateriazable */
@@ -6769,7 +6769,7 @@ static void genFarPointerSet (operand *right,
     aopOp(right,ic,FALSE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
         genPackBits((IS_BITVAR(retype) ? retype : letype),right,"dptr",FPOINTER);
     else {
         size = AOP_SIZE(right);
@@ -6799,7 +6799,7 @@ static void genGenPointerSet (operand *right,
 
     aopOp(result,ic,FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(result) != AOP_STR) {
         /* if this is remateriazable */
@@ -6817,7 +6817,7 @@ static void genGenPointerSet (operand *right,
             }
             else
             {
-               emitcode("mov","b,%s",aopGet(AOP(result),2,FALSE,FALSE));
+              emitcode("mov","b,%s",aopGet(AOP(result),2,FALSE,FALSE));
             }
         }
     }
@@ -6826,7 +6826,7 @@ static void genGenPointerSet (operand *right,
     aopOp(right,ic,FALSE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype) || IS_BITVAR(letype)) 
+    if (IS_BITVAR(retype) || IS_BITVAR(letype))
         genPackBits((IS_BITVAR(retype) ? retype : letype),right,"dptr",GPOINTER);
     else {
         size = AOP_SIZE(right);
@@ -6848,7 +6848,7 @@ static void genGenPointerSet (operand *right,
 /* genPointerSet - stores the value into a pointer location        */
 /*-----------------------------------------------------------------*/
 static void genPointerSet (iCode *ic)
-{    
+{
     operand *right, *result ;
     sym_link *type, *etype;
     int p_type;
@@ -6865,8 +6865,8 @@ static void genPointerSet (iCode *ic)
         p_type = DCL_TYPE(type);
     }
     else {
-       /* we have to go by the storage class */
-       p_type = PTR_TYPE(SPEC_OCLS(etype));
+  /* we have to go by the storage class */
+  p_type = PTR_TYPE(SPEC_OCLS(etype));
     }
 
     /* now that we have the pointer type we assign
@@ -6875,20 +6875,20 @@ static void genPointerSet (iCode *ic)
 
     case POINTER:
     case IPOINTER:
-       genNearPointerSet (right,result,ic);
-       break;
+  genNearPointerSet (right,result,ic);
+  break;
 
     case PPOINTER:
-       genPagedPointerSet (right,result,ic);
-       break;
+  genPagedPointerSet (right,result,ic);
+  break;
 
     case FPOINTER:
-       genFarPointerSet (right,result,ic);
-       break;
+  genFarPointerSet (right,result,ic);
+  break;
 
     case GPOINTER:
-       genGenPointerSet (right,result,ic);
-       break;
+  genGenPointerSet (right,result,ic);
+  break;
     }
 
 }
@@ -6916,14 +6916,14 @@ static void genIfx (iCode *ic, iCode *popIc)
         genIpop(popIc);
 
     /* if the condition is  a bit variable */
-    if (isbit && IS_ITEMP(cond) && 
-       SPIL_LOC(cond))
-       genIfxJump(ic,SPIL_LOC(cond)->rname);
+    if (isbit && IS_ITEMP(cond) &&
+  SPIL_LOC(cond))
+  genIfxJump(ic,SPIL_LOC(cond)->rname);
     else
-       if (isbit && !IS_ITEMP(cond))
-           genIfxJump(ic,OP_SYMBOL(cond)->rname);
-       else
-           genIfxJump(ic,"a");
+  if (isbit && !IS_ITEMP(cond))
+      genIfxJump(ic,OP_SYMBOL(cond)->rname);
+  else
+      genIfxJump(ic,"a");
 
     ic->generated = 1;
 }
@@ -6938,7 +6938,7 @@ static void genAddrOf (iCode *ic)
 
     aopOp(IC_RESULT(ic),ic,FALSE);
 
-    /* if the operand is on the stack then we 
+    /* if the operand is on the stack then we
     need to get the stack offset of this
     variable */
     if (sym->onStack) {
@@ -6947,21 +6947,21 @@ static void genAddrOf (iCode *ic)
         if (sym->stack) {
             emitcode("mov","a,_bp");
             emitcode("add","a,#0x%02x",((char) sym->stack & 0xff));
-            aopPut(AOP(IC_RESULT(ic)),"a",0);       
+            aopPut(AOP(IC_RESULT(ic)),"a",0);
         } else {
             /* we can just move _bp */
             aopPut(AOP(IC_RESULT(ic)),"_bp",0);
         }
         /* fill the result with zero */
         size = AOP_SIZE(IC_RESULT(ic)) - 1;
-        
-        
+
+
         if (options.stack10bit && size < (FPTRSIZE - 1))
         {
-            fprintf(stderr, 
-                   "*** warning: pointer to stack var truncated.\n");
+            fprintf(stderr,
+                  "*** warning: pointer to stack var truncated.\n");
         }
-        
+
         offset = 1;
         while (size--)
         {
@@ -6972,7 +6972,7 @@ static void genAddrOf (iCode *ic)
             }
             else
             {
-               aopPut(AOP(IC_RESULT(ic)),zero,offset++);
+              aopPut(AOP(IC_RESULT(ic)),zero,offset++);
             }
         }
 
@@ -6985,7 +6985,7 @@ static void genAddrOf (iCode *ic)
 
     while (size--) {
         char s[SDCC_NAME_MAX];
-        if (offset) 
+        if (offset)
             sprintf(s,"#(%s >> %d)",
                     sym->rname,
                     offset*8);
@@ -7009,21 +7009,21 @@ static void genFarFarAssign (operand *result, operand *right, iCode *ic)
     char *l ;
     /* first push the right side on to the stack */
     while (size--) {
-       l = aopGet(AOP(right),offset++,FALSE,FALSE);
-       MOVA(l);
-       emitcode ("push","acc");
+  l = aopGet(AOP(right),offset++,FALSE,FALSE);
+  MOVA(l);
+  emitcode ("push","acc");
     }
-    
+
     freeAsmop(right,NULL,ic,FALSE);
     /* now assign DPTR to result */
     aopOp(result,ic,FALSE);
     size = AOP_SIZE(result);
     while (size--) {
-       emitcode ("pop","acc");
-       aopPut(AOP(result),"a",--offset);
+  emitcode ("pop","acc");
+  aopPut(AOP(result),"a",--offset);
     }
     freeAsmop(result,NULL,ic,FALSE);
-       
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -7033,7 +7033,7 @@ static void genAssign (iCode *ic)
 {
     operand *result, *right;
     int size, offset ;
-       unsigned long lit = 0L;
+  unsigned long lit = 0L;
 
     result = IC_RESULT(ic);
     right  = IC_RIGHT(ic) ;
@@ -7043,15 +7043,15 @@ static void genAssign (iCode *ic)
         return ;
 
     aopOp(right,ic,FALSE);
-    
+
     /* special case both in far space */
     if ((AOP_TYPE(right) == AOP_DPTR ||
          AOP_TYPE(right) == AOP_DPTR2) &&
-       IS_TRUE_SYMOP(result)       &&
-       isOperandInFarSpace(result)) {
-       
-       genFarFarAssign (result,right,ic);
-       return ;
+  IS_TRUE_SYMOP(result)       &&
+  isOperandInFarSpace(result)) {
+
+  genFarFarAssign (result,right,ic);
+  return ;
     }
 
     aopOp(result,ic,TRUE);
@@ -7066,7 +7066,7 @@ static void genAssign (iCode *ic)
         /* if the right size is a literal then
         we know what the value is */
         if (AOP_TYPE(right) == AOP_LIT) {
-            if (((int) operandLitValue(right))) 
+            if (((int) operandLitValue(right)))
                 aopPut(AOP(result),one,0);
             else
                 aopPut(AOP(result),zero,0);
@@ -7091,34 +7091,34 @@ static void genAssign (iCode *ic)
     size = AOP_SIZE(result);
     offset = 0 ;
     if(AOP_TYPE(right) == AOP_LIT)
-       lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
+  lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
     if((size > 1) &&
        (AOP_TYPE(result) != AOP_REG) &&
        (AOP_TYPE(right) == AOP_LIT) &&
        !IS_FLOAT(operandType(right)) &&
        (lit < 256L)){
-       emitcode("clr","a");
-       while (size--) {
-           if((unsigned int)((lit >> (size*8)) & 0x0FFL)== 0)
-               aopPut(AOP(result),"a",size);
-           else
-               aopPut(AOP(result),
-                      aopGet(AOP(right),size,FALSE,FALSE),
-                      size);
-       }
+  emitcode("clr","a");
+  while (size--) {
+      if((unsigned int)((lit >> (size*8)) & 0x0FFL)== 0)
+    aopPut(AOP(result),"a",size);
+      else
+    aopPut(AOP(result),
+           aopGet(AOP(right),size,FALSE,FALSE),
+           size);
+  }
     } else {
-       while (size--) {
-           aopPut(AOP(result),
-                  aopGet(AOP(right),offset,FALSE,FALSE),
-                  offset);
-           offset++;
-       }
-    }
-    
+  while (size--) {
+      aopPut(AOP(result),
+       aopGet(AOP(right),offset,FALSE,FALSE),
+       offset);
+      offset++;
+  }
+    }
+
 release:
     freeAsmop (right,NULL,ic,TRUE);
     freeAsmop (result,NULL,ic,TRUE);
-}   
+}
 
 /*-----------------------------------------------------------------*/
 /* genJumpTab - genrates code for jump table                       */
@@ -7171,7 +7171,7 @@ static void genCast (iCode *ic)
         /* if the right size is a literal then
         we know what the value is */
         if (AOP_TYPE(right) == AOP_LIT) {
-            if (((int) operandLitValue(right))) 
+            if (((int) operandLitValue(right)))
                 aopPut(AOP(result),one,0);
             else
                 aopPut(AOP(result),zero,0);
@@ -7215,68 +7215,68 @@ static void genCast (iCode *ic)
     /* if the result is of type pointer */
     if (IS_PTR(ctype)) {
 
-       int p_type;
-       sym_link *type = operandType(right);
-       sym_link *etype = getSpec(type);
-
-       /* pointer to generic pointer */
-       if (IS_GENPTR(ctype)) {
-           char *l = zero;
-           
-           if (IS_PTR(type)) 
-               p_type = DCL_TYPE(type);
-           else {
-               /* we have to go by the storage class */
-               p_type = PTR_TYPE(SPEC_OCLS(etype));
-           }
-               
-           /* the first two bytes are known */
-           size = GPTRSIZE - 1; 
-           offset = 0 ;
-           while (size--) {
-               aopPut(AOP(result),
-                      aopGet(AOP(right),offset,FALSE,FALSE),
-                      offset);
-               offset++;
-           }
-           /* the last byte depending on type */
-           switch (p_type) {
-           case IPOINTER:
-           case POINTER:
-               l = zero;
-               break;
-           case FPOINTER:
-               l = one;
-               break;
-           case CPOINTER:
-               l = "#0x02";
-               break;                          
-           case PPOINTER:
-               l = "#0x03";
-               break;
-               
-           default:
-               /* this should never happen */
-               werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                      "got unknown pointer type");
-               exit(1);
-           }
-           aopPut(AOP(result),l, GPTRSIZE - 1);            
-           goto release ;
-       }
-       
-       /* just copy the pointers */
-       size = AOP_SIZE(result);
-       offset = 0 ;
-       while (size--) {
-           aopPut(AOP(result),
-                  aopGet(AOP(right),offset,FALSE,FALSE),
-                  offset);
-           offset++;
-       }
-       goto release ;
-    }
-    
+  int p_type;
+  sym_link *type = operandType(right);
+  sym_link *etype = getSpec(type);
+
+  /* pointer to generic pointer */
+  if (IS_GENPTR(ctype)) {
+      char *l = zero;
+
+      if (IS_PTR(type))
+    p_type = DCL_TYPE(type);
+      else {
+    /* we have to go by the storage class */
+    p_type = PTR_TYPE(SPEC_OCLS(etype));
+      }
+
+      /* the first two bytes are known */
+      size = GPTRSIZE - 1;
+      offset = 0 ;
+      while (size--) {
+    aopPut(AOP(result),
+           aopGet(AOP(right),offset,FALSE,FALSE),
+           offset);
+    offset++;
+      }
+      /* the last byte depending on type */
+      switch (p_type) {
+      case IPOINTER:
+      case POINTER:
+    l = zero;
+    break;
+      case FPOINTER:
+    l = one;
+    break;
+      case CPOINTER:
+    l = "#0x02";
+    break;
+      case PPOINTER:
+    l = "#0x03";
+    break;
+
+      default:
+    /* this should never happen */
+    werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+           "got unknown pointer type");
+    exit(1);
+      }
+      aopPut(AOP(result),l, GPTRSIZE - 1);
+      goto release ;
+  }
+
+  /* just copy the pointers */
+  size = AOP_SIZE(result);
+  offset = 0 ;
+  while (size--) {
+      aopPut(AOP(result),
+       aopGet(AOP(right),offset,FALSE,FALSE),
+       offset);
+      offset++;
+  }
+  goto release ;
+    }
+
     /* so we now know that the size of destination is greater
     than the size of the source */
     /* we move to result for the size of source */
@@ -7303,7 +7303,7 @@ static void genCast (iCode *ic)
         emitcode("rlc","a");
         emitcode("subb","a,acc");
         while (size--)
-            aopPut(AOP(result),"a",offset++);   
+            aopPut(AOP(result),"a",offset++);
     }
 
     /* we are done hurray !!!! */
@@ -7321,47 +7321,47 @@ static int genDjnz (iCode *ic, iCode *ifx)
 {
     symbol *lbl, *lbl1;
     if (!ifx)
-       return 0;
-    
+  return 0;
+
     /* if the if condition has a false label
        then we cannot save */
     if (IC_FALSE(ifx))
-       return 0;
+  return 0;
 
-    /* if the minus is not of the form 
+    /* if the minus is not of the form
        a = a - 1 */
     if (!isOperandEqual(IC_RESULT(ic),IC_LEFT(ic)) ||
-       !IS_OP_LITERAL(IC_RIGHT(ic)))
-       return 0;
+  !IS_OP_LITERAL(IC_RIGHT(ic)))
+  return 0;
 
     if (operandLitValue(IC_RIGHT(ic)) != 1)
-       return 0;
+  return 0;
 
     /* if the size of this greater than one then no
        saving */
     if (getSize(operandType(IC_RESULT(ic))) > 1)
-       return 0;
+  return 0;
 
     /* otherwise we can save BIG */
     lbl = newiTempLabel(NULL);
     lbl1= newiTempLabel(NULL);
 
     aopOp(IC_RESULT(ic),ic,FALSE);
-    
+
     if (IS_AOP_PREG(IC_RESULT(ic))) {
-       emitcode("dec","%s",
-                aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
-       emitcode("mov","a,%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
-       emitcode("jnz","%05d$",lbl->key+100);
-    } else {   
-       emitcode ("djnz","%s,%05d$",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE),
-                 lbl->key+100);
+  emitcode("dec","%s",
+     aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+  emitcode("mov","a,%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+  emitcode("jnz","%05d$",lbl->key+100);
+    } else {
+  emitcode ("djnz","%s,%05d$",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE),
+      lbl->key+100);
     }
     emitcode ("sjmp","%05d$",lbl1->key+100);
     emitcode ("","%05d$:",lbl->key+100);
     emitcode ("ljmp","%05d$",IC_TRUE(ifx)->key+100);
     emitcode ("","%05d$:",lbl1->key+100);
-    
+
     freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
     ifx->generated = 1;
     return 1;
@@ -7371,31 +7371,31 @@ static int genDjnz (iCode *ic, iCode *ifx)
 /* genReceive - generate code for a receive iCode                  */
 /*-----------------------------------------------------------------*/
 static void genReceive (iCode *ic)
-{    
-    if (isOperandInFarSpace(IC_RESULT(ic)) && 
-       ( OP_SYMBOL(IC_RESULT(ic))->isspilt ||
-         IS_TRUE_SYMOP(IC_RESULT(ic))) ) {
-
-       int size = getSize(operandType(IC_RESULT(ic)));
-       int offset =  fReturnSize - size;
-       while (size--) {
-           emitcode ("push","%s", (strcmp(fReturn[fReturnSize - offset - 1],"a") ?
-                                   fReturn[fReturnSize - offset - 1] : "acc"));
-           offset++;
-       }
-       aopOp(IC_RESULT(ic),ic,FALSE);  
-       size = AOP_SIZE(IC_RESULT(ic));
-       offset = 0;
-       while (size--) {
-           emitcode ("pop","acc");
-           aopPut (AOP(IC_RESULT(ic)),"a",offset++);
-       }
-       
+{
+    if (isOperandInFarSpace(IC_RESULT(ic)) &&
+  ( OP_SYMBOL(IC_RESULT(ic))->isspilt ||
+    IS_TRUE_SYMOP(IC_RESULT(ic))) ) {
+
+  int size = getSize(operandType(IC_RESULT(ic)));
+  int offset =  fReturnSize - size;
+  while (size--) {
+      emitcode ("push","%s", (strcmp(fReturn[fReturnSize - offset - 1],"a") ?
+            fReturn[fReturnSize - offset - 1] : "acc"));
+      offset++;
+  }
+  aopOp(IC_RESULT(ic),ic,FALSE);
+  size = AOP_SIZE(IC_RESULT(ic));
+  offset = 0;
+  while (size--) {
+      emitcode ("pop","acc");
+      aopPut (AOP(IC_RESULT(ic)),"a",offset++);
+  }
+
     } else {
-       _G.accInUse++;
-       aopOp(IC_RESULT(ic),ic,FALSE);  
-       _G.accInUse--;
-       assignResultValue(IC_RESULT(ic));       
+  _G.accInUse++;
+  aopOp(IC_RESULT(ic),ic,FALSE);
+  _G.accInUse--;
+  assignResultValue(IC_RESULT(ic));
     }
 
     freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
@@ -7413,242 +7413,242 @@ void gen51Code (iCode *lic)
 
     /* print the allocation information */
     if (allocInfo)
-       printAllocInfo( currFunc, codeOutFile);
+  printAllocInfo( currFunc, codeOutFile);
     /* if debug information required */
 /*     if (options.debug && currFunc) { */
     if (currFunc) {
-       cdbSymbol(currFunc,cdbFile,FALSE,TRUE);
-       _G.debugLine = 1;
-       if (IS_STATIC(currFunc->etype))
-           emitcode("","F%s$%s$0$0 ==.",moduleName,currFunc->name); 
-       else
-           emitcode("","G$%s$0$0 ==.",currFunc->name);
-       _G.debugLine = 0;
+  cdbSymbol(currFunc,cdbFile,FALSE,TRUE);
+  _G.debugLine = 1;
+  if (IS_STATIC(currFunc->etype))
+      emitcode("","F%s$%s$0$0 ==.",moduleName,currFunc->name);
+  else
+      emitcode("","G$%s$0$0 ==.",currFunc->name);
+  _G.debugLine = 0;
     }
     /* stack pointer name */
     if (options.useXstack)
-       spname = "_spx";
+  spname = "_spx";
     else
-       spname = "sp";
-    
+  spname = "sp";
+
+
     for (ic = lic ; ic ; ic = ic->next ) {
-       
-       if ( cln != ic->lineno ) {
-           if ( options.debug ) {
-               _G.debugLine = 1;
-               emitcode("","C$%s$%d$%d$%d ==.",
-                        ic->filename,ic->lineno,
-                        ic->level,ic->block);
-               _G.debugLine = 0;
-           }
-           emitcode(";","%s %d",ic->filename,ic->lineno);
-           cln = ic->lineno ;
-       }
-       /* if the result is marked as
-          spilt and rematerializable or code for
-          this has already been generated then
-          do nothing */
-       if (resultRemat(ic) || ic->generated ) 
-           continue ;
-       
-       /* depending on the operation */
-       switch (ic->op) {
-       case '!' :
-           genNot(ic);
-           break;
-           
-       case '~' :
-           genCpl(ic);
-           break;
-           
-       case UNARYMINUS:
-           genUminus (ic);
-           break;
-           
-       case IPUSH:
-           genIpush (ic);
-           break;
-           
-       case IPOP:
-           /* IPOP happens only when trying to restore a 
-              spilt live range, if there is an ifx statement
-              following this pop then the if statement might
-              be using some of the registers being popped which
-              would destory the contents of the register so
-              we need to check for this condition and handle it */
-           if (ic->next            && 
-               ic->next->op == IFX &&
-               regsInCommon(IC_LEFT(ic),IC_COND(ic->next))) 
-               genIfx (ic->next,ic);
-           else
-               genIpop (ic);
-           break; 
-           
-       case CALL:
-           genCall (ic);
-           break;
-           
-       case PCALL:
-           genPcall (ic);
-           break;
-           
-       case FUNCTION:
-           genFunction (ic);
-           break;
-           
-       case ENDFUNCTION:
-           genEndFunction (ic);
-           break;
-           
-       case RETURN:
-           genRet (ic);
-           break;
-           
-       case LABEL:
-           genLabel (ic);
-           break;
-           
-       case GOTO:
-           genGoto (ic);
-           break;
-           
-       case '+' :
-           genPlus (ic) ;
-           break;
-           
-       case '-' :
-           if ( ! genDjnz (ic,ifxForOp(IC_RESULT(ic),ic)))
-               genMinus (ic);
-           break;
-           
-       case '*' :
-           genMult (ic);
-           break;
-           
-       case '/' :
-           genDiv (ic) ;
-           break;
-           
-       case '%' :
-           genMod (ic);
-           break;
-           
-       case '>' :
-           genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic));                 
-           break;
-           
-       case '<' :
-           genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case LE_OP:
-       case GE_OP:
-       case NE_OP:
-           
-           /* note these two are xlated by algebraic equivalence
-              during parsing SDCC.y */
-           werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                  "got '>=' or '<=' shouldn't have come here");
-           break;      
-           
-       case EQ_OP:
-           genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;          
-           
-       case AND_OP:
-           genAndOp (ic);
-           break;
-           
-       case OR_OP:
-           genOrOp (ic);
-           break;
-           
-       case '^' :
-           genXor (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case '|' :
-               genOr (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case BITWISEAND:
+
+  if ( cln != ic->lineno ) {
+      if ( options.debug ) {
+    _G.debugLine = 1;
+    emitcode("","C$%s$%d$%d$%d ==.",
+       ic->filename,ic->lineno,
+       ic->level,ic->block);
+    _G.debugLine = 0;
+      }
+      emitcode(";","%s %d",ic->filename,ic->lineno);
+      cln = ic->lineno ;
+  }
+  /* if the result is marked as
+     spilt and rematerializable or code for
+     this has already been generated then
+     do nothing */
+  if (resultRemat(ic) || ic->generated )
+      continue ;
+
+  /* depending on the operation */
+  switch (ic->op) {
+  case '!' :
+      genNot(ic);
+      break;
+
+  case '~' :
+      genCpl(ic);
+      break;
+
+  case UNARYMINUS:
+      genUminus (ic);
+      break;
+
+  case IPUSH:
+      genIpush (ic);
+      break;
+
+  case IPOP:
+      /* IPOP happens only when trying to restore a
+         spilt live range, if there is an ifx statement
+         following this pop then the if statement might
+         be using some of the registers being popped which
+         would destory the contents of the register so
+         we need to check for this condition and handle it */
+      if (ic->next            &&
+    ic->next->op == IFX &&
+    regsInCommon(IC_LEFT(ic),IC_COND(ic->next)))
+    genIfx (ic->next,ic);
+      else
+    genIpop (ic);
+      break;
+
+  case CALL:
+      genCall (ic);
+      break;
+
+  case PCALL:
+      genPcall (ic);
+      break;
+
+  case FUNCTION:
+      genFunction (ic);
+      break;
+
+  case ENDFUNCTION:
+      genEndFunction (ic);
+      break;
+
+  case RETURN:
+      genRet (ic);
+      break;
+
+  case LABEL:
+      genLabel (ic);
+      break;
+
+  case GOTO:
+      genGoto (ic);
+      break;
+
+  case '+' :
+      genPlus (ic) ;
+      break;
+
+  case '-' :
+      if ( ! genDjnz (ic,ifxForOp(IC_RESULT(ic),ic)))
+    genMinus (ic);
+      break;
+
+  case '*' :
+      genMult (ic);
+      break;
+
+  case '/' :
+      genDiv (ic) ;
+      break;
+
+  case '%' :
+      genMod (ic);
+      break;
+
+  case '>' :
+      genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case '<' :
+      genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case LE_OP:
+  case GE_OP:
+  case NE_OP:
+
+      /* note these two are xlated by algebraic equivalence
+         during parsing SDCC.y */
+      werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+       "got '>=' or '<=' shouldn't have come here");
+      break;
+
+  case EQ_OP:
+      genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case AND_OP:
+      genAndOp (ic);
+      break;
+
+  case OR_OP:
+      genOrOp (ic);
+      break;
+
+  case '^' :
+      genXor (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case '|' :
+    genOr (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case BITWISEAND:
             genAnd (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case INLINEASM:
-           genInline (ic);
-           break;
-           
-       case RRC:
-           genRRC (ic);
-           break;
-           
-       case RLC:
-           genRLC (ic);
-           break;
-           
-       case GETHBIT:
-           genGetHbit (ic);
-           break;
-           
-       case LEFT_OP:
-           genLeftShift (ic);
-           break;
-           
-       case RIGHT_OP:
-           genRightShift (ic);
-           break;
-           
-       case GET_VALUE_AT_ADDRESS:
-           genPointerGet(ic);
-           break;
-           
-       case '=' :
-           if (POINTER_SET(ic))
-               genPointerSet(ic);
-           else
-               genAssign(ic);
-           break;
-           
-       case IFX:
-           genIfx (ic,NULL);
-           break;
-           
-       case ADDRESS_OF:
-           genAddrOf (ic);
-           break;
-           
-       case JUMPTABLE:
-           genJumpTab (ic);
-           break;
-           
-       case CAST:
-           genCast (ic);
-           break;
-           
-       case RECEIVE:
-           genReceive(ic);
-           break;
-           
-       case SEND:
-           addSet(&_G.sendSet,ic);
-           break;
-
-       default :
-           ic = ic;
-           /*      piCode(ic,stdout); */
-           
+      break;
+
+  case INLINEASM:
+      genInline (ic);
+      break;
+
+  case RRC:
+      genRRC (ic);
+      break;
+
+  case RLC:
+      genRLC (ic);
+      break;
+
+  case GETHBIT:
+      genGetHbit (ic);
+      break;
+
+  case LEFT_OP:
+      genLeftShift (ic);
+      break;
+
+  case RIGHT_OP:
+      genRightShift (ic);
+      break;
+
+  case GET_VALUE_AT_ADDRESS:
+      genPointerGet(ic);
+      break;
+
+  case '=' :
+      if (POINTER_SET(ic))
+    genPointerSet(ic);
+      else
+    genAssign(ic);
+      break;
+
+  case IFX:
+      genIfx (ic,NULL);
+      break;
+
+  case ADDRESS_OF:
+      genAddrOf (ic);
+      break;
+
+  case JUMPTABLE:
+      genJumpTab (ic);
+      break;
+
+  case CAST:
+      genCast (ic);
+      break;
+
+  case RECEIVE:
+      genReceive(ic);
+      break;
+
+  case SEND:
+      addSet(&_G.sendSet,ic);
+      break;
+
+  default :
+      ic = ic;
+      /*      piCode(ic,stdout); */
+
         }
     }
-    
 
-    /* now we are ready to call the 
+
+    /* now we are ready to call the
        peep hole optimizer */
     if (!options.nopeep)
-       peepHole (&lineHead);
+  peepHole (&lineHead);
 
     /* now do the actual printing */
-    printLine (lineHead,codeOutFile);    
+    printLine (lineHead,codeOutFile);
     return;
 }
index 28acf401f542de3fd3e184dcf27f957a3b75279d..8872f3042c443d552a93486d0f382f4d81b3563c 100644 (file)
@@ -1,32 +1,32 @@
 /*-------------------------------------------------------------------------
   SDCCgen51.c - source file for code generation for 8051
-  
+
   Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
          and -  Jean-Louis VERN.jlvern@writeme.com (1999)
   Bug Fixes  -  Wojciech Stryjewski  wstryj1@tiger.lsu.edu (1999 v2.1.9a)
   PIC port   -  Scott Dattalo scott@dattalo.com (2000)
-  
+
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
-  
+
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  
+
   In other words, you are welcome to use, share and improve this program.
   You are forbidden to forbid anyone else to use, share and improve
   what you give them.   Help stamp out software-hoarding!
-  
+
   Notes:
-  000123 mlh   Moved aopLiteral to SDCCglue.c to help the split
-               Made everything static
+  000123 mlh  Moved aopLiteral to SDCCglue.c to help the split
+      Made everything static
 -------------------------------------------------------------------------*/
 
 #include <stdio.h>
@@ -37,7 +37,7 @@
 #include "newalloc.h"
 
 #if defined(_MSC_VER)
-#define __FUNCTION__           __FILE__
+#define __FUNCTION__    __FILE__
 #endif
 
 #ifdef HAVE_SYS_ISA_DEFS_H
@@ -61,7 +61,7 @@
 //char *aopLiteral (value *val, int offset);
 char *pic14aopLiteral (value *val, int offset);
 
-/* this is the down and dirty file with all kinds of 
+/* this is the down and dirty file with all kinds of
    kludgy & hacky stuff. This is what it is all about
    CODE GENERATION for a specific MCU . some of the
    routines may be reusable, will have to see */
@@ -145,8 +145,8 @@ static int my_powof2 (unsigned long num)
     if( (num & (num-1)) == 0) {
       int nshifts = -1;
       while(num) {
-       num>>=1;
-       nshifts++;
+  num>>=1;
+  nshifts++;
       }
       return nshifts;
     }
@@ -162,23 +162,23 @@ static int my_powof2 (unsigned long num)
 static void emitcode (char *inst,char *fmt, ...)
 {
     va_list ap;
-    char lb[MAX_INLINEASM];  
+    char lb[MAX_INLINEASM];
     char *lbp = lb;
 
-    va_start(ap,fmt);   
+    va_start(ap,fmt);
 
     if (inst && *inst) {
-       if (fmt && *fmt)
-           sprintf(lb,"%s\t",inst);
-       else
-           sprintf(lb,"%s",inst);
+  if (fmt && *fmt)
+      sprintf(lb,"%s\t",inst);
+  else
+      sprintf(lb,"%s",inst);
         vsprintf(lb+(strlen(lb)),fmt,ap);
     }  else
         vsprintf(lb,fmt,ap);
 
     while (isspace(*lbp)) lbp++;
 
-    if (lbp && *lbp) 
+    if (lbp && *lbp)
         lineCurr = (lineCurr ?
                     connectLine(lineCurr,newLineNode(lb)) :
                     (lineHead = newLineNode(lb)));
@@ -190,26 +190,26 @@ static void emitcode (char *inst,char *fmt, ...)
 static void DEBUGemitcode (char *inst,char *fmt, ...)
 {
     va_list ap;
-    char lb[MAX_INLINEASM];  
+    char lb[MAX_INLINEASM];
     char *lbp = lb;
 
     if(!debug_verbose)
       return;
 
-    va_start(ap,fmt);   
+    va_start(ap,fmt);
 
     if (inst && *inst) {
-       if (fmt && *fmt)
-           sprintf(lb,"%s\t",inst);
-       else
-           sprintf(lb,"%s",inst);
+  if (fmt && *fmt)
+      sprintf(lb,"%s\t",inst);
+  else
+      sprintf(lb,"%s",inst);
         vsprintf(lb+(strlen(lb)),fmt,ap);
     }  else
         vsprintf(lb,fmt,ap);
 
     while (isspace(*lbp)) lbp++;
 
-    if (lbp && *lbp) 
+    if (lbp && *lbp)
         lineCurr = (lineCurr ?
                     connectLine(lineCurr,newLineNode(lb)) :
                     (lineHead = newLineNode(lb)));
@@ -233,9 +233,9 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
     /* first check if r0 & r1 are used by this
     instruction, in which case we are in trouble */
     if ((r0iu = bitVectBitValue(ic->rUsed,R0_IDX)) &&
-        (r1iu = bitVectBitValue(ic->rUsed,R1_IDX))) 
+        (r1iu = bitVectBitValue(ic->rUsed,R1_IDX)))
     {
-        goto endOfWorld;      
+        goto endOfWorld;
     }
 
     r0ou = bitVectBitValue(ic->rMask,R0_IDX);
@@ -245,7 +245,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
     if (!r0iu && !r0ou) {
         ic->rUsed = bitVectSetBit(ic->rUsed,R0_IDX);
         (*aopp)->type = AOP_R0;
-        
+
         return (*aopp)->aopu.aop_ptr = pic14_regWithIdx(R0_IDX);
     }
 
@@ -255,7 +255,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
         (*aopp)->type = AOP_R1;
 
         return (*aopp)->aopu.aop_ptr = pic14_regWithIdx(R1_IDX);
-    }    
+    }
 
     /* now we know they both have usage */
     /* if r0 not used in this instruction */
@@ -266,7 +266,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
                       pic14_regWithIdx(R0_IDX)->dname);
             _G.r0Pushed++ ;
         }
-        
+
         ic->rUsed = bitVectSetBit(ic->rUsed,R0_IDX);
         (*aopp)->type = AOP_R0;
 
@@ -282,7 +282,7 @@ static regs *getFreePtr (iCode *ic, asmop **aopp, bool result)
                       pic14_regWithIdx(R1_IDX)->dname);
             _G.r1Pushed++ ;
         }
-        
+
         ic->rUsed = bitVectSetBit(ic->rUsed,R1_IDX);
         (*aopp)->type = AOP_R1;
         return pic14_regWithIdx(R1_IDX);
@@ -292,7 +292,7 @@ endOfWorld :
     /* I said end of world but not quite end of world yet */
     /* if this is a result then we can push it on the stack*/
     if (result) {
-        (*aopp)->type = AOP_STK;    
+        (*aopp)->type = AOP_STK;
         return NULL;
     }
 
@@ -310,7 +310,7 @@ static asmop *newAsmop (short type)
 {
     asmop *aop;
 
-    aop = Safe_calloc(sizeof(asmop));
+    aop = Safe_calloc(1,sizeof(asmop));
     aop->type = type;
     return aop;
 }
@@ -354,13 +354,13 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
 
     /* assign depending on the storage class */
     /* if it is on the stack or indirectly addressable */
-    /* space we need to assign either r0 or r1 to it   */    
+    /* space we need to assign either r0 or r1 to it   */
     if ((sym->onStack && !options.stack10bit) || sym->iaccess) {
         sym->aop = aop = newAsmop(0);
         aop->aopu.aop_ptr = getFreePtr(ic,&aop,result);
         aop->size = getSize(sym->type);
 
-        /* now assign the address of the variable to 
+        /* now assign the address of the variable to
         the pointer register */
         if (aop->type != AOP_STK) {
 
@@ -371,8 +371,8 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
                     emitcode("mov","a,_bp");
                     emitcode("add","a,#0x%02x",
                              ((sym->stack < 0) ?
-                             ((char)(sym->stack - _G.nRegsSaved )) :
-                             ((char)sym->stack)) & 0xff);
+            ((char)(sym->stack - _G.nRegsSaved )) :
+            ((char)sym->stack)) & 0xff);
                     emitcode("mov","%s,a",
                              aop->aopu.aop_ptr->name);
 
@@ -387,36 +387,36 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
             aop->aopu.aop_stk = sym->stack;
         return aop;
     }
-    
+
     if (sym->onStack && options.stack10bit)
     {
         /* It's on the 10 bit stack, which is located in
          * far data space.
          */
-         
+
       //DEBUGemitcode(";","%d",__LINE__);
 
         if ( _G.accInUse )
-               emitcode("push","acc");
+          emitcode("push","acc");
 
         emitcode("mov","a,_bp");
         emitcode("add","a,#0x%02x",
                  ((sym->stack < 0) ?
                    ((char)(sym->stack - _G.nRegsSaved )) :
                    ((char)sym->stack)) & 0xff);
-        
+
         genSetDPTR(1);
         emitcode ("mov","dpx1,#0x40");
         emitcode ("mov","dph1,#0x00");
         emitcode ("mov","dpl1, a");
         genSetDPTR(0);
-       
+
         if ( _G.accInUse )
             emitcode("pop","acc");
-            
+
         sym->aop = aop = newAsmop(AOP_DPTR2);
-       aop->size = getSize(sym->type); 
-       return aop;
+      aop->size = getSize(sym->type);
+      return aop;
     }
 
     //DEBUGemitcode(";","%d",__LINE__);
@@ -425,7 +425,7 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
         sym->aop = aop = newAsmop (AOP_CRY);
         aop->aopu.aop_dir = sym->rname ;
         aop->size = getSize(sym->type);
-       DEBUGemitcode(";","%d sym->rname = %s, size = %d",__LINE__,sym->rname,aop->size);
+  DEBUGemitcode(";","%d sym->rname = %s, size = %d",__LINE__,sym->rname,aop->size);
         return aop;
     }
     /* if it is in direct space */
@@ -433,16 +433,16 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
         sym->aop = aop = newAsmop (AOP_DIR);
         aop->aopu.aop_dir = sym->rname ;
         aop->size = getSize(sym->type);
-       DEBUGemitcode(";","%d sym->rname = %s, size = %d",__LINE__,sym->rname,aop->size);
+  DEBUGemitcode(";","%d sym->rname = %s, size = %d",__LINE__,sym->rname,aop->size);
         return aop;
     }
 
     /* special case for a function */
-    if (IS_FUNC(sym->type)) {   
-        sym->aop = aop = newAsmop(AOP_IMMD);    
-        aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
+    if (IS_FUNC(sym->type)) {
+        sym->aop = aop = newAsmop(AOP_IMMD);
+        aop->aopu.aop_immd = Safe_calloc(1,strlen(sym->rname)+1);
         strcpy(aop->aopu.aop_immd,sym->rname);
-        aop->size = FPTRSIZE; 
+        aop->size = FPTRSIZE;
         return aop;
     }
 
@@ -458,7 +458,7 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result)
     if (IN_CODESPACE(space))
         aop->code = 1;
 
-    return aop;     
+    return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -471,28 +471,28 @@ static asmop *aopForRemat (symbol *sym)
     int val = 0;
     DEBUGemitcode(";","%s %d",__FUNCTION__,__LINE__);
     for (;;) {
-       if (ic->op == '+')
-           val += operandLitValue(IC_RIGHT(ic));
-       else if (ic->op == '-')
-           val -= operandLitValue(IC_RIGHT(ic));
-       else
-           break;
-       
-       ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode;
+      if (ic->op == '+')
+      val += operandLitValue(IC_RIGHT(ic));
+  else if (ic->op == '-')
+      val -= operandLitValue(IC_RIGHT(ic));
+  else
+      break;
+
+  ic = OP_SYMBOL(IC_LEFT(ic))->rematiCode;
     }
 
     if (val)
-       sprintf(buffer,"(%s %c 0x%04x)",
-               OP_SYMBOL(IC_LEFT(ic))->rname, 
-               val >= 0 ? '+' : '-',
-               abs(val) & 0xffff);
+      sprintf(buffer,"(%s %c 0x%04x)",
+          OP_SYMBOL(IC_LEFT(ic))->rname,
+    val >= 0 ? '+' : '-',
+    abs(val) & 0xffff);
     else
-       strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
+  strcpy(buffer,OP_SYMBOL(IC_LEFT(ic))->rname);
 
     //DEBUGemitcode(";","%s",buffer);
-    aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
-    strcpy(aop->aopu.aop_immd,buffer);    
-    return aop;        
+    aop->aopu.aop_immd = Safe_calloc(1,strlen(buffer)+1);
+    strcpy(aop->aopu.aop_immd,buffer);
+    return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -547,8 +547,8 @@ static bool operandsEqu ( operand *op1, operand *op2)
     /* if both are itemps & one is spilt
        and the other is not then false */
     if (IS_ITEMP(op1) && IS_ITEMP(op2) &&
-       sym1->isspilt != sym2->isspilt )
-       return FALSE ;
+  sym1->isspilt != sym2->isspilt )
+  return FALSE ;
 
     /* if they are the same */
     if (sym1 == sym2)
@@ -559,16 +559,16 @@ static bool operandsEqu ( operand *op1, operand *op2)
 
 
     /* if left is a tmp & right is not */
-    if (IS_ITEMP(op1)  && 
+    if (IS_ITEMP(op1)  &&
         !IS_ITEMP(op2) &&
         sym1->isspilt  &&
         (sym1->usl.spillLoc == sym2))
         return TRUE;
 
-    if (IS_ITEMP(op2)  && 
+    if (IS_ITEMP(op2)  &&
         !IS_ITEMP(op1) &&
         sym2->isspilt  &&
-       sym1->level > 0 &&
+  sym1->level > 0 &&
         (sym2->usl.spillLoc == sym1))
         return TRUE ;
 
@@ -634,7 +634,7 @@ static void aopOp (operand *op, iCode *ic, bool result)
     }
 
     /* if this is a true symbol */
-    if (IS_TRUE_SYMOP(op)) {    
+    if (IS_TRUE_SYMOP(op)) {
       DEBUGemitcode(";","%d",__LINE__);
         op->aop = aopForSym(ic,OP_SYMBOL(op),result);
         return ;
@@ -644,8 +644,8 @@ static void aopOp (operand *op, iCode *ic, bool result)
     only four choices :
     a) register
     b) spillocation
-    c) rematerialize 
-    d) conditional   
+    c) rematerialize
+    d) conditional
     e) can be a return use only */
 
     sym = OP_SYMBOL(op);
@@ -660,7 +660,7 @@ static void aopOp (operand *op, iCode *ic, bool result)
     }
 
     /* if it is spilt then two situations
-    a) is rematerialize 
+    a) is rematerialize
     b) has a spill location */
     if (sym->isspilt || sym->nRegs == 0) {
 
@@ -670,33 +670,33 @@ static void aopOp (operand *op, iCode *ic, bool result)
             sym->aop = op->aop = aop =
                                       aopForRemat (sym);
             aop->size = getSize(sym->type);
-           DEBUGemitcode(";","%d",__LINE__);
+      DEBUGemitcode(";","%d",__LINE__);
             return;
         }
 
-       if (sym->accuse) {
-           int i;
+  if (sym->accuse) {
+      int i;
             aop = op->aop = sym->aop = newAsmop(AOP_ACC);
             aop->size = getSize(sym->type);
             for ( i = 0 ; i < 2 ; i++ )
                 aop->aopu.aop_str[i] = accUse[i];
-           DEBUGemitcode(";","%d",__LINE__);
-            return;  
-       }
+      DEBUGemitcode(";","%d",__LINE__);
+            return;
+  }
 
         if (sym->ruonly ) {
             int i;
             aop = op->aop = sym->aop = newAsmop(AOP_STR);
             aop->size = getSize(sym->type);
             for ( i = 0 ; i < fReturnSize ; i++ )
-             aop->aopu.aop_str[i] = fReturn[i];
-           DEBUGemitcode(";","%d",__LINE__);
+        aop->aopu.aop_str[i] = fReturn[i];
+      DEBUGemitcode(";","%d",__LINE__);
             return;
         }
 
         /* else spill location  */
-       DEBUGemitcode(";","%s %d %s",__FUNCTION__,__LINE__,sym->usl.spillLoc->rname);
-        sym->aop = op->aop = aop = 
+  DEBUGemitcode(";","%s %d %s",__FUNCTION__,__LINE__,sym->usl.spillLoc->rname);
+        sym->aop = op->aop = aop =
                                   aopForSym(ic,sym->usl.spillLoc,result);
         aop->size = getSize(sym->type);
         return;
@@ -713,19 +713,19 @@ static void aopOp (operand *op, iCode *ic, bool result)
 /* freeAsmop - free up the asmop given to an operand               */
 /*----------------------------------------------------------------*/
 static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
-{   
+{
     asmop *aop ;
 
     if (!op)
         aop = aaop;
-    else 
+    else
         aop = op->aop;
 
     if (!aop)
         return ;
 
     if (aop->freed)
-        goto dealloc; 
+        goto dealloc;
 
     aop->freed = 1;
 
@@ -735,7 +735,7 @@ static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
         case AOP_R0 :
             if (_G.r0Pushed ) {
                 if (pop) {
-                    emitcode ("pop","ar0");     
+                    emitcode ("pop","ar0");
                     _G.r0Pushed--;
                 }
             }
@@ -749,27 +749,27 @@ static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
                     _G.r1Pushed--;
                 }
             }
-            bitVectUnSetBit(ic->rUsed,R1_IDX);          
+            bitVectUnSetBit(ic->rUsed,R1_IDX);
             break;
 
         case AOP_STK :
         {
-            int sz = aop->size;    
+            int sz = aop->size;
             int stk = aop->aopu.aop_stk + aop->size;
             bitVectUnSetBit(ic->rUsed,R0_IDX);
-            bitVectUnSetBit(ic->rUsed,R1_IDX);          
+            bitVectUnSetBit(ic->rUsed,R1_IDX);
 
             getFreePtr(ic,&aop,FALSE);
-            
+
             if (options.stack10bit)
             {
                 /* I'm not sure what to do here yet... */
                 /* #STUB */
-               fprintf(stderr, 
-                       "*** Warning: probably generating bad code for "
-                       "10 bit stack mode.\n");
+              fprintf(stderr,
+                "*** Warning: probably generating bad code for "
+                "10 bit stack mode.\n");
             }
-            
+
             if (stk) {
                 emitcode ("mov","a,_bp");
                 emitcode ("add","a,#0x%02x",((char)stk) & 0xff);
@@ -794,7 +794,7 @@ static void freeAsmop (operand *op, asmop *aaop, iCode *ic, bool pop)
             if (_G.r1Pushed) {
                 emitcode("pop","ar1");
                 _G.r1Pushed--;
-            }       
+            }
         }
     }
 
@@ -803,9 +803,9 @@ dealloc:
     if (op ) {
         op->aop = NULL;
         if (IS_SYMOP(op)) {
-            OP_SYMBOL(op)->aop = NULL;    
+            OP_SYMBOL(op)->aop = NULL;
             /* if the symbol has a spill */
-           if (SPIL_LOC(op))
+      if (SPIL_LOC(op))
                 SPIL_LOC(op)->aop = NULL;
         }
     }
@@ -828,31 +828,31 @@ static char *aopGet (asmop *aop, int offset, bool bit16, bool dname)
 
     /* depending on type */
     switch (aop->type) {
-       
+
     case AOP_R0:
     case AOP_R1:
         DEBUGemitcode(";","%d",__LINE__);
-       /* if we need to increment it */       
-       while (offset > aop->coff) {        
-           emitcode ("inc","%s",aop->aopu.aop_ptr->name);  
-           aop->coff++;
-       }
-       
-       while (offset < aop->coff) {
-           emitcode("dec","%s",aop->aopu.aop_ptr->name);
-           aop->coff--;
-       }
-       
-       aop->coff = offset ;
-       if (aop->paged) {
-           emitcode("movx","a,@%s",aop->aopu.aop_ptr->name);
-           return (dname ? "acc" : "a");
-       }       
-       sprintf(s,"@%s",aop->aopu.aop_ptr->name);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  /* if we need to increment it */
+  while (offset > aop->coff) {
+      emitcode ("inc","%s",aop->aopu.aop_ptr->name);
+      aop->coff++;
+  }
+
+  while (offset < aop->coff) {
+      emitcode("dec","%s",aop->aopu.aop_ptr->name);
+      aop->coff--;
+  }
+
+  aop->coff = offset ;
+  if (aop->paged) {
+      emitcode("movx","a,@%s",aop->aopu.aop_ptr->name);
+      return (dname ? "acc" : "a");
+  }
+  sprintf(s,"@%s",aop->aopu.aop_ptr->name);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_DPTR:
     case AOP_DPTR2:
         DEBUGemitcode(";","%d",__LINE__);
@@ -860,68 +860,68 @@ static char *aopGet (asmop *aop, int offset, bool bit16, bool dname)
     {
         genSetDPTR(1);
     }
-    
-       while (offset > aop->coff) {
-           emitcode ("inc","dptr");
-           aop->coff++;
-       }
-       
-       while (offset < aop->coff) {        
-           emitcode("lcall","__decdptr");
-           aop->coff--;
-       }
-       
-       aop->coff = offset;
-       if (aop->code) {
-           emitcode("clr","a");
-           emitcode("movc","a,@a+dptr");
+
+  while (offset > aop->coff) {
+      emitcode ("inc","dptr");
+      aop->coff++;
+  }
+
+  while (offset < aop->coff) {
+      emitcode("lcall","__decdptr");
+      aop->coff--;
+  }
+
+  aop->coff = offset;
+  if (aop->code) {
+      emitcode("clr","a");
+      emitcode("movc","a,@a+dptr");
         }
     else {
-           emitcode("movx","a,@dptr");
+      emitcode("movx","a,@dptr");
     }
-           
+
     if (aop->type == AOP_DPTR2)
     {
         genSetDPTR(0);
     }
-           
+
     return (dname ? "acc" : "a");
-       
-       
+
+
     case AOP_IMMD:
       DEBUGemitcode(";","%d",__LINE__);
-       if (bit16) 
-           sprintf (s,"%s",aop->aopu.aop_immd);
-       else
-           if (offset) 
-               sprintf(s,"(%s >> %d)",
-                       aop->aopu.aop_immd,
-                       offset*8);
-           else
-               sprintf(s,"%s",
-                       aop->aopu.aop_immd);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  if (bit16)
+      sprintf (s,"%s",aop->aopu.aop_immd);
+  else
+      if (offset)
+    sprintf(s,"(%s >> %d)",
+      aop->aopu.aop_immd,
+      offset*8);
+      else
+    sprintf(s,"%s",
+      aop->aopu.aop_immd);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_DIR:
-       if (offset)
-           sprintf(s,"(%s + %d)",
-                   aop->aopu.aop_dir,
-                   offset);
-       else
-           sprintf(s,"%s",aop->aopu.aop_dir);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  if (offset)
+      sprintf(s,"(%s + %d)",
+        aop->aopu.aop_dir,
+        offset);
+  else
+      sprintf(s,"%s",aop->aopu.aop_dir);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_REG:
       DEBUGemitcode(";","%d",__LINE__);
-       if (dname) 
-           return aop->aopu.aop_reg[offset]->dname;
-       else
-           return aop->aopu.aop_reg[offset]->name;
-       
+  if (dname)
+      return aop->aopu.aop_reg[offset]->dname;
+  else
+      return aop->aopu.aop_reg[offset]->name;
+
     case AOP_CRY:
       emitcode(";","%d",__LINE__);
       //emitcode("clr","a");
@@ -929,27 +929,27 @@ static char *aopGet (asmop *aop, int offset, bool bit16, bool dname)
       //emitcode("rlc","a") ;
       //return (dname ? "acc" : "a");
       return aop->aopu.aop_dir;
-       
+
     case AOP_ACC:
         DEBUGemitcode(";Warning -pic port ignoring get(AOP_ACC)","%d",__LINE__);
-       //if (!offset && dname)
-       //    return "acc";
-       //return aop->aopu.aop_str[offset];
-       return "AOP_accumulator_bug";
+  //if (!offset && dname)
+  //    return "acc";
+  //return aop->aopu.aop_str[offset];
+  return "AOP_accumulator_bug";
 
     case AOP_LIT:
         DEBUGemitcode(";","%d",__LINE__);
-       return pic14aopLiteral (aop->aopu.aop_lit,offset);
-       
+  return pic14aopLiteral (aop->aopu.aop_lit,offset);
+
     case AOP_STR:
         DEBUGemitcode(";","%d",__LINE__);
-       aop->coff = offset ;
-       if (strcmp(aop->aopu.aop_str[offset],"a") == 0 &&
-           dname)
-           return "acc";
-       
-       return aop->aopu.aop_str[offset];
-       
+  aop->coff = offset ;
+  if (strcmp(aop->aopu.aop_str[offset],"a") == 0 &&
+      dname)
+      return "acc";
+
+  return aop->aopu.aop_str[offset];
+
     }
 
     werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
@@ -976,179 +976,179 @@ static void aopPut (asmop *aop, char *s, int offset)
     /* depending on where it is ofcourse */
     switch (aop->type) {
     case AOP_DIR:
-       if (offset)
-           sprintf(d,"(%s + %d)",
-                   aop->aopu.aop_dir,offset);
-       else
-           sprintf(d,"%s",aop->aopu.aop_dir);
-       
-       if (strcmp(d,s)) {
-         DEBUGemitcode(";","%d",__LINE__);
-         if(strcmp(s,"W"))
-           emitcode("movf","%s,w",s);
-         emitcode("movwf","%s",d);
-       }
-       break;
-       
+  if (offset)
+      sprintf(d,"(%s + %d)",
+        aop->aopu.aop_dir,offset);
+  else
+      sprintf(d,"%s",aop->aopu.aop_dir);
+
+  if (strcmp(d,s)) {
+    DEBUGemitcode(";","%d",__LINE__);
+    if(strcmp(s,"W"))
+      emitcode("movf","%s,w",s);
+    emitcode("movwf","%s",d);
+  }
+  break;
+
     case AOP_REG:
-       if (strcmp(aop->aopu.aop_reg[offset]->name,s) != 0 &&
-           strcmp(aop->aopu.aop_reg[offset]->dname,s)!= 0){
-         /*
-           if (*s == '@'           ||
-               strcmp(s,"r0") == 0 ||
-               strcmp(s,"r1") == 0 ||
-               strcmp(s,"r2") == 0 ||
-               strcmp(s,"r3") == 0 ||
-               strcmp(s,"r4") == 0 ||
-               strcmp(s,"r5") == 0 ||
-               strcmp(s,"r6") == 0 || 
-               strcmp(s,"r7") == 0 )
-               emitcode("mov","%s,%s  ; %d",
-                        aop->aopu.aop_reg[offset]->dname,s,__LINE__);
-           else
-         */
-
-         if(strcmp(s,"W"))
-           emitcode("movf","%s,w  ; %d",s,__LINE__);
-
-         emitcode("movwf","%s",
-                  aop->aopu.aop_reg[offset]->name);
-
-       }
-       break;
-       
+  if (strcmp(aop->aopu.aop_reg[offset]->name,s) != 0 &&
+      strcmp(aop->aopu.aop_reg[offset]->dname,s)!= 0){
+    /*
+      if (*s == '@'           ||
+    strcmp(s,"r0") == 0 ||
+    strcmp(s,"r1") == 0 ||
+    strcmp(s,"r2") == 0 ||
+    strcmp(s,"r3") == 0 ||
+    strcmp(s,"r4") == 0 ||
+    strcmp(s,"r5") == 0 ||
+    strcmp(s,"r6") == 0 ||
+    strcmp(s,"r7") == 0 )
+    emitcode("mov","%s,%s  ; %d",
+       aop->aopu.aop_reg[offset]->dname,s,__LINE__);
+      else
+    */
+
+    if(strcmp(s,"W"))
+      emitcode("movf","%s,w  ; %d",s,__LINE__);
+
+    emitcode("movwf","%s",
+       aop->aopu.aop_reg[offset]->name);
+
+  }
+  break;
+
     case AOP_DPTR:
     case AOP_DPTR2:
-    
+
     if (aop->type == AOP_DPTR2)
     {
         genSetDPTR(1);
     }
-    
-       if (aop->code) {
-           werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                  "aopPut writting to code space");
-           exit(0);
-       }
-       
-       while (offset > aop->coff) {
-           aop->coff++;
-           emitcode ("inc","dptr");
-       }
-       
-       while (offset < aop->coff) {
-           aop->coff-- ;
-           emitcode("lcall","__decdptr");
-       }
-       
-       aop->coff = offset;
-       
-       /* if not in accumulater */
-       MOVA(s);        
-       
-       emitcode ("movx","@dptr,a");
-       
+
+  if (aop->code) {
+      werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+       "aopPut writting to code space");
+      exit(0);
+  }
+
+  while (offset > aop->coff) {
+      aop->coff++;
+      emitcode ("inc","dptr");
+  }
+
+  while (offset < aop->coff) {
+      aop->coff-- ;
+      emitcode("lcall","__decdptr");
+  }
+
+  aop->coff = offset;
+
+  /* if not in accumulater */
+  MOVA(s);
+
+  emitcode ("movx","@dptr,a");
+
     if (aop->type == AOP_DPTR2)
     {
         genSetDPTR(0);
     }
-       break;
-       
+  break;
+
     case AOP_R0:
     case AOP_R1:
-       while (offset > aop->coff) {
-           aop->coff++;
-           emitcode("inc","%s",aop->aopu.aop_ptr->name);
-       }
-       while (offset < aop->coff) {
-           aop->coff-- ;
-           emitcode ("dec","%s",aop->aopu.aop_ptr->name);
-       }
-       aop->coff = offset;
-       
-       if (aop->paged) {
-           MOVA(s);           
-           emitcode("movx","@%s,a",aop->aopu.aop_ptr->name);
-           
-       } else
-           if (*s == '@') {
-               MOVA(s);
-               emitcode("mov","@%s,a ; %d",aop->aopu.aop_ptr->name,__LINE__);
-           } else
-               if (strcmp(s,"r0") == 0 ||
-                   strcmp(s,"r1") == 0 ||
-                   strcmp(s,"r2") == 0 ||
-                   strcmp(s,"r3") == 0 ||
-                   strcmp(s,"r4") == 0 ||
-                   strcmp(s,"r5") == 0 ||
-                   strcmp(s,"r6") == 0 || 
-                   strcmp(s,"r7") == 0 ) {
-                   char buffer[10];
-                   sprintf(buffer,"a%s",s);
-                   emitcode("mov","@%s,%s",
-                            aop->aopu.aop_ptr->name,buffer);
-               } else
-                   emitcode("mov","@%s,%s",aop->aopu.aop_ptr->name,s);
-       
-       break;
-       
+  while (offset > aop->coff) {
+      aop->coff++;
+      emitcode("inc","%s",aop->aopu.aop_ptr->name);
+  }
+  while (offset < aop->coff) {
+      aop->coff-- ;
+      emitcode ("dec","%s",aop->aopu.aop_ptr->name);
+  }
+  aop->coff = offset;
+
+  if (aop->paged) {
+      MOVA(s);
+      emitcode("movx","@%s,a",aop->aopu.aop_ptr->name);
+
+  } else
+      if (*s == '@') {
+    MOVA(s);
+    emitcode("mov","@%s,a ; %d",aop->aopu.aop_ptr->name,__LINE__);
+      } else
+    if (strcmp(s,"r0") == 0 ||
+        strcmp(s,"r1") == 0 ||
+        strcmp(s,"r2") == 0 ||
+        strcmp(s,"r3") == 0 ||
+        strcmp(s,"r4") == 0 ||
+        strcmp(s,"r5") == 0 ||
+        strcmp(s,"r6") == 0 ||
+        strcmp(s,"r7") == 0 ) {
+        char buffer[10];
+        sprintf(buffer,"a%s",s);
+        emitcode("mov","@%s,%s",
+           aop->aopu.aop_ptr->name,buffer);
+    } else
+        emitcode("mov","@%s,%s",aop->aopu.aop_ptr->name,s);
+
+  break;
+
     case AOP_STK:
-       if (strcmp(s,"a") == 0)
-           emitcode("push","acc");
-       else
-           emitcode("push","%s",s);
-       
-       break;
-       
+  if (strcmp(s,"a") == 0)
+      emitcode("push","acc");
+  else
+      emitcode("push","%s",s);
+
+  break;
+
     case AOP_CRY:
-       /* if bit variable */
-       if (!aop->aopu.aop_dir) {
-           emitcode("clr","a");
-           emitcode("rlc","a");
-       } else {
-           if (s == zero) 
-               emitcode("clr","%s",aop->aopu.aop_dir);
-           else
-               if (s == one)
-                   emitcode("setb","%s",aop->aopu.aop_dir);
-               else
-                   if (!strcmp(s,"c"))
-                       emitcode("mov","%s,c",aop->aopu.aop_dir);
-                   else {
-                       lbl = newiTempLabel(NULL);
-                       
-                       if (strcmp(s,"a")) {
-                           MOVA(s);
-                       }
-                       emitcode("clr","c");
-                       emitcode("jz","%05d_DS_",lbl->key+100);
-                       emitcode("cpl","c");
-                       emitcode("","%05d_DS_:",lbl->key+100);
-                       emitcode("mov","%s,c",aop->aopu.aop_dir);
-                   }
-       }
-       break;
-       
+  /* if bit variable */
+  if (!aop->aopu.aop_dir) {
+      emitcode("clr","a");
+      emitcode("rlc","a");
+  } else {
+      if (s == zero)
+    emitcode("clr","%s",aop->aopu.aop_dir);
+      else
+    if (s == one)
+        emitcode("setb","%s",aop->aopu.aop_dir);
+    else
+        if (!strcmp(s,"c"))
+      emitcode("mov","%s,c",aop->aopu.aop_dir);
+        else {
+      lbl = newiTempLabel(NULL);
+
+      if (strcmp(s,"a")) {
+          MOVA(s);
+      }
+      emitcode("clr","c");
+      emitcode("jz","%05d_DS_",lbl->key+100);
+      emitcode("cpl","c");
+      emitcode("","%05d_DS_:",lbl->key+100);
+      emitcode("mov","%s,c",aop->aopu.aop_dir);
+        }
+  }
+  break;
+
     case AOP_STR:
-       aop->coff = offset;
-       if (strcmp(aop->aopu.aop_str[offset],s))
-           emitcode ("mov","%s,%s ; %d",aop->aopu.aop_str[offset],s,__LINE__);
-       break;
-       
+  aop->coff = offset;
+  if (strcmp(aop->aopu.aop_str[offset],s))
+      emitcode ("mov","%s,%s ; %d",aop->aopu.aop_str[offset],s,__LINE__);
+  break;
+
     case AOP_ACC:
-       aop->coff = offset;
-       if (!offset && (strcmp(s,"acc") == 0))
-           break;
-       
-       if (strcmp(aop->aopu.aop_str[offset],s))
-           emitcode ("mov","%s,%s ; %d",aop->aopu.aop_str[offset],s, __LINE__);
-       break;
+  aop->coff = offset;
+  if (!offset && (strcmp(s,"acc") == 0))
+      break;
+
+  if (strcmp(aop->aopu.aop_str[offset],s))
+      emitcode ("mov","%s,%s ; %d",aop->aopu.aop_str[offset],s, __LINE__);
+  break;
 
     default :
-       werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-              "aopPut got unsupported aop->type");
-       exit(0);    
-    }    
+  werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+         "aopPut got unsupported aop->type");
+  exit(0);
+    }
 
 }
 
@@ -1169,25 +1169,25 @@ static void reAdjustPreg (asmop *aop)
         case AOP_R1 :
             while (size--)
                 emitcode("dec","%s",aop->aopu.aop_ptr->name);
-            break;          
+            break;
         case AOP_DPTR :
         case AOP_DPTR2:
             if (aop->type == AOP_DPTR2)
-           {
+          {
                 genSetDPTR(1);
-           } 
+          }
             while (size--)
             {
                 emitcode("lcall","__decdptr");
             }
-                
-           if (aop->type == AOP_DPTR2)
-           {
+
+          if (aop->type == AOP_DPTR2)
+          {
                 genSetDPTR(0);
-           }                
-            break;  
+          }
+            break;
 
-    }   
+    }
 
 }
 
@@ -1199,7 +1199,7 @@ static void reAdjustPreg (asmop *aop)
 
 #define AOP_NEEDSACC(x) (AOP(x) && (AOP_TYPE(x) == AOP_CRY ||  \
                         AOP_TYPE(x) == AOP_DPTR || AOP_TYPE(x) == AOP_DPTR2 || \
-                         AOP(x)->paged)) 
+                         AOP(x)->paged))
 
 #define AOP_INPREG(x) (x && (x->type == AOP_REG &&                        \
                       (x->aopu.aop_reg[0] == pic14_regWithIdx(R0_IDX) || \
@@ -1215,14 +1215,14 @@ static void genNotFloat (operand *op, operand *res)
     symbol *tlbl ;
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-    /* we will put 127 in the first byte of 
+    /* we will put 127 in the first byte of
     the result */
     aopPut(AOP(res),"#127",0);
     size = AOP_SIZE(op) - 1;
     offset = 1;
 
     l = aopGet(op->aop,offset++,FALSE,FALSE);
-    MOVA(l);    
+    MOVA(l);
 
     while(size--) {
         emitcode("orl","a,%s",
@@ -1238,27 +1238,27 @@ static void genNotFloat (operand *op, operand *res)
     emitcode("","%05d_DS_:",(tlbl->key+100));
 
     size = res->aop->size - 2;
-    offset = 2;    
+    offset = 2;
     /* put zeros in the rest */
-    while (size--) 
+    while (size--)
         aopPut(res->aop,zero,offset++);
 }
 
 #if 0
 /*-----------------------------------------------------------------*/
-/* opIsGptr: returns non-zero if the passed operand is            */   
-/* a generic pointer type.                                        */
-/*-----------------------------------------------------------------*/ 
+/* opIsGptr: returns non-zero if the passed operand is       */
+/* a generic pointer type.             */
+/*-----------------------------------------------------------------*/
 static int opIsGptr(operand *op)
 {
     sym_link *type = operandType(op);
-    
+
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     if ((AOP_SIZE(op) == GPTRSIZE) && IS_GENPTR(type))
     {
         return 1;
     }
-    return 0;        
+    return 0;
 }
 #endif
 
@@ -1320,7 +1320,7 @@ static void outBitC(operand *result)
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     /* if the result is bit */
-    if (AOP_TYPE(result) == AOP_CRY) 
+    if (AOP_TYPE(result) == AOP_CRY)
         aopPut(AOP(result),"c",0);
     else {
         emitcode("clr","a  ; %d", __LINE__);
@@ -1342,7 +1342,7 @@ static void toBoolean(operand *oper)
     if ( AOP_TYPE(oper) != AOP_ACC)
       emitcode("movf","%s,w",aopGet(AOP(oper),0,FALSE,FALSE));
 
-    while (size--) 
+    while (size--)
         emitcode("iorwf","%s,w",aopGet(AOP(oper),offset++,FALSE,FALSE));
 }
 
@@ -1363,8 +1363,8 @@ static void genNot (iCode *ic)
     /* if in bit space then a special case */
     if (AOP_TYPE(IC_LEFT(ic)) == AOP_CRY) {
       emitcode("movlw","1<<%s");
-      //emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir); 
-      //emitcode("cpl","c"); 
+      //emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir);
+      //emitcode("cpl","c");
       //outBitC(IC_RESULT(ic));
       goto release;
     }
@@ -1382,7 +1382,7 @@ static void genNot (iCode *ic)
     emitcode("","%05d_DS_:",tlbl->key+100);
     outBitC(IC_RESULT(ic));
 
-release:    
+release:
     /* release the aops */
     freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
     freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
@@ -1403,21 +1403,21 @@ static void genCpl (iCode *ic)
     aopOp (IC_LEFT(ic),ic,FALSE);
     aopOp (IC_RESULT(ic),ic,TRUE);
 
-    /* if both are in bit space then 
+    /* if both are in bit space then
     a special case */
     if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY &&
-        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) { 
+        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) {
 
-        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir); 
-        emitcode("cpl","c"); 
-        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir); 
-        goto release; 
-    } 
+        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir);
+        emitcode("cpl","c");
+        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir);
+        goto release;
+    }
 
     size = AOP_SIZE(IC_RESULT(ic));
     while (size--) {
         char *l = aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE);
-        MOVA(l);       
+        MOVA(l);
         emitcode("cpl","a");
         aopPut(AOP(IC_RESULT(ic)),"a",offset++);
     }
@@ -1438,22 +1438,22 @@ static void genUminusFloat(operand *op,operand *result)
     char *l;
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-    /* for this we just need to flip the 
+    /* for this we just need to flip the
     first it then copy the rest in place */
     size = AOP_SIZE(op) - 1;
     l = aopGet(AOP(op),3,FALSE,FALSE);
 
-    MOVA(l);    
+    MOVA(l);
 
     emitcode("cpl","acc.7");
-    aopPut(AOP(result),"a",3);    
+    aopPut(AOP(result),"a",3);
 
     while(size--) {
         aopPut(AOP(result),
                aopGet(AOP(op),offset,FALSE,FALSE),
                offset);
         offset++;
-    }          
+    }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1473,13 +1473,13 @@ static void genUminus (iCode *ic)
     /* if both in bit space then special
     case */
     if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY &&
-        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) { 
+        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) {
 
-        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir); 
-        emitcode("cpl","c"); 
-        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir); 
-        goto release; 
-    } 
+        emitcode("mov","c,%s",IC_LEFT(ic)->aop->aopu.aop_dir);
+        emitcode("cpl","c");
+        emitcode("mov","%s,c",IC_RESULT(ic)->aop->aopu.aop_dir);
+        goto release;
+    }
 
     optype = operandType(IC_LEFT(ic));
     rtype = operandType(IC_RESULT(ic));
@@ -1502,7 +1502,7 @@ static void genUminus (iCode *ic)
         } else {
             emitcode("clr","a");
             emitcode("subb","a,%s",l);
-        }       
+        }
         aopPut(AOP(IC_RESULT(ic)),"a",offset++);
     }
 
@@ -1511,20 +1511,20 @@ static void genUminus (iCode *ic)
     if ((size = (AOP_SIZE(IC_RESULT(ic)) - AOP_SIZE(IC_LEFT(ic))))) {
         emitcode("rlc","a");
         emitcode("subb","a,acc");
-        while (size--) 
+        while (size--)
             aopPut(AOP(IC_RESULT(ic)),"a",offset++);
-    }       
+    }
 
 release:
     /* release the aops */
     freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? 0 : 1));
-    freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);    
+    freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* saveRegisters - will look for a call and save the registers     */
 /*-----------------------------------------------------------------*/
-static void saveRegisters(iCode *lic) 
+static void saveRegisters(iCode *lic)
 {
     int i;
     iCode *ic;
@@ -1533,7 +1533,7 @@ static void saveRegisters(iCode *lic)
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     /* look for call */
-    for (ic = lic ; ic ; ic = ic->next) 
+    for (ic = lic ; ic ; ic = ic->next)
         if (ic->op == CALL || ic->op == PCALL)
             break;
 
@@ -1547,40 +1547,40 @@ static void saveRegisters(iCode *lic)
     if (ic->regsSaved || (OP_SYMBOL(IC_LEFT(ic))->calleeSave))
         return ;
 
-    /* find the registers in use at this time 
+    /* find the registers in use at this time
     and push them away to safety */
     rsave = bitVectCplAnd(bitVectCopy(ic->rMask),
                           ic->rUsed);
 
     ic->regsSaved = 1;
     if (options.useXstack) {
-       if (bitVectBitValue(rsave,R0_IDX))
-           emitcode("mov","b,r0");
-       emitcode("mov","r0,%s",spname);
-       for (i = 0 ; i < pic14_nRegs ; i++) {
-           if (bitVectBitValue(rsave,i)) {
-               if (i == R0_IDX)
-                   emitcode("mov","a,b");
-               else
-                   emitcode("mov","a,%s",pic14_regWithIdx(i)->name);
-               emitcode("movx","@r0,a");
-               emitcode("inc","r0");
-           }
-       }
-       emitcode("mov","%s,r0",spname);
-       if (bitVectBitValue(rsave,R0_IDX))
-           emitcode("mov","r0,b");         
+  if (bitVectBitValue(rsave,R0_IDX))
+      emitcode("mov","b,r0");
+  emitcode("mov","r0,%s",spname);
+  for (i = 0 ; i < pic14_nRegs ; i++) {
+      if (bitVectBitValue(rsave,i)) {
+    if (i == R0_IDX)
+        emitcode("mov","a,b");
+    else
+        emitcode("mov","a,%s",pic14_regWithIdx(i)->name);
+    emitcode("movx","@r0,a");
+    emitcode("inc","r0");
+      }
+  }
+  emitcode("mov","%s,r0",spname);
+  if (bitVectBitValue(rsave,R0_IDX))
+      emitcode("mov","r0,b");
     } else
-       for (i = 0 ; i < pic14_nRegs ; i++) {
-           if (bitVectBitValue(rsave,i))
-               emitcode("push","%s",pic14_regWithIdx(i)->dname);
-       }
+  for (i = 0 ; i < pic14_nRegs ; i++) {
+      if (bitVectBitValue(rsave,i))
+    emitcode("push","%s",pic14_regWithIdx(i)->dname);
+  }
 
     detype = getSpec(operandType(IC_LEFT(ic)));
-    if (detype        && 
+    if (detype        &&
         (SPEC_BANK(currFunc->etype) != SPEC_BANK(detype)) &&
-       IS_ISR(currFunc->etype) &&
-        !ic->bankSaved) 
+  IS_ISR(currFunc->etype) &&
+        !ic->bankSaved)
 
         saverbank(SPEC_BANK(detype),ic,TRUE);
 
@@ -1594,62 +1594,62 @@ static void unsaveRegisters (iCode *ic)
     bitVect *rsave;
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-    /* find the registers in use at this time 
+    /* find the registers in use at this time
     and push them away to safety */
     rsave = bitVectCplAnd(bitVectCopy(ic->rMask),
                           ic->rUsed);
-    
+
     if (options.useXstack) {
-       emitcode("mov","r0,%s",spname); 
-       for (i =  pic14_nRegs ; i >= 0 ; i--) {
-           if (bitVectBitValue(rsave,i)) {
-               emitcode("dec","r0");
-               emitcode("movx","a,@r0");
-               if (i == R0_IDX)
-                   emitcode("mov","b,a");
-               else
-                   emitcode("mov","%s,a",pic14_regWithIdx(i)->name);
-           }       
-
-       }
-       emitcode("mov","%s,r0",spname);
-       if (bitVectBitValue(rsave,R0_IDX))
-           emitcode("mov","r0,b");
+  emitcode("mov","r0,%s",spname);
+  for (i =  pic14_nRegs ; i >= 0 ; i--) {
+      if (bitVectBitValue(rsave,i)) {
+    emitcode("dec","r0");
+    emitcode("movx","a,@r0");
+    if (i == R0_IDX)
+        emitcode("mov","b,a");
+    else
+        emitcode("mov","%s,a",pic14_regWithIdx(i)->name);
+      }
+
+  }
+  emitcode("mov","%s,r0",spname);
+  if (bitVectBitValue(rsave,R0_IDX))
+      emitcode("mov","r0,b");
     } else
-       for (i =  pic14_nRegs ; i >= 0 ; i--) {
-           if (bitVectBitValue(rsave,i))
-               emitcode("pop","%s",pic14_regWithIdx(i)->dname);
-       }
+  for (i =  pic14_nRegs ; i >= 0 ; i--) {
+      if (bitVectBitValue(rsave,i))
+    emitcode("pop","%s",pic14_regWithIdx(i)->dname);
+  }
 
-}  
+}
 
 
 /*-----------------------------------------------------------------*/
-/* pushSide -                                                     */
+/* pushSide -                */
 /*-----------------------------------------------------------------*/
 static void pushSide(operand * oper, int size)
 {
-       int offset = 0;
+  int offset = 0;
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-       while (size--) {
-               char *l = aopGet(AOP(oper),offset++,FALSE,TRUE);
-               if (AOP_TYPE(oper) != AOP_REG &&
-                   AOP_TYPE(oper) != AOP_DIR &&
-                   strcmp(l,"a") ) {
-                       emitcode("mov","a,%s",l);
-                       emitcode("push","acc");
-               } else
-                       emitcode("push","%s",l);
-       }
+  while (size--) {
+    char *l = aopGet(AOP(oper),offset++,FALSE,TRUE);
+    if (AOP_TYPE(oper) != AOP_REG &&
+        AOP_TYPE(oper) != AOP_DIR &&
+        strcmp(l,"a") ) {
+      emitcode("mov","a,%s",l);
+      emitcode("push","acc");
+    } else
+      emitcode("push","%s",l);
+  }
 }
 
 /*-----------------------------------------------------------------*/
-/* assignResultValue -                                            */
+/* assignResultValue -               */
 /*-----------------------------------------------------------------*/
 static void assignResultValue(operand * oper)
 {
-       int offset = 0;
-       int size = AOP_SIZE(oper);
+  int offset = 0;
+  int size = AOP_SIZE(oper);
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
 
@@ -1658,8 +1658,8 @@ static void assignResultValue(operand * oper)
 
     if(size>1) {
       while (--size) {
-       aopPut(AOP(oper),fReturn[offset],offset);
-       offset++;
+  aopPut(AOP(oper),fReturn[offset],offset);
+  offset++;
 
       }
     }
@@ -1679,21 +1679,21 @@ static void genXpush (iCode *ic)
     aopOp(IC_LEFT(ic),ic,FALSE);
     r = getFreePtr(ic,&aop,FALSE);
 
-    
+
     emitcode("mov","%s,_spx",r->name);
 
     size = AOP_SIZE(IC_LEFT(ic));
     while(size--) {
 
-       char *l = aopGet(AOP(IC_LEFT(ic)),
-                        offset++,FALSE,FALSE); 
-       MOVA(l);            
-       emitcode("movx","@%s,a",r->name);       
-       emitcode("inc","%s",r->name);
+  char *l = aopGet(AOP(IC_LEFT(ic)),
+       offset++,FALSE,FALSE);
+  MOVA(l);
+  emitcode("movx","@%s,a",r->name);
+  emitcode("inc","%s",r->name);
 
     }
 
-       
+
     emitcode("mov","_spx,%s",r->name);
 
     freeAsmop(NULL,aop,ic,TRUE);
@@ -1710,7 +1710,7 @@ static void genIpush (iCode *ic)
 
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-    /* if this is not a parm push : ie. it is spill push 
+    /* if this is not a parm push : ie. it is spill push
     and spill push is always done on the local stack */
     if (!ic->parmPush) {
 
@@ -1729,12 +1729,12 @@ static void genIpush (iCode *ic)
             }
             emitcode("push","%s",l);
         }
-        return ;        
+        return ;
     }
 
     /* this is a paramter push: in this case we call
     the routine to find the call and save those
-    registers that need to be saved */   
+    registers that need to be saved */
     saveRegisters(ic);
 
     /* if use external stack then call the external
@@ -1748,19 +1748,19 @@ static void genIpush (iCode *ic)
     aopOp(IC_LEFT(ic),ic,FALSE);
 
 
-       // pushSide(IC_LEFT(ic), AOP_SIZE(IC_LEFT(ic)));
+  // pushSide(IC_LEFT(ic), AOP_SIZE(IC_LEFT(ic)));
     size = AOP_SIZE(IC_LEFT(ic));
 
     while (size--) {
         l = aopGet(AOP(IC_LEFT(ic)),offset++,FALSE,TRUE);
-        if (AOP_TYPE(IC_LEFT(ic)) != AOP_REG && 
+        if (AOP_TYPE(IC_LEFT(ic)) != AOP_REG &&
             AOP_TYPE(IC_LEFT(ic)) != AOP_DIR &&
             strcmp(l,"a") ) {
             emitcode("mov","a,%s",l);
             emitcode("push","acc");
         } else
             emitcode("push","%s",l);
-    }       
+    }
 
     freeAsmop(IC_LEFT(ic),NULL,ic,TRUE);
 }
@@ -1781,7 +1781,7 @@ static void genIpop (iCode *ic)
     aopOp(IC_LEFT(ic),ic,FALSE);
     size = AOP_SIZE(IC_LEFT(ic));
     offset = (size-1);
-    while (size--) 
+    while (size--)
         emitcode("pop","%s",aopGet(AOP(IC_LEFT(ic)),offset--,
                                    FALSE,TRUE));
 
@@ -1799,38 +1799,38 @@ static void unsaverbank (int bank,iCode *ic,bool popPsw)
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     if (popPsw) {
-       if (options.useXstack) {
-           aop = newAsmop(0);
-           r = getFreePtr(ic,&aop,FALSE);
-           
-           
-           emitcode("mov","%s,_spx",r->name);
-           emitcode("movx","a,@%s",r->name);
-           emitcode("mov","psw,a");
-           emitcode("dec","%s",r->name);
-           
-       }else
-           emitcode ("pop","psw");
+  if (options.useXstack) {
+      aop = newAsmop(0);
+      r = getFreePtr(ic,&aop,FALSE);
+
+
+      emitcode("mov","%s,_spx",r->name);
+      emitcode("movx","a,@%s",r->name);
+      emitcode("mov","psw,a");
+      emitcode("dec","%s",r->name);
+
+  }else
+      emitcode ("pop","psw");
     }
 
     for (i = (pic14_nRegs - 1) ; i >= 0 ;i--) {
-        if (options.useXstack) {       
+        if (options.useXstack) {
             emitcode("movx","a,@%s",r->name);
             //emitcode("mov","(%s+%d),a",
-           //       regspic14[i].base,8*bank+regspic14[i].offset);
+      //       regspic14[i].base,8*bank+regspic14[i].offset);
             emitcode("dec","%s",r->name);
 
-        } else 
-         emitcode("pop",""); //"(%s+%d)",
-       //regspic14[i].base,8*bank); //+regspic14[i].offset);
+        } else
+    emitcode("pop",""); //"(%s+%d)",
+  //regspic14[i].base,8*bank); //+regspic14[i].offset);
     }
 
     if (options.useXstack) {
 
-       emitcode("mov","_spx,%s",r->name);
-       freeAsmop(NULL,aop,ic,TRUE);
+  emitcode("mov","_spx,%s",r->name);
+  freeAsmop(NULL,aop,ic,TRUE);
 
-    } 
+    }
 }
 
 /*-----------------------------------------------------------------*/
@@ -1845,9 +1845,9 @@ static void saverbank (int bank, iCode *ic, bool pushPsw)
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     if (options.useXstack) {
 
-       aop = newAsmop(0);
-       r = getFreePtr(ic,&aop,FALSE);  
-       emitcode("mov","%s,_spx",r->name);
+  aop = newAsmop(0);
+  r = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,_spx",r->name);
 
     }
 
@@ -1856,24 +1856,24 @@ static void saverbank (int bank, iCode *ic, bool pushPsw)
             emitcode("inc","%s",r->name);
             //emitcode("mov","a,(%s+%d)",
             //         regspic14[i].base,8*bank+regspic14[i].offset);
-            emitcode("movx","@%s,a",r->name);           
-        } else 
-         emitcode("push","");// "(%s+%d)",
+            emitcode("movx","@%s,a",r->name);
+        } else
+    emitcode("push","");// "(%s+%d)",
                      //regspic14[i].base,8*bank+regspic14[i].offset);
     }
-    
+
     if (pushPsw) {
-       if (options.useXstack) {
-           emitcode("mov","a,psw");
-           emitcode("movx","@%s,a",r->name);   
-           emitcode("inc","%s",r->name);
-           emitcode("mov","_spx,%s",r->name);       
-           freeAsmop (NULL,aop,ic,TRUE);
-           
-       } else
-           emitcode("push","psw");
-       
-       emitcode("mov","psw,#0x%02x",(bank << 3)&0x00ff);
+  if (options.useXstack) {
+      emitcode("mov","a,psw");
+      emitcode("movx","@%s,a",r->name);
+      emitcode("inc","%s",r->name);
+      emitcode("mov","_spx,%s",r->name);
+      freeAsmop (NULL,aop,ic,TRUE);
+
+  } else
+      emitcode("push","psw");
+
+  emitcode("mov","psw,#0x%02x",(bank << 3)&0x00ff);
     }
     ic->bankSaved = 1;
 
@@ -1884,7 +1884,7 @@ static void saverbank (int bank, iCode *ic, bool pushPsw)
 /*-----------------------------------------------------------------*/
 static void genCall (iCode *ic)
 {
-    sym_link *detype;   
+    sym_link *detype;
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
 
@@ -1896,44 +1896,44 @@ static void genCall (iCode *ic)
     the same register bank then we need to save the
     destination registers on the stack */
     detype = getSpec(operandType(IC_LEFT(ic)));
-    if (detype        && 
+    if (detype        &&
         (SPEC_BANK(currFunc->etype) != SPEC_BANK(detype)) &&
-       IS_ISR(currFunc->etype) &&
-        !ic->bankSaved) 
+  IS_ISR(currFunc->etype) &&
+        !ic->bankSaved)
 
         saverbank(SPEC_BANK(detype),ic,TRUE);
 
     /* if send set is not empty the assign */
     if (_G.sendSet) {
-       iCode *sic ;
-
-       for (sic = setFirstItem(_G.sendSet) ; sic ; 
-            sic = setNextItem(_G.sendSet)) {
-           int size, offset = 0;
-
-           aopOp(IC_LEFT(sic),sic,FALSE);
-           size = AOP_SIZE(IC_LEFT(sic));
-           while (size--) {
-               char *l = aopGet(AOP(IC_LEFT(sic)),offset,
-                               FALSE,FALSE);
-               DEBUGemitcode(";","%d - left type %d",__LINE__,AOP(IC_LEFT(sic))->type);
-
-               if (strcmp(l,fReturn[offset])) {
-
-                 if ( ((AOP(IC_LEFT(sic))->type) == AOP_IMMD) ||
-                      ((AOP(IC_LEFT(sic))->type) == AOP_LIT) )
-                   emitcode("movlw","%s",l);
-                 else
-                   emitcode("movf","%s,w",l);
-                 // The last one is past in W
-                 if(size)
-                   emitcode("movwf","%s",fReturn[offset]);
-               }
-               offset++;
-           }
-           freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
-       }
-       _G.sendSet = NULL;
+  iCode *sic ;
+
+  for (sic = setFirstItem(_G.sendSet) ; sic ;
+       sic = setNextItem(_G.sendSet)) {
+      int size, offset = 0;
+
+      aopOp(IC_LEFT(sic),sic,FALSE);
+      size = AOP_SIZE(IC_LEFT(sic));
+      while (size--) {
+    char *l = aopGet(AOP(IC_LEFT(sic)),offset,
+        FALSE,FALSE);
+    DEBUGemitcode(";","%d - left type %d",__LINE__,AOP(IC_LEFT(sic))->type);
+
+    if (strcmp(l,fReturn[offset])) {
+
+      if ( ((AOP(IC_LEFT(sic))->type) == AOP_IMMD) ||
+           ((AOP(IC_LEFT(sic))->type) == AOP_LIT) )
+        emitcode("movlw","%s",l);
+      else
+        emitcode("movf","%s,w",l);
+      // The last one is past in W
+      if(size)
+        emitcode("movwf","%s",fReturn[offset]);
+    }
+    offset++;
+      }
+      freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
+  }
+  _G.sendSet = NULL;
     }
     /* make the call */
     emitcode("call","%s",(OP_SYMBOL(IC_LEFT(ic))->rname[0] ?
@@ -1941,7 +1941,7 @@ static void genCall (iCode *ic)
                            OP_SYMBOL(IC_LEFT(ic))->name));
 
     /* if we need assign a result value */
-    if ((IS_ITEMP(IC_RESULT(ic)) && 
+    if ((IS_ITEMP(IC_RESULT(ic)) &&
          (OP_SYMBOL(IC_RESULT(ic))->nRegs ||
           OP_SYMBOL(IC_RESULT(ic))->spildir )) ||
         IS_TRUE_SYMOP(IC_RESULT(ic)) ) {
@@ -1950,12 +1950,12 @@ static void genCall (iCode *ic)
         aopOp(IC_RESULT(ic),ic,FALSE);
         _G.accInUse--;
 
-       assignResultValue(IC_RESULT(ic));
-               
+  assignResultValue(IC_RESULT(ic));
+
         freeAsmop(IC_RESULT(ic),NULL, ic,TRUE);
     }
 
-    /* adjust the stack for parameters if 
+    /* adjust the stack for parameters if
     required */
     if (IC_LEFT(ic)->parmBytes) {
         int i;
@@ -1963,7 +1963,7 @@ static void genCall (iCode *ic)
             emitcode("mov","a,%s",spname);
             emitcode("add","a,#0x%02x", (- IC_LEFT(ic)->parmBytes) & 0xff);
             emitcode("mov","%s,a",spname);
-        } else 
+        } else
             for ( i = 0 ; i <  IC_LEFT(ic)->parmBytes ;i++)
                 emitcode("dec","%s",spname);
 
@@ -1998,22 +1998,22 @@ static void genPcall (iCode *ic)
     the same register bank then we need to save the
     destination registers on the stack */
     detype = getSpec(operandType(IC_LEFT(ic)));
-    if (detype        && 
-       IS_ISR(currFunc->etype) &&
+    if (detype        &&
+  IS_ISR(currFunc->etype) &&
         (SPEC_BANK(currFunc->etype) != SPEC_BANK(detype)))
         saverbank(SPEC_BANK(detype),ic,TRUE);
 
 
     /* push the return address on to the stack */
     emitcode("mov","a,#%05d_DS_",(rlbl->key+100));
-    emitcode("push","acc");    
+    emitcode("push","acc");
     emitcode("mov","a,#(%05d_DS_ >> 8)",(rlbl->key+100));
     emitcode("push","acc");
-    
+
     if (options.model == MODEL_FLAT24)
     {
-       emitcode("mov","a,#(%05d_DS_ >> 16)",(rlbl->key+100));
-       emitcode("push","acc");    
+      emitcode("mov","a,#(%05d_DS_ >> 16)",(rlbl->key+100));
+      emitcode("push","acc");
     }
 
     /* now push the calling address */
@@ -2021,29 +2021,29 @@ static void genPcall (iCode *ic)
 
     pushSide(IC_LEFT(ic), FPTRSIZE);
 
-    freeAsmop(IC_LEFT(ic),NULL,ic,TRUE); 
+    freeAsmop(IC_LEFT(ic),NULL,ic,TRUE);
 
     /* if send set is not empty the assign */
     if (_G.sendSet) {
-       iCode *sic ;
-
-       for (sic = setFirstItem(_G.sendSet) ; sic ; 
-            sic = setNextItem(_G.sendSet)) {
-           int size, offset = 0;
-           aopOp(IC_LEFT(sic),sic,FALSE);
-           size = AOP_SIZE(IC_LEFT(sic));
-           while (size--) {
-               char *l = aopGet(AOP(IC_LEFT(sic)),offset,
-                               FALSE,FALSE);
-               if (strcmp(l,fReturn[offset]))
-                   emitcode("mov","%s,%s",
-                            fReturn[offset],
-                            l);
-               offset++;
-           }
-           freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
-       }
-       _G.sendSet = NULL;
+  iCode *sic ;
+
+  for (sic = setFirstItem(_G.sendSet) ; sic ;
+       sic = setNextItem(_G.sendSet)) {
+      int size, offset = 0;
+      aopOp(IC_LEFT(sic),sic,FALSE);
+      size = AOP_SIZE(IC_LEFT(sic));
+      while (size--) {
+    char *l = aopGet(AOP(IC_LEFT(sic)),offset,
+        FALSE,FALSE);
+    if (strcmp(l,fReturn[offset]))
+        emitcode("mov","%s,%s",
+           fReturn[offset],
+           l);
+    offset++;
+      }
+      freeAsmop (IC_LEFT(sic),NULL,sic,TRUE);
+  }
+  _G.sendSet = NULL;
     }
 
     emitcode("ret","");
@@ -2059,13 +2059,13 @@ static void genPcall (iCode *ic)
         _G.accInUse++;
         aopOp(IC_RESULT(ic),ic,FALSE);
         _G.accInUse--;
-       
-       assignResultValue(IC_RESULT(ic));
+
+  assignResultValue(IC_RESULT(ic));
 
         freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
     }
 
-    /* adjust the stack for parameters if 
+    /* adjust the stack for parameters if
     required */
     if (IC_LEFT(ic)->parmBytes) {
         int i;
@@ -2073,15 +2073,15 @@ static void genPcall (iCode *ic)
             emitcode("mov","a,%s",spname);
             emitcode("add","a,#0x%02x", (- IC_LEFT(ic)->parmBytes) & 0xff);
             emitcode("mov","%s,a",spname);
-        } else 
+        } else
             for ( i = 0 ; i <  IC_LEFT(ic)->parmBytes ;i++)
                 emitcode("dec","%s",spname);
 
     }
 
     /* if register bank was saved then unsave them */
-    if (detype        && 
-        (SPEC_BANK(currFunc->etype) != 
+    if (detype        &&
+        (SPEC_BANK(currFunc->etype) !=
          SPEC_BANK(detype)))
         unsaverbank(SPEC_BANK(detype),ic,TRUE);
 
@@ -2103,7 +2103,7 @@ static int resultRemat (iCode *ic)
 
     if (IC_RESULT(ic) && IS_ITEMP(IC_RESULT(ic))) {
         symbol *sym = OP_SYMBOL(IC_RESULT(ic));
-        if (sym->remat && !POINTER_SET(ic)) 
+        if (sym->remat && !POINTER_SET(ic))
             return 1;
     }
 
@@ -2122,16 +2122,16 @@ static int resultRemat (iCode *ic)
 static bool inExcludeList(char *s)
 {
     int i =0;
-    
+
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     if (options.excludeRegs[i] &&
     STRCASECMP(options.excludeRegs[i],"none") == 0)
-       return FALSE ;
+  return FALSE ;
 
     for ( i = 0 ; options.excludeRegs[i]; i++) {
-       if (options.excludeRegs[i] &&
+  if (options.excludeRegs[i] &&
         STRCASECMP(s,options.excludeRegs[i]) == 0)
-           return TRUE;
+      return TRUE;
     }
     return FALSE ;
 }
@@ -2184,124 +2184,124 @@ static void genFunction (iCode *ic)
     /* if this is an interrupt service routine then
     save acc, b, dpl, dph  */
     if (IS_ISR(sym->etype)) {
-        
-       if (!inExcludeList("acc"))          
-           emitcode ("push","acc");    
-       if (!inExcludeList("b"))
-           emitcode ("push","b");
-       if (!inExcludeList("dpl"))
-           emitcode ("push","dpl");
-       if (!inExcludeList("dph"))
-           emitcode ("push","dph");
-       if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
-       {
-           emitcode ("push", "dpx");
-           /* Make sure we're using standard DPTR */
-           emitcode ("push", "dps");
-           emitcode ("mov", "dps, #0x00");
-           if (options.stack10bit)
-           {   
-               /* This ISR could conceivably use DPTR2. Better save it. */
-               emitcode ("push", "dpl1");
-               emitcode ("push", "dph1");
-               emitcode ("push", "dpx1");
-           }
-       }
-       /* if this isr has no bank i.e. is going to
-          run with bank 0 , then we need to save more
-          registers :-) */
-       if (!SPEC_BANK(sym->etype)) {
-
-           /* if this function does not call any other
-              function then we can be economical and
-              save only those registers that are used */
-           if (! sym->hasFcall) {
-               int i;
-
-               /* if any registers used */
-               if (sym->regsUsed) {
-                   /* save the registers used */
-                   for ( i = 0 ; i < sym->regsUsed->size ; i++) {
-                       if (bitVectBitValue(sym->regsUsed,i) ||
+
+  if (!inExcludeList("acc"))
+      emitcode ("push","acc");
+  if (!inExcludeList("b"))
+      emitcode ("push","b");
+  if (!inExcludeList("dpl"))
+      emitcode ("push","dpl");
+  if (!inExcludeList("dph"))
+      emitcode ("push","dph");
+  if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
+  {
+      emitcode ("push", "dpx");
+      /* Make sure we're using standard DPTR */
+      emitcode ("push", "dps");
+      emitcode ("mov", "dps, #0x00");
+      if (options.stack10bit)
+      {
+        /* This ISR could conceivably use DPTR2. Better save it. */
+        emitcode ("push", "dpl1");
+        emitcode ("push", "dph1");
+        emitcode ("push", "dpx1");
+      }
+  }
+  /* if this isr has no bank i.e. is going to
+     run with bank 0 , then we need to save more
+     registers :-) */
+  if (!SPEC_BANK(sym->etype)) {
+
+      /* if this function does not call any other
+         function then we can be economical and
+         save only those registers that are used */
+      if (! sym->hasFcall) {
+    int i;
+
+    /* if any registers used */
+    if (sym->regsUsed) {
+        /* save the registers used */
+        for ( i = 0 ; i < sym->regsUsed->size ; i++) {
+      if (bitVectBitValue(sym->regsUsed,i) ||
                           (pic14_ptrRegReq && (i == R0_IDX || i == R1_IDX)) )
-                           emitcode("push","%s",pic14_regWithIdx(i)->dname);                       
-                   }
-               }
-               
-           } else {
-               /* this function has  a function call cannot
-                  determines register usage so we will have the
-                  entire bank */
-               saverbank(0,ic,FALSE);
-           }       
-       }
+          emitcode("push","%s",pic14_regWithIdx(i)->dname);
+        }
+    }
+
+      } else {
+    /* this function has  a function call cannot
+       determines register usage so we will have the
+       entire bank */
+    saverbank(0,ic,FALSE);
+      }
+  }
     } else {
-       /* if callee-save to be used for this function
-          then save the registers being used in this function */
-       if (sym->calleeSave) {
-           int i;
-           
-           /* if any registers used */
-           if (sym->regsUsed) {
-               /* save the registers used */
-               for ( i = 0 ; i < sym->regsUsed->size ; i++) {
-                   if (bitVectBitValue(sym->regsUsed,i) ||
+  /* if callee-save to be used for this function
+     then save the registers being used in this function */
+  if (sym->calleeSave) {
+      int i;
+
+      /* if any registers used */
+      if (sym->regsUsed) {
+    /* save the registers used */
+    for ( i = 0 ; i < sym->regsUsed->size ; i++) {
+        if (bitVectBitValue(sym->regsUsed,i) ||
                       (pic14_ptrRegReq && (i == R0_IDX || i == R1_IDX)) ) {
-                       emitcode("push","%s",pic14_regWithIdx(i)->dname);
-                       _G.nRegsSaved++;
-                   }
-               }
-           }
-       }
+      emitcode("push","%s",pic14_regWithIdx(i)->dname);
+      _G.nRegsSaved++;
+        }
+    }
+      }
+  }
     }
 
     /* set the register bank to the desired value */
     if (SPEC_BANK(sym->etype) || IS_ISR(sym->etype)) {
         emitcode("push","psw");
-        emitcode("mov","psw,#0x%02x",(SPEC_BANK(sym->etype) << 3)&0x00ff);   
+        emitcode("mov","psw,#0x%02x",(SPEC_BANK(sym->etype) << 3)&0x00ff);
     }
 
     if (IS_RENT(sym->etype) || options.stackAuto) {
 
-       if (options.useXstack) {
-           emitcode("mov","r0,%s",spname);
-           emitcode("mov","a,_bp");
-           emitcode("movx","@r0,a");
-           emitcode("inc","%s",spname);
-       }
-       else
-       {
-           /* set up the stack */
-           emitcode ("push","_bp");     /* save the callers stack  */
-       }
-       emitcode ("mov","_bp,%s",spname);
+  if (options.useXstack) {
+      emitcode("mov","r0,%s",spname);
+      emitcode("mov","a,_bp");
+      emitcode("movx","@r0,a");
+      emitcode("inc","%s",spname);
+  }
+  else
+  {
+      /* set up the stack */
+      emitcode ("push","_bp");     /* save the callers stack  */
+  }
+  emitcode ("mov","_bp,%s",spname);
     }
 
     /* adjust the stack for the function */
     if (sym->stack) {
 
-       int i = sym->stack;
-       if (i > 256 ) 
-           werror(W_STACK_OVERFLOW,sym->name);
+  int i = sym->stack;
+  if (i > 256 )
+      werror(W_STACK_OVERFLOW,sym->name);
 
-       if (i > 3 && sym->recvSize < 4) {              
+  if (i > 3 && sym->recvSize < 4) {
 
-           emitcode ("mov","a,sp");
-           emitcode ("add","a,#0x%02x",((char)sym->stack & 0xff));
-           emitcode ("mov","sp,a");
-          
-       }
-       else
-           while(i--)
-               emitcode("inc","sp");
+      emitcode ("mov","a,sp");
+      emitcode ("add","a,#0x%02x",((char)sym->stack & 0xff));
+      emitcode ("mov","sp,a");
+
+  }
+  else
+      while(i--)
+    emitcode("inc","sp");
     }
 
      if (sym->xstack) {
 
-       emitcode ("mov","a,_spx");
-       emitcode ("add","a,#0x%02x",((char)sym->xstack & 0xff));
-       emitcode ("mov","_spx,a");
-    }    
+  emitcode ("mov","a,_spx");
+  emitcode ("add","a,#0x%02x",((char)sym->xstack & 0xff));
+  emitcode ("mov","_spx,a");
+    }
 
 }
 
@@ -2322,7 +2322,7 @@ static void genEndFunction (iCode *ic)
     /* if use external stack but some variables were
     added to the local stack then decrement the
     local stack */
-    if (options.useXstack && sym->stack) {      
+    if (options.useXstack && sym->stack) {
         emitcode("mov","a,sp");
         emitcode("add","a,#0x%02x",((char)-sym->stack) & 0xff);
         emitcode("mov","sp,a");
@@ -2330,124 +2330,124 @@ static void genEndFunction (iCode *ic)
 
 
     if ((IS_RENT(sym->etype) || options.stackAuto)) {
-       if (options.useXstack) {
-           emitcode("mov","r0,%s",spname);
-           emitcode("movx","a,@r0");
-           emitcode("mov","_bp,a");
-           emitcode("dec","%s",spname);
-       }
-       else
-       {
-           emitcode ("pop","_bp");
-       }
-    }
-
-    /* restore the register bank  */    
+  if (options.useXstack) {
+      emitcode("mov","r0,%s",spname);
+      emitcode("movx","a,@r0");
+      emitcode("mov","_bp,a");
+      emitcode("dec","%s",spname);
+  }
+  else
+  {
+      emitcode ("pop","_bp");
+  }
+    }
+
+    /* restore the register bank  */
     if (SPEC_BANK(sym->etype) || IS_ISR(sym->etype))
         emitcode ("pop","psw");
 
     if (IS_ISR(sym->etype)) {
 
-       /* now we need to restore the registers */
-       /* if this isr has no bank i.e. is going to
-          run with bank 0 , then we need to save more
-          registers :-) */
-       if (!SPEC_BANK(sym->etype)) {
-           
-           /* if this function does not call any other
-              function then we can be economical and
-              save only those registers that are used */
-           if (! sym->hasFcall) {
-               int i;
-               
-               /* if any registers used */
-               if (sym->regsUsed) {
-                   /* save the registers used */
-                   for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
-                       if (bitVectBitValue(sym->regsUsed,i) ||
+  /* now we need to restore the registers */
+  /* if this isr has no bank i.e. is going to
+     run with bank 0 , then we need to save more
+     registers :-) */
+  if (!SPEC_BANK(sym->etype)) {
+
+      /* if this function does not call any other
+         function then we can be economical and
+         save only those registers that are used */
+      if (! sym->hasFcall) {
+    int i;
+
+    /* if any registers used */
+    if (sym->regsUsed) {
+        /* save the registers used */
+        for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
+      if (bitVectBitValue(sym->regsUsed,i) ||
                           (pic14_ptrRegReq && (i == R0_IDX || i == R1_IDX)) )
-                           emitcode("pop","%s",pic14_regWithIdx(i)->dname);
-                   }
-               }
-               
-           } else {
-               /* this function has  a function call cannot
-                  determines register usage so we will have the
-                  entire bank */
-               unsaverbank(0,ic,FALSE);
-           }       
-       }
-
-       if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
-       {
-           if (options.stack10bit)
-           {
-               emitcode ("pop", "dpx1");
-               emitcode ("pop", "dph1");
-               emitcode ("pop", "dpl1");
-           }   
-           emitcode ("pop", "dps");
-           emitcode ("pop", "dpx");
-       }
-       if (!inExcludeList("dph"))
-           emitcode ("pop","dph");
-       if (!inExcludeList("dpl"))
-           emitcode ("pop","dpl");
-       if (!inExcludeList("b"))
-           emitcode ("pop","b");
-       if (!inExcludeList("acc"))
-           emitcode ("pop","acc");
+          emitcode("pop","%s",pic14_regWithIdx(i)->dname);
+        }
+    }
+
+      } else {
+    /* this function has  a function call cannot
+       determines register usage so we will have the
+       entire bank */
+    unsaverbank(0,ic,FALSE);
+      }
+  }
+
+  if (options.model == MODEL_FLAT24 && !inExcludeList("dpx"))
+  {
+      if (options.stack10bit)
+      {
+          emitcode ("pop", "dpx1");
+          emitcode ("pop", "dph1");
+          emitcode ("pop", "dpl1");
+      }
+      emitcode ("pop", "dps");
+      emitcode ("pop", "dpx");
+  }
+  if (!inExcludeList("dph"))
+      emitcode ("pop","dph");
+  if (!inExcludeList("dpl"))
+      emitcode ("pop","dpl");
+  if (!inExcludeList("b"))
+      emitcode ("pop","b");
+  if (!inExcludeList("acc"))
+      emitcode ("pop","acc");
 
         if (SPEC_CRTCL(sym->etype))
             emitcode("setb","ea");
 
-       /* if debug then send end of function */
-/*     if (options.debug && currFunc) { */
-       if (currFunc) {
-           _G.debugLine = 1;
-           emitcode(";","C$%s$%d$%d$%d ==.",
-                    ic->filename,currFunc->lastLine,
-                    ic->level,ic->block); 
-           if (IS_STATIC(currFunc->etype))         
-               emitcode(";","XF%s$%s$0$0 ==.",moduleName,currFunc->name); 
-           else
-               emitcode(";","XG$%s$0$0 ==.",currFunc->name);
-           _G.debugLine = 0;
-       }
-       
+  /* if debug then send end of function */
+/*  if (options.debug && currFunc) { */
+  if (currFunc) {
+      _G.debugLine = 1;
+      emitcode(";","C$%s$%d$%d$%d ==.",
+         ic->filename,currFunc->lastLine,
+         ic->level,ic->block);
+      if (IS_STATIC(currFunc->etype))
+    emitcode(";","XF%s$%s$0$0 ==.",moduleName,currFunc->name);
+      else
+    emitcode(";","XG$%s$0$0 ==.",currFunc->name);
+      _G.debugLine = 0;
+  }
+
         emitcode ("reti","");
     }
     else {
         if (SPEC_CRTCL(sym->etype))
             emitcode("setb","ea");
-       
-       if (sym->calleeSave) {
-           int i;
-           
-           /* if any registers used */
-           if (sym->regsUsed) {
-               /* save the registers used */
-               for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
-                   if (bitVectBitValue(sym->regsUsed,i) ||
+
+  if (sym->calleeSave) {
+      int i;
+
+      /* if any registers used */
+      if (sym->regsUsed) {
+    /* save the registers used */
+    for ( i = sym->regsUsed->size ; i >= 0 ; i--) {
+        if (bitVectBitValue(sym->regsUsed,i) ||
                       (pic14_ptrRegReq && (i == R0_IDX || i == R1_IDX)) )
-                       emitcode("pop","%s",pic14_regWithIdx(i)->dname);
-               }
-           }
-           
-       }
-
-       /* if debug then send end of function */
-       if (currFunc) {
-           _G.debugLine = 1;
-           emitcode(";","C$%s$%d$%d$%d ==.",
-                    ic->filename,currFunc->lastLine,
-                    ic->level,ic->block); 
-           if (IS_STATIC(currFunc->etype))         
-               emitcode(";","XF%s$%s$0$0 ==.",moduleName,currFunc->name); 
-           else
-               emitcode(";","XG$%s$0$0 ==.",currFunc->name);
-           _G.debugLine = 0;
-       }
+      emitcode("pop","%s",pic14_regWithIdx(i)->dname);
+    }
+      }
+
+  }
+
+  /* if debug then send end of function */
+  if (currFunc) {
+      _G.debugLine = 1;
+      emitcode(";","C$%s$%d$%d$%d ==.",
+         ic->filename,currFunc->lastLine,
+         ic->level,ic->block);
+      if (IS_STATIC(currFunc->etype))
+    emitcode(";","XF%s$%s$0$0 ==.",moduleName,currFunc->name);
+      else
+    emitcode(";","XG$%s$0$0 ==.",currFunc->name);
+      _G.debugLine = 0;
+  }
 
         emitcode ("return","");
     }
@@ -2460,61 +2460,61 @@ static void genEndFunction (iCode *ic)
 static void genRet (iCode *ic)
 {
     int size,offset = 0 , pushed = 0;
-    
+
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     /* if we have no return value then
        just generate the "ret" */
-    if (!IC_LEFT(ic)) 
-       goto jumpret;       
-    
+    if (!IC_LEFT(ic))
+  goto jumpret;
+
     /* we have something to return then
        move the return value into place */
     aopOp(IC_LEFT(ic),ic,FALSE);
     size = AOP_SIZE(IC_LEFT(ic));
-    
+
     while (size--) {
-           char *l ;
-           if (AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR) {
-                   /* #NOCHANGE */
-                   l = aopGet(AOP(IC_LEFT(ic)),offset++,
-                          FALSE,TRUE);
-                   emitcode("push","%s",l);
-                   pushed++;
-           } else {
-                   l = aopGet(AOP(IC_LEFT(ic)),offset,
-                              FALSE,FALSE);
-                   if (strcmp(fReturn[offset],l)) {
-                     if( ( (AOP(IC_LEFT(ic))->type) == AOP_IMMD) ||
-                         ((AOP(IC_LEFT(ic))->type) == AOP_LIT) )
-                       emitcode("movlw","%s",l);
-                     else
-                       emitcode("movf","%s,w",l);
-                     if(size)
-                       emitcode("movwf","%s",fReturn[offset]);
-                     offset++;
-                   }
-           }
-    }    
+      char *l ;
+      if (AOP_TYPE(IC_LEFT(ic)) == AOP_DPTR) {
+            /* #NOCHANGE */
+        l = aopGet(AOP(IC_LEFT(ic)),offset++,
+         FALSE,TRUE);
+        emitcode("push","%s",l);
+        pushed++;
+      } else {
+        l = aopGet(AOP(IC_LEFT(ic)),offset,
+             FALSE,FALSE);
+        if (strcmp(fReturn[offset],l)) {
+          if( ( (AOP(IC_LEFT(ic))->type) == AOP_IMMD) ||
+        ((AOP(IC_LEFT(ic))->type) == AOP_LIT) )
+      emitcode("movlw","%s",l);
+          else
+      emitcode("movf","%s,w",l);
+          if(size)
+      emitcode("movwf","%s",fReturn[offset]);
+          offset++;
+        }
+      }
+    }
 
     if (pushed) {
-       while(pushed) {
-           pushed--;
-           if (strcmp(fReturn[pushed],"a"))
-               emitcode("pop",fReturn[pushed]);
-           else
-               emitcode("pop","acc");
-       }
+  while(pushed) {
+      pushed--;
+      if (strcmp(fReturn[pushed],"a"))
+    emitcode("pop",fReturn[pushed]);
+      else
+    emitcode("pop","acc");
+  }
     }
     freeAsmop (IC_LEFT(ic),NULL,ic,TRUE);
-    
+
  jumpret:
-       /* generate a jump to the return label
-          if the next is not the return statement */
+  /* generate a jump to the return label
+     if the next is not the return statement */
     if (!(ic->next && ic->next->op == LABEL &&
-         IC_LABEL(ic->next) == returnLabel))
-       
-       emitcode("goto","_%05d_DS_",returnLabel->key+100 + labelOffset);
-    
+    IC_LABEL(ic->next) == returnLabel))
+
+  emitcode("goto","_%05d_DS_",returnLabel->key+100 + labelOffset);
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -2541,28 +2541,28 @@ static void genGoto (iCode *ic)
 
 /*-----------------------------------------------------------------*/
 /* findLabelBackwards: walks back through the iCode chain looking  */
-/* for the given label. Returns number of iCode instructions      */
-/* between that label and given ic.                               */
-/* Returns zero if label not found.                               */
+/* for the given label. Returns number of iCode instructions     */
+/* between that label and given ic.          */
+/* Returns zero if label not found.          */
 /*-----------------------------------------------------------------*/
 #if 0
 static int findLabelBackwards(iCode *ic, int key)
 {
     int count = 0;
-    
+
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     while (ic->prev)
     {
         ic = ic->prev;
         count++;
-        
+
         if (ic->op == LABEL && IC_LABEL(ic)->key == key)
         {
             /* printf("findLabelBackwards = %d\n", count); */
             return count;
         }
     }
-    
+
     return 0;
 }
 #endif
@@ -2576,22 +2576,22 @@ static bool genPlusIncr (iCode *ic)
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     DEBUGemitcode ("; ","result %d, left %d, right %d",
-                  AOP_TYPE(IC_RESULT(ic)),
-                  AOP_TYPE(IC_LEFT(ic)),
-                  AOP_TYPE(IC_RIGHT(ic)));
+       AOP_TYPE(IC_RESULT(ic)),
+       AOP_TYPE(IC_LEFT(ic)),
+       AOP_TYPE(IC_RIGHT(ic)));
 
     /* will try to generate an increment */
-    /* if the right side is not a literal 
+    /* if the right side is not a literal
        we cannot */
     if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
         return FALSE ;
-    
+
     DEBUGemitcode ("; ","%s  %d",__FUNCTION__,__LINE__);
     /* if the literal value of the right hand side
        is greater than 1 then it is faster to add */
     if ((icount =  floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit)) > 2)
         return FALSE ;
-    
+
     /* if increment 16 bits in register */
     if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) &&
         (icount == 1)) {
@@ -2601,30 +2601,30 @@ static bool genPlusIncr (iCode *ic)
       emitcode("incf","%s,f",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
 
       while(--size) {
-       emitSKPNZ;
-       emitcode(" incf","%s,f",aopGet(AOP(IC_RESULT(ic)),offset++,FALSE,FALSE));
+  emitSKPNZ;
+  emitcode(" incf","%s,f",aopGet(AOP(IC_RESULT(ic)),offset++,FALSE,FALSE));
       }
 
       return TRUE;
     }
-    
+
     DEBUGemitcode ("; ","%s  %d",__FUNCTION__,__LINE__);
     /* if left is in accumulator  - probably a bit operation*/
     if( strcmp(aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE),"a")  &&
-       (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY) ) {
-      
+  (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY) ) {
+
       emitcode("bcf","(%s >> 3), (%s & 7)",
-              AOP(IC_RESULT(ic))->aopu.aop_dir,
-              AOP(IC_RESULT(ic))->aopu.aop_dir);
+         AOP(IC_RESULT(ic))->aopu.aop_dir,
+         AOP(IC_RESULT(ic))->aopu.aop_dir);
       if(icount)
-       emitcode("xorlw","1");
+  emitcode("xorlw","1");
       else
-       emitcode("andlw","1");
+  emitcode("andlw","1");
 
       emitSKPZ;
       emitcode("bsf","(%s >> 3), (%s & 7)",
-              AOP(IC_RESULT(ic))->aopu.aop_dir,
-              AOP(IC_RESULT(ic))->aopu.aop_dir);
+         AOP(IC_RESULT(ic))->aopu.aop_dir,
+         AOP(IC_RESULT(ic))->aopu.aop_dir);
 
       return TRUE;
     }
@@ -2635,20 +2635,20 @@ static bool genPlusIncr (iCode *ic)
     if (AOP_SIZE(IC_RESULT(ic)) > 1 ||
         AOP_SIZE(IC_LEFT(ic)) > 1   )
         return FALSE ;
-    
+
     /* If we are incrementing the same register by two: */
 
     if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) ) {
-       
-      while (icount--) 
-       emitcode("incf","%s,f",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
-       
+
+      while (icount--)
+  emitcode("incf","%s,f",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+
       return TRUE ;
     }
-    
+
     DEBUGemitcode ("; ","couldn't increment result-%s  left-%s",
-                  aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE),
-                  aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
+       aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE),
+       aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
     return FALSE ;
 }
 
@@ -2680,7 +2680,7 @@ static void genPlusBits (iCode *ic)
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     /*
-      The following block of code will add two bits. 
+      The following block of code will add two bits.
       Note that it'll even work if the destination is
       the carry (C in the status register).
       It won't work if the 'Z' bit is a source or destination.
@@ -2688,32 +2688,32 @@ static void genPlusBits (iCode *ic)
 
     /* If the result is stored in the accumulator (w) */
     if(strcmp(aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE),"a") == 0 ) {
-       emitcode("movlw","(1 << (%s & 7))",
-                AOP(IC_RESULT(ic))->aopu.aop_dir,
-                AOP(IC_RESULT(ic))->aopu.aop_dir);
-       emitcode("bcf","(%s >> 3), (%s & 7)",
-                AOP(IC_RESULT(ic))->aopu.aop_dir,
-                AOP(IC_RESULT(ic))->aopu.aop_dir);
-       emitcode("btfsc","(%s >> 3), (%s & 7)",
-                AOP(IC_RIGHT(ic))->aopu.aop_dir,
-                AOP(IC_RIGHT(ic))->aopu.aop_dir);
-       emitcode("xorwf","(%s >>3),f",
-                AOP(IC_RESULT(ic))->aopu.aop_dir);
-       emitcode("btfsc","(%s >> 3), (%s & 7)",
-                AOP(IC_LEFT(ic))->aopu.aop_dir,
-                AOP(IC_LEFT(ic))->aopu.aop_dir);
-       emitcode("xorwf","(%s>>3),f",
-                AOP(IC_RESULT(ic))->aopu.aop_dir);
-    } else { 
+  emitcode("movlw","(1 << (%s & 7))",
+     AOP(IC_RESULT(ic))->aopu.aop_dir,
+     AOP(IC_RESULT(ic))->aopu.aop_dir);
+  emitcode("bcf","(%s >> 3), (%s & 7)",
+     AOP(IC_RESULT(ic))->aopu.aop_dir,
+     AOP(IC_RESULT(ic))->aopu.aop_dir);
+  emitcode("btfsc","(%s >> 3), (%s & 7)",
+     AOP(IC_RIGHT(ic))->aopu.aop_dir,
+     AOP(IC_RIGHT(ic))->aopu.aop_dir);
+  emitcode("xorwf","(%s >>3),f",
+     AOP(IC_RESULT(ic))->aopu.aop_dir);
+  emitcode("btfsc","(%s >> 3), (%s & 7)",
+     AOP(IC_LEFT(ic))->aopu.aop_dir,
+     AOP(IC_LEFT(ic))->aopu.aop_dir);
+  emitcode("xorwf","(%s>>3),f",
+     AOP(IC_RESULT(ic))->aopu.aop_dir);
+    } else {
 
       emitcode("clrw","");
       emitcode("btfsc","(%s >> 3), (%s & 7)",
-                AOP(IC_RIGHT(ic))->aopu.aop_dir,
-                AOP(IC_RIGHT(ic))->aopu.aop_dir);
+     AOP(IC_RIGHT(ic))->aopu.aop_dir,
+     AOP(IC_RIGHT(ic))->aopu.aop_dir);
       emitcode("xorlw","1");
       emitcode("btfsc","(%s >> 3), (%s & 7)",
-              AOP(IC_LEFT(ic))->aopu.aop_dir,
-              AOP(IC_LEFT(ic))->aopu.aop_dir);
+         AOP(IC_LEFT(ic))->aopu.aop_dir,
+         AOP(IC_LEFT(ic))->aopu.aop_dir);
       emitcode("xorlw","1");
     }
 
@@ -2722,68 +2722,68 @@ static void genPlusBits (iCode *ic)
 #if 0
 /* This is the original version of this code.
  *
- * This is being kept around for reference, 
+ * This is being kept around for reference,
  * because I am not entirely sure I got it right...
  */
 static void adjustArithmeticResult(iCode *ic)
 {
-    if (AOP_SIZE(IC_RESULT(ic)) == 3 && 
-       AOP_SIZE(IC_LEFT(ic)) == 3   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
-       aopPut(AOP(IC_RESULT(ic)),
-              aopGet(AOP(IC_LEFT(ic)),2,FALSE,FALSE),
-              2);
-
-    if (AOP_SIZE(IC_RESULT(ic)) == 3 && 
-       AOP_SIZE(IC_RIGHT(ic)) == 3   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
-       aopPut(AOP(IC_RESULT(ic)),
-              aopGet(AOP(IC_RIGHT(ic)),2,FALSE,FALSE),
-              2);
-    
     if (AOP_SIZE(IC_RESULT(ic)) == 3 &&
-       AOP_SIZE(IC_LEFT(ic)) < 3    &&
-       AOP_SIZE(IC_RIGHT(ic)) < 3   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
-       char buffer[5];
-       sprintf(buffer,"#%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
-       aopPut(AOP(IC_RESULT(ic)),buffer,2);
+  AOP_SIZE(IC_LEFT(ic)) == 3   &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
+  aopPut(AOP(IC_RESULT(ic)),
+         aopGet(AOP(IC_LEFT(ic)),2,FALSE,FALSE),
+         2);
+
+    if (AOP_SIZE(IC_RESULT(ic)) == 3 &&
+  AOP_SIZE(IC_RIGHT(ic)) == 3   &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
+  aopPut(AOP(IC_RESULT(ic)),
+         aopGet(AOP(IC_RIGHT(ic)),2,FALSE,FALSE),
+         2);
+
+    if (AOP_SIZE(IC_RESULT(ic)) == 3 &&
+  AOP_SIZE(IC_LEFT(ic)) < 3    &&
+  AOP_SIZE(IC_RIGHT(ic)) < 3   &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
+  char buffer[5];
+  sprintf(buffer,"#%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
+  aopPut(AOP(IC_RESULT(ic)),buffer,2);
     }
 }
 //#else
 /* This is the pure and virtuous version of this code.
- * I'm pretty certain it's right, but not enough to toss the old 
+ * I'm pretty certain it's right, but not enough to toss the old
  * code just yet...
  */
 static void adjustArithmeticResult(iCode *ic)
 {
     if (opIsGptr(IC_RESULT(ic)) &&
-       opIsGptr(IC_LEFT(ic))   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
+      opIsGptr(IC_LEFT(ic))   &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
     {
-       aopPut(AOP(IC_RESULT(ic)),
-              aopGet(AOP(IC_LEFT(ic)), GPTRSIZE - 1,FALSE,FALSE),
-              GPTRSIZE - 1);
+  aopPut(AOP(IC_RESULT(ic)),
+         aopGet(AOP(IC_LEFT(ic)), GPTRSIZE - 1,FALSE,FALSE),
+         GPTRSIZE - 1);
     }
 
     if (opIsGptr(IC_RESULT(ic)) &&
         opIsGptr(IC_RIGHT(ic))   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic))))
     {
-       aopPut(AOP(IC_RESULT(ic)),
-              aopGet(AOP(IC_RIGHT(ic)),GPTRSIZE - 1,FALSE,FALSE),
-              GPTRSIZE - 1);
+  aopPut(AOP(IC_RESULT(ic)),
+         aopGet(AOP(IC_RIGHT(ic)),GPTRSIZE - 1,FALSE,FALSE),
+         GPTRSIZE - 1);
     }
 
-    if (opIsGptr(IC_RESULT(ic))           &&
+    if (opIsGptr(IC_RESULT(ic))      &&
         AOP_SIZE(IC_LEFT(ic)) < GPTRSIZE   &&
         AOP_SIZE(IC_RIGHT(ic)) < GPTRSIZE  &&
-        !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
-        !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
-        char buffer[5];
-        sprintf(buffer,"#%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
-        aopPut(AOP(IC_RESULT(ic)),buffer,GPTRSIZE - 1);
+   !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))) &&
+   !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_RIGHT(ic)))) {
+   char buffer[5];
+   sprintf(buffer,"#%d",pointerCode(getSpec(operandType(IC_LEFT(ic)))));
+   aopPut(AOP(IC_RESULT(ic)),buffer,GPTRSIZE - 1);
      }
 }
 #endif
@@ -2824,19 +2824,19 @@ static void genPlus (iCode *ic)
         AOP_TYPE(IC_RIGHT(ic)) == AOP_LIT) {
         /* if result in bit space */
         if(AOP_TYPE(IC_RESULT(ic)) == AOP_CRY){
-         if((unsigned long)floatFromVal(AOP(IC_RIGHT(ic))->aopu.aop_lit) != 0L) {
-           emitcode("movlw","(1 << (%s & 7)) ;%d",AOP(IC_RESULT(ic))->aopu.aop_dir,__LINE__);
-           if (!sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) )
-             emitcode("btfsc","(%s >> 3), (%s & 7)",
-                      AOP(IC_LEFT(ic))->aopu.aop_dir,
-                      AOP(IC_LEFT(ic))->aopu.aop_dir);
-
-           emitcode("xorwf","(%s>>3),f",AOP(IC_RESULT(ic))->aopu.aop_dir);
-         }
+    if((unsigned long)floatFromVal(AOP(IC_RIGHT(ic))->aopu.aop_lit) != 0L) {
+      emitcode("movlw","(1 << (%s & 7)) ;%d",AOP(IC_RESULT(ic))->aopu.aop_dir,__LINE__);
+      if (!sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) )
+        emitcode("btfsc","(%s >> 3), (%s & 7)",
+           AOP(IC_LEFT(ic))->aopu.aop_dir,
+           AOP(IC_LEFT(ic))->aopu.aop_dir);
+
+      emitcode("xorwf","(%s>>3),f",AOP(IC_RESULT(ic))->aopu.aop_dir);
+    }
         } else {
             size = getDataSize(IC_RESULT(ic));
             while (size--) {
-                MOVA(aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));  
+                MOVA(aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
                 emitcode("addc","a,#00  ;%d",__LINE__);
                 aopPut(AOP(IC_RESULT(ic)),"a",offset++);
             }
@@ -2847,7 +2847,7 @@ static void genPlus (iCode *ic)
     /* if I can do an increment instead
     of add then GOOD for ME */
     if (genPlusIncr (ic) == TRUE)
-        goto release;   
+        goto release;
 
     size = getDataSize(IC_RESULT(ic));
 
@@ -2863,50 +2863,50 @@ static void genPlus (iCode *ic)
 
       DEBUGemitcode(";","size %d",size);
 
-       switch (lit & 0xff) {
-       case 0:
-         break;
-       case 1:
-         if(sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))))
-           emitcode("incf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-         else {
-           know_W = 0;
-           emitcode("incf","%s,w", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-           if(AOP_TYPE(IC_RESULT(ic)) != AOP_ACC)
-             emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
-         }
-         break;
-       case 0xff:
-         if(sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))))
-           emitcode("decf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-         else {
-           know_W = 0;
-           emitcode("decf","%s,w", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-           if(AOP_TYPE(IC_RESULT(ic)) != AOP_ACC)
-             emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
-         }
-         break;
-       default:
-         if( !know_W || ( (lit&0xff) != l1)  ) {
-           know_W = 1;
-           emitcode("movlw","0x%x", lit&0xff);
-         }
-         if(sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))))
-           emitcode("addwf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-         else {
-           know_W = 0;
-           emitcode("addwf","%s,w", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-           emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
-           if(size) {
-             emitSKPNC;
-             emitcode("incf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset+1,FALSE,FALSE));
-           }
-         }
-       }
-
-       l1 = lit & 0xff;
-       lit >>= 8;
-       offset++;
+  switch (lit & 0xff) {
+  case 0:
+    break;
+  case 1:
+    if(sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))))
+      emitcode("incf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+    else {
+      know_W = 0;
+      emitcode("incf","%s,w", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+      if(AOP_TYPE(IC_RESULT(ic)) != AOP_ACC)
+        emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+    }
+    break;
+  case 0xff:
+    if(sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))))
+      emitcode("decf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+    else {
+      know_W = 0;
+      emitcode("decf","%s,w", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+      if(AOP_TYPE(IC_RESULT(ic)) != AOP_ACC)
+        emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+    }
+    break;
+  default:
+    if( !know_W || ( (lit&0xff) != l1)  ) {
+      know_W = 1;
+      emitcode("movlw","0x%x", lit&0xff);
+    }
+    if(sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))))
+      emitcode("addwf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+    else {
+      know_W = 0;
+      emitcode("addwf","%s,w", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+      emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+      if(size) {
+        emitSKPNC;
+        emitcode("incf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset+1,FALSE,FALSE));
+      }
+    }
+  }
+
+  l1 = lit & 0xff;
+  lit >>= 8;
+  offset++;
       }
 
     } else if(AOP_TYPE(IC_RIGHT(ic)) == AOP_CRY) {
@@ -2917,116 +2917,116 @@ static void genPlus (iCode *ic)
 
       /* here we are adding a bit to a char or int */
       if(size == 1) {
-       if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) ) {
-
-         emitcode("btfsc","(%s >> 3), (%s & 7)",
-                  AOP(IC_RIGHT(ic))->aopu.aop_dir,
-                  AOP(IC_RIGHT(ic))->aopu.aop_dir);
-         emitcode(" incf","%s,f", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
-       } else {
-
-         if(AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) {
-           emitcode("btfsc","(%s >> 3), (%s & 7)",
-                    AOP(IC_RIGHT(ic))->aopu.aop_dir,
-                    AOP(IC_RIGHT(ic))->aopu.aop_dir);
-           emitcode(" xorlw","1");
-         } else {
-           emitcode("movf","%s,w", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
-           emitcode("btfsc","(%s >> 3), (%s & 7)",
-                    AOP(IC_RIGHT(ic))->aopu.aop_dir,
-                    AOP(IC_RIGHT(ic))->aopu.aop_dir);
-           emitcode(" incf","%s,w", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
-         }
-         
-         if(AOP_TYPE(IC_RESULT(ic)) != AOP_ACC) {
-           
-           if(AOP_TYPE(IC_RESULT(ic)) == AOP_CRY) {
-             emitcode("andlw","1");
-             emitcode("bcf","(%s >> 3), (%s & 7)",
-                      AOP(IC_RESULT(ic))->aopu.aop_dir,
-                      AOP(IC_RESULT(ic))->aopu.aop_dir);
-             emitSKPZ;
-             emitcode("bsf","(%s >> 3), (%s & 7)",
-                      AOP(IC_RESULT(ic))->aopu.aop_dir,
-                      AOP(IC_RESULT(ic))->aopu.aop_dir);
-
-           } else
-               emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
-         }
-       }
+  if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) ) {
+
+    emitcode("btfsc","(%s >> 3), (%s & 7)",
+       AOP(IC_RIGHT(ic))->aopu.aop_dir,
+       AOP(IC_RIGHT(ic))->aopu.aop_dir);
+    emitcode(" incf","%s,f", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+  } else {
+
+    if(AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) {
+      emitcode("btfsc","(%s >> 3), (%s & 7)",
+         AOP(IC_RIGHT(ic))->aopu.aop_dir,
+         AOP(IC_RIGHT(ic))->aopu.aop_dir);
+      emitcode(" xorlw","1");
+    } else {
+      emitcode("movf","%s,w", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
+      emitcode("btfsc","(%s >> 3), (%s & 7)",
+         AOP(IC_RIGHT(ic))->aopu.aop_dir,
+         AOP(IC_RIGHT(ic))->aopu.aop_dir);
+      emitcode(" incf","%s,w", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
+    }
+
+    if(AOP_TYPE(IC_RESULT(ic)) != AOP_ACC) {
+
+      if(AOP_TYPE(IC_RESULT(ic)) == AOP_CRY) {
+        emitcode("andlw","1");
+        emitcode("bcf","(%s >> 3), (%s & 7)",
+           AOP(IC_RESULT(ic))->aopu.aop_dir,
+           AOP(IC_RESULT(ic))->aopu.aop_dir);
+        emitSKPZ;
+        emitcode("bsf","(%s >> 3), (%s & 7)",
+           AOP(IC_RESULT(ic))->aopu.aop_dir,
+           AOP(IC_RESULT(ic))->aopu.aop_dir);
+
+      } else
+    emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+    }
+  }
 
       } else {
-       int offset = 1;
+  int offset = 1;
 
-       if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) ) {
-         emitcode("clrz","");
+  if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) ) {
+    emitcode("clrz","");
 
-         emitcode("btfsc","(%s >> 3), (%s & 7)",
-                  AOP(IC_RIGHT(ic))->aopu.aop_dir,
-                  AOP(IC_RIGHT(ic))->aopu.aop_dir);
-         emitcode(" incf","%s,f", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+    emitcode("btfsc","(%s >> 3), (%s & 7)",
+       AOP(IC_RIGHT(ic))->aopu.aop_dir,
+       AOP(IC_RIGHT(ic))->aopu.aop_dir);
+    emitcode(" incf","%s,f", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
 
-       } else {
+  } else {
 
-         emitcode("movf","%s,w", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
-         emitcode("btfsc","(%s >> 3), (%s & 7)",
-                  AOP(IC_RIGHT(ic))->aopu.aop_dir,
-                  AOP(IC_RIGHT(ic))->aopu.aop_dir);
-         emitcode(" incf","%s,w", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
-         emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+    emitcode("movf","%s,w", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
+    emitcode("btfsc","(%s >> 3), (%s & 7)",
+       AOP(IC_RIGHT(ic))->aopu.aop_dir,
+       AOP(IC_RIGHT(ic))->aopu.aop_dir);
+    emitcode(" incf","%s,w", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
+    emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
 
-       }
+  }
 
-       while(--size){
-         emitSKPZ;
-         emitcode(" incf","%s,f", aopGet(AOP(IC_RIGHT(ic)),offset++,FALSE,FALSE));
-       }
+  while(--size){
+    emitSKPZ;
+    emitcode(" incf","%s,f", aopGet(AOP(IC_RIGHT(ic)),offset++,FALSE,FALSE));
+  }
 
       }
-      
+
     } else {
-    
+
       if(strcmp(aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE),"a") == 0 ) {
-       emitcode("addwf","%s,w", aopGet(AOP(IC_RIGHT(ic)),0,FALSE,FALSE));
-       emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+  emitcode("addwf","%s,w", aopGet(AOP(IC_RIGHT(ic)),0,FALSE,FALSE));
+  emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+      } else {
+  //if ( (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) || (AOP_TYPE(IC_RESULT(ic)) == AOP_ACC) )
+  if ( AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) {
+    emitcode("addwf","%s,w", aopGet(AOP(IC_RIGHT(ic)),0,FALSE,FALSE));
+    if ( AOP_TYPE(IC_RESULT(ic)) != AOP_ACC)
+      emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+  } else {
+
+  emitcode("movf","%s,w", aopGet(AOP(IC_RIGHT(ic)),0,FALSE,FALSE));
+
+    if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) )
+        emitcode("addwf","%s,f", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
+    else {
+      if( (AOP_TYPE(IC_LEFT(ic)) == AOP_IMMD) ||
+    (AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) ) {
+        emitcode("addlw","%s", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
       } else {
-       //if ( (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) || (AOP_TYPE(IC_RESULT(ic)) == AOP_ACC) )
-       if ( AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) {
-         emitcode("addwf","%s,w", aopGet(AOP(IC_RIGHT(ic)),0,FALSE,FALSE));
-         if ( AOP_TYPE(IC_RESULT(ic)) != AOP_ACC)
-           emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
-       } else {
-
-       emitcode("movf","%s,w", aopGet(AOP(IC_RIGHT(ic)),0,FALSE,FALSE));
-
-         if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) )
-             emitcode("addwf","%s,f", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
-         else {
-           if( (AOP_TYPE(IC_LEFT(ic)) == AOP_IMMD) ||
-               (AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) ) {
-             emitcode("addlw","%s", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
-           } else {
-             emitcode("addwf","%s,w", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
-             if ( AOP_TYPE(IC_RESULT(ic)) != AOP_ACC)
-               emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
-           }
-         }
-       }
+        emitcode("addwf","%s,w", aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
+        if ( AOP_TYPE(IC_RESULT(ic)) != AOP_ACC)
+    emitcode("movwf","%s", aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+      }
+    }
+  }
       }
 
       offset = 1;
       size--;
 
       while(size--){
-       if (!sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) ) {
-         emitcode("movf","%s,w",  aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-         emitcode("movwf","%s",  aopGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
-       }
-       emitcode("movf","%s,w",  aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
-       emitSKPNC;
-       emitcode("incfsz","%s,w",aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
-       emitcode("addwf","%s,f", aopGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
-       
+  if (!sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) ) {
+    emitcode("movf","%s,w",  aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+    emitcode("movwf","%s",  aopGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+  }
+  emitcode("movf","%s,w",  aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+  emitSKPNC;
+  emitcode("incfsz","%s,w",aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+  emitcode("addwf","%s,f", aopGet(AOP(IC_RESULT(ic)),offset,FALSE,FALSE));
+
       }
 
     }
@@ -3049,7 +3049,7 @@ static bool genMinusDec (iCode *ic)
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     /* will try to generate an increment */
-    /* if the right side is not a literal 
+    /* if the right side is not a literal
     we cannot */
     if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
         return FALSE ;
@@ -3066,25 +3066,25 @@ static bool genMinusDec (iCode *ic)
         (size > 1) &&
         (icount == 1)) {
 
-      if(size == 2) { 
-       emitcode("decf","%s,f",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
-       emitcode("incfsz","%s,w",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
-       emitcode(" decf","%s,f",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE));
+      if(size == 2) {
+  emitcode("decf","%s,f",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
+  emitcode("incfsz","%s,w",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
+  emitcode(" decf","%s,f",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE));
       } else {
-       /* size is 3 or 4 */
-       emitcode("movlw","0xff");
-       emitcode("addwf","%s,f",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
+  /* size is 3 or 4 */
+  emitcode("movlw","0xff");
+  emitcode("addwf","%s,f",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE,FALSE));
 
-       emitSKPNC;
-       emitcode("addwf","%s,f",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE));
-       emitSKPNC;
-       emitcode("addwf","%s,f",aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE));
+  emitSKPNC;
+  emitcode("addwf","%s,f",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE,FALSE));
+  emitSKPNC;
+  emitcode("addwf","%s,f",aopGet(AOP(IC_RESULT(ic)),MSB24,FALSE,FALSE));
 
-       if(size > 3) {
-         emitcode("skpnc","");
-         emitSKPNC;
-         emitcode("addwf","%s,f",aopGet(AOP(IC_RESULT(ic)),MSB32,FALSE,FALSE));
-       }
+  if(size > 3) {
+    emitcode("skpnc","");
+    emitSKPNC;
+    emitcode("addwf","%s,f",aopGet(AOP(IC_RESULT(ic)),MSB32,FALSE,FALSE));
+  }
 
       }
 
@@ -3102,15 +3102,15 @@ static bool genMinusDec (iCode *ic)
     same */
     if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic)))) {
 
-        while (icount--) 
+        while (icount--)
             emitcode ("decf","%s,f",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
 
         return TRUE ;
     }
 
     DEBUGemitcode ("; returning"," result=%s, left=%s",
-                  aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE),
-                  aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
+       aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE),
+       aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
     if(size==1) {
       emitcode("decf","%s,w",aopGet(AOP(IC_LEFT(ic)),0,FALSE,FALSE));
       emitcode("movwf","%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
@@ -3132,7 +3132,7 @@ static void addSign(operand *result, int offset, int sign)
             emitcode("rlc","a");
             emitcode("subb","a,acc");
             while(size--)
-                aopPut(AOP(result),"a",offset++); 
+                aopPut(AOP(result),"a",offset++);
         } else
             while(size--)
                 aopPut(AOP(result),zero,offset++);
@@ -3188,9 +3188,9 @@ static void genMinus (iCode *ic)
     /* if I can do an decrement instead
     of subtract then GOOD for ME */
     if (genMinusDec (ic) == TRUE)
-        goto release;   
+        goto release;
 
-    size = getDataSize(IC_RESULT(ic));   
+    size = getDataSize(IC_RESULT(ic));
 
     if(AOP(IC_RIGHT(ic))->type == AOP_LIT) {
       /* Add a literal to something else */
@@ -3207,16 +3207,16 @@ static void genMinus (iCode *ic)
 
       while(size--){
 
-       emitcode("rlf","_known_zero,w");
-       emitcode("addwf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+  emitcode("rlf","_known_zero,w");
+  emitcode("addwf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
 
-       lit >>= 8;
-       if(lit & 0xff) {
-         emitcode("movlw","0x%x", lit & 0xff);
-         emitcode("addwf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-         
-       }
-       offset++;
+  lit >>= 8;
+  if(lit & 0xff) {
+    emitcode("movlw","0x%x", lit & 0xff);
+    emitcode("addwf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+
+  }
+  offset++;
       }
 
     } else {
@@ -3228,18 +3228,18 @@ static void genMinus (iCode *ic)
       size--;
 
       while(size--){
-       emitcode("movf","%s,w",  aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
-       emitSKPNC;
-       emitcode("incfsz","%s,w",aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
-       emitcode("subwf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
-       
+  emitcode("movf","%s,w",  aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+  emitSKPNC;
+  emitcode("incfsz","%s,w",aopGet(AOP(IC_RIGHT(ic)),offset,FALSE,FALSE));
+  emitcode("subwf","%s,f", aopGet(AOP(IC_LEFT(ic)),offset,FALSE,FALSE));
+
       }
 
     }
 
 
     //    adjustArithmeticResult(ic);
-        
+
 release:
     freeAsmop(IC_LEFT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(IC_RIGHT(ic),NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
@@ -3250,8 +3250,8 @@ release:
 /*-----------------------------------------------------------------*/
 /* genMultbits :- multiplication of bits                           */
 /*-----------------------------------------------------------------*/
-static void genMultbits (operand *left, 
-                         operand *right, 
+static void genMultbits (operand *left,
+                         operand *right,
                          operand *result)
 {
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
@@ -3287,7 +3287,7 @@ static void genMultOneByte (operand *left,
     /* signed or unsigned */
     emitcode("mov","b,%s", aopGet(AOP(right),0,FALSE,FALSE));
     l = aopGet(AOP(left),0,FALSE,FALSE);
-    MOVA(l);       
+    MOVA(l);
     emitcode("mul","ab");
     /* if result size = 1, mul signed = mul unsigned */
     aopPut(AOP(result),"a",0);
@@ -3317,8 +3317,8 @@ static void genMultOneByte (operand *left,
                 emitcode("cjne","a,#0x80,%05d_DS_", (lbl->key+100));
                 emitcode("","%05d_DS_:",(lbl->key+100));
                 emitcode("xch","a,%s",aopGet(AOP(right),0,FALSE,FALSE));
-                lbl = newiTempLabel(NULL);      
-                emitcode("jc","%05d_DS_",(lbl->key+100));          
+                lbl = newiTempLabel(NULL);
+                emitcode("jc","%05d_DS_",(lbl->key+100));
                 emitcode("subb","a,%s", aopGet(AOP(left),0,FALSE,FALSE));
                 emitcode("","%05d_DS_:",(lbl->key+100));
             }
@@ -3328,8 +3328,8 @@ static void genMultOneByte (operand *left,
             emitcode("cjne","a,#0x80,%05d_DS_", (lbl->key+100));
             emitcode("","%05d_DS_:",(lbl->key+100));
             emitcode("xch","a,%s",aopGet(AOP(left),0,FALSE,FALSE));
-            lbl = newiTempLabel(NULL);      
-            emitcode("jc","%05d_DS_",(lbl->key+100));          
+            lbl = newiTempLabel(NULL);
+            emitcode("jc","%05d_DS_",(lbl->key+100));
             emitcode("subb","a,%s", aopGet(AOP(right),0,FALSE,FALSE));
             emitcode("","%05d_DS_:",(lbl->key+100));
 
@@ -3340,7 +3340,7 @@ static void genMultOneByte (operand *left,
                 emitcode("subb","a,acc");
             }
         }
-        size -= 2;   
+        size -= 2;
         offset = 2;
         if (size > 0)
             while (size--)
@@ -3355,7 +3355,7 @@ static void genMult (iCode *ic)
 {
     operand *left = IC_LEFT(ic);
     operand *right = IC_RIGHT(ic);
-    operand *result= IC_RESULT(ic);   
+    operand *result= IC_RESULT(ic);
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     /* assign the amsops */
@@ -3378,31 +3378,31 @@ static void genMult (iCode *ic)
         goto release ;
     }
 
-    /* should have been converted to function call */       
+    /* should have been converted to function call */
     assert(1) ;
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genDivbits :- division of bits                                  */
 /*-----------------------------------------------------------------*/
-static void genDivbits (operand *left, 
-                        operand *right, 
+static void genDivbits (operand *left,
+                        operand *right,
                         operand *result)
 {
 
     char *l;
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-    /* the result must be bit */    
+    /* the result must be bit */
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE));
     l = aopGet(AOP(left),0,FALSE,FALSE);
 
-    MOVA(l);    
+    MOVA(l);
 
     emitcode("div","ab");
     emitcode("rrc","a");
@@ -3429,7 +3429,7 @@ static void genDivOneByte (operand *left,
         /* unsigned is easy */
         emitcode("mov","b,%s", aopGet(AOP(right),0,FALSE,FALSE));
         l = aopGet(AOP(left),0,FALSE,FALSE);
-        MOVA(l);        
+        MOVA(l);
         emitcode("div","ab");
         aopPut(AOP(result),"a",0);
         while (size--)
@@ -3440,23 +3440,23 @@ static void genDivOneByte (operand *left,
     /* signed is a little bit more difficult */
 
     /* save the signs of the operands */
-    l = aopGet(AOP(left),0,FALSE,FALSE);    
-    MOVA(l);    
+    l = aopGet(AOP(left),0,FALSE,FALSE);
+    MOVA(l);
     emitcode("xrl","a,%s",aopGet(AOP(right),0,FALSE,TRUE));
     emitcode("push","acc"); /* save it on the stack */
 
     /* now sign adjust for both left & right */
-    l =  aopGet(AOP(right),0,FALSE,FALSE);    
-    MOVA(l);       
+    l =  aopGet(AOP(right),0,FALSE,FALSE);
+    MOVA(l);
     lbl = newiTempLabel(NULL);
-    emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100));   
-    emitcode("cpl","a");   
+    emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100));
+    emitcode("cpl","a");
     emitcode("inc","a");
     emitcode("","%05d_DS_:",(lbl->key+100));
     emitcode("mov","b,a");
 
     /* sign adjust left side */
-    l =  aopGet(AOP(left),0,FALSE,FALSE);    
+    l =  aopGet(AOP(left),0,FALSE,FALSE);
     MOVA(l);
 
     lbl = newiTempLabel(NULL);
@@ -3471,8 +3471,8 @@ static void genDivOneByte (operand *left,
     only */
     emitcode("mov","b,a");
     lbl = newiTempLabel(NULL);
-    emitcode("pop","acc");   
-    /* if there was an over flow we don't 
+    emitcode("pop","acc");
+    /* if there was an over flow we don't
     adjust the sign of the result */
     emitcode("jb","ov,%05d_DS_",(lbl->key+100));
     emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100));
@@ -3486,7 +3486,7 @@ static void genDivOneByte (operand *left,
     aopPut(AOP(result),"b",0);
     if(size > 0){
         emitcode("mov","c,b.7");
-        emitcode("subb","a,acc");   
+        emitcode("subb","a,acc");
     }
     while (size--)
         aopPut(AOP(result),"a",offset++);
@@ -3500,7 +3500,7 @@ static void genDiv (iCode *ic)
 {
     operand *left = IC_LEFT(ic);
     operand *right = IC_RIGHT(ic);
-    operand *result= IC_RESULT(ic);   
+    operand *result= IC_RESULT(ic);
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     /* assign the amsops */
@@ -3528,24 +3528,24 @@ static void genDiv (iCode *ic)
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
 /* genModbits :- modulus of bits                                   */
 /*-----------------------------------------------------------------*/
-static void genModbits (operand *left, 
-                        operand *right, 
+static void genModbits (operand *left,
+                        operand *right,
                         operand *result)
 {
 
     char *l;
 
-    /* the result must be bit */    
+    /* the result must be bit */
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE));
     l = aopGet(AOP(left),0,FALSE,FALSE);
 
-    MOVA(l);       
+    MOVA(l);
 
     emitcode("div","ab");
     emitcode("mov","a,b");
@@ -3570,7 +3570,7 @@ static void genModOneByte (operand *left,
         /* unsigned is easy */
         emitcode("mov","b,%s", aopGet(AOP(right),0,FALSE,FALSE));
         l = aopGet(AOP(left),0,FALSE,FALSE);
-        MOVA(l);    
+        MOVA(l);
         emitcode("div","ab");
         aopPut(AOP(result),"b",0);
         return ;
@@ -3579,30 +3579,30 @@ static void genModOneByte (operand *left,
     /* signed is a little bit more difficult */
 
     /* save the signs of the operands */
-    l = aopGet(AOP(left),0,FALSE,FALSE);    
+    l = aopGet(AOP(left),0,FALSE,FALSE);
     MOVA(l);
 
     emitcode("xrl","a,%s",aopGet(AOP(right),0,FALSE,FALSE));
     emitcode("push","acc"); /* save it on the stack */
 
     /* now sign adjust for both left & right */
-    l =  aopGet(AOP(right),0,FALSE,FALSE);    
+    l =  aopGet(AOP(right),0,FALSE,FALSE);
     MOVA(l);
 
     lbl = newiTempLabel(NULL);
-    emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100));  
-    emitcode("cpl","a");   
+    emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100));
+    emitcode("cpl","a");
     emitcode("inc","a");
     emitcode("","%05d_DS_:",(lbl->key+100));
-    emitcode("mov","b,a"); 
+    emitcode("mov","b,a");
 
     /* sign adjust left side */
-    l =  aopGet(AOP(left),0,FALSE,FALSE);    
+    l =  aopGet(AOP(left),0,FALSE,FALSE);
     MOVA(l);
 
     lbl = newiTempLabel(NULL);
     emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100));
-    emitcode("cpl","a");   
+    emitcode("cpl","a");
     emitcode("inc","a");
     emitcode("","%05d_DS_:",(lbl->key+100));
 
@@ -3611,8 +3611,8 @@ static void genModOneByte (operand *left,
     /* we are interested in the lower order
     only */
     lbl = newiTempLabel(NULL);
-    emitcode("pop","acc");   
-    /* if there was an over flow we don't 
+    emitcode("pop","acc");
+    /* if there was an over flow we don't
     adjust the sign of the result */
     emitcode("jb","ov,%05d_DS_",(lbl->key+100));
     emitcode("jnb","acc.7,%05d_DS_",(lbl->key+100));
@@ -3634,7 +3634,7 @@ static void genMod (iCode *ic)
 {
     operand *left = IC_LEFT(ic);
     operand *right = IC_RIGHT(ic);
-    operand *result= IC_RESULT(ic);  
+    operand *result= IC_RESULT(ic);
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     /* assign the amsops */
@@ -3663,7 +3663,7 @@ static void genMod (iCode *ic)
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3677,26 +3677,26 @@ static void genIfxJump (iCode *ic, char *jval)
     supplied is true */
     if ( IC_TRUE(ic) ) {
 
-       if(strcmp(jval,"a") == 0)
-         emitSKPZ;
-       else if (strcmp(jval,"c") == 0)
-         emitSKPC;
-       else
-         emitcode("btfsc","(%s >> 3),(%s & 7)",jval,jval);
+  if(strcmp(jval,"a") == 0)
+    emitSKPZ;
+  else if (strcmp(jval,"c") == 0)
+    emitSKPC;
+  else
+    emitcode("btfsc","(%s >> 3),(%s & 7)",jval,jval);
 
-       emitcode(" goto","_%05d_DS_",IC_TRUE(ic)->key+100 + labelOffset);
+  emitcode(" goto","_%05d_DS_",IC_TRUE(ic)->key+100 + labelOffset);
 
     }
     else {
         /* false label is present */
-       if(strcmp(jval,"a") == 0)
-         emitSKPNZ;
-       else if (strcmp(jval,"c") == 0)
-         emitSKPNC;
-       else
-         emitcode("btfss","(%s >> 3),(%s & 7)",jval,jval);
+  if(strcmp(jval,"a") == 0)
+    emitSKPNZ;
+  else if (strcmp(jval,"c") == 0)
+    emitSKPNC;
+  else
+    emitcode("btfss","(%s >> 3),(%s & 7)",jval,jval);
 
-       emitcode(" goto","_%05d_DS_",IC_FALSE(ic)->key+100 + labelOffset);
+  emitcode(" goto","_%05d_DS_",IC_FALSE(ic)->key+100 + labelOffset);
 
     }
 
@@ -3818,57 +3818,57 @@ static void genCmp (operand *left,operand *right,
        (AOP_TYPE(right) == AOP_LIT && AOP_TYPE(left) != AOP_DIR )){
       symbol *lbl  = newiTempLabel(NULL);
       emitcode("cjne","%s,%s,%05d_DS_",
-              aopGet(AOP(left),offset,FALSE,FALSE),
-              aopGet(AOP(right),offset,FALSE,FALSE),
-              lbl->key+100);
+         aopGet(AOP(left),offset,FALSE,FALSE),
+         aopGet(AOP(right),offset,FALSE,FALSE),
+         lbl->key+100);
       emitcode("","%05d_DS_:",lbl->key+100);
     } else {
 
       if(AOP_TYPE(right) == AOP_LIT) {
 
-       DEBUGemitcode(";right lit","%d",sign);
-
-       lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
-       //default:
-       while(size--) {
-         i = (lit >> (size*8)) & 0xff;
-         if(i == 0) {
-           emitcode("movf","%s,w",aopGet(AOP(left),size,FALSE,FALSE));
-           genSkipz(ifx,IC_TRUE(ifx) == NULL);
-         } else {
-           emitcode("movlw","0x%x",i);
-           emitcode("subwf","%s,w",aopGet(AOP(left),size,FALSE,FALSE));
-           genSkipc(ifx,IC_TRUE(ifx) == NULL);
-         }
-
-       }
-       ifx->generated = 1;
-       return;
+  DEBUGemitcode(";right lit","%d",sign);
+
+  lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
+  //default:
+  while(size--) {
+    i = (lit >> (size*8)) & 0xff;
+    if(i == 0) {
+      emitcode("movf","%s,w",aopGet(AOP(left),size,FALSE,FALSE));
+      genSkipz(ifx,IC_TRUE(ifx) == NULL);
+    } else {
+      emitcode("movlw","0x%x",i);
+      emitcode("subwf","%s,w",aopGet(AOP(left),size,FALSE,FALSE));
+      genSkipc(ifx,IC_TRUE(ifx) == NULL);
+    }
+
+  }
+  ifx->generated = 1;
+  return;
       }
       if(AOP_TYPE(left) == AOP_LIT) {
 
-       DEBUGemitcode(";left lit","%d",sign);
-
-       lit = (unsigned long)(floatFromVal(AOP(left)->aopu.aop_lit))+1;
-
-       //default:
-       while(size--) {
-         i = (lit >> (size*8)) & 0xff;
-         if(i == 0) {
-           emitcode("movf","%s,w",aopGet(AOP(right),size,FALSE,FALSE));
-           genSkipz(ifx,IC_TRUE(ifx) != NULL);
-         } else if( i == 1 ) {
-           emitcode("decf","%s,w",aopGet(AOP(right),size,FALSE,FALSE));
-           genSkipz(ifx,IC_TRUE(ifx) != NULL);
-
-         } else {
-           emitcode("movlw","0x%x",i);
-           emitcode("subwf","%s,w",aopGet(AOP(right),size,FALSE,FALSE));
-           genSkipc(ifx,IC_TRUE(ifx) != NULL);
-         }
-       }
-       ifx->generated = 1;
-       return;
+  DEBUGemitcode(";left lit","%d",sign);
+
+  lit = (unsigned long)(floatFromVal(AOP(left)->aopu.aop_lit))+1;
+
+  //default:
+  while(size--) {
+    i = (lit >> (size*8)) & 0xff;
+    if(i == 0) {
+      emitcode("movf","%s,w",aopGet(AOP(right),size,FALSE,FALSE));
+      genSkipz(ifx,IC_TRUE(ifx) != NULL);
+    } else if( i == 1 ) {
+      emitcode("decf","%s,w",aopGet(AOP(right),size,FALSE,FALSE));
+      genSkipz(ifx,IC_TRUE(ifx) != NULL);
+
+    } else {
+      emitcode("movlw","0x%x",i);
+      emitcode("subwf","%s,w",aopGet(AOP(right),size,FALSE,FALSE));
+      genSkipc(ifx,IC_TRUE(ifx) != NULL);
+    }
+  }
+  ifx->generated = 1;
+  return;
       }
 
 
@@ -3879,24 +3879,24 @@ static void genCmp (operand *left,operand *right,
       size--;
       while (size--) {
 
-       /*if (AOP_TYPE(right) == AOP_LIT){
-         unsigned long lit = (unsigned long)
-         floatFromVal(AOP(right)->aopu.aop_lit);
-         emitcode("subb","a,#0x%02x",
-         0x80 ^ (unsigned int)((lit >> (offset*8)) & 0x0FFL));                       
-         } else {
-         emitcode("mov","b,%s",aopGet(AOP(right),offset++,FALSE,FALSE));
-         emitcode("xrl","b,#0x80");
-         emitcode("subb","a,b");
-         }
-         } else      
-         emitcode("subb","a,%s",aopGet(AOP(right),offset++,FALSE,FALSE));
-       */
-       emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-       emitSKPC;
-       emitcode("incfsz","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-       emitcode("subwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-       offset++;
+  /*if (AOP_TYPE(right) == AOP_LIT){
+    unsigned long lit = (unsigned long)
+    floatFromVal(AOP(right)->aopu.aop_lit);
+    emitcode("subb","a,#0x%02x",
+    0x80 ^ (unsigned int)((lit >> (offset*8)) & 0x0FFL));
+    } else {
+    emitcode("mov","b,%s",aopGet(AOP(right),offset++,FALSE,FALSE));
+    emitcode("xrl","b,#0x80");
+    emitcode("subb","a,b");
+    }
+    } else
+    emitcode("subb","a,%s",aopGet(AOP(right),offset++,FALSE,FALSE));
+  */
+  emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+  emitSKPC;
+  emitcode("incfsz","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+  emitcode("subwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+  offset++;
       }
     }
   }
@@ -3943,7 +3943,7 @@ static void genCmpGt (iCode *ic, iCode *ifx)
 
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3973,7 +3973,7 @@ static void genCmpLt (iCode *ic, iCode *ifx)
 
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE); 
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -3986,10 +3986,10 @@ static void gencjneshort(operand *left, operand *right, symbol *lbl)
     unsigned long lit = 0L;
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-    /* if the left side is a literal or 
-    if the right is in a pointer register and left 
+    /* if the left side is a literal or
+    if the right is in a pointer register and left
     is not */
-    if ((AOP_TYPE(left) == AOP_LIT) || 
+    if ((AOP_TYPE(left) == AOP_LIT) ||
         (IS_AOP_PREG(right) && !IS_AOP_PREG(left))) {
         operand *t = right;
         right = left;
@@ -4002,37 +4002,37 @@ static void gencjneshort(operand *left, operand *right, symbol *lbl)
     if (AOP_TYPE(right) == AOP_LIT &&
         AOP_TYPE(left) != AOP_DIR ) {
         while (size--) {
-         if(lit & 0xff) {
-           emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-           emitcode("xorlw","0x%x",lit & 0xff);
-         } else
-           emitcode("movf","%s,f",aopGet(AOP(left),offset,FALSE,FALSE));
-
-         emitSKPNZ;
-         emitcode("goto","_%05d_DS_",lbl->key+100+labelOffset);
-         offset++;
-         lit >>= 8;
+    if(lit & 0xff) {
+      emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      emitcode("xorlw","0x%x",lit & 0xff);
+    } else
+      emitcode("movf","%s,f",aopGet(AOP(left),offset,FALSE,FALSE));
+
+    emitSKPNZ;
+    emitcode("goto","_%05d_DS_",lbl->key+100+labelOffset);
+    offset++;
+    lit >>= 8;
         }
     }
 
     /* if the right side is in a register or in direct space or
-    if the left is a pointer register & right is not */    
+    if the left is a pointer register & right is not */
     else if (AOP_TYPE(right) == AOP_REG ||
-             AOP_TYPE(right) == AOP_DIR || 
+             AOP_TYPE(right) == AOP_DIR ||
              (AOP_TYPE(left) == AOP_DIR && AOP_TYPE(right) == AOP_LIT) ||
              (IS_AOP_PREG(left) && !IS_AOP_PREG(right))) {
         while (size--) {
-         if((AOP_TYPE(left) == AOP_DIR && AOP_TYPE(right) == AOP_LIT) &&
-            ( (lit & 0xff) != 0)) {
-           emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-           emitcode("xorlw","0x%x",lit & 0xff);
-           lit >>= 8;
-         } else
-           emitcode("movf","%s,f",aopGet(AOP(left),offset,FALSE,FALSE));
-
-         emitSKPZ;
-         emitcode("goto","_%05d_DS_",lbl->key+100+labelOffset);
-         offset++;
+    if((AOP_TYPE(left) == AOP_DIR && AOP_TYPE(right) == AOP_LIT) &&
+       ( (lit & 0xff) != 0)) {
+      emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      emitcode("xorlw","0x%x",lit & 0xff);
+      lit >>= 8;
+    } else
+      emitcode("movf","%s,f",aopGet(AOP(left),offset,FALSE,FALSE));
+
+    emitSKPZ;
+    emitcode("goto","_%05d_DS_",lbl->key+100+labelOffset);
+    offset++;
 /*
             MOVA(aopGet(AOP(left),offset,FALSE,FALSE));
             if((AOP_TYPE(left) == AOP_DIR && AOP_TYPE(right) == AOP_LIT) &&
@@ -4052,7 +4052,7 @@ static void gencjneshort(operand *left, operand *right, symbol *lbl)
             if(strcmp(l,"b"))
                 emitcode("mov","b,%s",l);
             MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-            emitcode("cjne","a,b,%05d_DS_",lbl->key+100);    
+            emitcode("cjne","a,b,%05d_DS_",lbl->key+100);
             offset++;
         }
     }
@@ -4097,10 +4097,10 @@ static void genCmpEq (iCode *ic, iCode *ifx)
 
     size = max(AOP_SIZE(left),AOP_SIZE(right));
 
-    /* if literal, literal on the right or 
-    if the right is in a pointer register and left 
+    /* if literal, literal on the right or
+    if the right is in a pointer register and left
     is not */
-    if ((AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) || 
+    if ((AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) ||
         (IS_AOP_PREG(right) && !IS_AOP_PREG(left))) {
         operand *t = IC_RIGHT(ic);
         IC_RIGHT(ic) = IC_LEFT(ic);
@@ -4143,175 +4143,175 @@ static void genCmpEq (iCode *ic, iCode *ifx)
             emitcode("","%05d_DS_:",tlbl->key+100+labelOffset);
         } else {
 
-         /* They're not both bit variables. Is the right a literal? */
-         if(AOP_TYPE(right) == AOP_LIT) {
-
-           lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
-           while (size--) {
-
-             if(size >= 1) {
-               int l = lit & 0xff;
-               int h = (lit>>8) & 0xff;
-               int optimized=0;
-
-               /* Check special cases for integers */
-               switch(lit & 0xffff) {
-               case 0x0000:
-                 emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                 emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
-                 genSkip(ifx,'z');
-                 optimized++;
-                 break;
-               case 0x0001:
-                 emitcode("decf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                 emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
-                 genSkip(ifx,'z');
-                 optimized++;
-                 break;
-               case 0x0100:
-                 emitcode("decf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
-                 emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                 genSkip(ifx,'z');
-                 optimized++;
-                 break;
-               case 0x00ff:
-                 emitcode("incf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                 emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
-                 genSkip(ifx,'z');
-                 optimized++;
-                 break;
-               case 0xff00:
-                 emitcode("incf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
-                 emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                 genSkip(ifx,'z');
-                 optimized++;
-                 break;
-               default:
-                 if(h == 0) {
-                   emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                   emitcode("xorlw","0x%x",l);
-                   emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
-                   optimized++;
-                   genSkip(ifx,'z');
-                 } else if (l == 0) {
-                   emitcode("movf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
-                   emitcode("xorlw","0x%x",h);
-                   emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                   optimized++;
-                   genSkip(ifx,'z');
-                 } else {
-                   emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                   emitcode("xorlw","0x%x",l);
-                   emitcode("movlw","0x%x",h);
-                   emitSKPZ;
-                   emitcode("xorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
-                   optimized++;
-                   genSkip(ifx,'z');
-                 }
-
-               }
-               if(optimized) {
-                 size--;
-                 offset+=2;
-                 lit>>=16;
-
-                 continue;
-               }
-                 
-             }
-               
-             switch(lit & 0xff) {
-             case 1:
-               if ( IC_TRUE(ifx) ) {
-                 emitcode("decf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                 emitSKPNZ;
-                 emitcode("goto","_%05d_DS_",IC_TRUE(ifx)->key+100+labelOffset);
-               } else {
-                 emitcode("decfsz","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                 emitcode("goto","_%05d_DS_",IC_FALSE(ifx)->key+100+labelOffset);
-               }
-               break;
-             case 0xff:
-               if ( IC_TRUE(ifx) ) {
-                 emitcode("incf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                 emitSKPNZ;
-                 emitcode("goto","_%05d_DS_",IC_TRUE(ifx)->key+100+labelOffset);
-               } else {
-                 emitcode("incfsz","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-                 emitcode("goto","_%05d_DS_",IC_FALSE(ifx)->key+100+labelOffset);
-               }
-               break;
-             default:
-               emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-               if(lit)
-                 emitcode("xorlw","0x%x",lit & 0xff);
-               genSkip(ifx,'z');
-             }
-
-
-             //              emitcode("goto","_%05d_DS_",tlbl->key+100+labelOffset);
-             //emitcode("","_%05d_DS_:",tlbl->key+100+labelOffset);                
-             offset++;
-             lit >>= 8;
-           }
-
-         } else if(AOP_TYPE(right) == AOP_CRY ) {
-           /* we know the left is not a bit, but that the right is */
-           emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-           if ( IC_TRUE(ifx) )
-             emitcode("btfsc","(%s >> 3), (%s & 7)",
-                      AOP(right)->aopu.aop_dir,
-                      AOP(right)->aopu.aop_dir);
-           else
-             emitcode("btfss","(%s >> 3), (%s & 7)",
-                      AOP(right)->aopu.aop_dir,
-                      AOP(right)->aopu.aop_dir);
-
-           emitcode("xorlw","1");
-
-           /* if the two are equal, then W will be 0 and the Z bit is set
-            * we could test Z now, or go ahead and check the high order bytes if
-            * the variable we're comparing is larger than a byte. */
-
-           while(--size)
-             emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-
-           if ( IC_TRUE(ifx) ) {
-             emitSKPNZ;
-             emitcode(" goto","_%05d_DS_",IC_TRUE(ifx)->key+100+labelOffset);
-           } else {
-             emitSKPZ;
-             emitcode(" goto","_%05d_DS_",IC_FALSE(ifx)->key+100+labelOffset);
-           }
-
-         } else {
-           /* They're both variables that are larger than bits */
-           int s = size;
-
-           tlbl = newiTempLabel(NULL);
-
-           while(size--) {
-
-             emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-             emitcode("xorwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-
-             if ( IC_TRUE(ifx) ) {
-               if(size) {
-                 emitSKPZ;
-                 emitcode(" goto","_%05d_DS_",tlbl->key+100+labelOffset);
-               } else {
-                 emitSKPNZ;
-                 emitcode(" goto","_%05d_DS_",IC_TRUE(ifx)->key+100+labelOffset);
-               }
-             } else {
-               emitSKPZ;
-               emitcode(" goto","_%05d_DS_",IC_FALSE(ifx)->key+100+labelOffset);
-             }
-             offset++;
-           }
-           if(s>1 && IC_TRUE(ifx))
-             emitcode("","_%05d_DS_:",tlbl->key+100+labelOffset);                
-         }
+    /* They're not both bit variables. Is the right a literal? */
+    if(AOP_TYPE(right) == AOP_LIT) {
+
+      lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
+      while (size--) {
+
+        if(size >= 1) {
+    int l = lit & 0xff;
+    int h = (lit>>8) & 0xff;
+    int optimized=0;
+
+    /* Check special cases for integers */
+    switch(lit & 0xffff) {
+    case 0x0000:
+      emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
+      genSkip(ifx,'z');
+      optimized++;
+      break;
+    case 0x0001:
+      emitcode("decf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
+      genSkip(ifx,'z');
+      optimized++;
+      break;
+    case 0x0100:
+      emitcode("decf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
+      emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      genSkip(ifx,'z');
+      optimized++;
+      break;
+    case 0x00ff:
+      emitcode("incf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
+      genSkip(ifx,'z');
+      optimized++;
+      break;
+    case 0xff00:
+      emitcode("incf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
+      emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      genSkip(ifx,'z');
+      optimized++;
+      break;
+    default:
+      if(h == 0) {
+        emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+        emitcode("xorlw","0x%x",l);
+        emitcode("iorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
+        optimized++;
+        genSkip(ifx,'z');
+      } else if (l == 0) {
+        emitcode("movf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
+        emitcode("xorlw","0x%x",h);
+        emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+        optimized++;
+        genSkip(ifx,'z');
+      } else {
+        emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+        emitcode("xorlw","0x%x",l);
+        emitcode("movlw","0x%x",h);
+        emitSKPZ;
+        emitcode("xorwf","%s,w",aopGet(AOP(left),offset+1,FALSE,FALSE));
+        optimized++;
+        genSkip(ifx,'z');
+      }
+
+    }
+    if(optimized) {
+      size--;
+      offset+=2;
+      lit>>=16;
+
+      continue;
+    }
+
+        }
+
+        switch(lit & 0xff) {
+        case 1:
+    if ( IC_TRUE(ifx) ) {
+      emitcode("decf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      emitSKPNZ;
+      emitcode("goto","_%05d_DS_",IC_TRUE(ifx)->key+100+labelOffset);
+    } else {
+      emitcode("decfsz","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      emitcode("goto","_%05d_DS_",IC_FALSE(ifx)->key+100+labelOffset);
+    }
+    break;
+        case 0xff:
+    if ( IC_TRUE(ifx) ) {
+      emitcode("incf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      emitSKPNZ;
+      emitcode("goto","_%05d_DS_",IC_TRUE(ifx)->key+100+labelOffset);
+    } else {
+      emitcode("incfsz","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      emitcode("goto","_%05d_DS_",IC_FALSE(ifx)->key+100+labelOffset);
+    }
+    break;
+        default:
+    emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+    if(lit)
+      emitcode("xorlw","0x%x",lit & 0xff);
+    genSkip(ifx,'z');
+        }
+
+
+        //        emitcode("goto","_%05d_DS_",tlbl->key+100+labelOffset);
+        //emitcode("","_%05d_DS_:",tlbl->key+100+labelOffset);
+        offset++;
+        lit >>= 8;
+      }
+
+    } else if(AOP_TYPE(right) == AOP_CRY ) {
+      /* we know the left is not a bit, but that the right is */
+      emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      if ( IC_TRUE(ifx) )
+        emitcode("btfsc","(%s >> 3), (%s & 7)",
+           AOP(right)->aopu.aop_dir,
+           AOP(right)->aopu.aop_dir);
+      else
+        emitcode("btfss","(%s >> 3), (%s & 7)",
+           AOP(right)->aopu.aop_dir,
+           AOP(right)->aopu.aop_dir);
+
+      emitcode("xorlw","1");
+
+      /* if the two are equal, then W will be 0 and the Z bit is set
+       * we could test Z now, or go ahead and check the high order bytes if
+       * the variable we're comparing is larger than a byte. */
+
+      while(--size)
+        emitcode("iorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+
+      if ( IC_TRUE(ifx) ) {
+        emitSKPNZ;
+        emitcode(" goto","_%05d_DS_",IC_TRUE(ifx)->key+100+labelOffset);
+      } else {
+        emitSKPZ;
+        emitcode(" goto","_%05d_DS_",IC_FALSE(ifx)->key+100+labelOffset);
+      }
+
+    } else {
+      /* They're both variables that are larger than bits */
+      int s = size;
+
+      tlbl = newiTempLabel(NULL);
+
+      while(size--) {
+
+        emitcode("movf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+        emitcode("xorwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+
+        if ( IC_TRUE(ifx) ) {
+    if(size) {
+      emitSKPZ;
+      emitcode(" goto","_%05d_DS_",tlbl->key+100+labelOffset);
+    } else {
+      emitSKPNZ;
+      emitcode(" goto","_%05d_DS_",IC_TRUE(ifx)->key+100+labelOffset);
+    }
+        } else {
+    emitSKPZ;
+    emitcode(" goto","_%05d_DS_",IC_FALSE(ifx)->key+100+labelOffset);
+        }
+        offset++;
+      }
+      if(s>1 && IC_TRUE(ifx))
+        emitcode("","_%05d_DS_:",tlbl->key+100+labelOffset);
+    }
         }
         /* mark the icode as generated */
         ifx->generated = 1;
@@ -4352,7 +4352,7 @@ static void genCmpEq (iCode *ic, iCode *ifx)
         then put the result in place */
         outBitC(result);
     } else {
-        gencjne(left,right,newiTempLabel(NULL));    
+        gencjne(left,right,newiTempLabel(NULL));
         if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) {
             aopPut(AOP(result),"a",0);
             goto release ;
@@ -4363,7 +4363,7 @@ static void genCmpEq (iCode *ic, iCode *ifx)
         }
         /* if the result is used in an arithmetic operation
         then put the result in place */
-        if (AOP_TYPE(result) != AOP_CRY) 
+        if (AOP_TYPE(result) != AOP_CRY)
             outAcc(result);
         /* leave the result in acc */
     }
@@ -4419,7 +4419,7 @@ static void genAndOp (iCode *ic)
         outBitC(result);
     } else {
         tlbl = newiTempLabel(NULL);
-        toBoolean(left);    
+        toBoolean(left);
         emitcode("jz","%05d_DS_",tlbl->key+100);
         toBoolean(right);
         emitcode("","%05d_DS_:",tlbl->key+100);
@@ -4458,17 +4458,17 @@ static void genOrOp (iCode *ic)
         AOP_TYPE(right) == AOP_CRY ) {
       emitcode("clrc","");
       emitcode("btfss","(%s >> 3), (%s & 7)",
-              AOP(left)->aopu.aop_dir,
-              AOP(left)->aopu.aop_dir);
+         AOP(left)->aopu.aop_dir,
+         AOP(left)->aopu.aop_dir);
       emitcode("btfsc","(%s >> 3), (%s & 7)",
-              AOP(right)->aopu.aop_dir,
-              AOP(right)->aopu.aop_dir);
+         AOP(right)->aopu.aop_dir,
+         AOP(right)->aopu.aop_dir);
       emitcode("setc","");
 
     } else {
         tlbl = newiTempLabel(NULL);
         toBoolean(left);
-       emitSKPZ;
+  emitSKPZ;
         emitcode("goto","%05d_DS_",tlbl->key+100+labelOffset);
         toBoolean(right);
         emitcode("","%05d_DS_:",tlbl->key+100+labelOffset);
@@ -4478,7 +4478,7 @@ static void genOrOp (iCode *ic)
 
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);            
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -4494,7 +4494,7 @@ static int isLiteralBit(unsigned long lit)
     0x1000000L,0x2000000L,0x4000000L,0x8000000L,
     0x10000000L,0x20000000L,0x40000000L,0x80000000L};
     int idx;
-    
+
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     for(idx = 0; idx < 32; idx++)
         if(lit == pw[idx])
@@ -4533,7 +4533,7 @@ static void jmpTrueOrFalse (iCode *ic, symbol *tlbl)
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     if(IC_TRUE(ic)){
         symbol *nlbl = newiTempLabel(NULL);
-        emitcode("sjmp","%05d_DS_",nlbl->key+100);                 
+        emitcode("sjmp","%05d_DS_",nlbl->key+100);
         emitcode("","%05d_DS_:",tlbl->key+100);
         emitcode("ljmp","%05d_DS_",IC_TRUE(ic)->key+100);
         emitcode("","%05d_DS_:",nlbl->key+100);
@@ -4551,7 +4551,7 @@ static void jmpTrueOrFalse (iCode *ic, symbol *tlbl)
 static void genAnd (iCode *ic, iCode *ifx)
 {
     operand *left, *right, *result;
-    int size, offset=0;  
+    int size, offset=0;
     unsigned long lit = 0L;
     int bytelit = 0;
     char buffer[10];
@@ -4572,7 +4572,7 @@ static void genAnd (iCode *ic, iCode *ifx)
 
     /* if left is a literal & right is not then exchange them */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       AOP_NEEDSACC(left)) {
+  AOP_NEEDSACC(left)) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -4638,7 +4638,7 @@ static void genAnd (iCode *ic, iCode *ifx)
             outBitC(result);
         // if(bit & ...)
         else if((AOP_TYPE(result) == AOP_CRY) && ifx)
-            genIfxJump(ifx, "c");           
+            genIfxJump(ifx, "c");
         goto release ;
     }
 
@@ -4702,37 +4702,37 @@ static void genAnd (iCode *ic, iCode *ifx)
     /* if left is same as result */
     if(sameRegs(AOP(result),AOP(left))){
       for(;size--; offset++,lit>>=8) {
-       if(AOP_TYPE(right) == AOP_LIT){
-         switch(lit & 0xff) {
-         case 0x00:
-           /*  and'ing with 0 has clears the result */
-           emitcode("clrf","%s",aopGet(AOP(result),offset,FALSE,FALSE));
-           break;
-         case 0xff:
-           emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-           break;
-
-         default:
-           {
-             int p = my_powof2( (~lit) & 0xff );
-             if(p>=0) {
-               /* only one bit is set in the literal, so use a bcf instruction */
-               emitcode("bcf","%s,%d",aopGet(AOP(left),offset,FALSE,TRUE),p);
-             } else {
-               emitcode("movlw","0x%x", (lit & 0xff));
-               emitcode("andwf","%s,f",aopGet(AOP(left),offset,FALSE,TRUE),p);
-             }
-           }    
-         }
-       } else {
-         if (AOP_TYPE(left) == AOP_ACC) 
-           emitcode("iorwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-         else {                    
-           emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-           emitcode("iorwf","%s,f",aopGet(AOP(left),offset,FALSE,FALSE));
-
-         }
-       }
+  if(AOP_TYPE(right) == AOP_LIT){
+    switch(lit & 0xff) {
+    case 0x00:
+      /*  and'ing with 0 has clears the result */
+      emitcode("clrf","%s",aopGet(AOP(result),offset,FALSE,FALSE));
+      break;
+    case 0xff:
+      emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+      break;
+
+    default:
+      {
+        int p = my_powof2( (~lit) & 0xff );
+        if(p>=0) {
+    /* only one bit is set in the literal, so use a bcf instruction */
+    emitcode("bcf","%s,%d",aopGet(AOP(left),offset,FALSE,TRUE),p);
+        } else {
+    emitcode("movlw","0x%x", (lit & 0xff));
+    emitcode("andwf","%s,f",aopGet(AOP(left),offset,FALSE,TRUE),p);
+        }
+      }
+    }
+  } else {
+    if (AOP_TYPE(left) == AOP_ACC)
+      emitcode("iorwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+    else {
+      emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+      emitcode("iorwf","%s,f",aopGet(AOP(left),offset,FALSE,FALSE));
+
+    }
+  }
       }
 
     } else {
@@ -4759,49 +4759,49 @@ static void genAnd (iCode *ic, iCode *ifx)
             } else if(ifx)
                 jmpTrueOrFalse(ifx, tlbl);
         } else {
-         for(;(size--);offset++) {
-           // normal case
-           // result = left & right
-           if(AOP_TYPE(right) == AOP_LIT){
-             int t = (lit >> (offset*8)) & 0x0FFL;
-             switch(t) { 
-             case 0x00:
-               emitcode("clrf","%s",
-                        aopGet(AOP(result),offset,FALSE,FALSE));
-               break;
-             case 0xff:
-               emitcode("movf","%s,w",
-                        aopGet(AOP(left),offset,FALSE,FALSE));
-               emitcode("movwf","%s",
-                        aopGet(AOP(result),offset,FALSE,FALSE));
-               break;
-             default:
-               emitcode("movlw","0x%x",t);
-               emitcode("andwf","%s,w",
-                        aopGet(AOP(left),offset,FALSE,FALSE));
-               emitcode("movwf","%s",
-                        aopGet(AOP(result),offset,FALSE,FALSE));
-             
-             }
-             continue;
-           }
-
-           if (AOP_TYPE(left) == AOP_ACC) 
-             emitcode("andwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-           else {
-             emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-             emitcode("andwf","%s,w",
-                      aopGet(AOP(left),offset,FALSE,FALSE));
-           }
-           emitcode("movwf","%s",aopGet(AOP(result),offset,FALSE,FALSE));
-         }
-       }
+    for(;(size--);offset++) {
+      // normal case
+      // result = left & right
+      if(AOP_TYPE(right) == AOP_LIT){
+        int t = (lit >> (offset*8)) & 0x0FFL;
+        switch(t) {
+        case 0x00:
+    emitcode("clrf","%s",
+       aopGet(AOP(result),offset,FALSE,FALSE));
+    break;
+        case 0xff:
+    emitcode("movf","%s,w",
+       aopGet(AOP(left),offset,FALSE,FALSE));
+    emitcode("movwf","%s",
+       aopGet(AOP(result),offset,FALSE,FALSE));
+    break;
+        default:
+    emitcode("movlw","0x%x",t);
+    emitcode("andwf","%s,w",
+       aopGet(AOP(left),offset,FALSE,FALSE));
+    emitcode("movwf","%s",
+       aopGet(AOP(result),offset,FALSE,FALSE));
+
+        }
+        continue;
+      }
+
+      if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("andwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+      else {
+        emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+        emitcode("andwf","%s,w",
+           aopGet(AOP(left),offset,FALSE,FALSE));
+      }
+      emitcode("movwf","%s",aopGet(AOP(result),offset,FALSE,FALSE));
+    }
+  }
     }
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);     
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -4822,7 +4822,7 @@ static void genOr (iCode *ic, iCode *ifx)
 
     /* if left is a literal & right is not then exchange them */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       AOP_NEEDSACC(left)) {
+  AOP_NEEDSACC(left)) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -4858,8 +4858,8 @@ static void genOr (iCode *ic, iCode *ifx)
                 if(AOP_TYPE(result) == AOP_CRY){
                     if(size)
                         emitcode("bsf","(%s >> 3), (%s & 7)",
-                                AOP(result)->aopu.aop_dir,
-                                AOP(result)->aopu.aop_dir);
+         AOP(result)->aopu.aop_dir,
+         AOP(result)->aopu.aop_dir);
                     else if(ifx)
                         continueIfTrue(ifx);
                     goto release;
@@ -4873,32 +4873,32 @@ static void genOr (iCode *ic, iCode *ifx)
             }
         } else {
             if (AOP_TYPE(right) == AOP_CRY){
-             if(sameRegs(AOP(result),AOP(left))){
+        if(sameRegs(AOP(result),AOP(left))){
                 // c = bit | bit;
-               emitcode("bcf","(%s >> 3), (%s & 7)",
-                        AOP(result)->aopu.aop_dir,
-                        AOP(result)->aopu.aop_dir);
-               emitcode("btfsc","(%s >> 3), (%s & 7)",
-                        AOP(right)->aopu.aop_dir,
-                        AOP(right)->aopu.aop_dir);
-               emitcode("bsf","(%s >> 3), (%s & 7)",
-                        AOP(result)->aopu.aop_dir,
-                        AOP(result)->aopu.aop_dir);
-             } else {
-
-               emitcode("bcf","(%s >> 3), (%s & 7)",
-                        AOP(result)->aopu.aop_dir,
-                        AOP(result)->aopu.aop_dir);
-               emitcode("btfss","(%s >> 3), (%s & 7)",
-                        AOP(right)->aopu.aop_dir,
-                        AOP(right)->aopu.aop_dir);
-               emitcode("btfsc","(%s >> 3), (%s & 7)",
-                        AOP(left)->aopu.aop_dir,
-                        AOP(left)->aopu.aop_dir);
-               emitcode("bsf","(%s >> 3), (%s & 7)",
-                        AOP(result)->aopu.aop_dir,
-                        AOP(result)->aopu.aop_dir);
-             }
+    emitcode("bcf","(%s >> 3), (%s & 7)",
+       AOP(result)->aopu.aop_dir,
+       AOP(result)->aopu.aop_dir);
+    emitcode("btfsc","(%s >> 3), (%s & 7)",
+       AOP(right)->aopu.aop_dir,
+       AOP(right)->aopu.aop_dir);
+    emitcode("bsf","(%s >> 3), (%s & 7)",
+       AOP(result)->aopu.aop_dir,
+       AOP(result)->aopu.aop_dir);
+        } else {
+
+    emitcode("bcf","(%s >> 3), (%s & 7)",
+       AOP(result)->aopu.aop_dir,
+       AOP(result)->aopu.aop_dir);
+    emitcode("btfss","(%s >> 3), (%s & 7)",
+       AOP(right)->aopu.aop_dir,
+       AOP(right)->aopu.aop_dir);
+    emitcode("btfsc","(%s >> 3), (%s & 7)",
+       AOP(left)->aopu.aop_dir,
+       AOP(left)->aopu.aop_dir);
+    emitcode("bsf","(%s >> 3), (%s & 7)",
+       AOP(result)->aopu.aop_dir,
+       AOP(result)->aopu.aop_dir);
+        }
             }
             else{
                 // c = bit | val;
@@ -4925,7 +4925,7 @@ static void genOr (iCode *ic, iCode *ifx)
             outBitC(result);
         // if(bit | ...)
         else if((AOP_TYPE(result) == AOP_CRY) && ifx)
-            genIfxJump(ifx, "c");           
+            genIfxJump(ifx, "c");
         goto release ;
     }
 
@@ -4935,15 +4935,15 @@ static void genOr (iCode *ic, iCode *ifx)
        (AOP_TYPE(result) == AOP_CRY) &&
        (AOP_TYPE(left) != AOP_CRY)){
         if(lit){
-         emitcode(";XXX "," %s,%d",__FILE__,__LINE__);
+    emitcode(";XXX "," %s,%d",__FILE__,__LINE__);
             // result = 1
             if(size)
                 emitcode(";XXX setb","%s",AOP(result)->aopu.aop_dir);
-            else 
+            else
                 continueIfTrue(ifx);
             goto release;
         } else {
-         emitcode(";XXX "," %s,%d",__FILE__,__LINE__);
+    emitcode(";XXX "," %s,%d",__FILE__,__LINE__);
             // lit = 0, result = boolean(left)
             if(size)
                 emitcode(";XXX setb","c");
@@ -4965,30 +4965,30 @@ static void genOr (iCode *ic, iCode *ifx)
     /* if left is same as result */
     if(sameRegs(AOP(result),AOP(left))){
       for(;size--; offset++,lit>>=8) {
-       if(AOP_TYPE(right) == AOP_LIT){
-         if((lit & 0xff) == 0)
-           /*  or'ing with 0 has no effect */
-           continue;
-         else {
-           int p = my_powof2(lit & 0xff);
-           if(p>=0) {
-             /* only one bit is set in the literal, so use a bsf instruction */
-             emitcode("bsf","%s,%d",aopGet(AOP(left),offset,FALSE,TRUE),p);
-           } else {
-             emitcode("movlw","0x%x", (lit & 0xff));
-             emitcode("iorwf","%s,f",aopGet(AOP(left),offset,FALSE,TRUE),p);
-           }
-                   
-         }
-       } else {
-         if (AOP_TYPE(left) == AOP_ACC) 
-           emitcode("iorwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-         else {                    
-           emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-           emitcode("iorwf","%s,f",aopGet(AOP(left),offset,FALSE,FALSE));
-
-         }
-       }
+  if(AOP_TYPE(right) == AOP_LIT){
+    if((lit & 0xff) == 0)
+      /*  or'ing with 0 has no effect */
+      continue;
+    else {
+      int p = my_powof2(lit & 0xff);
+      if(p>=0) {
+        /* only one bit is set in the literal, so use a bsf instruction */
+        emitcode("bsf","%s,%d",aopGet(AOP(left),offset,FALSE,TRUE),p);
+      } else {
+        emitcode("movlw","0x%x", (lit & 0xff));
+        emitcode("iorwf","%s,f",aopGet(AOP(left),offset,FALSE,TRUE),p);
+      }
+
+    }
+  } else {
+    if (AOP_TYPE(left) == AOP_ACC)
+      emitcode("iorwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+    else {
+      emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+      emitcode("iorwf","%s,f",aopGet(AOP(left),offset,FALSE,FALSE));
+
+    }
+  }
       }
     } else {
         // left & result in different registers
@@ -4998,7 +4998,7 @@ static void genOr (iCode *ic, iCode *ifx)
             // if(!size && ifx), conditional oper: if(left | right)
             symbol *tlbl = newiTempLabel(NULL);
             int sizer = max(AOP_SIZE(left),AOP_SIZE(right));
-           emitcode(";XXX "," %s,%d",__FILE__,__LINE__);
+      emitcode(";XXX "," %s,%d",__FILE__,__LINE__);
 
             if(size)
                 emitcode(";XXX setb","c");
@@ -5016,45 +5016,45 @@ static void genOr (iCode *ic, iCode *ifx)
             } else if(ifx)
                 jmpTrueOrFalse(ifx, tlbl);
         } else for(;(size--);offset++){
-         // normal case
-         // result = left & right
-         if(AOP_TYPE(right) == AOP_LIT){
-           int t = (lit >> (offset*8)) & 0x0FFL;
-           switch(t) { 
-           case 0x00:
-             emitcode("movf","%s,w",
-                      aopGet(AOP(left),offset,FALSE,FALSE));
-             emitcode("movwf","%s",
-                      aopGet(AOP(result),offset,FALSE,FALSE));
-             break;
-           default:
-             emitcode("movlw","0x%x",t);
-             emitcode("iorwf","%s,w",
-                      aopGet(AOP(left),offset,FALSE,FALSE));
-             emitcode("movwf","%s",
-                      aopGet(AOP(result),offset,FALSE,FALSE));
-             
-           }
-           continue;
-         }
-
-         // faster than result <- left, anl result,right
-         // and better if result is SFR
-         if (AOP_TYPE(left) == AOP_ACC) 
-           emitcode("iorwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-         else {
-           emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-           emitcode("iorwf","%s,w",
-                    aopGet(AOP(left),offset,FALSE,FALSE));
-         }
-         emitcode("movwf","%s",aopGet(AOP(result),offset,FALSE,FALSE));
-       }
+    // normal case
+    // result = left & right
+    if(AOP_TYPE(right) == AOP_LIT){
+      int t = (lit >> (offset*8)) & 0x0FFL;
+      switch(t) {
+      case 0x00:
+        emitcode("movf","%s,w",
+           aopGet(AOP(left),offset,FALSE,FALSE));
+        emitcode("movwf","%s",
+           aopGet(AOP(result),offset,FALSE,FALSE));
+        break;
+      default:
+        emitcode("movlw","0x%x",t);
+        emitcode("iorwf","%s,w",
+           aopGet(AOP(left),offset,FALSE,FALSE));
+        emitcode("movwf","%s",
+           aopGet(AOP(result),offset,FALSE,FALSE));
+
+      }
+      continue;
+    }
+
+    // faster than result <- left, anl result,right
+    // and better if result is SFR
+    if (AOP_TYPE(left) == AOP_ACC)
+      emitcode("iorwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+    else {
+      emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+      emitcode("iorwf","%s,w",
+         aopGet(AOP(left),offset,FALSE,FALSE));
+    }
+    emitcode("movwf","%s",aopGet(AOP(result),offset,FALSE,FALSE));
+  }
     }
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);     
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -5075,7 +5075,7 @@ static void genXor (iCode *ic, iCode *ifx)
     /* if left is a literal & right is not ||
        if left needs acc & right does not */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       (AOP_NEEDSACC(left) && !AOP_NEEDSACC(right))) {
+  (AOP_NEEDSACC(left) && !AOP_NEEDSACC(right))) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -5152,7 +5152,7 @@ static void genXor (iCode *ic, iCode *ifx)
                         // test the msb of the lsb
                         emitcode("anl","a,#0xfe");
                     emitcode("jnz","%05d_DS_",tlbl->key+100);
-                   sizer--;
+        sizer--;
                 }
                 // val = (0,1)
                 emitcode("rrc","a");
@@ -5167,7 +5167,7 @@ static void genXor (iCode *ic, iCode *ifx)
             outBitC(result);
         // if(bit | ...)
         else if((AOP_TYPE(result) == AOP_CRY) && ifx)
-            genIfxJump(ifx, "c");           
+            genIfxJump(ifx, "c");
         goto release ;
     }
 
@@ -5178,26 +5178,26 @@ static void genXor (iCode *ic, iCode *ifx)
                 if(((lit >> (offset*8)) & 0x0FFL) == 0x00L)
                     continue;
                 else
-                   if (IS_AOP_PREG(left)) {
-                       MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-                       emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
-                       aopPut(AOP(result),"a",offset);
-                   } else 
-                       emitcode("xrl","%s,%s",
-                                aopGet(AOP(left),offset,FALSE,TRUE),
-                                aopGet(AOP(right),offset,FALSE,FALSE));
+        if (IS_AOP_PREG(left)) {
+      MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+      emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
+            aopPut(AOP(result),"a",offset);
+        } else
+      emitcode("xrl","%s,%s",
+         aopGet(AOP(left),offset,FALSE,TRUE),
+         aopGet(AOP(right),offset,FALSE,FALSE));
             } else {
-               if (AOP_TYPE(left) == AOP_ACC)
-                   emitcode("xrl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
-               else {
-                   MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
-                   if (IS_AOP_PREG(left)) {
-                       emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
-                       aopPut(AOP(result),"a",offset);
-                   } else
-                       emitcode("xrl","%s,a",
-                                aopGet(AOP(left),offset,FALSE,TRUE));
-               }
+    if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("xrl","a,%s",aopGet(AOP(right),offset,FALSE,FALSE));
+    else {
+        MOVA(aopGet(AOP(right),offset,FALSE,FALSE));
+        if (IS_AOP_PREG(left)) {
+      emitcode("xrl","a,%s",aopGet(AOP(left),offset,FALSE,TRUE));
+      aopPut(AOP(result),"a",offset);
+        } else
+      emitcode("xrl","%s,a",
+         aopGet(AOP(left),offset,FALSE,TRUE));
+    }
             }
         }
     } else {
@@ -5232,48 +5232,48 @@ static void genXor (iCode *ic, iCode *ifx)
             // normal case
             // result = left & right
             if(AOP_TYPE(right) == AOP_LIT){
-             int t = (lit >> (offset*8)) & 0x0FFL;
-             switch(t) { 
-             case 0x00:
-               emitcode("movf","%s,w",
-                        aopGet(AOP(left),offset,FALSE,FALSE));
-               emitcode("movwf","%s",
-                        aopGet(AOP(result),offset,FALSE,FALSE));
-               break;
-             case 0xff:
-               emitcode("comf","%s,w",
-                        aopGet(AOP(left),offset,FALSE,FALSE));
-               emitcode("movwf","%s",
-                        aopGet(AOP(result),offset,FALSE,FALSE));
-               break;
-             default:
-               emitcode("movlw","0x%x",t);
-               emitcode("xorwf","%s,w",
-                        aopGet(AOP(left),offset,FALSE,FALSE));
-               emitcode("movwf","%s",
-                        aopGet(AOP(result),offset,FALSE,FALSE));
-
-             }
-             continue;
+        int t = (lit >> (offset*8)) & 0x0FFL;
+        switch(t) {
+        case 0x00:
+    emitcode("movf","%s,w",
+       aopGet(AOP(left),offset,FALSE,FALSE));
+    emitcode("movwf","%s",
+       aopGet(AOP(result),offset,FALSE,FALSE));
+    break;
+        case 0xff:
+    emitcode("comf","%s,w",
+       aopGet(AOP(left),offset,FALSE,FALSE));
+    emitcode("movwf","%s",
+       aopGet(AOP(result),offset,FALSE,FALSE));
+    break;
+        default:
+    emitcode("movlw","0x%x",t);
+    emitcode("xorwf","%s,w",
+       aopGet(AOP(left),offset,FALSE,FALSE));
+    emitcode("movwf","%s",
+       aopGet(AOP(result),offset,FALSE,FALSE));
+
+        }
+        continue;
             }
 
             // faster than result <- left, anl result,right
             // and better if result is SFR
-           if (AOP_TYPE(left) == AOP_ACC)
-               emitcode("xorwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-           else {
-               emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-               emitcode("xorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
-           }
-           if ( AOP_TYPE(result) != AOP_ACC)
-             emitcode("movwf","%s",aopGet(AOP(result),offset,FALSE,FALSE));
+      if (AOP_TYPE(left) == AOP_ACC)
+    emitcode("xorwf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+      else {
+    emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+    emitcode("xorwf","%s,w",aopGet(AOP(left),offset,FALSE,FALSE));
+      }
+      if ( AOP_TYPE(result) != AOP_ACC)
+        emitcode("movwf","%s",aopGet(AOP(result),offset,FALSE,FALSE));
         }
     }
 
 release :
     freeAsmop(left,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
     freeAsmop(right,NULL,ic,(RESULTONSTACK(ic) ? FALSE : TRUE));
-    freeAsmop(result,NULL,ic,TRUE);     
+    freeAsmop(result,NULL,ic,TRUE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -5284,7 +5284,7 @@ static void genInline (iCode *ic)
     char buffer[MAX_INLINEASM];
     char *bp = buffer;
     char *bp1= buffer;
-    
+
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
 
     _G.inLine += (!options.asmpeep);
@@ -5320,7 +5320,7 @@ static void genRRC (iCode *ic)
 {
     operand *left , *result ;
     int size, offset = 0;
-    char *l;    
+    char *l;
 
     /* rotate right with carry */
     left = IC_LEFT(ic);
@@ -5329,7 +5329,7 @@ static void genRRC (iCode *ic)
     aopOp (result,ic,FALSE);
 
     /* move it to the result */
-    size = AOP_SIZE(result);    
+    size = AOP_SIZE(result);
     offset = size - 1 ;
     CLRC;
     while (size--) {
@@ -5355,10 +5355,10 @@ static void genRRC (iCode *ic)
 /* genRLC - generate code for rotate left with carry               */
 /*-----------------------------------------------------------------*/
 static void genRLC (iCode *ic)
-{    
+{
     operand *left , *result ;
     int size, offset = 0;
-    char *l;    
+    char *l;
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     /* rotate right with carry */
@@ -5368,7 +5368,7 @@ static void genRLC (iCode *ic)
     aopOp (result,ic,FALSE);
 
     /* move it to the result */
-    size = AOP_SIZE(result);    
+    size = AOP_SIZE(result);
     offset = 0 ;
     if (size--) {
         l = aopGet(AOP(left),offset,FALSE,FALSE);
@@ -5472,8 +5472,8 @@ static void AccLsh (int shCount)
     if(shCount != 0){
         if(shCount == 1)
             emitcode("add","a,acc");
-        else 
-           if(shCount == 2) {
+        else
+      if(shCount == 2) {
             emitcode("add","a,acc");
             emitcode("add","a,acc");
         } else {
@@ -5660,7 +5660,7 @@ static void AccAXLsh (char *x, int shCount)
             emitcode("anl","a,#0x%02x",
                      SLMask[shCount]);  // DDD00000:(BBB^DDD)CCCCC
             emitcode("xch","a,%s",x);   // (BBB^DDD)CCCCC:DDD00000
-            emitcode("xrl","a,%s",x);   // BBBCCCCC:DDD00000            
+            emitcode("xrl","a,%s",x);   // BBBCCCCC:DDD00000
             break;
         case 6 :                        // AAAAAABB:CCCCCCDD
             emitcode("anl","a,#0x%02x",
@@ -5686,7 +5686,7 @@ static void AccAXLsh (char *x, int shCount)
 /* AccAXRsh - right shift a:x known count (0..7)                   */
 /*-----------------------------------------------------------------*/
 static void AccAXRsh (char *x, int shCount)
-{   
+{
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     switch(shCount){
         case 0 :
@@ -5741,7 +5741,7 @@ static void AccAXRsh (char *x, int shCount)
 /* AccAXRshS - right shift signed a:x known count (0..7)           */
 /*-----------------------------------------------------------------*/
 static void AccAXRshS (char *x, int shCount)
-{   
+{
     symbol *tlbl ;
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     switch(shCount){
@@ -5773,7 +5773,7 @@ static void AccAXRshS (char *x, int shCount)
             emitcode("xch","a,%s",x);   // BBB(CCCCC^AAAAA):000AAAAA
             emitcode("xrl","a,%s",x);   // BBBCCCCC:000AAAAA
             emitcode("xch","a,%s",x);   // 000SAAAA:BBBCCCCC
-            emitcode("jnb","acc.%d,%05d_DS_",7-shCount,tlbl->key+100); 
+            emitcode("jnb","acc.%d,%05d_DS_",7-shCount,tlbl->key+100);
             emitcode("orl","a,#0x%02x",
                      (unsigned char)~SRMask[shCount]);  // 111AAAAA:BBBCCCCC
             emitcode("","%05d_DS_:",tlbl->key+100);
@@ -5786,7 +5786,7 @@ static void AccAXRshS (char *x, int shCount)
             emitcode("xch","a,%s",x);   // DDDDDDAA:BBBBBBCC
             emitcode("anl","a,#0x%02x",
                      SRMask[shCount]);  // 000000AA:BBBBBBCC
-            emitcode("jnb","acc.%d,%05d_DS_",7-shCount,tlbl->key+100); 
+            emitcode("jnb","acc.%d,%05d_DS_",7-shCount,tlbl->key+100);
             emitcode("orl","a,#0x%02x",
                      (unsigned char)~SRMask[shCount]);  // 111111AA:BBBBBBCC
             emitcode("","%05d_DS_:",tlbl->key+100);
@@ -5798,7 +5798,7 @@ static void AccAXRshS (char *x, int shCount)
             emitcode("xch","a,%s",x);   // DDDDDDDA:BBBBBBCC
             emitcode("anl","a,#0x%02x",
                      SRMask[shCount]);  // 0000000A:BBBBBBBC
-            emitcode("jnb","acc.%d,%05d_DS_",7-shCount,tlbl->key+100); 
+            emitcode("jnb","acc.%d,%05d_DS_",7-shCount,tlbl->key+100);
             emitcode("orl","a,#0x%02x",
                      (unsigned char)~SRMask[shCount]);  // 1111111A:BBBBBBBC
             emitcode("","%05d_DS_:",tlbl->key+100);
@@ -5817,12 +5817,12 @@ static void shiftL2Left2Result (operand *left, int offl,
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     if(sameRegs(AOP(result), AOP(left)) &&
        ((offl + MSB16) == offr)){
-       /* don't crash result[offr] */
-       MOVA(aopGet(AOP(left),offl,FALSE,FALSE));
-       emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
+  /* don't crash result[offr] */
+  MOVA(aopGet(AOP(left),offl,FALSE,FALSE));
+  emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
     } else {
-       movLeft2Result(left,offl, result, offr, 0);
-       MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
+  movLeft2Result(left,offl, result, offr, 0);
+  MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
     }
     /* ax << shCount (x = lsb(result))*/
     AccAXLsh( aopGet(AOP(result),offr,FALSE,FALSE) , shCount);
@@ -5840,12 +5840,12 @@ static void shiftR2Left2Result (operand *left, int offl,
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     if(sameRegs(AOP(result), AOP(left)) &&
        ((offl + MSB16) == offr)){
-       /* don't crash result[offr] */
-       MOVA(aopGet(AOP(left),offl,FALSE,FALSE));
-       emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
+  /* don't crash result[offr] */
+  MOVA(aopGet(AOP(left),offl,FALSE,FALSE));
+  emitcode("xch","a,%s", aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
     } else {
-       movLeft2Result(left,offl, result, offr, 0);
-       MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
+  movLeft2Result(left,offl, result, offr, 0);
+  MOVA(aopGet(AOP(left),offl+MSB16,FALSE,FALSE));
     }
     /* a:x >> shCount (x = lsb(result))*/
     if(sign)
@@ -5892,7 +5892,7 @@ static void shiftRLeftOrResult (operand *left, int offl,
 /* genlshOne - left shift a one byte quantity by known count       */
 /*-----------------------------------------------------------------*/
 static void genlshOne (operand *result, operand *left, int shCount)
-{       
+{
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     shiftL1Left2Result(left, LSB, result, LSB, shCount);
 }
@@ -5903,7 +5903,7 @@ static void genlshOne (operand *result, operand *left, int shCount)
 static void genlshTwo (operand *result,operand *left, int shCount)
 {
     int size;
-    
+
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     size = getDataSize(result);
 
@@ -5914,17 +5914,17 @@ static void genlshTwo (operand *result,operand *left, int shCount)
         if (size > 1){
             if (shCount)
                 shiftL1Left2Result(left, LSB, result, MSB16, shCount);
-            else 
+            else
                 movLeft2Result(left, LSB, result, MSB16, 0);
         }
-        aopPut(AOP(result),zero,LSB);   
+        aopPut(AOP(result),zero,LSB);
     }
 
     /*  1 <= shCount <= 7 */
-    else {  
+    else {
         if(size == 1)
-            shiftL1Left2Result(left, LSB, result, LSB, shCount); 
-        else 
+            shiftL1Left2Result(left, LSB, result, LSB, shCount);
+        else
             shiftL2Left2Result(left, LSB, result, LSB, shCount);
     }
 }
@@ -5943,52 +5943,52 @@ static void shiftLLong (operand *left, operand *result, int offr )
         l = aopGet(AOP(left),LSB,FALSE,FALSE);
         MOVA(l);
         emitcode("add","a,acc");
-       if (sameRegs(AOP(left),AOP(result)) && 
-           size >= MSB16+offr && offr != LSB )
-           emitcode("xch","a,%s",
-                    aopGet(AOP(left),LSB+offr,FALSE,FALSE));
-       else        
-           aopPut(AOP(result),"a",LSB+offr);
+  if (sameRegs(AOP(left),AOP(result)) &&
+      size >= MSB16+offr && offr != LSB )
+      emitcode("xch","a,%s",
+         aopGet(AOP(left),LSB+offr,FALSE,FALSE));
+  else
+      aopPut(AOP(result),"a",LSB+offr);
     }
 
     if(size >= MSB16+offr){
-       if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB16+offr && offr != LSB) ) {
-           l = aopGet(AOP(left),MSB16,FALSE,FALSE);
-           MOVA(l);
-       }
+  if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB16+offr && offr != LSB) ) {
+      l = aopGet(AOP(left),MSB16,FALSE,FALSE);
+      MOVA(l);
+  }
         emitcode("rlc","a");
-       if (sameRegs(AOP(left),AOP(result)) && 
-           size >= MSB24+offr && offr != LSB)
-           emitcode("xch","a,%s",
-                    aopGet(AOP(left),MSB16+offr,FALSE,FALSE));
-       else        
-           aopPut(AOP(result),"a",MSB16+offr);
+  if (sameRegs(AOP(left),AOP(result)) &&
+      size >= MSB24+offr && offr != LSB)
+      emitcode("xch","a,%s",
+         aopGet(AOP(left),MSB16+offr,FALSE,FALSE));
+  else
+      aopPut(AOP(result),"a",MSB16+offr);
     }
 
     if(size >= MSB24+offr){
-       if (!(sameRegs(AOP(left),AOP(left)) && size >= MSB24+offr && offr != LSB)) {
-           l = aopGet(AOP(left),MSB24,FALSE,FALSE);
-           MOVA(l);
-       }
+  if (!(sameRegs(AOP(left),AOP(left)) && size >= MSB24+offr && offr != LSB)) {
+      l = aopGet(AOP(left),MSB24,FALSE,FALSE);
+      MOVA(l);
+  }
         emitcode("rlc","a");
-       if (sameRegs(AOP(left),AOP(result)) && 
-           size >= MSB32+offr && offr != LSB )
-           emitcode("xch","a,%s",
-                    aopGet(AOP(left),MSB24+offr,FALSE,FALSE));
-       else        
-           aopPut(AOP(result),"a",MSB24+offr);
+  if (sameRegs(AOP(left),AOP(result)) &&
+      size >= MSB32+offr && offr != LSB )
+      emitcode("xch","a,%s",
+         aopGet(AOP(left),MSB24+offr,FALSE,FALSE));
+  else
+      aopPut(AOP(result),"a",MSB24+offr);
     }
 
     if(size > MSB32+offr){
-       if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB32+offr && offr != LSB)) {
-           l = aopGet(AOP(left),MSB32,FALSE,FALSE);
-           MOVA(l);    
-       }
+  if (!(sameRegs(AOP(result),AOP(left)) && size >= MSB32+offr && offr != LSB)) {
+      l = aopGet(AOP(left),MSB32,FALSE,FALSE);
+      MOVA(l);
+  }
         emitcode("rlc","a");
         aopPut(AOP(result),"a",MSB32+offr);
     }
     if(offr != LSB)
-        aopPut(AOP(result),zero,LSB);       
+        aopPut(AOP(result),zero,LSB);
 }
 
 /*-----------------------------------------------------------------*/
@@ -6030,7 +6030,7 @@ static void genlshFour (operand *result, operand *left, int shCount)
         aopPut(AOP(result),zero,MSB16);
         aopPut(AOP(result),zero,LSB);
         return;
-    }    
+    }
 
     /* if more than 1 byte */
     else if ( shCount >= 8 ) {
@@ -6081,7 +6081,7 @@ static void genLeftShiftLiteral (operand *left,
                                  operand *right,
                                  operand *result,
                                  iCode *ic)
-{    
+{
     int shCount = (int) floatFromVal (AOP(right)->aopu.aop_lit);
     int size;
 
@@ -6146,18 +6146,18 @@ static void genLeftShift (iCode *ic)
 
     aopOp(right,ic,FALSE);
 
-    /* if the shift count is known then do it 
+    /* if the shift count is known then do it
     as efficiently as possible */
     if (AOP_TYPE(right) == AOP_LIT) {
         genLeftShiftLiteral (left,right,result,ic);
         return ;
     }
 
-    /* shift count is unknown then we have to form 
+    /* shift count is unknown then we have to form
     a loop get the loop count in B : Note: we take
     only the lower order byte since shifting
     more that 32 bits make no sense anyway, ( the
-    largest size of an object can be only 32 bits ) */  
+    largest size of an object can be only 32 bits ) */
 
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE));
     emitcode("inc","b");
@@ -6167,7 +6167,7 @@ static void genLeftShift (iCode *ic)
 
     /* now move the left to the result if they are not the
     same */
-    if (!sameRegs(AOP(left),AOP(result)) && 
+    if (!sameRegs(AOP(left),AOP(result)) &&
         AOP_SIZE(result) > 1) {
 
         size = AOP_SIZE(result);
@@ -6186,36 +6186,36 @@ static void genLeftShift (iCode *ic)
 
     tlbl = newiTempLabel(NULL);
     size = AOP_SIZE(result);
-    offset = 0 ;   
+    offset = 0 ;
     tlbl1 = newiTempLabel(NULL);
 
     /* if it is only one byte then */
     if (size == 1) {
-       symbol *tlbl1 = newiTempLabel(NULL);
+  symbol *tlbl1 = newiTempLabel(NULL);
 
         l = aopGet(AOP(left),0,FALSE,FALSE);
         MOVA(l);
-       emitcode("sjmp","%05d_DS_",tlbl1->key+100); 
+  emitcode("sjmp","%05d_DS_",tlbl1->key+100);
         emitcode("","%05d_DS_:",tlbl->key+100);
         emitcode("add","a,acc");
-       emitcode("","%05d_DS_:",tlbl1->key+100);
-        emitcode("djnz","b,%05d_DS_",tlbl->key+100);      
+  emitcode("","%05d_DS_:",tlbl1->key+100);
+        emitcode("djnz","b,%05d_DS_",tlbl->key+100);
         aopPut(AOP(result),"a",0);
         goto release ;
     }
-    
-    reAdjustPreg(AOP(result));    
-    
-    emitcode("sjmp","%05d_DS_",tlbl1->key+100); 
-    emitcode("","%05d_DS_:",tlbl->key+100);    
+
+    reAdjustPreg(AOP(result));
+
+    emitcode("sjmp","%05d_DS_",tlbl1->key+100);
+    emitcode("","%05d_DS_:",tlbl->key+100);
     l = aopGet(AOP(result),offset,FALSE,FALSE);
     MOVA(l);
-    emitcode("add","a,acc");         
+    emitcode("add","a,acc");
     aopPut(AOP(result),"a",offset++);
     while (--size) {
         l = aopGet(AOP(result),offset,FALSE,FALSE);
         MOVA(l);
-        emitcode("rlc","a");         
+        emitcode("rlc","a");
         aopPut(AOP(result),"a",offset++);
     }
     reAdjustPreg(AOP(result));
@@ -6250,14 +6250,14 @@ static void genrshTwo (operand *result,operand *left,
         if (shCount)
             shiftR1Left2Result(left, MSB16, result, LSB,
                                shCount, sign);
-        else 
+        else
             movLeft2Result(left, MSB16, result, LSB, sign);
         addSign(result, MSB16, sign);
     }
 
     /*  1 <= shCount <= 7 */
     else
-        shiftR2Left2Result(left, LSB, result, LSB, shCount, sign); 
+        shiftR2Left2Result(left, LSB, result, LSB, shCount, sign);
 }
 
 /*-----------------------------------------------------------------*/
@@ -6360,7 +6360,7 @@ static void genRightShiftLiteral (operand *left,
                                   operand *result,
                                   iCode *ic,
                                   int sign)
-{    
+{
     int shCount = (int) floatFromVal (AOP(right)->aopu.aop_lit);
     int size;
 
@@ -6430,18 +6430,18 @@ static void genSignedRightShift (iCode *ic)
     left  = IC_LEFT(ic);
     result = IC_RESULT(ic);
 
-    aopOp(right,ic,FALSE);  
+    aopOp(right,ic,FALSE);
 
 
     if ( AOP_TYPE(right) == AOP_LIT) {
-       genRightShiftLiteral (left,right,result,ic,1);
-       return ;
+  genRightShiftLiteral (left,right,result,ic,1);
+  return ;
     }
-        /* shift count is unknown then we have to form 
+        /* shift count is unknown then we have to form
        a loop get the loop count in B : Note: we take
        only the lower order byte since shifting
        more that 32 bits make no sense anyway, ( the
-       largest size of an object can be only 32 bits ) */  
+       largest size of an object can be only 32 bits ) */
 
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE));
     emitcode("inc","b");
@@ -6451,7 +6451,7 @@ static void genSignedRightShift (iCode *ic)
 
     /* now move the left to the result if they are not the
     same */
-    if (!sameRegs(AOP(left),AOP(result)) && 
+    if (!sameRegs(AOP(left),AOP(result)) &&
         AOP_SIZE(result) > 1) {
 
         size = AOP_SIZE(result);
@@ -6468,7 +6468,7 @@ static void genSignedRightShift (iCode *ic)
         }
     }
 
-    /* mov the highest order bit to OVR */    
+    /* mov the highest order bit to OVR */
     tlbl = newiTempLabel(NULL);
     tlbl1= newiTempLabel(NULL);
 
@@ -6481,11 +6481,11 @@ static void genSignedRightShift (iCode *ic)
     if (size == 1) {
         l = aopGet(AOP(left),0,FALSE,FALSE);
         MOVA(l);
-       emitcode("sjmp","%05d_DS_",tlbl1->key+100);
+  emitcode("sjmp","%05d_DS_",tlbl1->key+100);
         emitcode("","%05d_DS_:",tlbl->key+100);
         emitcode("mov","c,ov");
         emitcode("rrc","a");
-       emitcode("","%05d_DS_:",tlbl1->key+100);
+  emitcode("","%05d_DS_:",tlbl1->key+100);
         emitcode("djnz","b,%05d_DS_",tlbl->key+100);
         aopPut(AOP(result),"a",0);
         goto release ;
@@ -6493,12 +6493,12 @@ static void genSignedRightShift (iCode *ic)
 
     reAdjustPreg(AOP(result));
     emitcode("sjmp","%05d_DS_",tlbl1->key+100);
-    emitcode("","%05d_DS_:",tlbl->key+100);    
+    emitcode("","%05d_DS_:",tlbl->key+100);
     emitcode("mov","c,ov");
     while (size--) {
         l = aopGet(AOP(result),offset,FALSE,FALSE);
         MOVA(l);
-        emitcode("rrc","a");         
+        emitcode("rrc","a");
         aopPut(AOP(result),"a",offset--);
     }
     reAdjustPreg(AOP(result));
@@ -6544,18 +6544,18 @@ static void genRightShift (iCode *ic)
 
     aopOp(right,ic,FALSE);
 
-    /* if the shift count is known then do it 
+    /* if the shift count is known then do it
     as efficiently as possible */
     if (AOP_TYPE(right) == AOP_LIT) {
         genRightShiftLiteral (left,right,result,ic, 0);
         return ;
     }
 
-    /* shift count is unknown then we have to form 
+    /* shift count is unknown then we have to form
     a loop get the loop count in B : Note: we take
     only the lower order byte since shifting
     more that 32 bits make no sense anyway, ( the
-    largest size of an object can be only 32 bits ) */  
+    largest size of an object can be only 32 bits ) */
 
     emitcode("mov","b,%s",aopGet(AOP(right),0,FALSE,FALSE));
     emitcode("inc","b");
@@ -6565,7 +6565,7 @@ static void genRightShift (iCode *ic)
 
     /* now move the left to the result if they are not the
     same */
-    if (!sameRegs(AOP(left),AOP(result)) && 
+    if (!sameRegs(AOP(left),AOP(result)) &&
         AOP_SIZE(result) > 1) {
 
         size = AOP_SIZE(result);
@@ -6591,11 +6591,11 @@ static void genRightShift (iCode *ic)
     if (size == 1) {
         l = aopGet(AOP(left),0,FALSE,FALSE);
         MOVA(l);
-       emitcode("sjmp","%05d_DS_",tlbl1->key+100);
+  emitcode("sjmp","%05d_DS_",tlbl1->key+100);
         emitcode("","%05d_DS_:",tlbl->key+100);
         CLRC;
         emitcode("rrc","a");
-       emitcode("","%05d_DS_:",tlbl1->key+100);
+  emitcode("","%05d_DS_:",tlbl1->key+100);
         emitcode("djnz","b,%05d_DS_",tlbl->key+100);
         aopPut(AOP(result),"a",0);
         goto release ;
@@ -6603,12 +6603,12 @@ static void genRightShift (iCode *ic)
 
     reAdjustPreg(AOP(result));
     emitcode("sjmp","%05d_DS_",tlbl1->key+100);
-    emitcode("","%05d_DS_:",tlbl->key+100);    
+    emitcode("","%05d_DS_:",tlbl->key+100);
     CLRC;
     while (size--) {
         l = aopGet(AOP(result),offset,FALSE,FALSE);
         MOVA(l);
-        emitcode("rrc","a");         
+        emitcode("rrc","a");
         aopPut(AOP(result),"a",offset--);
     }
     reAdjustPreg(AOP(result));
@@ -6625,7 +6625,7 @@ release:
 /* genUnpackBits - generates code for unpacking bits               */
 /*-----------------------------------------------------------------*/
 static void genUnpackBits (operand *result, char *rname, int ptype)
-{    
+{
     int shCnt ;
     int rlen = 0 ;
     sym_link *etype;
@@ -6639,31 +6639,31 @@ static void genUnpackBits (operand *result, char *rname, int ptype)
 
     case POINTER:
     case IPOINTER:
-       emitcode("mov","a,@%s",rname);
-       break;
-       
+  emitcode("mov","a,@%s",rname);
+  break;
+
     case PPOINTER:
-       emitcode("movx","a,@%s",rname);
-       break;
-       
+  emitcode("movx","a,@%s",rname);
+  break;
+
     case FPOINTER:
-       emitcode("movx","a,@dptr");
-       break;
+  emitcode("movx","a,@dptr");
+  break;
 
     case CPOINTER:
-       emitcode("clr","a");
-       emitcode("movc","a","@a+dptr");
-       break;
+  emitcode("clr","a");
+  emitcode("movc","a","@a+dptr");
+  break;
 
     case GPOINTER:
-       emitcode("lcall","__gptrget");
-       break;
+  emitcode("lcall","__gptrget");
+  break;
     }
 
     /* if we have bitdisplacement then it fits   */
     /* into this byte completely or if length is */
     /* less than a byte                          */
-    if ((shCnt = SPEC_BSTR(etype)) || 
+    if ((shCnt = SPEC_BSTR(etype)) ||
         (SPEC_BLEN(etype) <= 8))  {
 
         /* shift right acc */
@@ -6681,49 +6681,49 @@ static void genUnpackBits (operand *result, char *rname, int ptype)
 
     while (1)  {
 
-       switch (ptype) {
-       case POINTER:
-       case IPOINTER:
-           emitcode("inc","%s",rname);
-           emitcode("mov","a,@%s",rname);
-           break;
-           
-       case PPOINTER:
-           emitcode("inc","%s",rname);
-           emitcode("movx","a,@%s",rname);
-           break;
-
-       case FPOINTER:
-           emitcode("inc","dptr");
-           emitcode("movx","a,@dptr");
-           break;
-           
-       case CPOINTER:
-           emitcode("clr","a");
-           emitcode("inc","dptr");
-           emitcode("movc","a","@a+dptr");
-           break;
-           
-       case GPOINTER:
-           emitcode("inc","dptr");
-           emitcode("lcall","__gptrget");
-           break;
-       }
-
-       rlen -= 8;            
-       /* if we are done */
-       if ( rlen <= 0 )
-           break ;
-       
-       aopPut(AOP(result),"a",offset++);
-                                     
-    }
-    
+  switch (ptype) {
+  case POINTER:
+  case IPOINTER:
+      emitcode("inc","%s",rname);
+      emitcode("mov","a,@%s",rname);
+      break;
+
+  case PPOINTER:
+      emitcode("inc","%s",rname);
+      emitcode("movx","a,@%s",rname);
+      break;
+
+  case FPOINTER:
+      emitcode("inc","dptr");
+      emitcode("movx","a,@dptr");
+      break;
+
+  case CPOINTER:
+      emitcode("clr","a");
+      emitcode("inc","dptr");
+      emitcode("movc","a","@a+dptr");
+      break;
+
+  case GPOINTER:
+      emitcode("inc","dptr");
+      emitcode("lcall","__gptrget");
+      break;
+  }
+
+  rlen -= 8;
+  /* if we are done */
+  if ( rlen <= 0 )
+      break ;
+
+  aopPut(AOP(result),"a",offset++);
+
+    }
+
     if (rlen) {
-       emitcode("anl","a,#0x%02x",((unsigned char)-1)>>(-rlen));
-       aopPut(AOP(result),"a",offset);        
+  emitcode("anl","a,#0x%02x",((unsigned char)-1)>>(-rlen));
+  aopPut(AOP(result),"a",offset);
     }
-    
+
     return ;
 }
 
@@ -6731,9 +6731,9 @@ static void genUnpackBits (operand *result, char *rname, int ptype)
 /*-----------------------------------------------------------------*/
 /* genDataPointerGet - generates code when ptr offset is known     */
 /*-----------------------------------------------------------------*/
-static void genDataPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genDataPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
     char *l;
     char buffer[256];
@@ -6747,11 +6747,11 @@ static void genDataPointerGet (operand *left,
     size = AOP_SIZE(result);
     // tsd, was l+1 - the underline `_' prefix was being stripped
     while (size--) {
-       if (offset)
-           sprintf(buffer,"(%s + %d)",l,offset);
-       else
-           sprintf(buffer,"%s",l);
-       aopPut(AOP(result),buffer,offset++);
+  if (offset)
+      sprintf(buffer,"(%s + %d)",l,offset);
+  else
+      sprintf(buffer,"%s",l);
+  aopPut(AOP(result),buffer,offset++);
     }
 
     freeAsmop(left,NULL,ic,TRUE);
@@ -6761,178 +6761,178 @@ static void genDataPointerGet (operand *left,
 /*-----------------------------------------------------------------*/
 /* genNearPointerGet - emitcode for near pointer fetch             */
 /*-----------------------------------------------------------------*/
-static void genNearPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genNearPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
     asmop *aop = NULL;
     regs *preg = NULL ;
     char *rname ;
     sym_link *rtype, *retype;
-    sym_link *ltype = operandType(left);    
+    sym_link *ltype = operandType(left);
     char buffer[80];
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
 
     rtype = operandType(result);
     retype= getSpec(rtype);
-    
+
     aopOp(left,ic,FALSE);
-    
+
     /* if left is rematerialisable and
        result is not bit variable type and
        the left is pointer to data space i.e
        lower 128 bytes of space */
     if (AOP_TYPE(left) == AOP_IMMD &&
-       !IS_BITVAR(retype)         &&
-       DCL_TYPE(ltype) == POINTER) {
-       genDataPointerGet (left,result,ic);
-       return ;
+  !IS_BITVAR(retype)         &&
+  DCL_TYPE(ltype) == POINTER) {
+  genDataPointerGet (left,result,ic);
+  return ;
     }
-    
-       /* if the value is already in a pointer register
+
+  /* if the value is already in a pointer register
        then don't need anything more */
     if (!AOP_INPREG(AOP(left))) {
-       /* otherwise get a free pointer register */
-       aop = newAsmop(0);
-       preg = getFreePtr(ic,&aop,FALSE);
-       emitcode("mov","%s,%s",
-               preg->name,
-               aopGet(AOP(left),0,FALSE,TRUE));
-       rname = preg->name ;
+  /* otherwise get a free pointer register */
+  aop = newAsmop(0);
+  preg = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,%s",
+    preg->name,
+    aopGet(AOP(left),0,FALSE,TRUE));
+  rname = preg->name ;
     } else
-       rname = aopGet(AOP(left),0,FALSE,FALSE);
-    
+  rname = aopGet(AOP(left),0,FALSE,FALSE);
+
     freeAsmop(left,NULL,ic,TRUE);
     aopOp (result,ic,FALSE);
-    
+
       /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype)) 
-       genUnpackBits (result,rname,POINTER);
+    if (IS_BITVAR(retype))
+  genUnpackBits (result,rname,POINTER);
     else {
-       /* we have can just get the values */
-       int size = AOP_SIZE(result);
-       int offset = 0 ;        
-       
-       while (size--) {
-           if (IS_AOP_PREG(result) || AOP_TYPE(result) == AOP_STK ) {
-
-               emitcode("mov","a,@%s",rname);
-               aopPut(AOP(result),"a",offset);
-           } else {
-               sprintf(buffer,"@%s",rname);
-               aopPut(AOP(result),buffer,offset);
-           }
-           offset++ ;
-           if (size)
-               emitcode("inc","%s",rname);
-       }
+  /* we have can just get the values */
+  int size = AOP_SIZE(result);
+  int offset = 0 ;
+
+  while (size--) {
+      if (IS_AOP_PREG(result) || AOP_TYPE(result) == AOP_STK ) {
+
+    emitcode("mov","a,@%s",rname);
+    aopPut(AOP(result),"a",offset);
+      } else {
+    sprintf(buffer,"@%s",rname);
+    aopPut(AOP(result),buffer,offset);
+      }
+      offset++ ;
+      if (size)
+    emitcode("inc","%s",rname);
+  }
     }
 
     /* now some housekeeping stuff */
     if (aop) {
-       /* we had to allocate for this iCode */
-       freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
-       /* we did not allocate which means left
-          already in a pointer register, then
-          if size > 0 && this could be used again
-          we have to point it back to where it 
-          belongs */
-       if (AOP_SIZE(result) > 1 &&
-           !OP_SYMBOL(left)->remat &&
-           ( OP_SYMBOL(left)->liveTo > ic->seq ||
-             ic->depth )) {
-           int size = AOP_SIZE(result) - 1;
-           while (size--)
-               emitcode("dec","%s",rname);
-       }
+  /* we had to allocate for this iCode */
+  freeAsmop(NULL,aop,ic,TRUE);
+    } else {
+  /* we did not allocate which means left
+     already in a pointer register, then
+     if size > 0 && this could be used again
+     we have to point it back to where it
+     belongs */
+  if (AOP_SIZE(result) > 1 &&
+      !OP_SYMBOL(left)->remat &&
+      ( OP_SYMBOL(left)->liveTo > ic->seq ||
+        ic->depth )) {
+      int size = AOP_SIZE(result) - 1;
+      while (size--)
+    emitcode("dec","%s",rname);
+  }
     }
 
     /* done */
     freeAsmop(result,NULL,ic,TRUE);
-     
+
 }
 
 /*-----------------------------------------------------------------*/
 /* genPagedPointerGet - emitcode for paged pointer fetch           */
 /*-----------------------------------------------------------------*/
-static void genPagedPointerGet (operand *left, 
-                              operand *result, 
-                              iCode *ic)
+static void genPagedPointerGet (operand *left,
+             operand *result,
+             iCode *ic)
 {
     asmop *aop = NULL;
     regs *preg = NULL ;
     char *rname ;
-    sym_link *rtype, *retype;    
+    sym_link *rtype, *retype;
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
 
     rtype = operandType(result);
     retype= getSpec(rtype);
-    
+
     aopOp(left,ic,FALSE);
 
   /* if the value is already in a pointer register
        then don't need anything more */
     if (!AOP_INPREG(AOP(left))) {
-       /* otherwise get a free pointer register */
-       aop = newAsmop(0);
-       preg = getFreePtr(ic,&aop,FALSE);
-       emitcode("mov","%s,%s",
-               preg->name,
-               aopGet(AOP(left),0,FALSE,TRUE));
-       rname = preg->name ;
+  /* otherwise get a free pointer register */
+  aop = newAsmop(0);
+  preg = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,%s",
+    preg->name,
+    aopGet(AOP(left),0,FALSE,TRUE));
+  rname = preg->name ;
     } else
-       rname = aopGet(AOP(left),0,FALSE,FALSE);
-    
+  rname = aopGet(AOP(left),0,FALSE,FALSE);
+
     freeAsmop(left,NULL,ic,TRUE);
     aopOp (result,ic,FALSE);
 
     /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype)) 
-       genUnpackBits (result,rname,PPOINTER);
+    if (IS_BITVAR(retype))
+  genUnpackBits (result,rname,PPOINTER);
     else {
-       /* we have can just get the values */
-       int size = AOP_SIZE(result);
-       int offset = 0 ;        
-       
-       while (size--) {
-           
-           emitcode("movx","a,@%s",rname);
-           aopPut(AOP(result),"a",offset);
-           
-           offset++ ;
-           
-           if (size)
-               emitcode("inc","%s",rname);
-       }
+  /* we have can just get the values */
+  int size = AOP_SIZE(result);
+  int offset = 0 ;
+
+  while (size--) {
+
+      emitcode("movx","a,@%s",rname);
+      aopPut(AOP(result),"a",offset);
+
+      offset++ ;
+
+      if (size)
+    emitcode("inc","%s",rname);
+  }
     }
 
     /* now some housekeeping stuff */
     if (aop) {
-       /* we had to allocate for this iCode */
-       freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
-       /* we did not allocate which means left
-          already in a pointer register, then
-          if size > 0 && this could be used again
-          we have to point it back to where it 
-          belongs */
-       if (AOP_SIZE(result) > 1 &&
-           !OP_SYMBOL(left)->remat &&
-           ( OP_SYMBOL(left)->liveTo > ic->seq ||
-             ic->depth )) {
-           int size = AOP_SIZE(result) - 1;
-           while (size--)
-               emitcode("dec","%s",rname);
-       }
+  /* we had to allocate for this iCode */
+  freeAsmop(NULL,aop,ic,TRUE);
+    } else {
+  /* we did not allocate which means left
+     already in a pointer register, then
+     if size > 0 && this could be used again
+     we have to point it back to where it
+     belongs */
+  if (AOP_SIZE(result) > 1 &&
+      !OP_SYMBOL(left)->remat &&
+      ( OP_SYMBOL(left)->liveTo > ic->seq ||
+        ic->depth )) {
+      int size = AOP_SIZE(result) - 1;
+      while (size--)
+    emitcode("dec","%s",rname);
+  }
     }
 
     /* done */
     freeAsmop(result,NULL,ic,TRUE);
-    
-       
+
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -6948,7 +6948,7 @@ static void genFarPointerGet (operand *left,
 
     aopOp(left,ic,FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(left) != AOP_STR) {
         /* if this is remateriazable */
@@ -6968,7 +6968,7 @@ static void genFarPointerGet (operand *left,
     aopOp(result,ic,FALSE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype)) 
+    if (IS_BITVAR(retype))
         genUnpackBits(result,"dptr",FPOINTER);
     else {
         size = AOP_SIZE(result);
@@ -6998,7 +6998,7 @@ static void emitcodePointerGet (operand *left,
 
     aopOp(left,ic,FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(left) != AOP_STR) {
         /* if this is remateriazable */
@@ -7018,7 +7018,7 @@ static void emitcodePointerGet (operand *left,
     aopOp(result,ic,FALSE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype)) 
+    if (IS_BITVAR(retype))
         genUnpackBits(result,"dptr",CPOINTER);
     else {
         size = AOP_SIZE(result);
@@ -7048,19 +7048,19 @@ static void genGenPointerGet (operand *left,
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     aopOp(left,ic,FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(left) != AOP_STR) {
         /* if this is remateriazable */
         if (AOP_TYPE(left) == AOP_IMMD) {
             emitcode("mov","dptr,%s",aopGet(AOP(left),0,TRUE,FALSE));
-           emitcode("mov","b,#%d",pointerCode(retype));
-       }
+      emitcode("mov","b,#%d",pointerCode(retype));
+  }
         else { /* we need to get it byte by byte */
-         
-         emitcode("movf","%s,w",aopGet(AOP(left),0,FALSE,FALSE));
-         emitcode("movwf","FSR");
-         /*
+
+    emitcode("movf","%s,w",aopGet(AOP(left),0,FALSE,FALSE));
+    emitcode("movwf","FSR");
+    /*
             emitcode("mov","dpl,%s",aopGet(AOP(left),0,FALSE,FALSE));
             emitcode("mov","dph,%s",aopGet(AOP(left),1,FALSE,FALSE));
             if (options.model == MODEL_FLAT24)
@@ -7070,28 +7070,28 @@ static void genGenPointerGet (operand *left,
             }
             else
             {
-               emitcode("mov","b,%s",aopGet(AOP(left),2,FALSE,FALSE));
+              emitcode("mov","b,%s",aopGet(AOP(left),2,FALSE,FALSE));
             }
-         */
+    */
         }
     }
     /* so dptr know contains the address */
     freeAsmop(left,NULL,ic,TRUE);
-    aopOp(result,ic,FALSE); 
+    aopOp(result,ic,FALSE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype)) 
+    if (IS_BITVAR(retype))
         genUnpackBits(result,"dptr",GPOINTER);
     else {
         size = AOP_SIZE(result);
         offset = 0 ;
 
         while (size--) {
-         //emitcode("lcall","__gptrget");
+    //emitcode("lcall","__gptrget");
             emitcode("movf","indf,w");
             //aopPut(AOP(result),"a",offset++);
-           emitcode("movwf","%s",
-                    aopGet(AOP(result),offset++,FALSE,FALSE));
+      emitcode("movwf","%s",
+         aopGet(AOP(result),offset++,FALSE,FALSE));
             if (size)
                 emitcode("incf","fsr,f");
         }
@@ -7119,52 +7119,52 @@ static void genPointerGet (iCode *ic)
     type = operandType(left);
     etype = getSpec(type);
     /* if left is of type of pointer then it is simple */
-    if (IS_PTR(type) && !IS_FUNC(type->next)) 
+    if (IS_PTR(type) && !IS_FUNC(type->next))
         p_type = DCL_TYPE(type);
     else {
-       /* we have to go by the storage class */
-       p_type = PTR_TYPE(SPEC_OCLS(etype));
-
-/*     if (SPEC_OCLS(etype)->codesp ) { */
-/*         p_type = CPOINTER ;  */
-/*     } */
-/*     else */
-/*         if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
-/*             p_type = FPOINTER ; */
-/*         else */
-/*             if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
-/*                 p_type = PPOINTER; */
-/*             else */
-/*                 if (SPEC_OCLS(etype) == idata ) */
-/*                     p_type = IPOINTER; */
-/*                 else */
-/*                     p_type = POINTER ; */
+  /* we have to go by the storage class */
+  p_type = PTR_TYPE(SPEC_OCLS(etype));
+
+/*  if (SPEC_OCLS(etype)->codesp ) { */
+/*      p_type = CPOINTER ;  */
+/*  } */
+/*  else */
+/*      if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
+/*    p_type = FPOINTER ; */
+/*      else */
+/*    if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
+/*        p_type = PPOINTER; */
+/*    else */
+/*        if (SPEC_OCLS(etype) == idata ) */
+/*      p_type = IPOINTER; */
+/*        else */
+/*      p_type = POINTER ; */
     }
 
     /* now that we have the pointer type we assign
     the pointer values */
     switch (p_type) {
 
-    case POINTER:      
+    case POINTER:
     case IPOINTER:
-       genNearPointerGet (left,result,ic);
-       break;
+  genNearPointerGet (left,result,ic);
+  break;
 
     case PPOINTER:
-       genPagedPointerGet(left,result,ic);
-       break;
+  genPagedPointerGet(left,result,ic);
+  break;
 
     case FPOINTER:
-       genFarPointerGet (left,result,ic);
-       break;
+  genFarPointerGet (left,result,ic);
+  break;
 
     case CPOINTER:
-       emitcodePointerGet (left,result,ic);
-       break;
+  emitcodePointerGet (left,result,ic);
+  break;
 
     case GPOINTER:
-       genGenPointerGet (left,result,ic);
-       break;
+  genGenPointerGet (left,result,ic);
+  break;
     }
 
 }
@@ -7179,7 +7179,7 @@ static void genPackBits (sym_link    *etype ,
     int shCount = 0 ;
     int offset = 0  ;
     int rLen = 0 ;
-    int blen, bstr ;   
+    int blen, bstr ;
     char *l ;
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
@@ -7187,7 +7187,7 @@ static void genPackBits (sym_link    *etype ,
     bstr = SPEC_BSTR(etype);
 
     l = aopGet(AOP(right),offset++,FALSE,FALSE);
-    MOVA(l);   
+    MOVA(l);
 
     /* if the bit lenth is less than or    */
     /* it exactly fits a byte then         */
@@ -7220,7 +7220,7 @@ static void genPackBits (sym_link    *etype ,
             }
 
             emitcode ("anl","a,#0x%02x",(unsigned char)
-                      ((unsigned char)(0xFF << (blen+bstr)) | 
+                      ((unsigned char)(0xFF << (blen+bstr)) |
                        (unsigned char)(0xFF >> (8-bstr)) ) );
             emitcode ("orl","a,b");
             if (p_type == GPOINTER)
@@ -7247,7 +7247,7 @@ static void genPackBits (sym_link    *etype ,
         return ;
 
     emitcode("inc","%s",rname);
-    rLen = SPEC_BLEN(etype) ;     
+    rLen = SPEC_BLEN(etype) ;
 
     /* now generate for lengths greater than one byte */
     while (1) {
@@ -7275,8 +7275,8 @@ static void genPackBits (sym_link    *etype ,
             case GPOINTER:
                 MOVA(l);
                 DEBUGemitcode(";lcall","__gptrput");
-                break;  
-        }   
+                break;
+        }
         emitcode ("inc","%s",rname);
     }
 
@@ -7314,54 +7314,54 @@ static void genPackBits (sym_link    *etype ,
     switch (p_type) {
 
     case POINTER:
-       emitcode("mov","@%s,a",rname);
-       break;
-       
+  emitcode("mov","@%s,a",rname);
+  break;
+
     case FPOINTER:
-       emitcode("movx","@dptr,a");
-       break;
-       
+  emitcode("movx","@dptr,a");
+  break;
+
     case GPOINTER:
-       DEBUGemitcode(";lcall","__gptrput");
-       break;                  
+  DEBUGemitcode(";lcall","__gptrput");
+  break;
     }
 }
 /*-----------------------------------------------------------------*/
 /* genDataPointerSet - remat pointer to data space                 */
 /*-----------------------------------------------------------------*/
 static void genDataPointerSet(operand *right,
-                             operand *result,
-                             iCode *ic)
+            operand *result,
+            iCode *ic)
 {
     int size, offset = 0 ;
     char *l, buffer[256];
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     aopOp(right,ic,FALSE);
-    
+
     l = aopGet(AOP(result),0,FALSE,TRUE);
     size = AOP_SIZE(right);
     // tsd, was l+1 - the underline `_' prefix was being stripped
     while (size--) {
-       if (offset)
-           sprintf(buffer,"(%s + %d)",l,offset);
-       else
-           sprintf(buffer,"%s",l);
-
-       if (AOP_TYPE(right) == AOP_LIT) {
-         unsigned int lit = floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit);
-         lit = lit >> (8*offset);
-         if(lit) {
-           emitcode("movlw","%s",lit);
-           emitcode("movwf","%s",buffer);
-         } else 
-           emitcode("clrf","%s",buffer);
-       }else {
-         emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
-         emitcode("movwf","%s",buffer);
-       }
-
-       offset++;
+  if (offset)
+      sprintf(buffer,"(%s + %d)",l,offset);
+  else
+      sprintf(buffer,"%s",l);
+
+  if (AOP_TYPE(right) == AOP_LIT) {
+    unsigned int lit = floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit);
+    lit = lit >> (8*offset);
+    if(lit) {
+      emitcode("movlw","%s",lit);
+      emitcode("movwf","%s",buffer);
+    } else
+      emitcode("clrf","%s",buffer);
+  }else {
+    emitcode("movf","%s,w",aopGet(AOP(right),offset,FALSE,FALSE));
+    emitcode("movwf","%s",buffer);
+  }
+
+  offset++;
     }
 
     freeAsmop(right,NULL,ic,TRUE);
@@ -7372,7 +7372,7 @@ static void genDataPointerSet(operand *right,
 /* genNearPointerSet - emitcode for near pointer put                */
 /*-----------------------------------------------------------------*/
 static void genNearPointerSet (operand *right,
-                               operand *result, 
+                               operand *result,
                                iCode *ic)
 {
     asmop *aop = NULL;
@@ -7380,19 +7380,19 @@ static void genNearPointerSet (operand *right,
     sym_link *retype;
     sym_link *ptype = operandType(result);
 
-    
+
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     retype= getSpec(operandType(right));
 
     aopOp(result,ic,FALSE);
-    
+
     /* if the result is rematerializable &
        in data space & not a bit variable */
     if (AOP_TYPE(result) == AOP_IMMD &&
-       DCL_TYPE(ptype) == POINTER   &&
-       !IS_BITVAR(retype)) {
-       genDataPointerSet (right,result,ic);
-       return;
+  DCL_TYPE(ptype) == POINTER   &&
+  !IS_BITVAR(retype)) {
+  genDataPointerSet (right,result,ic);
+  return;
     }
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
@@ -7403,12 +7403,12 @@ static void genNearPointerSet (operand *right,
         /* otherwise get a free pointer register */
         //aop = newAsmop(0);
         //preg = getFreePtr(ic,&aop,FALSE);
-       DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
-       //emitcode("mov","%s,%s",
+  DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
+  //emitcode("mov","%s,%s",
         //         preg->name,
         //         aopGet(AOP(result),0,FALSE,TRUE));
         //rname = preg->name ;
-       emitcode("movwf","fsr");
+  emitcode("movwf","fsr");
     }// else
     //   rname = aopGet(AOP(result),0,FALSE,FALSE);
 
@@ -7419,40 +7419,40 @@ static void genNearPointerSet (operand *right,
     /* if bitfield then unpack the bits */
     if (IS_BITVAR(retype)) {
       werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-            "The programmer is obviously confused");
+       "The programmer is obviously confused");
       //genPackBits (retype,right,rname,POINTER);
       exit(1);
     }
     else {
         /* we have can just get the values */
         int size = AOP_SIZE(right);
-        int offset = 0 ;    
+        int offset = 0 ;
 
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
         while (size--) {
             l = aopGet(AOP(right),offset,FALSE,TRUE);
             if (*l == '@' ) {
-             //MOVA(l);
-             //emitcode("mov","@%s,a",rname);
-             emitcode("movf","indf,w ;1");
+        //MOVA(l);
+        //emitcode("mov","@%s,a",rname);
+        emitcode("movf","indf,w ;1");
             } else {
 
-             if (AOP_TYPE(right) == AOP_LIT) {
-               unsigned int lit = floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit);
-               if(lit) {
-                 emitcode("movlw","%s",l);
-                 emitcode("movwf","indf ;2");
-               } else 
-                 emitcode("clrf","indf");
-             }else {
-               emitcode("movf","%s,w",l);
-               emitcode("movwf","indf ;2");
-             }
-           //emitcode("mov","@%s,%s",rname,l);
-           }
+        if (AOP_TYPE(right) == AOP_LIT) {
+    unsigned int lit = floatFromVal (AOP(IC_RIGHT(ic))->aopu.aop_lit);
+    if(lit) {
+      emitcode("movlw","%s",l);
+      emitcode("movwf","indf ;2");
+    } else
+      emitcode("clrf","indf");
+        }else {
+    emitcode("movf","%s,w",l);
+    emitcode("movwf","indf ;2");
+        }
+      //emitcode("mov","@%s,%s",rname,l);
+      }
             if (size)
-             emitcode("incf","fsr,f ;3");
-           //emitcode("inc","%s",rname);
+        emitcode("incf","fsr,f ;3");
+      //emitcode("inc","%s",rname);
             offset++;
         }
     }
@@ -7462,11 +7462,11 @@ static void genNearPointerSet (operand *right,
     if (aop) {
         /* we had to allocate for this iCode */
         freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
+    } else {
         /* we did not allocate which means left
         already in a pointer register, then
         if size > 0 && this could be used again
-        we have to point it back to where it 
+        we have to point it back to where it
         belongs */
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
         if (AOP_SIZE(right) > 1 &&
@@ -7475,8 +7475,8 @@ static void genNearPointerSet (operand *right,
               ic->depth )) {
             int size = AOP_SIZE(right) - 1;
             while (size--)
-             emitcode("decf","fsr,f");
-             //emitcode("dec","%s",rname);
+        emitcode("decf","fsr,f");
+        //emitcode("dec","%s",rname);
         }
     }
 
@@ -7491,81 +7491,81 @@ static void genNearPointerSet (operand *right,
 /* genPagedPointerSet - emitcode for Paged pointer put             */
 /*-----------------------------------------------------------------*/
 static void genPagedPointerSet (operand *right,
-                              operand *result, 
-                              iCode *ic)
+             operand *result,
+             iCode *ic)
 {
     asmop *aop = NULL;
     regs *preg = NULL ;
     char *rname , *l;
     sym_link *retype;
-       
+
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
 
     retype= getSpec(operandType(right));
-    
+
     aopOp(result,ic,FALSE);
-    
+
     /* if the value is already in a pointer register
        then don't need anything more */
     if (!AOP_INPREG(AOP(result))) {
-       /* otherwise get a free pointer register */
-       aop = newAsmop(0);
-       preg = getFreePtr(ic,&aop,FALSE);
-       emitcode("mov","%s,%s",
-               preg->name,
-               aopGet(AOP(result),0,FALSE,TRUE));
-       rname = preg->name ;
+  /* otherwise get a free pointer register */
+  aop = newAsmop(0);
+  preg = getFreePtr(ic,&aop,FALSE);
+  emitcode("mov","%s,%s",
+    preg->name,
+    aopGet(AOP(result),0,FALSE,TRUE));
+  rname = preg->name ;
     } else
-       rname = aopGet(AOP(result),0,FALSE,FALSE);
-    
+  rname = aopGet(AOP(result),0,FALSE,FALSE);
+
     freeAsmop(result,NULL,ic,TRUE);
     aopOp (right,ic,FALSE);
 
     /* if bitfield then unpack the bits */
-    if (IS_BITVAR(retype)) 
-       genPackBits (retype,right,rname,PPOINTER);
+    if (IS_BITVAR(retype))
+  genPackBits (retype,right,rname,PPOINTER);
     else {
-       /* we have can just get the values */
-       int size = AOP_SIZE(right);
-       int offset = 0 ;        
-       
-       while (size--) {
-           l = aopGet(AOP(right),offset,FALSE,TRUE);
-           
-           MOVA(l);
-           emitcode("movx","@%s,a",rname);
-
-           if (size)
-               emitcode("inc","%s",rname);
-
-           offset++;
-       }
-    }
-    
+  /* we have can just get the values */
+  int size = AOP_SIZE(right);
+  int offset = 0 ;
+
+  while (size--) {
+      l = aopGet(AOP(right),offset,FALSE,TRUE);
+
+      MOVA(l);
+      emitcode("movx","@%s,a",rname);
+
+      if (size)
+    emitcode("inc","%s",rname);
+
+      offset++;
+  }
+    }
+
     /* now some housekeeping stuff */
     if (aop) {
-       /* we had to allocate for this iCode */
-       freeAsmop(NULL,aop,ic,TRUE);
-    } else { 
-       /* we did not allocate which means left
-          already in a pointer register, then
-          if size > 0 && this could be used again
-          we have to point it back to where it 
-          belongs */
-       if (AOP_SIZE(right) > 1 &&
-           !OP_SYMBOL(result)->remat &&
-           ( OP_SYMBOL(result)->liveTo > ic->seq ||
-             ic->depth )) {
-           int size = AOP_SIZE(right) - 1;
-           while (size--)
-               emitcode("dec","%s",rname);
-       }
+  /* we had to allocate for this iCode */
+  freeAsmop(NULL,aop,ic,TRUE);
+    } else {
+  /* we did not allocate which means left
+     already in a pointer register, then
+     if size > 0 && this could be used again
+     we have to point it back to where it
+     belongs */
+  if (AOP_SIZE(right) > 1 &&
+      !OP_SYMBOL(result)->remat &&
+      ( OP_SYMBOL(result)->liveTo > ic->seq ||
+        ic->depth )) {
+      int size = AOP_SIZE(right) - 1;
+      while (size--)
+    emitcode("dec","%s",rname);
+  }
     }
 
     /* done */
     freeAsmop(right,NULL,ic,TRUE);
-    
-       
+
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -7580,7 +7580,7 @@ static void genFarPointerSet (operand *right,
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
     aopOp(result,ic,FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(result) != AOP_STR) {
         /* if this is remateriazable */
@@ -7600,7 +7600,7 @@ static void genFarPointerSet (operand *right,
     aopOp(right,ic,FALSE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype)) 
+    if (IS_BITVAR(retype))
         genPackBits(retype,right,"dptr",FPOINTER);
     else {
         size = AOP_SIZE(right);
@@ -7631,7 +7631,7 @@ static void genGenPointerSet (operand *right,
 
     aopOp(result,ic,FALSE);
 
-    /* if the operand is already in dptr 
+    /* if the operand is already in dptr
     then we do nothing else we move the value to dptr */
     if (AOP_TYPE(result) != AOP_STR) {
         /* if this is remateriazable */
@@ -7640,11 +7640,11 @@ static void genGenPointerSet (operand *right,
             emitcode("mov","b,%s + 1",aopGet(AOP(result),0,TRUE,FALSE));
         }
         else { /* we need to get it byte by byte */
-         char *l = aopGet(AOP(result),0,FALSE,FALSE);
-         if(strcmp("FSR",l))
-           emitcode("movlw","%s",aopGet(AOP(result),0,FALSE,FALSE));
+    char *l = aopGet(AOP(result),0,FALSE,FALSE);
+    if(strcmp("FSR",l))
+      emitcode("movlw","%s",aopGet(AOP(result),0,FALSE,FALSE));
 
-         emitcode("movwf","INDF");
+    emitcode("movwf","INDF");
         }
     }
     /* so dptr know contains the address */
@@ -7652,7 +7652,7 @@ static void genGenPointerSet (operand *right,
     aopOp(right,ic,FALSE);
 
     /* if bit then unpack */
-    if (IS_BITVAR(retype)) 
+    if (IS_BITVAR(retype))
         genPackBits(retype,right,"dptr",GPOINTER);
     else {
         size = AOP_SIZE(right);
@@ -7660,10 +7660,10 @@ static void genGenPointerSet (operand *right,
 
         while (--size) {
             char *l = aopGet(AOP(right),offset++,FALSE,FALSE);
-           if(size)
-             emitcode("incf","fsr,f");
-           emitcode("movf","%s,w",aopGet(AOP(right),offset++,FALSE,FALSE));
-           emitcode("movwf","indf");
+      if(size)
+        emitcode("incf","fsr,f");
+      emitcode("movf","%s,w",aopGet(AOP(right),offset++,FALSE,FALSE));
+      emitcode("movwf","indf");
             //MOVA(l);
             //DEBUGemitcode(";lcall","__gptrput");
             //if (size)
@@ -7678,7 +7678,7 @@ static void genGenPointerSet (operand *right,
 /* genPointerSet - stores the value into a pointer location        */
 /*-----------------------------------------------------------------*/
 static void genPointerSet (iCode *ic)
-{    
+{
     operand *right, *result ;
     sym_link *type, *etype;
     int p_type;
@@ -7697,23 +7697,23 @@ static void genPointerSet (iCode *ic)
         p_type = DCL_TYPE(type);
     }
     else {
-       /* we have to go by the storage class */
-       p_type = PTR_TYPE(SPEC_OCLS(etype));
-
-/*     if (SPEC_OCLS(etype)->codesp ) { */
-/*         p_type = CPOINTER ;  */
-/*     } */
-/*     else */
-/*         if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
-/*             p_type = FPOINTER ; */
-/*         else */
-/*             if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
-/*                 p_type = PPOINTER ; */
-/*             else */
-/*                 if (SPEC_OCLS(etype) == idata ) */
-/*                     p_type = IPOINTER ; */
-/*                 else */
-/*                     p_type = POINTER ; */
+  /* we have to go by the storage class */
+  p_type = PTR_TYPE(SPEC_OCLS(etype));
+
+/*  if (SPEC_OCLS(etype)->codesp ) { */
+/*      p_type = CPOINTER ;  */
+/*  } */
+/*  else */
+/*      if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
+/*    p_type = FPOINTER ; */
+/*      else */
+/*    if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
+/*        p_type = PPOINTER ; */
+/*    else */
+/*        if (SPEC_OCLS(etype) == idata ) */
+/*      p_type = IPOINTER ; */
+/*        else */
+/*      p_type = POINTER ; */
     }
 
     /* now that we have the pointer type we assign
@@ -7722,20 +7722,20 @@ static void genPointerSet (iCode *ic)
 
     case POINTER:
     case IPOINTER:
-       genNearPointerSet (right,result,ic);
-       break;
+  genNearPointerSet (right,result,ic);
+  break;
 
     case PPOINTER:
-       genPagedPointerSet (right,result,ic);
-       break;
+  genPagedPointerSet (right,result,ic);
+  break;
 
     case FPOINTER:
-       genFarPointerSet (right,result,ic);
-       break;
+  genFarPointerSet (right,result,ic);
+  break;
 
     case GPOINTER:
-       genGenPointerSet (right,result,ic);
-       break;
+  genGenPointerSet (right,result,ic);
+  break;
     }
 
 }
@@ -7764,23 +7764,23 @@ static void genIfx (iCode *ic, iCode *popIc)
         genIpop(popIc);
 
     /* if the condition is  a bit variable */
-    if (isbit && IS_ITEMP(cond) && 
-       SPIL_LOC(cond)) {
+    if (isbit && IS_ITEMP(cond) &&
+  SPIL_LOC(cond)) {
       genIfxJump(ic,SPIL_LOC(cond)->rname);
       DEBUGemitcode ("; isbit  SPIL_LOC","%s",SPIL_LOC(cond)->rname);
     }
     else {
       /*
-       if (isbit && !IS_ITEMP(cond))
-         DEBUGemitcode ("; isbit OP_SYM","%s",OP_SYMBOL(cond)->rname);
-       else
-         DEBUGemitcode ("; isbit","a");
+  if (isbit && !IS_ITEMP(cond))
+    DEBUGemitcode ("; isbit OP_SYM","%s",OP_SYMBOL(cond)->rname);
+  else
+    DEBUGemitcode ("; isbit","a");
       */
 
-       if (isbit && !IS_ITEMP(cond))
-           genIfxJump(ic,OP_SYMBOL(cond)->rname);
-       else
-           genIfxJump(ic,"a");
+  if (isbit && !IS_ITEMP(cond))
+      genIfxJump(ic,OP_SYMBOL(cond)->rname);
+  else
+      genIfxJump(ic,"a");
     }
     ic->generated = 1;
 }
@@ -7797,7 +7797,7 @@ static void genAddrOf (iCode *ic)
 
     aopOp(IC_RESULT(ic),ic,FALSE);
 
-    /* if the operand is on the stack then we 
+    /* if the operand is on the stack then we
     need to get the stack offset of this
     variable */
     if (sym->onStack) {
@@ -7806,21 +7806,21 @@ static void genAddrOf (iCode *ic)
         if (sym->stack) {
             emitcode("mov","a,_bp");
             emitcode("add","a,#0x%02x",((char) sym->stack & 0xff));
-            aopPut(AOP(IC_RESULT(ic)),"a",0);       
+            aopPut(AOP(IC_RESULT(ic)),"a",0);
         } else {
             /* we can just move _bp */
             aopPut(AOP(IC_RESULT(ic)),"_bp",0);
         }
         /* fill the result with zero */
         size = AOP_SIZE(IC_RESULT(ic)) - 1;
-        
-        
+
+
         if (options.stack10bit && size < (FPTRSIZE - 1))
         {
-            fprintf(stderr, 
-                   "*** warning: pointer to stack var truncated.\n");
+            fprintf(stderr,
+                  "*** warning: pointer to stack var truncated.\n");
         }
-        
+
         offset = 1;
         while (size--)
         {
@@ -7831,7 +7831,7 @@ static void genAddrOf (iCode *ic)
             }
             else
             {
-               aopPut(AOP(IC_RESULT(ic)),zero,offset++);
+              aopPut(AOP(IC_RESULT(ic)),zero,offset++);
             }
         }
 
@@ -7844,7 +7844,7 @@ static void genAddrOf (iCode *ic)
 
     while (size--) {
         char s[SDCC_NAME_MAX];
-        if (offset) 
+        if (offset)
             sprintf(s,"#(%s >> %d)",
                     sym->rname,
                     offset*8);
@@ -7869,21 +7869,21 @@ static void genFarFarAssign (operand *result, operand *right, iCode *ic)
     char *l ;
     /* first push the right side on to the stack */
     while (size--) {
-       l = aopGet(AOP(right),offset++,FALSE,FALSE);
-       MOVA(l);
-       emitcode ("push","acc");
+  l = aopGet(AOP(right),offset++,FALSE,FALSE);
+  MOVA(l);
+  emitcode ("push","acc");
     }
-    
+
     freeAsmop(right,NULL,ic,FALSE);
     /* now assign DPTR to result */
     aopOp(result,ic,FALSE);
     size = AOP_SIZE(result);
     while (size--) {
-       emitcode ("pop","acc");
-       aopPut(AOP(result),"a",--offset);
+  emitcode ("pop","acc");
+  aopPut(AOP(result),"a",--offset);
     }
     freeAsmop(result,NULL,ic,FALSE);
-       
+
 }
 #endif
 
@@ -7894,7 +7894,7 @@ static void genAssign (iCode *ic)
 {
     operand *result, *right;
     int size, offset ;
-       unsigned long lit = 0L;
+  unsigned long lit = 0L;
 
     result = IC_RESULT(ic);
     right  = IC_RIGHT(ic) ;
@@ -7918,29 +7918,29 @@ static void genAssign (iCode *ic)
         /* if the right size is a literal then
         we know what the value is */
         if (AOP_TYPE(right) == AOP_LIT) {
-            if (((int) operandLitValue(right))) 
-             emitcode("bsf","(%s >> 3),(%s & 7)",
-                AOP(result)->aopu.aop_dir,
-                AOP(result)->aopu.aop_dir);
+            if (((int) operandLitValue(right)))
+        emitcode("bsf","(%s >> 3),(%s & 7)",
+     AOP(result)->aopu.aop_dir,
+     AOP(result)->aopu.aop_dir);
             else
-             emitcode("bcf","(%s >> 3),(%s & 7)",
-                AOP(result)->aopu.aop_dir,
-                AOP(result)->aopu.aop_dir);
+        emitcode("bcf","(%s >> 3),(%s & 7)",
+     AOP(result)->aopu.aop_dir,
+     AOP(result)->aopu.aop_dir);
             goto release;
         }
 
         /* the right is also a bit variable */
         if (AOP_TYPE(right) == AOP_CRY) {
-         emitcode("bcf","(%s >> 3),(%s & 7)",
-                  AOP(result)->aopu.aop_dir,
-                  AOP(result)->aopu.aop_dir);
-         emitcode("btfsc","(%s >> 3),(%s & 7)",
-                  AOP(right)->aopu.aop_dir,
-                  AOP(right)->aopu.aop_dir);
-         emitcode("bsf","(%s >> 3),(%s & 7)",
-                  AOP(result)->aopu.aop_dir,
-                  AOP(result)->aopu.aop_dir);
-         goto release ;
+    emitcode("bcf","(%s >> 3),(%s & 7)",
+       AOP(result)->aopu.aop_dir,
+       AOP(result)->aopu.aop_dir);
+    emitcode("btfsc","(%s >> 3),(%s & 7)",
+       AOP(right)->aopu.aop_dir,
+       AOP(right)->aopu.aop_dir);
+    emitcode("bsf","(%s >> 3),(%s & 7)",
+       AOP(result)->aopu.aop_dir,
+       AOP(result)->aopu.aop_dir);
+    goto release ;
         }
 
         /* we need to or */
@@ -7954,36 +7954,36 @@ static void genAssign (iCode *ic)
     size = AOP_SIZE(result);
     offset = 0 ;
     if(AOP_TYPE(right) == AOP_LIT)
-       lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
+  lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
     if((AOP_TYPE(result) != AOP_REG) &&
        (AOP_TYPE(right) == AOP_LIT) &&
        !IS_FLOAT(operandType(right)) &&
        (lit < 256L)){
 
-       while (size--) {
-           if((unsigned int)((lit >> (size*8)) & 0x0FFL)== 0)
-             emitcode("clrf","%s", aopGet(AOP(result),size,FALSE,FALSE));
-           else {
-             emitcode("movlw","%s", aopGet(AOP(right),size,FALSE,FALSE));
-             emitcode("movwf","%s", aopGet(AOP(result),size,FALSE,FALSE));
-           }
-       }
+  while (size--) {
+      if((unsigned int)((lit >> (size*8)) & 0x0FFL)== 0)
+        emitcode("clrf","%s", aopGet(AOP(result),size,FALSE,FALSE));
+      else {
+        emitcode("movlw","%s", aopGet(AOP(right),size,FALSE,FALSE));
+        emitcode("movwf","%s", aopGet(AOP(result),size,FALSE,FALSE));
+      }
+  }
     } else {
-       while (size--) {
-         if(AOP_TYPE(right) == AOP_LIT)
-           emitcode("movlw","%s", aopGet(AOP(right),offset,FALSE,FALSE));
-         else
-           emitcode("movf","%s,w", aopGet(AOP(right),offset,FALSE,FALSE));
-           
-         emitcode("movwf","%s", aopGet(AOP(result),offset,FALSE,FALSE));
-         offset++;
-       }
-    }
-    
+  while (size--) {
+    if(AOP_TYPE(right) == AOP_LIT)
+      emitcode("movlw","%s", aopGet(AOP(right),offset,FALSE,FALSE));
+    else
+      emitcode("movf","%s,w", aopGet(AOP(right),offset,FALSE,FALSE));
+
+    emitcode("movwf","%s", aopGet(AOP(result),offset,FALSE,FALSE));
+    offset++;
+  }
+    }
+
 release:
     freeAsmop (right,NULL,ic,FALSE);
     freeAsmop (result,NULL,ic,TRUE);
-}   
+}
 
 /*-----------------------------------------------------------------*/
 /* genJumpTab - genrates code for jump table                       */
@@ -8020,10 +8020,10 @@ static void genJumpTab (iCode *ic)
 /*-----------------------------------------------------------------*/
 /*
   TSD - Written for the PIC port - but this unfortunately is buggy.
-  This routine is good in that it is able to efficiently promote 
+  This routine is good in that it is able to efficiently promote
   types to different (larger) sizes. Unfortunately, the temporary
   variables that are optimized out by this routine are sometimes
-  used in other places. So until I know how to really parse the 
+  used in other places. So until I know how to really parse the
   iCode tree, I'm going to not be using this routine :(.
 */
 static int genMixedOperation (iCode *ic)
@@ -8059,7 +8059,7 @@ static int genMixedOperation (iCode *ic)
 
     operand *t = right;
     right = nextright;
-    nextright = t; 
+    nextright = t;
 
     emitcode(";remove right +","");
 
@@ -8067,7 +8067,7 @@ static int genMixedOperation (iCode *ic)
 /*
     operand *t = right;
     right = nextleft;
-    nextleft = t; 
+    nextleft = t;
 */
     emitcode(";remove left +","");
   } else
@@ -8088,45 +8088,45 @@ static int genMixedOperation (iCode *ic)
       emitcode("movf","%s,w",AOP(nextright)->aopu.aop_dir);
 
       if (!sameRegs(AOP(IC_LEFT(nextic)), AOP(IC_RESULT(nextic))) ) {
-       emitcode("addwf","%s,w",AOP(nextleft)->aopu.aop_dir);
-       emitcode("movwf","%s",aopGet(AOP(IC_RESULT(nextic)),0,FALSE,FALSE));
+  emitcode("addwf","%s,w",AOP(nextleft)->aopu.aop_dir);
+  emitcode("movwf","%s",aopGet(AOP(IC_RESULT(nextic)),0,FALSE,FALSE));
       } else
-       emitcode("addwf","%s,f",AOP(nextleft)->aopu.aop_dir);
+  emitcode("addwf","%s,f",AOP(nextleft)->aopu.aop_dir);
 
       offset = 0;
       while(--big) {
 
-       offset++;
+  offset++;
 
-       if(--small) {
-         if (!sameRegs(AOP(IC_LEFT(nextic)), AOP(IC_RESULT(nextic))) ){
-           emitcode("movf","%s,w",aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE));
-           emitcode("movwf","%s,f",aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE) );
-         }
+  if(--small) {
+    if (!sameRegs(AOP(IC_LEFT(nextic)), AOP(IC_RESULT(nextic))) ){
+      emitcode("movf","%s,w",aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE));
+      emitcode("movwf","%s,f",aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE) );
+    }
 
-         emitcode("movf","%s,w", aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE));
-         emitSKPNC;
-         emitcode("btfsc","(%s >> 3), (%s & 7)",
-                  AOP(IC_RIGHT(nextic))->aopu.aop_dir,
-                  AOP(IC_RIGHT(nextic))->aopu.aop_dir);
-         emitcode(" incf","%s,w", aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE));
-         emitcode("movwf","%s", aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE));
+    emitcode("movf","%s,w", aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE));
+    emitSKPNC;
+    emitcode("btfsc","(%s >> 3), (%s & 7)",
+       AOP(IC_RIGHT(nextic))->aopu.aop_dir,
+       AOP(IC_RIGHT(nextic))->aopu.aop_dir);
+    emitcode(" incf","%s,w", aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE));
+    emitcode("movwf","%s", aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE));
 
-       } else {
-         emitcode("rlf","known_zero,w");
+  } else {
+    emitcode("rlf","known_zero,w");
 
-         /*
-           if right is signed
-             btfsc  right,7
+    /*
+      if right is signed
+        btfsc  right,7
                addlw ff
-         */
-         if (!sameRegs(AOP(IC_LEFT(nextic)), AOP(IC_RESULT(nextic))) ){
-           emitcode("addwf","%s,w",aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE));
-           emitcode("movwf","%s,f",aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE) );
-         } else {
-           emitcode("addwf","%s,f",aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE) );
-         }
-       }
+    */
+    if (!sameRegs(AOP(IC_LEFT(nextic)), AOP(IC_RESULT(nextic))) ){
+      emitcode("addwf","%s,w",aopGet(AOP(IC_LEFT(nextic)),offset,FALSE,FALSE));
+      emitcode("movwf","%s,f",aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE) );
+    } else {
+      emitcode("addwf","%s,f",aopGet(AOP(IC_RESULT(nextic)),offset,FALSE,FALSE) );
+    }
+  }
       }
       ret = 1;
     }
@@ -8169,25 +8169,25 @@ static void genCast (iCode *ic)
         /* if the right size is a literal then
         we know what the value is */
         if (AOP_TYPE(right) == AOP_LIT) {
-         emitcode("; ***  right is a lit","%s  %d",__FUNCTION__,__LINE__);
-            if (((int) operandLitValue(right))) 
-             emitcode("bsf","(%s >> 3), (%s & 7)",
-                      AOP(result)->aopu.aop_dir,
-                      AOP(result)->aopu.aop_dir);
+    emitcode("; ***  right is a lit","%s  %d",__FUNCTION__,__LINE__);
+            if (((int) operandLitValue(right)))
+        emitcode("bsf","(%s >> 3), (%s & 7)",
+           AOP(result)->aopu.aop_dir,
+           AOP(result)->aopu.aop_dir);
             else
-             emitcode("bcf","(%s >> 3), (%s & 7)",
-                      AOP(result)->aopu.aop_dir,
-                      AOP(result)->aopu.aop_dir);
+        emitcode("bcf","(%s >> 3), (%s & 7)",
+           AOP(result)->aopu.aop_dir,
+           AOP(result)->aopu.aop_dir);
 
             goto release;
         }
 
         /* the right is also a bit variable */
         if (AOP_TYPE(right) == AOP_CRY) {
-         emitcode("clrc","");
-         emitcode("btfsc","(%s >> 3), (%s & 7)",
-                  AOP(right)->aopu.aop_dir,
-                  AOP(right)->aopu.aop_dir);
+    emitcode("clrc","");
+    emitcode("btfsc","(%s >> 3), (%s & 7)",
+       AOP(right)->aopu.aop_dir,
+       AOP(right)->aopu.aop_dir);
             aopPut(AOP(result),"c",0);
             goto release ;
         }
@@ -8221,82 +8221,81 @@ static void genCast (iCode *ic)
     /* if the result is of type pointer */
     if (IS_PTR(ctype)) {
 
-       int p_type;
-       sym_link *type = operandType(right);
-       sym_link *etype = getSpec(type);
-
-       /* pointer to generic pointer */
-       if (IS_GENPTR(ctype)) {
-           char *l = zero;
-           
-           if (IS_PTR(type)) 
-               p_type = DCL_TYPE(type);
-           else {
-               /* we have to go by the storage class */
-               p_type = PTR_TYPE(SPEC_OCLS(etype));
-
-/*             if (SPEC_OCLS(etype)->codesp )  */
-/*                 p_type = CPOINTER ;  */
-/*             else */
-/*                 if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
-/*                     p_type = FPOINTER ; */
-/*                 else */
-/*                     if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
-/*                         p_type = PPOINTER; */
-/*                     else */
-/*                         if (SPEC_OCLS(etype) == idata ) */
-/*                             p_type = IPOINTER ; */
-/*                         else */
-/*                             p_type = POINTER ; */
-           }
-               
-           /* the first two bytes are known */
-           size = GPTRSIZE - 1; 
-           offset = 0 ;
-           while (size--) {
-               aopPut(AOP(result),
-                      aopGet(AOP(right),offset,FALSE,FALSE),
-                      offset);
-               offset++;
-           }
-           /* the last byte depending on type */
-           switch (p_type) {
-           case IPOINTER:
-           case POINTER:
-               l = zero;
-               break;
-           case FPOINTER:
-               l = one;
-               break;
-           case CPOINTER:
-               l = "#0x02";
-               break;                          
-           case PPOINTER:
-               l = "#0x03";
-               break;
-               
-           default:
-               /* this should never happen */
-               werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                      "got unknown pointer type");
-               exit(1);
-           }
-           aopPut(AOP(result),l, GPTRSIZE - 1);            
-           goto release ;
-       }
-       
-       /* just copy the pointers */
-       size = AOP_SIZE(result);
-       offset = 0 ;
-       while (size--) {
-           aopPut(AOP(result),
-                  aopGet(AOP(right),offset,FALSE,FALSE),
-                  offset);
-           offset++;
-       }
-       goto release ;
-    }
-    
+  int p_type;
+  sym_link *type = operandType(right);
+  sym_link *etype = getSpec(type);
+
+  /* pointer to generic pointer */
+  if (IS_GENPTR(ctype)) {
+      char *l = zero;
+
+      if (IS_PTR(type))
+    p_type = DCL_TYPE(type);
+      else {
+    /* we have to go by the storage class */
+    p_type = PTR_TYPE(SPEC_OCLS(etype));
+
+/*    if (SPEC_OCLS(etype)->codesp )  */
+/*        p_type = CPOINTER ;  */
+/*    else */
+/*        if (SPEC_OCLS(etype)->fmap && !SPEC_OCLS(etype)->paged) */
+/*      p_type = FPOINTER ; */
+/*        else */
+/*      if (SPEC_OCLS(etype)->fmap && SPEC_OCLS(etype)->paged) */
+/*          p_type = PPOINTER; */
+/*      else */
+/*          if (SPEC_OCLS(etype) == idata ) */
+/*        p_type = IPOINTER ; */
+/*          else */
+/*        p_type = POINTER ; */
+      }
+
+      /* the first two bytes are known */
+      size = GPTRSIZE - 1;
+      offset = 0 ;
+      while (size--) {
+    aopPut(AOP(result),
+           aopGet(AOP(right),offset,FALSE,FALSE),
+           offset);
+    offset++;
+      }
+      /* the last byte depending on type */
+      switch (p_type) {
+      case IPOINTER:
+      case POINTER:
+    l = zero;
+    break;
+      case FPOINTER:
+    l = one;
+    break;
+      case CPOINTER:
+    l = "#0x02";
+    break;
+      case PPOINTER:
+    l = "#0x03";
+    break;
+
+      default:
+    /* this should never happen */
+    werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+           "got unknown pointer type");
+    exit(1);\v      }
+      aopPut(AOP(result),l, GPTRSIZE - 1);
+      goto release ;
+  }
+
+  /* just copy the pointers */
+  size = AOP_SIZE(result);
+  offset = 0 ;
+  while (size--) {
+      aopPut(AOP(result),
+       aopGet(AOP(right),offset,FALSE,FALSE),
+       offset);
+      offset++;
+  }
+  goto release ;
+    }
+
 
     if (AOP_TYPE(right) == AOP_CRY) {
       int offset = 1;
@@ -8304,11 +8303,11 @@ static void genCast (iCode *ic)
 
       emitcode("clrf","%s ; %d", aopGet(AOP(result),0,FALSE,FALSE),__LINE__);
       emitcode("btfsc","(%s >> 3), (%s & 7)",
-              AOP(right)->aopu.aop_dir,
-              AOP(right)->aopu.aop_dir);
+         AOP(right)->aopu.aop_dir,
+         AOP(right)->aopu.aop_dir);
       emitcode("incf","%s,f", aopGet(AOP(result),0,FALSE,FALSE),__LINE__);
       while (size--) {
-       emitcode("clrf","%s", aopGet(AOP(result),offset++,FALSE,FALSE),__LINE__);
+  emitcode("clrf","%s", aopGet(AOP(result),offset++,FALSE,FALSE),__LINE__);
       }
       goto release;
     }
@@ -8321,7 +8320,7 @@ static void genCast (iCode *ic)
     if(genMixedOperation(ic))
       goto release;
 
-    
+
     /* we move to result for the size of source */
     size = AOP_SIZE(right);
     offset = 0 ;
@@ -8338,21 +8337,21 @@ static void genCast (iCode *ic)
     /* if unsigned or not an integral type */
     if (SPEC_USIGN(ctype) || !IS_SPEC(ctype)) {
         while (size--)
-         emitcode("clrf","%s",aopGet(AOP(result),offset++,FALSE,FALSE));
+    emitcode("clrf","%s",aopGet(AOP(result),offset++,FALSE,FALSE));
     } else {
       /* we need to extend the sign :{ */
       //char *l = aopGet(AOP(right),AOP_SIZE(right) - 1,FALSE,FALSE);
       //MOVA(l);
 
         emitcode("clrw","");
-       emitcode("btfsc","(%s >> 3), (%s & 7)",
-                AOP(right)->aopu.aop_dir,
-                AOP(right)->aopu.aop_dir);
+  emitcode("btfsc","(%s >> 3), (%s & 7)",
+     AOP(right)->aopu.aop_dir,
+     AOP(right)->aopu.aop_dir);
         emitcode("movlw","0xff");
         while (size--) {
-         emitcode("movwf","%s",aopGet(AOP(result),offset++,FALSE,FALSE));
-         // aopPut(AOP(result),"a",offset++);
-       }
+    emitcode("movwf","%s",aopGet(AOP(result),offset++,FALSE,FALSE));
+    // aopPut(AOP(result),"a",offset++);
+  }
 
     }
 
@@ -8373,39 +8372,39 @@ static int genDjnz (iCode *ic, iCode *ifx)
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
 
     if (!ifx)
-       return 0;
-    
+  return 0;
+
     /* if the if condition has a false label
        then we cannot save */
     if (IC_FALSE(ifx))
-       return 0;
+  return 0;
 
-    /* if the minus is not of the form 
+    /* if the minus is not of the form
        a = a - 1 */
     if (!isOperandEqual(IC_RESULT(ic),IC_LEFT(ic)) ||
-       !IS_OP_LITERAL(IC_RIGHT(ic)))
-       return 0;
+  !IS_OP_LITERAL(IC_RIGHT(ic)))
+  return 0;
 
     if (operandLitValue(IC_RIGHT(ic)) != 1)
-       return 0;
+  return 0;
 
     /* if the size of this greater than one then no
        saving */
     if (getSize(operandType(IC_RESULT(ic))) > 1)
-       return 0;
+  return 0;
 
     /* otherwise we can save BIG */
     lbl = newiTempLabel(NULL);
     lbl1= newiTempLabel(NULL);
 
     aopOp(IC_RESULT(ic),ic,FALSE);
-    
+
     if (IS_AOP_PREG(IC_RESULT(ic))) {
-       emitcode("dec","%s",
-                aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
-       emitcode("mov","a,%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
-       emitcode("jnz","%05d_DS_",lbl->key+100);
-    } else {   
+  emitcode("dec","%s",
+     aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+  emitcode("mov","a,%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
+  emitcode("jnz","%05d_DS_",lbl->key+100);
+    } else {
       emitcode("decfsz","%s,f",aopGet(AOP(IC_RESULT(ic)),0,FALSE,FALSE));
       emitcode ("goto","_%05d_DS_",IC_TRUE(ifx)->key+100 + labelOffset);
 
@@ -8415,7 +8414,7 @@ static int genDjnz (iCode *ic, iCode *ifx)
 /*     emitcode ("ljmp","%05d_DS_",IC_TRUE(ifx)->key+100); */
 /*     emitcode ("","%05d_DS_:",lbl1->key+100); */
 
-    
+
     freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
     ifx->generated = 1;
     return 1;
@@ -8425,33 +8424,33 @@ static int genDjnz (iCode *ic, iCode *ifx)
 /* genReceive - generate code for a receive iCode                  */
 /*-----------------------------------------------------------------*/
 static void genReceive (iCode *ic)
-{    
+{
     DEBUGemitcode ("; ***","%s  %d",__FUNCTION__,__LINE__);
 
-    if (isOperandInFarSpace(IC_RESULT(ic)) && 
-       ( OP_SYMBOL(IC_RESULT(ic))->isspilt ||
-         IS_TRUE_SYMOP(IC_RESULT(ic))) ) {
-
-       int size = getSize(operandType(IC_RESULT(ic)));
-       int offset =  fReturnSize - size;
-       while (size--) {
-           emitcode ("push","%s", (strcmp(fReturn[fReturnSize - offset - 1],"a") ?
-                                   fReturn[fReturnSize - offset - 1] : "acc"));
-           offset++;
-       }
-       aopOp(IC_RESULT(ic),ic,FALSE);  
-       size = AOP_SIZE(IC_RESULT(ic));
-       offset = 0;
-       while (size--) {
-           emitcode ("pop","acc");
-           aopPut (AOP(IC_RESULT(ic)),"a",offset++);
-       }
-       
+    if (isOperandInFarSpace(IC_RESULT(ic)) &&
+  ( OP_SYMBOL(IC_RESULT(ic))->isspilt ||
+    IS_TRUE_SYMOP(IC_RESULT(ic))) ) {
+
+  int size = getSize(operandType(IC_RESULT(ic)));
+  int offset =  fReturnSize - size;
+  while (size--) {
+      emitcode ("push","%s", (strcmp(fReturn[fReturnSize - offset - 1],"a") ?
+            fReturn[fReturnSize - offset - 1] : "acc"));
+      offset++;
+  }
+  aopOp(IC_RESULT(ic),ic,FALSE);
+  size = AOP_SIZE(IC_RESULT(ic));
+  offset = 0;
+  while (size--) {
+      emitcode ("pop","acc");
+      aopPut (AOP(IC_RESULT(ic)),"a",offset++);
+  }
+
     } else {
-       _G.accInUse++;
-       aopOp(IC_RESULT(ic),ic,FALSE);  
-       _G.accInUse--;
-       assignResultValue(IC_RESULT(ic));       
+  _G.accInUse++;
+  aopOp(IC_RESULT(ic),ic,FALSE);
+  _G.accInUse--;
+  assignResultValue(IC_RESULT(ic));
     }
 
     freeAsmop(IC_RESULT(ic),NULL,ic,TRUE);
@@ -8470,233 +8469,233 @@ void genpic14Code (iCode *lic)
     /* if debug information required */
 /*     if (options.debug && currFunc) { */
     if (currFunc) {
-       cdbSymbol(currFunc,cdbFile,FALSE,TRUE);
-       _G.debugLine = 1;
-       if (IS_STATIC(currFunc->etype))
-           emitcode("",";F%s$%s$0$0     %d",moduleName,currFunc->name,__LINE__); 
-       else
-           emitcode("",";G$%s$0$0   %d",currFunc->name,__LINE__);
-       _G.debugLine = 0;
+  cdbSymbol(currFunc,cdbFile,FALSE,TRUE);
+  _G.debugLine = 1;
+  if (IS_STATIC(currFunc->etype))
+      emitcode("",";F%s$%s$0$0     %d",moduleName,currFunc->name,__LINE__);
+  else
+      emitcode("",";G$%s$0$0   %d",currFunc->name,__LINE__);
+  _G.debugLine = 0;
     }
 
 
     for (ic = lic ; ic ; ic = ic->next ) {
 
       DEBUGemitcode(";ic","");
-       if ( cln != ic->lineno ) {
-           if ( options.debug ) {
-               _G.debugLine = 1;
-               emitcode("",";C$%s$%d$%d$%d ==.",
-                        ic->filename,ic->lineno,
-                        ic->level,ic->block);
-               _G.debugLine = 0;
-           }
-           emitcode(";","%s %d",ic->filename,ic->lineno);
-           cln = ic->lineno ;
-       }
-       /* if the result is marked as
-          spilt and rematerializable or code for
-          this has already been generated then
-          do nothing */
-       if (resultRemat(ic) || ic->generated ) 
-           continue ;
-       
-       /* depending on the operation */
-       switch (ic->op) {
-       case '!' :
-           genNot(ic);
-           break;
-           
-       case '~' :
-           genCpl(ic);
-           break;
-           
-       case UNARYMINUS:
-           genUminus (ic);
-           break;
-           
-       case IPUSH:
-           genIpush (ic);
-           break;
-           
-       case IPOP:
-           /* IPOP happens only when trying to restore a 
-              spilt live range, if there is an ifx statement
-              following this pop then the if statement might
-              be using some of the registers being popped which
-              would destory the contents of the register so
-              we need to check for this condition and handle it */
-           if (ic->next            && 
-               ic->next->op == IFX &&
-               regsInCommon(IC_LEFT(ic),IC_COND(ic->next))) 
-               genIfx (ic->next,ic);
-           else
-               genIpop (ic);
-           break; 
-           
-       case CALL:
-           genCall (ic);
-           break;
-           
-       case PCALL:
-           genPcall (ic);
-           break;
-           
-       case FUNCTION:
-           genFunction (ic);
-           break;
-           
-       case ENDFUNCTION:
-           genEndFunction (ic);
-           break;
-           
-       case RETURN:
-           genRet (ic);
-           break;
-           
-       case LABEL:
-           genLabel (ic);
-           break;
-           
-       case GOTO:
-           genGoto (ic);
-           break;
-           
-       case '+' :
-           genPlus (ic) ;
-           break;
-           
-       case '-' :
-           if ( ! genDjnz (ic,ifxForOp(IC_RESULT(ic),ic)))
-               genMinus (ic);
-           break;
-           
-       case '*' :
-           genMult (ic);
-           break;
-           
-       case '/' :
-           genDiv (ic) ;
-           break;
-           
-       case '%' :
-           genMod (ic);
-           break;
-           
-       case '>' :
-           genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic));                 
-           break;
-           
-       case '<' :
-           genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case LE_OP:
-       case GE_OP:
-       case NE_OP:
-           
-           /* note these two are xlated by algebraic equivalence
-              during parsing SDCC.y */
-           werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                  "got '>=' or '<=' shouldn't have come here");
-           break;      
-           
-       case EQ_OP:
-           genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;          
-           
-       case AND_OP:
-           genAndOp (ic);
-           break;
-           
-       case OR_OP:
-           genOrOp (ic);
-           break;
-           
-       case '^' :
-           genXor (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case '|' :
-               genOr (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case BITWISEAND:
+  if ( cln != ic->lineno ) {
+      if ( options.debug ) {
+    _G.debugLine = 1;
+    emitcode("",";C$%s$%d$%d$%d ==.",
+       ic->filename,ic->lineno,
+       ic->level,ic->block);
+    _G.debugLine = 0;
+      }
+      emitcode(";","%s %d",ic->filename,ic->lineno);
+      cln = ic->lineno ;
+  }
+  /* if the result is marked as
+     spilt and rematerializable or code for
+     this has already been generated then
+     do nothing */
+  if (resultRemat(ic) || ic->generated )
+      continue ;
+
+  /* depending on the operation */
+  switch (ic->op) {
+  case '!' :
+      genNot(ic);
+      break;
+
+  case '~' :
+      genCpl(ic);
+      break;
+
+  case UNARYMINUS:
+      genUminus (ic);
+      break;
+
+  case IPUSH:
+      genIpush (ic);
+      break;
+
+  case IPOP:
+      /* IPOP happens only when trying to restore a
+         spilt live range, if there is an ifx statement
+         following this pop then the if statement might
+         be using some of the registers being popped which
+         would destory the contents of the register so
+         we need to check for this condition and handle it */
+      if (ic->next            &&
+    ic->next->op == IFX &&
+    regsInCommon(IC_LEFT(ic),IC_COND(ic->next)))
+    genIfx (ic->next,ic);
+      else
+    genIpop (ic);
+      break;
+
+  case CALL:
+      genCall (ic);
+      break;
+
+  case PCALL:
+      genPcall (ic);
+      break;
+
+  case FUNCTION:
+      genFunction (ic);
+      break;
+
+  case ENDFUNCTION:
+      genEndFunction (ic);
+      break;
+
+  case RETURN:
+      genRet (ic);
+      break;
+
+  case LABEL:
+      genLabel (ic);
+      break;
+
+  case GOTO:
+      genGoto (ic);
+      break;
+
+  case '+' :
+      genPlus (ic) ;
+      break;
+
+  case '-' :
+      if ( ! genDjnz (ic,ifxForOp(IC_RESULT(ic),ic)))
+    genMinus (ic);
+      break;
+
+  case '*' :
+      genMult (ic);
+      break;
+
+  case '/' :
+      genDiv (ic) ;
+      break;
+
+  case '%' :
+      genMod (ic);
+      break;
+
+  case '>' :
+      genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case '<' :
+      genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case LE_OP:
+  case GE_OP:
+  case NE_OP:
+
+      /* note these two are xlated by algebraic equivalence
+         during parsing SDCC.y */
+      werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+       "got '>=' or '<=' shouldn't have come here");
+      break;
+
+  case EQ_OP:
+      genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case AND_OP:
+      genAndOp (ic);
+      break;
+
+  case OR_OP:
+      genOrOp (ic);
+      break;
+
+  case '^' :
+      genXor (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case '|' :
+    genOr (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case BITWISEAND:
             genAnd (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case INLINEASM:
-           genInline (ic);
-           break;
-           
-       case RRC:
-           genRRC (ic);
-           break;
-           
-       case RLC:
-           genRLC (ic);
-           break;
-           
-       case GETHBIT:
-           genGetHbit (ic);
-           break;
-           
-       case LEFT_OP:
-           genLeftShift (ic);
-           break;
-           
-       case RIGHT_OP:
-           genRightShift (ic);
-           break;
-           
-       case GET_VALUE_AT_ADDRESS:
-           genPointerGet(ic);
-           break;
-           
-       case '=' :
-           if (POINTER_SET(ic))
-               genPointerSet(ic);
-           else
-               genAssign(ic);
-           break;
-           
-       case IFX:
-           genIfx (ic,NULL);
-           break;
-           
-       case ADDRESS_OF:
-           genAddrOf (ic);
-           break;
-           
-       case JUMPTABLE:
-           genJumpTab (ic);
-           break;
-           
-       case CAST:
-           genCast (ic);
-           break;
-           
-       case RECEIVE:
-           genReceive(ic);
-           break;
-           
-       case SEND:
-           addSet(&_G.sendSet,ic);
-           break;
-
-       default :
-           ic = ic;
-           /*      piCode(ic,stdout); */
-           
+      break;
+
+  case INLINEASM:
+      genInline (ic);
+      break;
+
+  case RRC:
+      genRRC (ic);
+      break;
+
+  case RLC:
+      genRLC (ic);
+      break;
+
+  case GETHBIT:
+      genGetHbit (ic);
+      break;
+
+  case LEFT_OP:
+      genLeftShift (ic);
+      break;
+
+  case RIGHT_OP:
+      genRightShift (ic);
+      break;
+
+  case GET_VALUE_AT_ADDRESS:
+      genPointerGet(ic);
+      break;
+
+  case '=' :
+      if (POINTER_SET(ic))
+    genPointerSet(ic);
+      else
+    genAssign(ic);
+      break;
+
+  case IFX:
+      genIfx (ic,NULL);
+      break;
+
+  case ADDRESS_OF:
+      genAddrOf (ic);
+      break;
+
+  case JUMPTABLE:
+      genJumpTab (ic);
+      break;
+
+  case CAST:
+      genCast (ic);
+      break;
+
+  case RECEIVE:
+      genReceive(ic);
+      break;
+
+  case SEND:
+      addSet(&_G.sendSet,ic);
+      break;
+
+  default :
+      ic = ic;
+      /*      piCode(ic,stdout); */
+
         }
     }
-    
 
-    /* now we are ready to call the 
+
+    /* now we are ready to call the
        peep hole optimizer */
     if (!options.nopeep) {
       printf("peep hole optimizing\n");
-       peepHole (&lineHead);
+  peepHole (&lineHead);
     }
     /* now do the actual printing */
     printLine (lineHead,codeOutFile);
index e34d8081935198a407a246e9e7352fc387d08220..4be47c6b400b85e6a1bf84aa465660ece5a82ad7 100644 (file)
@@ -1,25 +1,25 @@
 /*-------------------------------------------------------------------------
 
-  SDCCglue.c - glues everything we have done together into one file.                 
+  SDCCglue.c - glues everything we have done together into one file.
                 Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
-               
+
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
 #include "../common.h"
@@ -61,10 +61,10 @@ static void emitRegularMap (memmap * map, bool addPublics, bool arFlag)
 value *initPointer (initList *ilist)
 void printIvalType (sym_link * type, initList * ilist, FILE * oFile)
 void printIvalStruct (symbol * sym,sym_link * type,
-                     initList * ilist, FILE * oFile)
+          initList * ilist, FILE * oFile)
 int printIvalChar (sym_link * type, initList * ilist, FILE * oFile, char *s)
 void printIvalArray (symbol * sym, sym_link * type, initList * ilist,
-                    FILE * oFile)
+         FILE * oFile)
 void printIvalFuncPtr (sym_link * type, initList * ilist, FILE * oFile)
 int printIvalCharPtr (symbol * sym, sym_link * type, value * val, FILE * oFile)
 void printIvalPtr (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
@@ -89,18 +89,18 @@ char *pic14aopLiteral (value *val, int offset)
 
         v >>= (offset * 8);
         sprintf(buffer,"0x%02x",((char) v) & 0xff);
-        rs = Safe_calloc(strlen(buffer)+1);
+        rs = Safe_calloc(1,strlen(buffer)+1);
         return strcpy (rs,buffer);
     }
 
     /* it is type float */
     fl.f = (float) floatFromVal(val);
-#ifdef _BIG_ENDIAN    
+#ifdef _BIG_ENDIAN
     sprintf(buffer,"0x%02x",fl.c[3-offset]);
 #else
     sprintf(buffer,"0x%02x",fl.c[offset]);
 #endif
-    rs = Safe_calloc(strlen(buffer)+1);
+    rs = Safe_calloc(1,strlen(buffer)+1);
     return strcpy (rs,buffer);
 }
 
@@ -115,106 +115,106 @@ static void pic14emitRegularMap (memmap * map, bool addPublics, bool arFlag)
 
     if (addPublics)
       fprintf (map->oFile, ";\t.area\t%s\n", map->sname);
-    
+
     /* print the area name */
     for (sym = setFirstItem (map->syms); sym;
-        sym = setNextItem (map->syms))  {
-       
-       /* if extern then do nothing */
-       if (IS_EXTERN (sym->etype))
-           continue;
-       
-       /* if allocation required check is needed
-          then check if the symbol really requires
-          allocation only for local variables */
-       if (arFlag && !IS_AGGREGATE(sym->type) &&
-           !(sym->_isparm && !IS_REGPARM(sym->etype)) && 
-             !sym->allocreq && sym->level)
-           continue ;
-       
-       /* if global variable & not static or extern 
-          and addPublics allowed then add it to the public set */
-       if ((sym->level == 0 || 
-            (sym->_isparm && !IS_REGPARM(sym->etype))) &&
-           addPublics &&
-           !IS_STATIC (sym->etype))
-           addSetHead (&publics, sym);
-       
-       /* if extern then do nothing or is a function 
-          then do nothing */
-       if (IS_FUNC (sym->type))
-           continue;
-#if 0  
-       /* print extra debug info if required */
-       if (options.debug || sym->level == 0) {
-
-           cdbSymbol(sym,cdbFile,FALSE,FALSE);
-
-           if (!sym->level) /* global */
-               if (IS_STATIC(sym->etype))
-                   fprintf(map->oFile,"F%s_",moduleName); /* scope is file */
-               else
-                   fprintf(map->oFile,"G_"); /* scope is global */
-           else
-               /* symbol is local */
-               fprintf(map->oFile,"L%s_",(sym->localof ? sym->localof->name : "-null-"));
-           fprintf(map->oFile,"%s_%d_%d",sym->name,sym->level,sym->block);
-       }
+   sym = setNextItem (map->syms))  {
+
+  /* if extern then do nothing */
+  if (IS_EXTERN (sym->etype))
+      continue;
+
+  /* if allocation required check is needed
+     then check if the symbol really requires
+     allocation only for local variables */
+  if (arFlag && !IS_AGGREGATE(sym->type) &&
+      !(sym->_isparm && !IS_REGPARM(sym->etype)) &&
+        !sym->allocreq && sym->level)
+      continue ;
+
+  /* if global variable & not static or extern
+     and addPublics allowed then add it to the public set */
+  if ((sym->level == 0 ||
+       (sym->_isparm && !IS_REGPARM(sym->etype))) &&
+      addPublics &&
+      !IS_STATIC (sym->etype))
+      addSetHead (&publics, sym);
+
+  /* if extern then do nothing or is a function
+     then do nothing */
+  if (IS_FUNC (sym->type))
+      continue;
+#if 0
+  /* print extra debug info if required */
+  if (options.debug || sym->level == 0) {
+
+      cdbSymbol(sym,cdbFile,FALSE,FALSE);
+
+      if (!sym->level) /* global */
+    if (IS_STATIC(sym->etype))
+        fprintf(map->oFile,"F%s_",moduleName); /* scope is file */
+    else
+        fprintf(map->oFile,"G_"); /* scope is global */
+      else
+    /* symbol is local */
+    fprintf(map->oFile,"L%s_",(sym->localof ? sym->localof->name : "-null-"));
+      fprintf(map->oFile,"%s_%d_%d",sym->name,sym->level,sym->block);
+  }
 #endif
 
-       /* if is has an absolute address then generate
-          an equate for this no need to allocate space */
-       if (SPEC_ABSA (sym->etype)) {
-         //if (options.debug || sym->level == 0)
-         //fprintf (map->oFile,"; == 0x%04x\n",SPEC_ADDR (sym->etype));            
-
-           fprintf (map->oFile, "%s\tEQU\t0x%04x\n",
-                    sym->rname,
-                    SPEC_ADDR (sym->etype));
-       }
-       else {
-           /* allocate space */
-
-         /* If this is a bit variable, then allocate storage after 8 bits have been declared */
-         /* unlike the 8051, the pic does not have a separate bit area. So we emulate bit ram */
-         /* by grouping the bits together into groups of 8 and storing them in the normal ram.*/
-         if(IS_BITVAR(sym->etype)) {
-           if((bitvars % 8) == 0) {
-             fprintf (map->oFile, "  cblock\n");
-             fprintf (map->oFile, "\tbitfield%d\n", bitvars);
-             fprintf (map->oFile, "  endc\n");
-           }
-
-           fprintf (map->oFile, "%s\tEQU\t( (bitfield%d<<3)+%d)\n",
-                    sym->rname,
-                    bitvars & 0xfff8,
-                    bitvars & 0x0007);
-             
-           bitvars++;
-         } else {
-           fprintf (map->oFile, "\t%s\n", sym->rname);
-           if( (size = (unsigned int)getSize (sym->type) & 0xffff)>1) {
-             for(i=1; i<size; i++)
-               fprintf (map->oFile, "\t%s_%d\n", sym->rname,i);
-           }
-         }
-             //fprintf (map->oFile, "\t.ds\t0x%04x\n", (unsigned int)getSize (sym->type) & 0xffff);
-       }
-       
-       /* if it has a initial value then do it only if
-          it is a global variable */
-       if (sym->ival && sym->level == 0) {
-           ast *ival = NULL;
-           
-           if (IS_AGGREGATE (sym->type))
-               ival = initAggregates (sym, sym->ival, NULL);
-           else
-               ival = newNode ('=', newAst_VALUE(symbolVal (sym)),
-                               decorateType (resolveSymbols (list2expr (sym->ival))));
-           codeOutFile = statsg->oFile;
-           eBBlockFromiCode (iCodeFromAst (ival));
-           sym->ival = NULL;
-       }
+  /* if is has an absolute address then generate
+     an equate for this no need to allocate space */
+  if (SPEC_ABSA (sym->etype)) {
+    //if (options.debug || sym->level == 0)
+    //fprintf (map->oFile,"; == 0x%04x\n",SPEC_ADDR (sym->etype));
+
+      fprintf (map->oFile, "%s\tEQU\t0x%04x\n",
+         sym->rname,
+         SPEC_ADDR (sym->etype));
+  }
+  else {
+      /* allocate space */
+
+    /* If this is a bit variable, then allocate storage after 8 bits have been declared */
+    /* unlike the 8051, the pic does not have a separate bit area. So we emulate bit ram */
+    /* by grouping the bits together into groups of 8 and storing them in the normal ram.*/
+    if(IS_BITVAR(sym->etype)) {
+      if((bitvars % 8) == 0) {
+        fprintf (map->oFile, "  cblock\n");
+        fprintf (map->oFile, "\tbitfield%d\n", bitvars);
+        fprintf (map->oFile, "  endc\n");
+      }
+
+      fprintf (map->oFile, "%s\tEQU\t( (bitfield%d<<3)+%d)\n",
+         sym->rname,
+         bitvars & 0xfff8,
+         bitvars & 0x0007);
+
+      bitvars++;
+    } else {
+      fprintf (map->oFile, "\t%s\n", sym->rname);
+      if( (size = (unsigned int)getSize (sym->type) & 0xffff)>1) {
+        for(i=1; i<size; i++)
+    fprintf (map->oFile, "\t%s_%d\n", sym->rname,i);
+      }
+    }
+        //fprintf (map->oFile, "\t.ds\t0x%04x\n", (unsigned int)getSize (sym->type) & 0xffff);
+  }
+
+  /* if it has a initial value then do it only if
+     it is a global variable */
+  if (sym->ival && sym->level == 0) {
+      ast *ival = NULL;
+
+      if (IS_AGGREGATE (sym->type))
+    ival = initAggregates (sym, sym->ival, NULL);
+      else
+    ival = newNode ('=', newAst_VALUE(symbolVal (sym)),
+        decorateType (resolveSymbols (list2expr (sym->ival))));
+      codeOutFile = statsg->oFile;
+      eBBlockFromiCode (iCodeFromAst (ival));
+      sym->ival = NULL;
+  }
     }
 }
 
@@ -228,69 +228,69 @@ value *initPointer (initList *ilist)
     value *val;
     ast *expr = list2expr(ilist);
 
-    if (!expr) 
-       goto wrong;             
-       
+    if (!expr)
+  goto wrong;
+
     /* try it the oldway first */
     if ((val = constExprValue(expr,FALSE)))
-       return val;
+  return val;
 
     /* no then we have to do these cludgy checks */
     /* pointers can be initialized with address of
        a variable or address of an array element */
     if (IS_AST_OP(expr) && expr->opval.op == '&') {
-       /* address of symbol */
-       if (IS_AST_SYM_VALUE(expr->left)) {
-           val = copyValue(AST_VALUE(expr->left));
-           val->type = newLink();
-           if (SPEC_SCLS(expr->left->etype) == S_CODE) {
-               DCL_TYPE(val->type) = CPOINTER ;
-               DCL_PTR_CONST(val->type) = port->mem.code_ro;
-           }
-           else
-               if (SPEC_SCLS(expr->left->etype) == S_XDATA)
-                   DCL_TYPE(val->type) = FPOINTER;
-               else
-                   if (SPEC_SCLS(expr->left->etype) == S_XSTACK )
-                       DCL_TYPE(val->type) = PPOINTER ;
-                   else
-                       if (SPEC_SCLS(expr->left->etype) == S_IDATA)
-                           DCL_TYPE(val->type) = IPOINTER ;
-                       else
-                           if (SPEC_SCLS(expr->left->etype) == S_EEPROM)
-                               DCL_TYPE(val->type) = EEPPOINTER ;
-                           else
-                               DCL_TYPE(val->type) = POINTER ;
-           val->type->next = expr->left->ftype;
-           val->etype = getSpec(val->type);
-           return val;
-       }
-
-       /* if address of indexed array */
-       if (IS_AST_OP(expr->left) && expr->left->opval.op == '[')
-           return valForArray(expr->left);     
-
-       /* if address of structure element then 
-          case 1. a.b ; */
-       if (IS_AST_OP(expr->left) && 
-           expr->left->opval.op == '.' ) {
-               return valForStructElem(expr->left->left,
-                                       expr->left->right);
-       }
-
-       /* case 2. (&a)->b ; 
-          (&some_struct)->element */
-       if (IS_AST_OP(expr->left) &&
-           expr->left->opval.op == PTR_OP &&
-           IS_ADDRESS_OF_OP(expr->left->left))
-               return valForStructElem(expr->left->left->left,
-                                       expr->left->right);     
+  /* address of symbol */
+  if (IS_AST_SYM_VALUE(expr->left)) {
+      val = copyValue(AST_VALUE(expr->left));
+      val->type = newLink();
+      if (SPEC_SCLS(expr->left->etype) == S_CODE) {
+    DCL_TYPE(val->type) = CPOINTER ;
+    DCL_PTR_CONST(val->type) = port->mem.code_ro;
+      }
+      else
+    if (SPEC_SCLS(expr->left->etype) == S_XDATA)
+        DCL_TYPE(val->type) = FPOINTER;
+    else
+        if (SPEC_SCLS(expr->left->etype) == S_XSTACK )
+      DCL_TYPE(val->type) = PPOINTER ;
+        else
+      if (SPEC_SCLS(expr->left->etype) == S_IDATA)
+          DCL_TYPE(val->type) = IPOINTER ;
+      else
+          if (SPEC_SCLS(expr->left->etype) == S_EEPROM)
+        DCL_TYPE(val->type) = EEPPOINTER ;
+          else
+        DCL_TYPE(val->type) = POINTER ;
+      val->type->next = expr->left->ftype;
+      val->etype = getSpec(val->type);
+      return val;
+  }
+
+  /* if address of indexed array */
+  if (IS_AST_OP(expr->left) && expr->left->opval.op == '[')
+      return valForArray(expr->left);
+
+  /* if address of structure element then
+     case 1. a.b ; */
+  if (IS_AST_OP(expr->left) &&
+      expr->left->opval.op == '.' ) {
+    return valForStructElem(expr->left->left,
+          expr->left->right);
+  }
+
+  /* case 2. (&a)->b ;
+     (&some_struct)->element */
+  if (IS_AST_OP(expr->left) &&
+      expr->left->opval.op == PTR_OP &&
+      IS_ADDRESS_OF_OP(expr->left->left))
+    return valForStructElem(expr->left->left->left,
+          expr->left->right);
     }
 
- wrong:    
+ wrong:
     werror(E_INIT_WRONG);
     return NULL;
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -301,29 +301,29 @@ void printChar (FILE * ofile, char *s, int plen)
     int i;
     int len = strlen (s);
     int pplen = 0;
-    
+
     while (len && pplen < plen) {
 
-       fprintf (ofile, "\t.ascii /");
-       i = 60;
-       while (i && *s && pplen < plen) {
-           if (*s < ' ' || *s == '/') {               
-               fprintf (ofile, "/\n\t.byte 0x%02x\n\t.ascii /", *s++);
-           }
-           else 
-               fprintf (ofile, "%c", *s++);
-           pplen++;
-           i--;
-       }
-       fprintf (ofile, "/\n");
-       
-       if (len > 60)
-           len -= 60;
-       else
-           len = 0;
+  fprintf (ofile, "\t.ascii /");
+  i = 60;
+  while (i && *s && pplen < plen) {
+      if (*s < ' ' || *s == '/') {
+    fprintf (ofile, "/\n\t.byte 0x%02x\n\t.ascii /", *s++);
+      }
+      else
+    fprintf (ofile, "%c", *s++);
+      pplen++;
+      i--;
+  }
+  fprintf (ofile, "/\n");
+
+  if (len > 60)
+      len -= 60;
+  else
+      len = 0;
     }
     if (pplen < plen)
-       fprintf(ofile,"\t.byte\t0\n");
+  fprintf(ofile,"\t.byte\t0\n");
 }
 
 /*-----------------------------------------------------------------*/
@@ -332,39 +332,39 @@ void printChar (FILE * ofile, char *s, int plen)
 void printIvalType (sym_link * type, initList * ilist, FILE * oFile)
 {
     value *val;
-    
+
     /* if initList is deep */
     if (ilist->type == INIT_DEEP)
-       ilist = ilist->init.deep;
-    
+  ilist = ilist->init.deep;
+
     val = list2val (ilist);
     switch (getSize (type)) {
     case 1:
-       if (!val)
-           fprintf (oFile, "\t.byte 0\n");
-       else
-           fprintf (oFile, "\t.byte %s\n",
-                    aopLiteral (val, 0));
-       break;
+  if (!val)
+      fprintf (oFile, "\t.byte 0\n");
+  else
+      fprintf (oFile, "\t.byte %s\n",
+         aopLiteral (val, 0));
+  break;
 
     case 2:
-       if (!val)
-           fprintf (oFile, "\t.word 0\n");
-       else
-           fprintf (oFile, "\t.byte %s,%s\n",
-                    aopLiteral (val, 0), aopLiteral (val, 1));
-       break;
+  if (!val)
+      fprintf (oFile, "\t.word 0\n");
+  else
+      fprintf (oFile, "\t.byte %s,%s\n",
+         aopLiteral (val, 0), aopLiteral (val, 1));
+  break;
 
     case 4:
-       if (!val)
-           fprintf (oFile, "\t.word 0,0\n");
-       else
-           fprintf (oFile, "\t.byte %s,%s,%s,%s\n",
-                    aopLiteral (val, 0), aopLiteral (val, 1),
-                    aopLiteral (val, 2), aopLiteral (val, 3));
-       break;
+  if (!val)
+      fprintf (oFile, "\t.word 0,0\n");
+  else
+      fprintf (oFile, "\t.byte %s,%s,%s,%s\n",
+         aopLiteral (val, 0), aopLiteral (val, 1),
+         aopLiteral (val, 2), aopLiteral (val, 3));
+  break;
     }
-    
+
     return;
 }
 
@@ -372,22 +372,22 @@ void printIvalType (sym_link * type, initList * ilist, FILE * oFile)
 /* printIvalStruct - generates initial value for structures        */
 /*-----------------------------------------------------------------*/
 void printIvalStruct (symbol * sym,sym_link * type,
-                     initList * ilist, FILE * oFile)
+          initList * ilist, FILE * oFile)
 {
     symbol *sflds;
     initList *iloop;
-    
+
     sflds = SPEC_STRUCT (type)->fields;
     if (ilist->type != INIT_DEEP) {
-       werror (E_INIT_STRUCT, sym->name);
-       return;
+  werror (E_INIT_STRUCT, sym->name);
+  return;
     }
-    
+
     iloop = ilist->init.deep;
-    
+
     for (; sflds; sflds = sflds->next, iloop = (iloop ? iloop->next : NULL))
-       printIval (sflds, sflds->type, iloop, oFile);
-    
+  printIval (sflds, sflds->type, iloop, oFile);
+
     return;
 }
 
@@ -398,32 +398,32 @@ int printIvalChar (sym_link * type, initList * ilist, FILE * oFile, char *s)
 {
     value *val;
     int remain;
-    
+
     if (!s) {
-       
-       val = list2val (ilist);
-       /* if the value is a character string  */
-       if (IS_ARRAY (val->type) && IS_CHAR (val->etype)) {
-           if (!DCL_ELEM (type))
-               DCL_ELEM (type) = strlen (SPEC_CVAL (val->etype).v_char) + 1;
-           
-           /* if size mismatch  */
-/*         if (DCL_ELEM (type) < ((int) strlen (SPEC_CVAL (val->etype).v_char) + 1)) */
-/*             werror (E_ARRAY_BOUND); */
-           
-           printChar (oFile, SPEC_CVAL (val->etype).v_char,DCL_ELEM(type));
-           
-           if ((remain = (DCL_ELEM (type) - strlen (SPEC_CVAL (val->etype).v_char) -1))>0)
-               while (remain--)
-                   fprintf (oFile, "\t.byte 0\n");
-           
-           return 1;
-       }
-       else
-           return 0;
+
+  val = list2val (ilist);
+  /* if the value is a character string  */
+  if (IS_ARRAY (val->type) && IS_CHAR (val->etype)) {
+      if (!DCL_ELEM (type))
+    DCL_ELEM (type) = strlen (SPEC_CVAL (val->etype).v_char) + 1;
+
+      /* if size mismatch  */
+/*      if (DCL_ELEM (type) < ((int) strlen (SPEC_CVAL (val->etype).v_char) + 1)) */
+/*    werror (E_ARRAY_BOUND); */
+
+      printChar (oFile, SPEC_CVAL (val->etype).v_char,DCL_ELEM(type));
+
+      if ((remain = (DCL_ELEM (type) - strlen (SPEC_CVAL (val->etype).v_char) -1))>0)
+    while (remain--)
+        fprintf (oFile, "\t.byte 0\n");
+
+      return 1;
+  }
+  else
+      return 0;
     }
     else
-       printChar (oFile, s,strlen(s)+1);
+  printChar (oFile, s,strlen(s)+1);
     return 1;
 }
 
@@ -431,50 +431,50 @@ int printIvalChar (sym_link * type, initList * ilist, FILE * oFile, char *s)
 /* printIvalArray - generates code for array initialization        */
 /*-----------------------------------------------------------------*/
 void printIvalArray (symbol * sym, sym_link * type, initList * ilist,
-                    FILE * oFile)
+         FILE * oFile)
 {
     initList *iloop;
     int lcnt = 0, size = 0;
-    
+
     /* take care of the special   case  */
     /* array of characters can be init  */
     /* by a string                      */
     if (IS_CHAR (type->next))
-       if (printIvalChar (type,
-                          (ilist->type == INIT_DEEP ? ilist->init.deep : ilist),
-                          oFile, SPEC_CVAL (sym->etype).v_char))
-           return;
-    
+  if (printIvalChar (type,
+         (ilist->type == INIT_DEEP ? ilist->init.deep : ilist),
+         oFile, SPEC_CVAL (sym->etype).v_char))
+      return;
+
     /* not the special case             */
     if (ilist->type != INIT_DEEP) {
-       werror (E_INIT_STRUCT, sym->name);
-       return;
+  werror (E_INIT_STRUCT, sym->name);
+  return;
     }
-    
+
     iloop = ilist->init.deep;
     lcnt = DCL_ELEM (type);
-    
+
     for (;;) {
-       size++;
-       printIval (sym, type->next, iloop, oFile);
-       iloop = (iloop ? iloop->next : NULL);
-       
-       
-       /* if not array limits given & we */
-       /* are out of initialisers then   */
-       if (!DCL_ELEM (type) && !iloop)
-           break;
-       
-       /* no of elements given and we    */
-       /* have generated for all of them */
-       if (!--lcnt)
-           break;
+  size++;
+  printIval (sym, type->next, iloop, oFile);
+  iloop = (iloop ? iloop->next : NULL);
+
+
+  /* if not array limits given & we */
+  /* are out of initialisers then   */
+  if (!DCL_ELEM (type) && !iloop)
+      break;
+
+  /* no of elements given and we    */
+  /* have generated for all of them */
+  if (!--lcnt)
+      break;
     }
-    
+
     /* if we have not been given a size  */
     if (!DCL_ELEM (type))
-       DCL_ELEM (type) = size;
-    
+  DCL_ELEM (type) = size;
+
     return;
 }
 
@@ -485,28 +485,28 @@ void printIvalFuncPtr (sym_link * type, initList * ilist, FILE * oFile)
 {
     value *val;
     int dLvl = 0;
-    
+
     val = list2val (ilist);
     /* check the types   */
     if ((dLvl = checkType (val->type, type->next)) <= 0) {
-       
-       fprintf (oFile, "\t.word 0\n");
-       return;
+
+  fprintf (oFile, "\t.word 0\n");
+  return;
     }
-    
+
     /* now generate the name */
     if (!val->sym) {
-       if (IS_LITERAL (val->etype))
-           fprintf (oFile, "\t.byte %s,%s\n",
-                    aopLiteral (val, 0), aopLiteral (val, 1));
-       else
-           fprintf (oFile, "\t.byte %s,(%s >> 8)\n",
-                    val->name, val->name);
+  if (IS_LITERAL (val->etype))
+      fprintf (oFile, "\t.byte %s,%s\n",
+         aopLiteral (val, 0), aopLiteral (val, 1));
+  else
+      fprintf (oFile, "\t.byte %s,(%s >> 8)\n",
+         val->name, val->name);
     }
-    else 
-       fprintf (oFile, "\t.byte %s,(%s >> 8)\n",
-                val->sym->rname, val->sym->rname);
-    
+    else
+  fprintf (oFile, "\t.byte %s,(%s >> 8)\n",
+     val->sym->rname, val->sym->rname);
+
     return;
 }
 
@@ -516,25 +516,25 @@ void printIvalFuncPtr (sym_link * type, initList * ilist, FILE * oFile)
 int printIvalCharPtr (symbol * sym, sym_link * type, value * val, FILE * oFile)
 {
     int size = 0;
-    
+
     size = getSize (type);
-    
+
     if (size == 1)
-       fprintf(oFile,
-            "\t.byte %s", val->name) ;
+  fprintf(oFile,
+       "\t.byte %s", val->name) ;
     else
-       fprintf (oFile,
-                "\t.byte %s,(%s >> 8)",
-                val->name, val->name);
-   
+  fprintf (oFile,
+     "\t.byte %s,(%s >> 8)",
+     val->name, val->name);
+
     if (size > 2)
-       fprintf (oFile, ",#0x02\n");
+  fprintf (oFile, ",#0x02\n");
     else
-       fprintf (oFile, "\n");
-    
+  fprintf (oFile, "\n");
+
     if (val->sym && val->sym->isstrlit)
-       addSet (&statsg->syms, val->sym);
-    
+  addSet (&statsg->syms, val->sym);
+
     return 1;
 }
 
@@ -544,59 +544,59 @@ int printIvalCharPtr (symbol * sym, sym_link * type, value * val, FILE * oFile)
 void printIvalPtr (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
 {
     value *val;
-    
+
     /* if deep then   */
     if (ilist->type == INIT_DEEP)
-       ilist = ilist->init.deep;
-    
+  ilist = ilist->init.deep;
+
     /* function pointer     */
     if (IS_FUNC (type->next)) {
-       printIvalFuncPtr (type, ilist, oFile);
-       return;
+  printIvalFuncPtr (type, ilist, oFile);
+  return;
     }
-    
+
     if (!(val = initPointer (ilist)))
-       return ;
+  return ;
 
     /* if character pointer */
     if (IS_CHAR (type->next))
-       if (printIvalCharPtr (sym, type, val, oFile))
-           return;
-    
+  if (printIvalCharPtr (sym, type, val, oFile))
+      return;
+
     /* check the type      */
     if (checkType (type, val->type) != 1)
-       werror (E_INIT_WRONG);
-    
+  werror (E_INIT_WRONG);
+
     /* if val is literal */
     if (IS_LITERAL (val->etype)) {
-       switch (getSize (type)) {
-       case 1:
-           fprintf (oFile, "\t.byte 0x%02x\n", ((char) floatFromVal (val)) & 0xff);
-           break;
-       case 2:
-           fprintf (oFile, "\t.byte %s,%s\n",
-                    aopLiteral (val, 0), aopLiteral (val, 1));
-           
-           break;
-       case 3:
-           fprintf (oFile, "\t.byte %s,%s,0x%02x\n",
-                    aopLiteral (val, 0), aopLiteral (val, 1), CPOINTER);
-       }
-       return;
+  switch (getSize (type)) {
+  case 1:
+      fprintf (oFile, "\t.byte 0x%02x\n", ((char) floatFromVal (val)) & 0xff);
+      break;
+  case 2:
+      fprintf (oFile, "\t.byte %s,%s\n",
+         aopLiteral (val, 0), aopLiteral (val, 1));
+
+      break;
+  case 3:
+      fprintf (oFile, "\t.byte %s,%s,0x%02x\n",
+         aopLiteral (val, 0), aopLiteral (val, 1), CPOINTER);
+  }
+  return;
     }
-    
-    
+
+
     switch (getSize (type)) {
     case 1:
-       fprintf (oFile, "\t.byte %s\n", val->name);
-       break;
+  fprintf (oFile, "\t.byte %s\n", val->name);
+  break;
     case 2:
-       fprintf (oFile, "\t.byte %s,(%s >> 8)\n", val->name, val->name);
-       break;
-       
+  fprintf (oFile, "\t.byte %s,(%s >> 8)\n", val->name, val->name);
+  break;
+
     case 3:
-       fprintf (oFile, "\t.byte %s,(%s >> 8),0x%02x\n",
-                val->name, val->name, DCL_TYPE(val->type));
+  fprintf (oFile, "\t.byte %s,(%s >> 8),0x%02x\n",
+     val->name, val->name, DCL_TYPE(val->type));
     }
     return;
 }
@@ -607,30 +607,30 @@ void printIvalPtr (symbol * sym, sym_link * type, initList * ilist, FILE * oFile
 void printIval (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
 {
     if (!ilist)
-       return;    
-    
+  return;
+
     /* if structure then    */
     if (IS_STRUCT (type)) {
-       printIvalStruct (sym, type, ilist, oFile);
-       return;
+  printIvalStruct (sym, type, ilist, oFile);
+  return;
     }
-    
+
     /* if this is a pointer */
     if (IS_PTR (type)) {
-       printIvalPtr (sym, type, ilist, oFile);
-       return;
+  printIvalPtr (sym, type, ilist, oFile);
+  return;
     }
-    
+
     /* if this is an array   */
     if (IS_ARRAY (type)) {
-       printIvalArray (sym, type, ilist, oFile);
-       return;
+  printIvalArray (sym, type, ilist, oFile);
+  return;
     }
-    
+
     /* if type is SPECIFIER */
     if (IS_SPEC (type)) {
-       printIvalType (type, ilist, oFile);
-       return;
+  printIvalType (type, ilist, oFile);
+  return;
     }
 }
 
@@ -641,75 +641,75 @@ void printIval (symbol * sym, sym_link * type, initList * ilist, FILE * oFile)
 static void pic14emitStaticSeg (memmap * map)
 {
     symbol *sym;
-    
+
     fprintf(map->oFile,";\t.area\t%s\n",map->sname);
-    
-    
+
+
     /* for all variables in this segment do */
     for (sym = setFirstItem (map->syms); sym;
-        sym = setNextItem (map->syms)) {
-       
-       /* if it is "extern" then do nothing */
-       if (IS_EXTERN (sym->etype))
-           continue;
-       
-       /* if it is not static add it to the public
-          table */
-       if (!IS_STATIC (sym->etype))
-           addSetHead (&publics, sym);
-
-       /* print extra debug info if required */
-       if (options.debug || sym->level == 0) {
-
-           cdbSymbol(sym,cdbFile,FALSE,FALSE);
-
-           if (!sym->level) { /* global */
-               if (IS_STATIC(sym->etype))
-                   fprintf(code->oFile,"F%s_",moduleName); /* scope is file */
-               else
-                   fprintf(code->oFile,"G_"); /* scope is global */
-           }
-           else
-               /* symbol is local */
-               fprintf(code->oFile,"L%s_",
-                       (sym->localof ? sym->localof->name : "-null-"));
-           fprintf(code->oFile,"%s_%d_%d",sym->name,sym->level,sym->block);
-       }
-
-       /* if it has an absolute address */
-       if (SPEC_ABSA (sym->etype)) {
-           if (options.debug || sym->level == 0)
-               fprintf(code->oFile," == 0x%04x\n", SPEC_ADDR (sym->etype));
-
-           fprintf (code->oFile, "%s\t=\t0x%04x\n",
-                    sym->rname,
-                    SPEC_ADDR (sym->etype));
-       }
-       else {
-           if (options.debug || sym->level == 0)
-               fprintf(code->oFile," == .\n"); 
-
-           /* if it has an initial value */
-           if (sym->ival) {
-               fprintf (code->oFile, "%s:\n", sym->rname);
-               noAlloc++;
-               resolveIvalSym (sym->ival);
-               printIval (sym, sym->type, sym->ival, code->oFile);
-               noAlloc--;
-           }
-           else {
-               /* allocate space */
-               fprintf (code->oFile, "%s:\n", sym->rname);
-               /* special case for character strings */
-               if (IS_ARRAY (sym->type) && IS_CHAR (sym->type->next) &&
-                   SPEC_CVAL (sym->etype).v_char)
-                   printChar (code->oFile,
-                              SPEC_CVAL (sym->etype).v_char,
-                              strlen(SPEC_CVAL (sym->etype).v_char)+1);
-               else
-                   fprintf (code->oFile, "\t.ds\t0x%04x\n", (unsigned int)getSize (sym->type)& 0xffff);
-           }
-       }
+   sym = setNextItem (map->syms)) {
+
+  /* if it is "extern" then do nothing */
+  if (IS_EXTERN (sym->etype))
+      continue;
+
+  /* if it is not static add it to the public
+     table */
+  if (!IS_STATIC (sym->etype))
+      addSetHead (&publics, sym);
+
+  /* print extra debug info if required */
+  if (options.debug || sym->level == 0) {
+
+      cdbSymbol(sym,cdbFile,FALSE,FALSE);
+
+      if (!sym->level) { /* global */
+    if (IS_STATIC(sym->etype))
+        fprintf(code->oFile,"F%s_",moduleName); /* scope is file */
+    else
+        fprintf(code->oFile,"G_"); /* scope is global */
+      }
+      else
+    /* symbol is local */
+    fprintf(code->oFile,"L%s_",
+      (sym->localof ? sym->localof->name : "-null-"));
+      fprintf(code->oFile,"%s_%d_%d",sym->name,sym->level,sym->block);
+  }
+
+  /* if it has an absolute address */
+  if (SPEC_ABSA (sym->etype)) {
+      if (options.debug || sym->level == 0)
+    fprintf(code->oFile," == 0x%04x\n", SPEC_ADDR (sym->etype));
+
+      fprintf (code->oFile, "%s\t=\t0x%04x\n",
+         sym->rname,
+         SPEC_ADDR (sym->etype));
+  }
+  else {
+      if (options.debug || sym->level == 0)
+    fprintf(code->oFile," == .\n");
+
+      /* if it has an initial value */
+      if (sym->ival) {
+    fprintf (code->oFile, "%s:\n", sym->rname);
+    noAlloc++;
+    resolveIvalSym (sym->ival);
+    printIval (sym, sym->type, sym->ival, code->oFile);
+    noAlloc--;
+      }
+      else {
+    /* allocate space */
+    fprintf (code->oFile, "%s:\n", sym->rname);
+    /* special case for character strings */
+    if (IS_ARRAY (sym->type) && IS_CHAR (sym->type->next) &&
+        SPEC_CVAL (sym->etype).v_char)
+        printChar (code->oFile,
+             SPEC_CVAL (sym->etype).v_char,
+             strlen(SPEC_CVAL (sym->etype).v_char)+1);
+    else
+        fprintf (code->oFile, "\t.ds\t0x%04x\n", (unsigned int)getSize (sym->type)& 0xffff);
+      }
+  }
     }
 }
 
@@ -739,43 +739,43 @@ static void pic14createInterruptVect (FILE * vFile)
     int i = 0;
     mainf = newSymbol ("main", 0);
     mainf->block = 0;
-    
+
     /* only if the main function exists */
     if (!(mainf = findSymWithLevel (SymbolTab, mainf))) {
-       if (!options.cc_only)
-           werror(E_NO_MAIN);
-       return;
+  if (!options.cc_only)
+      werror(E_NO_MAIN);
+  return;
     }
-    
+
     /* if the main is only a prototype ie. no body then do nothing */
     if (!mainf->fbody) {
-       /* if ! compile only then main function should be present */
-       if (!options.cc_only)
-           werror(E_NO_MAIN);
-       return;
+  /* if ! compile only then main function should be present */
+  if (!options.cc_only)
+      werror(E_NO_MAIN);
+  return;
     }
-    
+
     fprintf (vFile, ";\t.area\t%s\n", CODE_NAME);
     fprintf (vFile, ";__interrupt_vect:\n");
 
-    
+
     if (!port->genIVT || ! (port->genIVT(vFile, interrupts, maxInterrupts)))
     {
         /* "generic" interrupt table header (if port doesn't specify one).
          *
          * Look suspiciously like 8051 code to me...
          */
-    
-       fprintf (vFile, ";\tljmp\t__sdcc_gsinit_startup\n");
-    
-    
-       /* now for the other interrupts */
-       for (; i < maxInterrupts; i++) {
-               if (interrupts[i])
-                       fprintf (vFile, ";\tljmp\t%s\n\t.ds\t5\n", interrupts[i]->rname);
-               else
-                       fprintf (vFile, ";\treti\n;\t.ds\t7\n");
-       }
+
+      fprintf (vFile, ";\tljmp\t__sdcc_gsinit_startup\n");
+
+
+      /* now for the other interrupts */
+      for (; i < maxInterrupts; i++) {
+    if (interrupts[i])
+          fprintf (vFile, ";\tljmp\t%s\n\t.ds\t5\n", interrupts[i]->rname);
+    else
+          fprintf (vFile, ";\treti\n;\t.ds\t7\n");
+      }
     }
 }
 
@@ -797,14 +797,14 @@ static void pic14initialComments (FILE * afile)
 static void pic14printPublics (FILE * afile)
 {
     symbol *sym;
-    
+
     fprintf (afile, "%s", iComments2);
     fprintf (afile, "; publics variables in this module\n");
     fprintf (afile, "%s", iComments2);
-    
+
     for (sym = setFirstItem (publics); sym;
-        sym = setNextItem (publics))
-       fprintf (afile, ";\t.globl %s\n", sym->rname);
+   sym = setNextItem (publics))
+  fprintf (afile, ";\t.globl %s\n", sym->rname);
 }
 
 
@@ -815,91 +815,91 @@ static void pic14printPublics (FILE * afile)
 static void pic14emitOverlay(FILE *afile)
 {
     set *ovrset;
-    
+
     if (!elementsInSet(ovrSetSets))
-       fprintf(afile,";\t.area\t%s\n", port->mem.overlay_name);
+  fprintf(afile,";\t.area\t%s\n", port->mem.overlay_name);
 
     /* for each of the sets in the overlay segment do */
     for (ovrset = setFirstItem(ovrSetSets); ovrset;
-        ovrset = setNextItem(ovrSetSets)) {
-
-       symbol *sym ;
-
-       if (elementsInSet(ovrset)) {
-           /* this dummy area is used to fool the assembler
-              otherwise the assembler will append each of these
-              declarations into one chunk and will not overlay 
-              sad but true */
-           fprintf(afile,";\t.area _DUMMY\n");
-           /* output the area informtion */
-           fprintf(afile,";\t.area\t%s\n", port->mem.overlay_name); /* MOF */
-       }
-       
-       for (sym = setFirstItem(ovrset); sym;
-            sym = setNextItem(ovrset)) {
-       
-           /* if extern then do nothing */
-           if (IS_EXTERN (sym->etype))
-               continue;
-           
-           /* if allocation required check is needed
-              then check if the symbol really requires
-              allocation only for local variables */
-           if (!IS_AGGREGATE(sym->type) &&
-               !(sym->_isparm && !IS_REGPARM(sym->etype))
-               && !sym->allocreq && sym->level)
-               continue ;
-           
-           /* if global variable & not static or extern 
-              and addPublics allowed then add it to the public set */
-           if ((sym->_isparm && !IS_REGPARM(sym->etype))
-               && !IS_STATIC (sym->etype))
-               addSetHead (&publics, sym);
-           
-           /* if extern then do nothing or is a function 
-              then do nothing */
-           if (IS_FUNC (sym->type))
-               continue;
-
-           /* print extra debug info if required */
-           if (options.debug || sym->level == 0) {
-               
-               cdbSymbol(sym,cdbFile,FALSE,FALSE);
-               
-               if (!sym->level) { /* global */
-                   if (IS_STATIC(sym->etype))
-                       fprintf(afile,"F%s_",moduleName); /* scope is file */
-                   else
-                       fprintf(afile,"G_"); /* scope is global */
-               }
-               else
-                   /* symbol is local */
-                   fprintf(afile,"L%s_",
-                           (sym->localof ? sym->localof->name : "-null-"));
-               fprintf(afile,"%s_%d_%d",sym->name,sym->level,sym->block);
-           }
-           
-           /* if is has an absolute address then generate
-              an equate for this no need to allocate space */
-           if (SPEC_ABSA (sym->etype)) {
-               
-               if (options.debug || sym->level == 0)
-                   fprintf (afile," == 0x%04x\n",SPEC_ADDR (sym->etype));          
-
-               fprintf (afile, "%s\t=\t0x%04x\n",
-                        sym->rname,
-                        SPEC_ADDR (sym->etype));
-           }
-           else {
-               if (options.debug || sym->level == 0)
-                   fprintf(afile,"==.\n");
-       
-               /* allocate space */
-               fprintf (afile, "%s:\n", sym->rname);
-               fprintf (afile, "\t.ds\t0x%04x\n", (unsigned int)getSize (sym->type) & 0xffff);
-           }
-           
-       }
+   ovrset = setNextItem(ovrSetSets)) {
+
+  symbol *sym ;
+
+  if (elementsInSet(ovrset)) {
+      /* this dummy area is used to fool the assembler
+         otherwise the assembler will append each of these
+         declarations into one chunk and will not overlay
+         sad but true */
+      fprintf(afile,";\t.area _DUMMY\n");
+      /* output the area informtion */
+      fprintf(afile,";\t.area\t%s\n", port->mem.overlay_name); /* MOF */
+  }
+
+  for (sym = setFirstItem(ovrset); sym;
+       sym = setNextItem(ovrset)) {
+
+      /* if extern then do nothing */
+      if (IS_EXTERN (sym->etype))
+    continue;
+
+      /* if allocation required check is needed
+         then check if the symbol really requires
+         allocation only for local variables */
+      if (!IS_AGGREGATE(sym->type) &&
+    !(sym->_isparm && !IS_REGPARM(sym->etype))
+    && !sym->allocreq && sym->level)
+    continue ;
+
+      /* if global variable & not static or extern
+         and addPublics allowed then add it to the public set */
+      if ((sym->_isparm && !IS_REGPARM(sym->etype))
+    && !IS_STATIC (sym->etype))
+    addSetHead (&publics, sym);
+
+      /* if extern then do nothing or is a function
+         then do nothing */
+      if (IS_FUNC (sym->type))
+    continue;
+
+      /* print extra debug info if required */
+      if (options.debug || sym->level == 0) {
+
+    cdbSymbol(sym,cdbFile,FALSE,FALSE);
+
+    if (!sym->level) { /* global */
+        if (IS_STATIC(sym->etype))
+      fprintf(afile,"F%s_",moduleName); /* scope is file */
+        else
+      fprintf(afile,"G_"); /* scope is global */
+    }
+    else
+        /* symbol is local */
+        fprintf(afile,"L%s_",
+          (sym->localof ? sym->localof->name : "-null-"));
+    fprintf(afile,"%s_%d_%d",sym->name,sym->level,sym->block);
+      }
+
+      /* if is has an absolute address then generate
+         an equate for this no need to allocate space */
+      if (SPEC_ABSA (sym->etype)) {
+
+    if (options.debug || sym->level == 0)
+        fprintf (afile," == 0x%04x\n",SPEC_ADDR (sym->etype));
+
+    fprintf (afile, "%s\t=\t0x%04x\n",
+       sym->rname,
+       SPEC_ADDR (sym->etype));
+      }
+      else {
+    if (options.debug || sym->level == 0)
+        fprintf(afile,"==.\n");
+
+    /* allocate space */
+    fprintf (afile, "%s:\n", sym->rname);
+    fprintf (afile, "\t.ds\t0x%04x\n", (unsigned int)getSize (sym->type) & 0xffff);
+      }
+
+  }
     }
 }
 
@@ -918,17 +918,17 @@ void pic14glue ()
     addSetHead(&tmpfileSet,ovrFile);
     /* print the global struct definitions */
     if (options.debug)
-       cdbStructBlock (0,cdbFile);
+  cdbStructBlock (0,cdbFile);
 
     vFile = tempfile();
     /* PENDING: this isnt the best place but it will do */
     if (port->general.glue_up_main) {
-       /* create the interrupt vector table */
-       pic14createInterruptVect (vFile);
+  /* create the interrupt vector table */
+  pic14createInterruptVect (vFile);
     }
 
     addSetHead(&tmpfileSet,vFile);
-    
+
     /* emit code for the all the variables declared */
     pic14emitMaps ();
     /* do the overlay segments */
@@ -936,49 +936,49 @@ void pic14glue ()
 
     /* now put it all together into the assembler file */
     /* create the assembler file name */
-    
+
     if (!options.c1mode) {
-       sprintf (buffer, srcFileName);
-       strcat (buffer, ".asm");
+  sprintf (buffer, srcFileName);
+  strcat (buffer, ".asm");
     }
     else {
-       strcpy(buffer, options.out_name);
+  strcpy(buffer, options.out_name);
     }
 
     if (!(asmFile = fopen (buffer, "w"))) {
-       werror (E_FILE_OPEN_ERR, buffer);
-       exit (1);
+  werror (E_FILE_OPEN_ERR, buffer);
+  exit (1);
     }
-    
+
     /* initial comments */
     pic14initialComments (asmFile);
-    
+
     /* print module name */
     fprintf (asmFile, ";\t.module %s\n", moduleName);
-    
+
     /* Let the port generate any global directives, etc. */
     if (port->genAssemblerPreamble)
     {
-       port->genAssemblerPreamble(asmFile);
+      port->genAssemblerPreamble(asmFile);
     }
-    
+
     /* print the global variables in this module */
     pic14printPublics (asmFile);
-    
+
 
     /* copy the sfr segment */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; special function registers\n");
     fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, sfr->oFile);
-    
+
 
     /* Put all variables into a cblock */
     fprintf (asmFile, "\n\n\tcblock  0x13\n\n");
 
     for(i=0; i<pic14_nRegs; i++) {
       if(regspic14[i].wasUsed && (regspic14[i].offset>=0x0c) )
-       fprintf (asmFile, "\t%s\n",regspic14[i].name);
+  fprintf (asmFile, "\t%s\n",regspic14[i].name);
     }
     //fprintf (asmFile, "\tr0x0C\n");
     //fprintf (asmFile, "\tr0x0D\n");
@@ -999,7 +999,7 @@ void pic14glue ()
     fprintf (asmFile, "; special function bits \n");
     fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, sfrbit->oFile);
-    
+
     /* copy the data segment */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; internal ram data\n");
@@ -1010,16 +1010,16 @@ void pic14glue ()
     /* create the overlay segments */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; overlayable items in internal ram \n");
-    fprintf (asmFile, "%s", iComments2);    
+    fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, ovrFile);
 
     /* create the stack segment MOF */
     if (mainf && mainf->fbody) {
-       fprintf (asmFile, "%s", iComments2);
-       fprintf (asmFile, "; Stack segment in internal ram \n");
-       fprintf (asmFile, "%s", iComments2);    
-       fprintf (asmFile, ";\t.area\tSSEG\t(DATA)\n"
-                ";__start__stack:\n;\t.ds\t1\n\n");
+  fprintf (asmFile, "%s", iComments2);
+  fprintf (asmFile, "; Stack segment in internal ram \n");
+  fprintf (asmFile, "%s", iComments2);
+  fprintf (asmFile, ";\t.area\tSSEG\t(DATA)\n"
+     ";__start__stack:\n;\t.ds\t1\n\n");
     }
 
     /* create the idata segment */
@@ -1027,23 +1027,23 @@ void pic14glue ()
     fprintf (asmFile, "; indirectly addressable internal ram data\n");
     fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, idata->oFile);
-    
+
     /* if external stack then reserve space of it */
     if (mainf && mainf->fbody && options.useXstack ) {
-       fprintf (asmFile, "%s", iComments2);
-       fprintf (asmFile, "; external stack \n");
-       fprintf (asmFile, "%s", iComments2);
-       fprintf (asmFile,";\t.area XSEG (XDATA)\n"); /* MOF */
-       fprintf (asmFile,";\t.ds 256\n");
+  fprintf (asmFile, "%s", iComments2);
+  fprintf (asmFile, "; external stack \n");
+  fprintf (asmFile, "%s", iComments2);
+  fprintf (asmFile,";\t.area XSEG (XDATA)\n"); /* MOF */
+  fprintf (asmFile,";\t.ds 256\n");
     }
-       
-       
+
+
     /* copy xtern ram data */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; external ram data\n");
     fprintf (asmFile, "%s", iComments2);
     copyFile (asmFile, xdata->oFile);
-    
+
 
     fprintf (asmFile, "\tendc\n");
 
@@ -1059,19 +1059,19 @@ void pic14glue ()
 
     /* copy the interrupt vector table */
     if (mainf && mainf->fbody) {
-       fprintf (asmFile, "%s", iComments2);
-       fprintf (asmFile, "; interrupt vector \n");
-       fprintf (asmFile, "%s", iComments2);
-       copyFile (asmFile, vFile);
+  fprintf (asmFile, "%s", iComments2);
+  fprintf (asmFile, "; interrupt vector \n");
+  fprintf (asmFile, "%s", iComments2);
+  copyFile (asmFile, vFile);
     }
-    
+
     /* copy global & static initialisations */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; global & static initialisations\n");
     fprintf (asmFile, "%s", iComments2);
-    
-    /* Everywhere we generate a reference to the static_name area, 
-     * (which is currently only here), we immediately follow it with a 
+
+    /* Everywhere we generate a reference to the static_name area,
+     * (which is currently only here), we immediately follow it with a
      * definition of the post_static_name area. This guarantees that
      * the post_static_name area will immediately follow the static_name
      * area.
@@ -1079,37 +1079,37 @@ void pic14glue ()
     fprintf (asmFile, ";\t.area %s\n", port->mem.static_name); /* MOF */
     fprintf (asmFile, ";\t.area %s\n", port->mem.post_static_name);
     fprintf (asmFile, ";\t.area %s\n", port->mem.static_name);
-    
+
     if (mainf && mainf->fbody) {
-       fprintf (asmFile,"__sdcc_gsinit_startup:\n");
-       /* if external stack is specified then the
-          higher order byte of the xdatalocation is
-          going into P2 and the lower order going into
-          spx */
-       if (options.useXstack) {
-           fprintf(asmFile,";\tmov\tP2,#0x%02x\n",
-                   (((unsigned int)options.xdata_loc) >> 8) & 0xff);
-           fprintf(asmFile,";\tmov\t_spx,#0x%02x\n",
-                   (unsigned int)options.xdata_loc & 0xff);
-       }
-
-       /* initialise the stack pointer */
-       /* if the user specified a value then use it */
-       if (options.stack_loc) 
-           fprintf(asmFile,";\tmov\tsp,#%d\n",options.stack_loc);
-       else 
-           /* no: we have to compute it */
-           if (!options.stackOnData && maxRegBank <= 3)
-               fprintf(asmFile,";\tmov\tsp,#%d\n",((maxRegBank + 1) * 8) -1); 
-           else
-               fprintf(asmFile,";\tmov\tsp,#__start__stack\n"); /* MOF */
-
-       fprintf (asmFile,";\tlcall\t__sdcc_external_startup\n");
-       fprintf (asmFile,";\tmov\ta,dpl\n");
-       fprintf (asmFile,";\tjz\t__sdcc_init_data\n");
-       fprintf (asmFile,";\tljmp\t__sdcc_program_startup\n");
-       fprintf (asmFile,";__sdcc_init_data:\n");
-       
+  fprintf (asmFile,"__sdcc_gsinit_startup:\n");
+  /* if external stack is specified then the
+     higher order byte of the xdatalocation is
+     going into P2 and the lower order going into
+     spx */
+  if (options.useXstack) {
+      fprintf(asmFile,";\tmov\tP2,#0x%02x\n",
+        (((unsigned int)options.xdata_loc) >> 8) & 0xff);
+      fprintf(asmFile,";\tmov\t_spx,#0x%02x\n",
+        (unsigned int)options.xdata_loc & 0xff);
+  }
+
+  /* initialise the stack pointer */
+  /* if the user specified a value then use it */
+  if (options.stack_loc)
+      fprintf(asmFile,";\tmov\tsp,#%d\n",options.stack_loc);
+  else
+      /* no: we have to compute it */
+      if (!options.stackOnData && maxRegBank <= 3)
+    fprintf(asmFile,";\tmov\tsp,#%d\n",((maxRegBank + 1) * 8) -1);
+      else
+    fprintf(asmFile,";\tmov\tsp,#__start__stack\n"); /* MOF */
+
+  fprintf (asmFile,";\tlcall\t__sdcc_external_startup\n");
+  fprintf (asmFile,";\tmov\ta,dpl\n");
+  fprintf (asmFile,";\tjz\t__sdcc_init_data\n");
+  fprintf (asmFile,";\tljmp\t__sdcc_program_startup\n");
+  fprintf (asmFile,";__sdcc_init_data:\n");
+
     }
     copyFile (asmFile, statsg->oFile);
 
@@ -1119,35 +1119,35 @@ void pic14glue ()
          * This area is guaranteed to follow the static area
          * by the ugly shucking and jiving about 20 lines ago.
          */
-       fprintf(asmFile, ";\t.area %s\n", port->mem.post_static_name);
-       fprintf (asmFile,";\tljmp\t__sdcc_program_startup\n");
+      fprintf(asmFile, ";\t.area %s\n", port->mem.post_static_name);
+  fprintf (asmFile,";\tljmp\t__sdcc_program_startup\n");
     }
-       
+
     /* copy over code */
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, "; code\n");
     fprintf (asmFile, "%s", iComments2);
     fprintf (asmFile, ";\t.area %s\n", port->mem.code_name);
     if (mainf && mainf->fbody) {
-       
-       /* entry point @ start of CSEG */
-       fprintf (asmFile,"__sdcc_program_startup:\n");
-       
-       /* put in the call to main */
-       fprintf(asmFile,"\tcall\t_main\n");
-       if (options.mainreturn) {
-
-           fprintf(asmFile,";\treturn from main ; will return to caller\n");
-           fprintf(asmFile,"\treturn\n");
-
-       } else {
-                  
-           fprintf(asmFile,";\treturn from main will lock up\n");
-           fprintf(asmFile,"\tgoto\t$\n");
-       }
+
+  /* entry point @ start of CSEG */
+  fprintf (asmFile,"__sdcc_program_startup:\n");
+
+  /* put in the call to main */
+  fprintf(asmFile,"\tcall\t_main\n");
+  if (options.mainreturn) {
+
+      fprintf(asmFile,";\treturn from main ; will return to caller\n");
+      fprintf(asmFile,"\treturn\n");
+
+  } else {
+
+      fprintf(asmFile,";\treturn from main will lock up\n");
+      fprintf(asmFile,"\tgoto\t$\n");
+  }
     }
     copyFile (asmFile, code->oFile);
-    
+
     fprintf (asmFile,"\tend\n");
 
     fclose (asmFile);
index 7a2984eb996c5ccb7df662f48cb7f52e142691d8..2b66449381d695ebeefc50aad6ac0b294e374dd7 100644 (file)
@@ -2,43 +2,43 @@
   gen.c - Z80 specific code generator.
 
   Benchmarks on dhry.c 2.1 with 32766 loops and a 10ms clock:
-                                               ticks   dhry    size
-  Base with asm strcpy / strcmp / memcpy:      23198   141     1A14
-  Improved WORD push                           22784   144     19AE
-  With label1 on                               22694   144     197E
-  With label2 on                               22743   144     198A
-  With label3 on                               22776   144     1999
-  With label4 on                               22776   144     1999
-  With all 'label' on                          22661   144     196F
-  With loopInvariant on                                20919   156     19AB
-  With loopInduction on                                Breaks          198B
-  With all working on                          20796   158     196C
-  Slightly better genCmp(signed)               20597   159     195B
-  Better reg packing, first peephole           20038   163     1873
-  With assign packing                          19281   165     1849
-  5/3/00                                       17741   185     17B6
-  With reg params for mul and div              16234   202     162D
-
-  Michael Hope <michaelh@earthling.net>        2000
-  Based on the mcs51 generator - 
-               Sandeep Dutta . sandeep.dutta@usa.net (1998)
-        and -  Jean-Louis VERN.jlvern@writeme.com (1999)
-        
+            ticks dhry  size
+  Base with asm strcpy / strcmp / memcpy: 23198 141 1A14
+  Improved WORD push        22784 144 19AE
+  With label1 on        22694 144 197E
+  With label2 on        22743 144 198A
+  With label3 on        22776 144 1999
+  With label4 on        22776 144 1999
+  With all 'label' on       22661 144 196F
+  With loopInvariant on       20919 156 19AB
+  With loopInduction on       Breaks    198B
+  With all working on       20796 158 196C
+  Slightly better genCmp(signed)    20597 159 195B
+  Better reg packing, first peephole    20038 163 1873
+  With assign packing       19281 165 1849
+  5/3/00          17741 185 17B6
+  With reg params for mul and div   16234 202 162D
+
+  Michael Hope <michaelh@earthling.net> 2000
+  Based on the mcs51 generator -
+      Sandeep Dutta . sandeep.dutta@usa.net (1998)
+   and -  Jean-Louis VERN.jlvern@writeme.com (1999)
+
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version.
-  
+
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
 
-  
+
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-  
+
   In other words, you are welcome to use, share and improve this program.
   You are forbidden to forbid anyone else to use, share and improve
   what you give them.   Help stamp out software-hoarding!
@@ -108,7 +108,7 @@ static struct {
     { "iy", "iy.l?", "iy.h?" },
     { "ix", "ix.l?", "ix.h?" }
 };
-    
+
 #define RESULTONSTACK(x) \
                          (IC_RESULT(x) && IC_RESULT(x)->aop && \
                          IC_RESULT(x)->aop->type == AOP_STK )
@@ -119,9 +119,9 @@ static struct {
 lineNode *lineHead = NULL;
 lineNode *lineCurr = NULL;
 
-static const unsigned char SLMask[] = 
+static const unsigned char SLMask[] =
 {0xFF ,0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00};
-static const unsigned char SRMask[] = 
+static const unsigned char SRMask[] =
 {0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x00};
 
 #define LSB     0
@@ -130,25 +130,25 @@ static const unsigned char SRMask[] =
 #define MSB32   3
 
 /* Stack frame:
-   IX+4                param0  LH
-   IX+2                ret     LH
-   IX+0                ix      LH
-   IX-2                temp0   LH
+   IX+4   param0  LH
+   IX+2   ret LH
+   IX+0   ix  LH
+   IX-2   temp0 LH
 */
 
 static struct {
     struct {
-       AOP_TYPE last_type;
-       const char *lit;
-       int offset;
+  AOP_TYPE last_type;
+  const char *lit;
+  int offset;
     } pairs[NUM_PAIRS];
     struct {
-       int last;
-       int pushed;
-       int param_offset;
-       int offset;
-       int pushed_bc;
-       int pushed_de;
+  int last;
+  int pushed;
+  int param_offset;
+  int offset;
+  int pushed_bc;
+  int pushed_de;
     } stack;
     int frameId;
     bool flush_statics;
@@ -161,18 +161,18 @@ static void _tidyUp(char *buf)
 {
     /* Clean up the line so that it is 'prettier' */
     if (strchr(buf, ':')) {
-       /* Is a label - cant do anything */
-       return;
+  /* Is a label - cant do anything */
+  return;
     }
     /* Change the first (and probably only) ' ' to a tab so
        everything lines up.
     */
     while (*buf) {
-       if (*buf == ' ') {
-           *buf = '\t';
-           return;
-       }
-       buf++;
+  if (*buf == ' ') {
+      *buf = '\t';
+      return;
+  }
+  buf++;
     }
 }
 
@@ -187,8 +187,8 @@ static void emit2(const char *szFormat, ...)
 
     _tidyUp(buffer);
     lineCurr = (lineCurr ?
-               connectLine(lineCurr,newLineNode(buffer)) :
-               (lineHead = newLineNode(buffer)));
+    connectLine(lineCurr,newLineNode(buffer)) :
+    (lineHead = newLineNode(buffer)));
 
     lineCurr->isInline = inLine;
     lineCurr->isDebug  = debugLine;
@@ -200,20 +200,20 @@ static void emit2(const char *szFormat, ...)
 void emitcode (const char *inst, const char *fmt, ...)
 {
     va_list ap;
-    char lb[MAX_INLINEASM];  
+    char lb[MAX_INLINEASM];
     char *lbp = lb;
 
-    va_start(ap,fmt);   
+    va_start(ap,fmt);
 
     if (*inst != '\0') {
         sprintf(lb,"%s\t",inst);
         vsprintf(lb+(strlen(lb)),fmt,ap);
-    }  else 
+    }  else
         vsprintf(lb,fmt,ap);
 
     while (isspace(*lbp)) lbp++;
 
-    if (lbp && *lbp) 
+    if (lbp && *lbp)
         lineCurr = (lineCurr ?
                     connectLine(lineCurr,newLineNode(lb)) :
                     (lineHead = newLineNode(lb)));
@@ -223,18 +223,18 @@ void emitcode (const char *inst, const char *fmt, ...)
 }
 
 /* Z80:
-    { "adjustsp", 
+    { "adjustsp",
       "\tld hl,#-%d\n"
       "\tadd hl,sp\n"
       "\tld sp,hl"
     }
     { "prelude",
-       "push bc"
-       "push de"
-       "push ix"
-       "ld ix,#0"
-       "add ix,sp"
-    { "leave" 
+  "push bc"
+  "push de"
+  "push ix"
+  "ld ix,#0"
+  "add ix,sp"
+    { "leave"
     emitcode("ld", "sp,ix");
     emitcode("pop", "ix");
     emitcode("pop", "de");
@@ -245,30 +245,30 @@ void emitcode (const char *inst, const char *fmt, ...)
 const char *getPairName(asmop *aop)
 {
     if (aop->type == AOP_REG) {
-       switch (aop->aopu.aop_reg[0]->rIdx) {
-       case C_IDX:
-           return "bc";
-           break;
-       case E_IDX:
-           return "de";
-           break;
-       case L_IDX:
-           return "hl";
-           break;
-       }
+  switch (aop->aopu.aop_reg[0]->rIdx) {
+  case C_IDX:
+      return "bc";
+      break;
+  case E_IDX:
+      return "de";
+      break;
+  case L_IDX:
+      return "hl";
+      break;
+  }
     }
     else if (aop->type == AOP_STR) {
-       switch (*aop->aopu.aop_str[0]) {
-       case 'c':
-           return "bc";
-           break;
-       case 'e':
-           return "de";
-           break;
-       case 'l':
-           return "hl";
-           break;
-       }
+  switch (*aop->aopu.aop_str[0]) {
+  case 'c':
+      return "bc";
+      break;
+  case 'e':
+      return "de";
+      break;
+  case 'l':
+      return "hl";
+      break;
+  }
     }
     wassert(0);
     return NULL;
@@ -277,28 +277,28 @@ const char *getPairName(asmop *aop)
 static PAIR_ID getPairId(asmop *aop)
 {
     if (aop->size == 2) {
-       if (aop->type == AOP_REG) {
-           if ((aop->aopu.aop_reg[0]->rIdx == C_IDX)&&(aop->aopu.aop_reg[1]->rIdx == B_IDX)) {
-               return PAIR_BC;
-           }
-           if ((aop->aopu.aop_reg[0]->rIdx == E_IDX)&&(aop->aopu.aop_reg[1]->rIdx == D_IDX)) {
-               return PAIR_DE;
-           }
-           if ((aop->aopu.aop_reg[0]->rIdx == L_IDX)&&(aop->aopu.aop_reg[1]->rIdx == H_IDX)) {
-               return PAIR_HL;
-           }
-       }
-       if (aop->type == AOP_STR) {
-           if (!strcmp(aop->aopu.aop_str[0], "c")&&!strcmp(aop->aopu.aop_str[1], "b")) {
-               return PAIR_BC;
-           }
-           if (!strcmp(aop->aopu.aop_str[0], "e")&&!strcmp(aop->aopu.aop_str[1], "d")) {
-               return PAIR_DE;
-           }
-           if (!strcmp(aop->aopu.aop_str[0], "l")&&!strcmp(aop->aopu.aop_str[1], "h")) {
-               return PAIR_HL;
-           }
-       }
+  if (aop->type == AOP_REG) {
+      if ((aop->aopu.aop_reg[0]->rIdx == C_IDX)&&(aop->aopu.aop_reg[1]->rIdx == B_IDX)) {
+    return PAIR_BC;
+      }
+      if ((aop->aopu.aop_reg[0]->rIdx == E_IDX)&&(aop->aopu.aop_reg[1]->rIdx == D_IDX)) {
+    return PAIR_DE;
+      }
+      if ((aop->aopu.aop_reg[0]->rIdx == L_IDX)&&(aop->aopu.aop_reg[1]->rIdx == H_IDX)) {
+    return PAIR_HL;
+      }
+  }
+  if (aop->type == AOP_STR) {
+      if (!strcmp(aop->aopu.aop_str[0], "c")&&!strcmp(aop->aopu.aop_str[1], "b")) {
+    return PAIR_BC;
+      }
+      if (!strcmp(aop->aopu.aop_str[0], "e")&&!strcmp(aop->aopu.aop_str[1], "d")) {
+    return PAIR_DE;
+      }
+      if (!strcmp(aop->aopu.aop_str[0], "l")&&!strcmp(aop->aopu.aop_str[1], "h")) {
+    return PAIR_HL;
+      }
+  }
     }
     return PAIR_INVALID;
 }
@@ -316,9 +316,9 @@ bool isPtrPair(asmop *aop)
     case PAIR_HL:
     case PAIR_IY:
     case PAIR_IX:
-       return TRUE;
+  return TRUE;
     default:
-       return FALSE;
+  return FALSE;
     }
 }
 /** Push a register pair onto the stack */
@@ -335,7 +335,7 @@ static asmop *newAsmop (short type)
 {
     asmop *aop;
 
-    aop = Safe_calloc(sizeof(asmop));
+    aop = Safe_calloc(1,sizeof(asmop));
     aop->type = type;
     return aop;
 }
@@ -360,41 +360,41 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool requires_a)
 
     /* Assign depending on the storage class */
     if (sym->onStack || sym->iaccess) {
-       emitcode("", "; AOP_STK for %s", sym->rname);
+  emitcode("", "; AOP_STK for %s", sym->rname);
         sym->aop = aop = newAsmop(AOP_STK);
         aop->size = getSize(sym->type);
-       aop->aopu.aop_stk = sym->stack;
+  aop->aopu.aop_stk = sym->stack;
         return aop;
     }
 
     /* special case for a function */
-    if (IS_FUNC(sym->type)) {   
-        sym->aop = aop = newAsmop(AOP_IMMD);    
-        aop->aopu.aop_immd = Safe_calloc(strlen(sym->rname)+1);
+    if (IS_FUNC(sym->type)) {
+        sym->aop = aop = newAsmop(AOP_IMMD);
+        aop->aopu.aop_immd = Safe_calloc(1,strlen(sym->rname)+1);
         strcpy(aop->aopu.aop_immd,sym->rname);
         aop->size = 2;
         return aop;
     }
 
     if (IS_GB) {
-       /* if it is in direct space */
-       if (IN_REGSP(space) && !requires_a) {
-           sym->aop = aop = newAsmop (AOP_SFR);
-           aop->aopu.aop_dir = sym->rname ;
-           aop->size = getSize(sym->type);
-           emitcode("", "; AOP_SFR for %s", sym->rname);
-           return aop;
-       }
+  /* if it is in direct space */
+  if (IN_REGSP(space) && !requires_a) {
+      sym->aop = aop = newAsmop (AOP_SFR);
+      aop->aopu.aop_dir = sym->rname ;
+      aop->size = getSize(sym->type);
+      emitcode("", "; AOP_SFR for %s", sym->rname);
+      return aop;
+  }
     }
 
     /* only remaining is far space */
     /* in which case DPTR gets the address */
     if (IS_GB) {
-       emitcode("", "; AOP_HL for %s", sym->rname);
-       sym->aop = aop = newAsmop(AOP_HL);
+  emitcode("", "; AOP_HL for %s", sym->rname);
+  sym->aop = aop = newAsmop(AOP_HL);
     }
     else {
-       sym->aop = aop = newAsmop(AOP_IY);
+  sym->aop = aop = newAsmop(AOP_IY);
     }
     aop->size = getSize(sym->type);
     aop->aopu.aop_dir = sym->rname;
@@ -403,7 +403,7 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool requires_a)
     if (IN_CODESPACE(space))
         aop->code = 1;
 
-    return aop;     
+    return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -411,14 +411,14 @@ static asmop *aopForSym (iCode *ic,symbol *sym,bool result, bool requires_a)
 /*-----------------------------------------------------------------*/
 static asmop *aopForRemat (symbol *sym)
 {
-    char *s = buffer;   
+    char *s = buffer;
     iCode *ic = sym->rematiCode;
     asmop *aop = newAsmop(AOP_IMMD);
 
     while (1) {
         /* if plus or minus print the right hand side */
         if (ic->op == '+' || ic->op == '-') {
-           /* PENDING: for re-target */
+      /* PENDING: for re-target */
             sprintf(s,"0x%04x %c ",(int) operandLitValue(IC_RIGHT(ic)),
                     ic->op );
             s += strlen(s);
@@ -430,9 +430,9 @@ static asmop *aopForRemat (symbol *sym)
         break;
     }
 
-    aop->aopu.aop_immd = Safe_calloc(strlen(buffer)+1);
-    strcpy(aop->aopu.aop_immd,buffer);    
-    return aop;        
+    aop->aopu.aop_immd = Safe_calloc(1,strlen(buffer)+1);
+    strcpy(aop->aopu.aop_immd,buffer);
+    return aop;
 }
 
 /*-----------------------------------------------------------------*/
@@ -487,8 +487,8 @@ bool operandsEqu ( operand *op1, operand *op2)
     /* if both are itemps & one is spilt
        and the other is not then false */
     if (IS_ITEMP(op1) && IS_ITEMP(op2) &&
-       sym1->isspilt != sym2->isspilt )
-       return FALSE ;
+  sym1->isspilt != sym2->isspilt )
+  return FALSE ;
 
     /* if they are the same */
     if (sym1 == sym2)
@@ -499,16 +499,16 @@ bool operandsEqu ( operand *op1, operand *op2)
 
 
     /* if left is a tmp & right is not */
-    if (IS_ITEMP(op1)  && 
+    if (IS_ITEMP(op1)  &&
         !IS_ITEMP(op2) &&
         sym1->isspilt  &&
         (sym1->usl.spillLoc == sym2))
         return 3;
 
-    if (IS_ITEMP(op2)  && 
+    if (IS_ITEMP(op2)  &&
         !IS_ITEMP(op1) &&
         sym2->isspilt  &&
-       sym1->level > 0 &&
+  sym1->level > 0 &&
         (sym2->usl.spillLoc == sym1))
         return 4;
 
@@ -523,10 +523,10 @@ bool sameRegs (asmop *aop1, asmop *aop2 )
     int i;
 
     if (aop1->type == AOP_SFR ||
-       aop2->type == AOP_SFR)
-       return FALSE;
+  aop2->type == AOP_SFR)
+  return FALSE;
 
-    if (aop1 == aop2) 
+    if (aop1 == aop2)
         return TRUE;
 
     if (aop1->type != AOP_REG ||
@@ -575,7 +575,7 @@ static void aopOp (operand *op, iCode *ic, bool result, bool requires_a)
     }
 
     /* if this is a true symbol */
-    if (IS_TRUE_SYMOP(op)) {    
+    if (IS_TRUE_SYMOP(op)) {
         op->aop = aopForSym(ic, OP_SYMBOL(op), result, requires_a);
         return ;
     }
@@ -584,8 +584,8 @@ static void aopOp (operand *op, iCode *ic, bool result, bool requires_a)
     only four choices :
     a) register
     b) spillocation
-    c) rematerialize 
-    d) conditional   
+    c) rematerialize
+    d) conditional
     e) can be a return use only */
 
     sym = OP_SYMBOL(op);
@@ -598,7 +598,7 @@ static void aopOp (operand *op, iCode *ic, bool result, bool requires_a)
     }
 
     /* if it is spilt then two situations
-    a) is rematerialize 
+    a) is rematerialize
     b) has a spill location */
     if (sym->isspilt || sym->nRegs == 0) {
         /* rematerialize it NOW */
@@ -609,25 +609,25 @@ static void aopOp (operand *op, iCode *ic, bool result, bool requires_a)
             return;
         }
 
-       if (sym->accuse) {
-           int i;
-           if (sym->accuse == ACCUSE_A) {
-               aop = op->aop = sym->aop = newAsmop(AOP_ACC);
-               aop->size = getSize(sym->type);
-               for ( i = 0 ; i < 2 ; i++ )
-                   aop->aopu.aop_str[i] = accUse[i];
-           }
-           else if (sym->accuse == ACCUSE_HL) {
-               wassert(!IS_GB);
-               aop = op->aop = sym->aop = newAsmop(AOP_HLREG);
-               aop->size = getSize(sym->type);
-               for ( i = 0 ; i < 2 ; i++ )
-                   aop->aopu.aop_str[i] = hlUse[i];
-           }
-           else
-               wassert(0);
-           return;
-       }
+  if (sym->accuse) {
+      int i;
+      if (sym->accuse == ACCUSE_A) {
+    aop = op->aop = sym->aop = newAsmop(AOP_ACC);
+    aop->size = getSize(sym->type);
+    for ( i = 0 ; i < 2 ; i++ )
+        aop->aopu.aop_str[i] = accUse[i];
+      }
+      else if (sym->accuse == ACCUSE_HL) {
+    wassert(!IS_GB);
+    aop = op->aop = sym->aop = newAsmop(AOP_HLREG);
+    aop->size = getSize(sym->type);
+    for ( i = 0 ; i < 2 ; i++ )
+        aop->aopu.aop_str[i] = hlUse[i];
+      }
+      else
+    wassert(0);
+      return;
+  }
 
         if (sym->ruonly ) {
             int i;
@@ -639,7 +639,7 @@ static void aopOp (operand *op, iCode *ic, bool result, bool requires_a)
         }
 
         /* else spill location  */
-        sym->aop = op->aop = aop = 
+        sym->aop = op->aop = aop =
                                   aopForSym(ic,sym->usl.spillLoc,result, requires_a);
         aop->size = getSize(sym->type);
         return;
@@ -656,19 +656,19 @@ static void aopOp (operand *op, iCode *ic, bool result, bool requires_a)
 /* freeAsmop - free up the asmop given to an operand               */
 /*----------------------------------------------------------------*/
 static void freeAsmop (operand *op, asmop *aaop, iCode *ic)
-{   
+{
     asmop *aop ;
 
     if (!op)
         aop = aaop;
-    else 
+    else
         aop = op->aop;
 
     if (!aop)
         return ;
 
     if (aop->freed)
-        goto dealloc; 
+        goto dealloc;
 
     aop->freed = 1;
 
@@ -677,9 +677,9 @@ dealloc:
     if (op ) {
         op->aop = NULL;
         if (IS_SYMOP(op)) {
-            OP_SYMBOL(op)->aop = NULL;    
+            OP_SYMBOL(op)->aop = NULL;
             /* if the symbol has a spill */
-           if (SPIL_LOC(op))
+      if (SPIL_LOC(op))
                 SPIL_LOC(op)->aop = NULL;
         }
     }
@@ -688,13 +688,13 @@ dealloc:
 bool isLitWord(asmop *aop)
 {
     /*    if (aop->size != 2)
-         return FALSE;*/
+    return FALSE;*/
     switch (aop->type) {
     case AOP_IMMD:
     case AOP_LIT:
-       return TRUE;
+  return TRUE;
     default:
-       return FALSE;
+  return FALSE;
     }
 }
 
@@ -705,52 +705,52 @@ char *aopGetLitWordLong(asmop *aop, int offset, bool with_hash)
 
 #if 0
     if (aop->size != 2 && aop->type != AOP_HL)
-       return NULL;
+  return NULL;
 #endif
     /* depending on type */
     switch (aop->type) {
     case AOP_HL:
     case AOP_IY:
     case AOP_IMMD:
-       /* PENDING: for re-target */
-       if (with_hash)
-           tsprintf(s, "!hashedstr + %d", aop->aopu.aop_immd, offset);
-       else
-           tsprintf(s, "%s + %d", aop->aopu.aop_immd, offset);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
+  /* PENDING: for re-target */
+  if (with_hash)
+      tsprintf(s, "!hashedstr + %d", aop->aopu.aop_immd, offset);
+  else
+      tsprintf(s, "%s + %d", aop->aopu.aop_immd, offset);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
     case AOP_LIT: {
-       value * val = aop->aopu.aop_lit;
-       /* if it is a float then it gets tricky */
-       /* otherwise it is fairly simple */
-       if (!IS_FLOAT(val->type)) {
-           unsigned long v = floatFromVal(val);
-
-           if (offset == 2)
-               v >>= 16;
-
-           if (with_hash)
-               tsprintf(buffer, "!immedword", v);
-           else
-               tsprintf(buffer, "!constword", v);
-           rs = Safe_calloc(strlen(buffer)+1);
-           return strcpy (rs,buffer);
-       }
-       else {
-           /* A float */
-           Z80_FLOAT f;
-           convertFloat(&f, floatFromVal(val));
-           if (with_hash) 
-               tsprintf(buffer, "!immedword", f.w[offset/2]);
-           else
-               tsprintf(buffer, "!constword", f.w[offset/2]);
-           rs = Safe_calloc(strlen(buffer)+1);
-           return strcpy (rs,buffer);
-       }
+  value * val = aop->aopu.aop_lit;
+  /* if it is a float then it gets tricky */
+  /* otherwise it is fairly simple */
+  if (!IS_FLOAT(val->type)) {
+      unsigned long v = floatFromVal(val);
+
+      if (offset == 2)
+    v >>= 16;
+
+      if (with_hash)
+    tsprintf(buffer, "!immedword", v);
+      else
+    tsprintf(buffer, "!constword", v);
+      rs = Safe_calloc(1,strlen(buffer)+1);
+      return strcpy (rs,buffer);
+  }
+  else {
+      /* A float */
+      Z80_FLOAT f;
+      convertFloat(&f, floatFromVal(val));
+      if (with_hash)
+    tsprintf(buffer, "!immedword", f.w[offset/2]);
+      else
+    tsprintf(buffer, "!constword", f.w[offset/2]);
+      rs = Safe_calloc(1,strlen(buffer)+1);
+      return strcpy (rs,buffer);
+  }
     }
     default:
-       return NULL;
+  return NULL;
     }
 }
 
@@ -759,14 +759,14 @@ char *aopGetWord(asmop *aop, int offset)
     return aopGetLitWordLong(aop, offset, TRUE);
 }
 
-bool isPtr(const char *s) 
+bool isPtr(const char *s)
 {
     if (!strcmp(s, "hl"))
-       return TRUE;
+  return TRUE;
     if (!strcmp(s, "ix"))
-       return TRUE;
+  return TRUE;
     if (!strcmp(s, "iy"))
-       return TRUE;
+  return TRUE;
     return FALSE;
 }
 
@@ -775,12 +775,12 @@ static void adjustPair(const char *pair, int *pold, int new)
     wassert(pair);
 
     while (*pold < new) {
-       emitcode("inc", "%s", pair);
-       (*pold)++;
+  emitcode("inc", "%s", pair);
+  (*pold)++;
     }
     while (*pold > new) {
-       emitcode("dec", "%s", pair);
-       (*pold)--;
+  emitcode("dec", "%s", pair);
+  (*pold)--;
     }
 }
 
@@ -801,9 +801,9 @@ static bool requiresHL(asmop *aop)
     switch (aop->type) {
     case AOP_HL:
     case AOP_STK:
-       return TRUE;
+  return TRUE;
     default:
-       return FALSE;
+  return FALSE;
     }
 }
 
@@ -814,13 +814,13 @@ static char *fetchLitSpecial(asmop *aop, bool negate, bool xor)
 
     wassert(aop->type == AOP_LIT);
     wassert(!IS_FLOAT(val->type));
-    
+
     v = floatFromVal(val);
 
     if (xor)
-       v ^= 0x8000;
+  v ^= 0x8000;
     if (negate)
-       v = -v;
+  v = -v;
     v &= 0xFFFF;
 
     tsprintf(buffer, "!immedword", v);
@@ -835,78 +835,78 @@ static void fetchLitPair(PAIR_ID pairId, asmop *left, int offset)
     wassert(l && pair);
 
     if (isPtr(pair)) {
-       if (pairId == PAIR_HL || pairId == PAIR_IY) {
-           if (_G.pairs[pairId].last_type == left->type) {
-               if (_G.pairs[pairId].lit && !strcmp(_G.pairs[pairId].lit, l)) {
-                   if (pairId == PAIR_HL && abs(_G.pairs[pairId].offset - offset) < 3) {
-                       adjustPair(pair, &_G.pairs[pairId].offset, offset);
-                       return;
-                   }
-                   if (pairId == PAIR_IY && abs(offset)<127) {
-                       return;
-                   }
-               }
-           }
-       }
-       _G.pairs[pairId].last_type = left->type;
-       _G.pairs[pairId].lit = gc_strdup(l);
-       _G.pairs[pairId].offset = offset;
+  if (pairId == PAIR_HL || pairId == PAIR_IY) {
+      if (_G.pairs[pairId].last_type == left->type) {
+    if (_G.pairs[pairId].lit && !strcmp(_G.pairs[pairId].lit, l)) {
+        if (pairId == PAIR_HL && abs(_G.pairs[pairId].offset - offset) < 3) {
+      adjustPair(pair, &_G.pairs[pairId].offset, offset);
+      return;
+        }
+        if (pairId == PAIR_IY && abs(offset)<127) {
+      return;
+        }
+    }
+      }
+  }
+  _G.pairs[pairId].last_type = left->type;
+  _G.pairs[pairId].lit = gc_strdup(l);
+  _G.pairs[pairId].offset = offset;
     }
     if (IS_GB && pairId == PAIR_DE && 0) {
-       if (_G.pairs[pairId].lit && !strcmp(_G.pairs[pairId].lit, l)) {
-           if (abs(_G.pairs[pairId].offset - offset) < 3) {
-               adjustPair(pair, &_G.pairs[pairId].offset, offset);
-               return;
-           }
-       }
-       _G.pairs[pairId].last_type = left->type;
-       _G.pairs[pairId].lit = gc_strdup(l);
-       _G.pairs[pairId].offset = offset;
+  if (_G.pairs[pairId].lit && !strcmp(_G.pairs[pairId].lit, l)) {
+      if (abs(_G.pairs[pairId].offset - offset) < 3) {
+    adjustPair(pair, &_G.pairs[pairId].offset, offset);
+    return;
+      }
+  }
+  _G.pairs[pairId].last_type = left->type;
+  _G.pairs[pairId].lit = gc_strdup(l);
+  _G.pairs[pairId].offset = offset;
     }
     /* Both a lit on the right and a true symbol on the left */
     if (offset)
-       emit2("ld %s,!hashedstr + %u", pair, l, offset);
+  emit2("ld %s,!hashedstr + %u", pair, l, offset);
     else
-       emit2("ld %s,!hashedstr", pair, l);
+  emit2("ld %s,!hashedstr", pair, l);
 }
 
 static void fetchPairLong(PAIR_ID pairId, asmop *aop, int offset)
 {
     /* if this is remateriazable */
     if (isLitWord(aop)) {
-       fetchLitPair(pairId, aop, offset);
+  fetchLitPair(pairId, aop, offset);
     }
     else { /* we need to get it byte by byte */
-       if (pairId == PAIR_HL && IS_GB && requiresHL(aop)) {
-           aopGet(aop, offset, FALSE);
-           switch (aop->size) {
-           case 1:
-               emit2("ld l,!*hl");
-               emit2("ld h,!immedbyte", 0);
-               break;
-           case 2:
-               emit2("!ldahli");
-               emit2("ld h,!*hl");
-               emit2("ld l,a");
-               break;
-           default:
-               emit2("; WARNING: mlh woosed out.  This code is invalid.");
-           }
-       }
-       else if (IS_Z80 && aop->type == AOP_IY) {
-           /* Instead of fetching relative to IY, just grab directly
-              from the address IY refers to */
-           char *l = aopGetLitWordLong(aop, offset, FALSE);
-           wassert(l);
-           emit2("ld %s,(%s)", _pairs[pairId].name, l);
-       }
-       else {
-           emitcode("ld", "%s,%s", _pairs[pairId].l, aopGet(aop, offset, FALSE));
-           emitcode("ld", "%s,%s", _pairs[pairId].h, aopGet(aop, offset+1, FALSE));
-       }
-       /* PENDING: check? */
-       if (pairId == PAIR_HL)
-           spillPair(PAIR_HL);
+  if (pairId == PAIR_HL && IS_GB && requiresHL(aop)) {
+      aopGet(aop, offset, FALSE);
+      switch (aop->size) {
+      case 1:
+    emit2("ld l,!*hl");
+    emit2("ld h,!immedbyte", 0);
+    break;
+      case 2:
+    emit2("!ldahli");
+    emit2("ld h,!*hl");
+    emit2("ld l,a");
+    break;
+      default:
+    emit2("; WARNING: mlh woosed out.  This code is invalid.");
+      }
+  }
+  else if (IS_Z80 && aop->type == AOP_IY) {
+      /* Instead of fetching relative to IY, just grab directly
+         from the address IY refers to */
+      char *l = aopGetLitWordLong(aop, offset, FALSE);
+      wassert(l);
+      emit2("ld %s,(%s)", _pairs[pairId].name, l);
+  }
+  else {
+      emitcode("ld", "%s,%s", _pairs[pairId].l, aopGet(aop, offset, FALSE));
+      emitcode("ld", "%s,%s", _pairs[pairId].h, aopGet(aop, offset+1, FALSE));
+  }
+  /* PENDING: check? */
+  if (pairId == PAIR_HL)
+      spillPair(PAIR_HL);
     }
 }
 
@@ -926,31 +926,31 @@ static void setupPair(PAIR_ID pairId, asmop *aop, int offset)
 
     switch (aop->type) {
     case AOP_IY:
-       fetchLitPair(pairId, aop, 0);
-       break;
+  fetchLitPair(pairId, aop, 0);
+  break;
     case AOP_HL:
-       fetchLitPair(pairId, aop, offset);
-       _G.pairs[pairId].offset = offset;
-       break;
+  fetchLitPair(pairId, aop, offset);
+  _G.pairs[pairId].offset = offset;
+  break;
     case AOP_STK: {
-       /* Doesnt include _G.stack.pushed */
-       int abso = aop->aopu.aop_stk + offset + _G.stack.offset;
-       if (aop->aopu.aop_stk > 0) {
-           abso += _G.stack.param_offset;
-       }
-       assert(pairId == PAIR_HL);
-       /* In some cases we can still inc or dec hl */
-       if (_G.pairs[pairId].last_type == AOP_STK && abs(_G.pairs[pairId].offset - abso) < 3) {
-           adjustPair(_pairs[pairId].name, &_G.pairs[pairId].offset, abso);
-       }
-       else {
-           emit2("!ldahlsp", abso +_G.stack.pushed);
-       }
-       _G.pairs[pairId].offset = abso;
-       break;
+  /* Doesnt include _G.stack.pushed */
+  int abso = aop->aopu.aop_stk + offset + _G.stack.offset;
+  if (aop->aopu.aop_stk > 0) {
+      abso += _G.stack.param_offset;
+  }
+  assert(pairId == PAIR_HL);
+  /* In some cases we can still inc or dec hl */
+  if (_G.pairs[pairId].last_type == AOP_STK && abs(_G.pairs[pairId].offset - abso) < 3) {
+      adjustPair(_pairs[pairId].name, &_G.pairs[pairId].offset, abso);
+  }
+  else {
+      emit2("!ldahlsp", abso +_G.stack.pushed);
+  }
+  _G.pairs[pairId].offset = abso;
+  break;
     }
     default:
-       wassert(0);
+  wassert(0);
     }
     _G.pairs[pairId].last_type = aop->type;
 }
@@ -978,95 +978,95 @@ static char *aopGet(asmop *aop, int offset, bool bit16)
     /* depending on type */
     switch (aop->type) {
     case AOP_IMMD:
-       /* PENDING: re-target */
-       if (bit16) 
-           tsprintf (s,"!immedwords", aop->aopu.aop_immd);
-       else
-           switch (offset) {
-           case 2:
-               tsprintf(s, "!bankimmeds", aop->aopu.aop_immd);
-               break;
-           case 1:
-               tsprintf(s, "!msbimmeds", aop->aopu.aop_immd);
-               break;
-           case 0:
-               tsprintf(s, "!lsbimmeds", aop->aopu.aop_immd);
-               break;
-           default:
-               wassert(0);
-           }
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  /* PENDING: re-target */
+  if (bit16)
+      tsprintf (s,"!immedwords", aop->aopu.aop_immd);
+  else
+      switch (offset) {
+      case 2:
+    tsprintf(s, "!bankimmeds", aop->aopu.aop_immd);
+    break;
+      case 1:
+    tsprintf(s, "!msbimmeds", aop->aopu.aop_immd);
+    break;
+      case 0:
+    tsprintf(s, "!lsbimmeds", aop->aopu.aop_immd);
+    break;
+      default:
+    wassert(0);
+      }
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_DIR:
-       wassert(IS_GB);
-       emitcode("ld", "a,(%s+%d) ; x", aop->aopu.aop_dir, offset);
-       sprintf(s, "a");
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  wassert(IS_GB);
+  emitcode("ld", "a,(%s+%d) ; x", aop->aopu.aop_dir, offset);
+  sprintf(s, "a");
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_SFR:
-       wassert(IS_GB);
-       emitcode("ldh", "a,(%s+%d) ; x", aop->aopu.aop_dir, offset);
-       sprintf(s, "a");
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
+  wassert(IS_GB);
+  emitcode("ldh", "a,(%s+%d) ; x", aop->aopu.aop_dir, offset);
+  sprintf(s, "a");
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
 
     case AOP_REG:
-       return aop->aopu.aop_reg[offset]->name;
+  return aop->aopu.aop_reg[offset]->name;
 
     case AOP_HL:
-       wassert(IS_GB);
-       setupPair(PAIR_HL, aop, offset);
-       tsprintf(s, "!*hl");
-       return gc_strdup(s);
+  wassert(IS_GB);
+  setupPair(PAIR_HL, aop, offset);
+  tsprintf(s, "!*hl");
+  return gc_strdup(s);
 
     case AOP_IY:
-       wassert(IS_Z80);
-       setupPair(PAIR_IY, aop, offset);
-       tsprintf(s,"!*iyx", offset);
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
+  wassert(IS_Z80);
+  setupPair(PAIR_IY, aop, offset);
+  tsprintf(s,"!*iyx", offset);
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
 
     case AOP_STK:
-       if (IS_GB) {
-           setupPair(PAIR_HL, aop, offset);
-           tsprintf(s, "!*hl");
-       }
-       else {
-           if (aop->aopu.aop_stk >= 0)
-               offset += _G.stack.param_offset;
-           tsprintf(s,"!*ixx ; x", aop->aopu.aop_stk+offset);
-       }
-       rs = Safe_calloc(strlen(s)+1);
-       strcpy(rs,s);   
-       return rs;
-       
+  if (IS_GB) {
+      setupPair(PAIR_HL, aop, offset);
+      tsprintf(s, "!*hl");
+  }
+  else {
+      if (aop->aopu.aop_stk >= 0)
+    offset += _G.stack.param_offset;
+      tsprintf(s,"!*ixx ; x", aop->aopu.aop_stk+offset);
+  }
+  rs = Safe_calloc(1,strlen(s)+1);
+  strcpy(rs,s);
+  return rs;
+
     case AOP_CRY:
-       wassert(0);
-       
+  wassert(0);
+
     case AOP_ACC:
-       if (!offset) {
-           return "a";
-       }
-       return "!zero";
+  if (!offset) {
+      return "a";
+  }
+  return "!zero";
 
     case AOP_HLREG:
-       wassert(offset < 2);
-       return aop->aopu.aop_str[offset];
+  wassert(offset < 2);
+  return aop->aopu.aop_str[offset];
 
     case AOP_LIT:
-       return aopLiteral (aop->aopu.aop_lit,offset);
-       
+  return aopLiteral (aop->aopu.aop_lit,offset);
+
     case AOP_STR:
-       aop->coff = offset;
-       return aop->aopu.aop_str[offset];
+  aop->coff = offset;
+  return aop->aopu.aop_str[offset];
     default:
-       break;
+  break;
     }
     wassertl(0, "aopget got unsupported aop->type");
     exit(0);
@@ -1075,13 +1075,13 @@ static char *aopGet(asmop *aop, int offset, bool bit16)
 bool isRegString(const char *s)
 {
     if (!strcmp(s, "b") ||
-       !strcmp(s, "c") ||
-       !strcmp(s, "d") ||
-       !strcmp(s, "e") ||
-       !strcmp(s, "a") ||
-       !strcmp(s, "h") ||
-       !strcmp(s, "l"))
-       return TRUE;
+  !strcmp(s, "c") ||
+  !strcmp(s, "d") ||
+  !strcmp(s, "e") ||
+  !strcmp(s, "a") ||
+  !strcmp(s, "h") ||
+  !strcmp(s, "l"))
+  return TRUE;
     return FALSE;
 }
 
@@ -1094,9 +1094,9 @@ bool isConstant(const char *s)
 bool canAssignToPtr(const char *s)
 {
     if (isRegString(s))
-       return TRUE;
+  return TRUE;
     if (isConstant(s))
-       return TRUE;
+  return TRUE;
     return FALSE;
 }
 
@@ -1115,120 +1115,120 @@ static void aopPut (asmop *aop, const char *s, int offset)
     /* depending on where it is ofcourse */
     switch (aop->type) {
     case AOP_DIR:
-       /* Direct.  Hmmm. */
-       wassert(IS_GB);
-       if (strcmp(s, "a"))
-           emitcode("ld", "a,%s", s);
-       emitcode("ld", "(%s+%d),a", aop->aopu.aop_dir, offset);
-       break;
-       
+  /* Direct.  Hmmm. */
+  wassert(IS_GB);
+  if (strcmp(s, "a"))
+      emitcode("ld", "a,%s", s);
+  emitcode("ld", "(%s+%d),a", aop->aopu.aop_dir, offset);
+  break;
+
     case AOP_SFR:
-       wassert(IS_GB);
-       if (strcmp(s, "a"))
-           emitcode("ld", "a,%s", s);
-       emitcode("ldh", "(%s+%d),a", aop->aopu.aop_dir, offset);
-       break;
-       
+  wassert(IS_GB);
+  if (strcmp(s, "a"))
+      emitcode("ld", "a,%s", s);
+  emitcode("ldh", "(%s+%d),a", aop->aopu.aop_dir, offset);
+  break;
+
     case AOP_REG:
-       if (!strcmp(s, "!*hl"))
-           emit2("ld %s,!*hl", aop->aopu.aop_reg[offset]->name);
-       else
-           emit2("ld %s,%s",
-                 aop->aopu.aop_reg[offset]->name, s);
-       break;
-       
+  if (!strcmp(s, "!*hl"))
+      emit2("ld %s,!*hl", aop->aopu.aop_reg[offset]->name);
+  else
+      emit2("ld %s,%s",
+      aop->aopu.aop_reg[offset]->name, s);
+  break;
+
     case AOP_IY:
-       wassert(!IS_GB);
-       setupPair(PAIR_IY, aop, offset);
-       if (!canAssignToPtr(s)) {
-           emit2("ld a,%s", s);
-           emit2("ld !*iyx,a", offset);
-       }
-       else
-           emit2("ld !*iyx,%s", offset, s);
-       break;
-    
+  wassert(!IS_GB);
+  setupPair(PAIR_IY, aop, offset);
+  if (!canAssignToPtr(s)) {
+      emit2("ld a,%s", s);
+      emit2("ld !*iyx,a", offset);
+  }
+  else
+      emit2("ld !*iyx,%s", offset, s);
+  break;
+
     case AOP_HL:
-       wassert(IS_GB);
-       /* PENDING: for re-target */
-       if (!strcmp(s, "!*hl") || !strcmp(s, "(hl)") || !strcmp(s, "[hl]")) {
-           emit2("ld a,!*hl");
-           s = "a";
-       }
-       setupPair(PAIR_HL, aop, offset);
-       
-       emit2("ld !*hl,%s", s);
-       break;
+  wassert(IS_GB);
+  /* PENDING: for re-target */
+  if (!strcmp(s, "!*hl") || !strcmp(s, "(hl)") || !strcmp(s, "[hl]")) {
+      emit2("ld a,!*hl");
+      s = "a";
+  }
+  setupPair(PAIR_HL, aop, offset);
+
+  emit2("ld !*hl,%s", s);
+  break;
 
     case AOP_STK:
-       if (IS_GB) {
-           /* PENDING: re-target */
-           if (!strcmp(s, "!*hl") || !strcmp(s, "(hl)") || !strcmp(s, "[hl]")) {
-               emit2("ld a,!*hl");
-               s = "a";
-           }
-           setupPair(PAIR_HL, aop, offset);
-           if (!canAssignToPtr(s)) {
-               emit2("ld a,%s", s);
-               emit2("ld !*hl,a");
-           }
-           else
-               emit2("ld !*hl,%s", s);
-       }
-       else {
-           if (aop->aopu.aop_stk >= 0)
-               offset += _G.stack.param_offset;
-           if (!canAssignToPtr(s)) {
-               emit2("ld a,%s", s);
-               emit2("ld !*ixx,a", aop->aopu.aop_stk+offset);
-           }
-           else
-               emit2("ld !*ixx,%s", aop->aopu.aop_stk+offset, s);
-       }
-       break;
-       
+  if (IS_GB) {
+      /* PENDING: re-target */
+      if (!strcmp(s, "!*hl") || !strcmp(s, "(hl)") || !strcmp(s, "[hl]")) {
+    emit2("ld a,!*hl");
+    s = "a";
+      }
+      setupPair(PAIR_HL, aop, offset);
+      if (!canAssignToPtr(s)) {
+    emit2("ld a,%s", s);
+    emit2("ld !*hl,a");
+      }
+      else
+    emit2("ld !*hl,%s", s);
+  }
+  else {
+      if (aop->aopu.aop_stk >= 0)
+    offset += _G.stack.param_offset;
+      if (!canAssignToPtr(s)) {
+    emit2("ld a,%s", s);
+    emit2("ld !*ixx,a", aop->aopu.aop_stk+offset);
+      }
+      else
+    emit2("ld !*ixx,%s", aop->aopu.aop_stk+offset, s);
+  }
+  break;
+
     case AOP_CRY:
-       /* if bit variable */
-       if (!aop->aopu.aop_dir) {
-           emit2("ld a,#0");
-           emit2("rla");
-       } else {
-           /* In bit space but not in C - cant happen */
-           wassert(0);
-       }
-       break;
-       
+  /* if bit variable */
+  if (!aop->aopu.aop_dir) {
+      emit2("ld a,#0");
+      emit2("rla");
+  } else {
+      /* In bit space but not in C - cant happen */
+      wassert(0);
+  }
+  break;
+
     case AOP_STR:
-       aop->coff = offset;
-       if (strcmp(aop->aopu.aop_str[offset],s)) {
-           emitcode ("ld","%s,%s",aop->aopu.aop_str[offset],s);
-       }
-       break;
-       
+  aop->coff = offset;
+  if (strcmp(aop->aopu.aop_str[offset],s)) {
+      emitcode ("ld","%s,%s",aop->aopu.aop_str[offset],s);
+  }
+  break;
+
     case AOP_ACC:
-       aop->coff = offset;
-       if (!offset && (strcmp(s,"acc") == 0))
-           break;
-       if (offset>0) {
-           
-           emitcode("", "; Error aopPut AOP_ACC");
-       }
-       else {
-           if (strcmp(aop->aopu.aop_str[offset],s))
-               emitcode ("ld","%s,%s",aop->aopu.aop_str[offset],s);
-       }
-       break;
+  aop->coff = offset;
+  if (!offset && (strcmp(s,"acc") == 0))
+      break;
+  if (offset>0) {
+
+      emitcode("", "; Error aopPut AOP_ACC");
+  }
+  else {
+      if (strcmp(aop->aopu.aop_str[offset],s))
+    emitcode ("ld","%s,%s",aop->aopu.aop_str[offset],s);
+  }
+  break;
 
     case AOP_HLREG:
-       wassert(offset < 2);
-       emit2("ld %s,%s", aop->aopu.aop_str[offset], s);
-       break;
+  wassert(offset < 2);
+  emit2("ld %s,%s", aop->aopu.aop_str[offset], s);
+  break;
 
     default :
-       werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-              "aopPut got unsupported aop->type");
-       exit(0);    
-    }    
+  werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+         "aopPut got unsupported aop->type");
+  exit(0);
+    }
 }
 
 #define AOP(op) op->aop
@@ -1239,14 +1239,14 @@ static void aopPut (asmop *aop, const char *s, int offset)
 static void commitPair(asmop *aop, PAIR_ID id)
 {
     if (id == PAIR_HL && requiresHL(aop)) {
-       emit2("ld a,l");
-       emit2("ld d,h");
-       aopPut(aop, "a", 0);
-       aopPut(aop, "d", 1);
+  emit2("ld a,l");
+  emit2("ld d,h");
+  aopPut(aop, "a", 0);
+  aopPut(aop, "d", 1);
     }
     else {
-       aopPut(aop, _pairs[id].l, 0);
-       aopPut(aop, _pairs[id].h, 1);
+  aopPut(aop, _pairs[id].l, 0);
+  aopPut(aop, _pairs[id].h, 1);
     }
 }
 
@@ -1259,7 +1259,7 @@ int getDataSize(operand *op)
     size = AOP_SIZE(op);
     if(size == 3) {
         /* pointer */
-       wassert(0);
+  wassert(0);
     }
     return size;
 }
@@ -1274,17 +1274,17 @@ static void movLeft2Result (operand *left, int offl,
     if(!sameRegs(AOP(left),AOP(result)) || (offl != offr)){
         l = aopGet(AOP(left),offl,FALSE);
 
-       if (!sign) {
-           aopPut(AOP(result),l,offr);
-       }
-       else {
-           wassert(0);
+  if (!sign) {
+      aopPut(AOP(result),l,offr);
+  }
+  else {
+      wassert(0);
         }
     }
 }
 
 
-/** Put Acc into a register set 
+/** Put Acc into a register set
  */
 void outAcc(operand *result)
 {
@@ -1307,14 +1307,14 @@ void outBitCLong(operand *result, bool swap_sense)
 {
     /* if the result is bit */
     if (AOP_TYPE(result) == AOP_CRY) {
-       emitcode("", "; Note: outBitC form 1");
+  emitcode("", "; Note: outBitC form 1");
         aopPut(AOP(result),"blah",0);
     }
     else {
-       emit2("ld a,!zero");
-       emit2("rla");
-       if (swap_sense)
-           emit2("xor a,!immedbyte", 1);
+  emit2("ld a,!zero");
+  emit2("rla");
+  if (swap_sense)
+      emit2("xor a,!immedbyte", 1);
         outAcc(result);
     }
 }
@@ -1332,16 +1332,16 @@ void toBoolean(operand *oper)
     int size = AOP_SIZE(oper);
     int offset = 0;
     if (size>1) {
-       emitcode("ld", "a,%s", aopGet(AOP(oper), offset++, FALSE));
-       size--;
-       while (size--) 
-           emitcode("or","a,%s",aopGet(AOP(oper),offset++,FALSE));
+  emitcode("ld", "a,%s", aopGet(AOP(oper), offset++, FALSE));
+  size--;
+  while (size--)
+      emitcode("or","a,%s",aopGet(AOP(oper),offset++,FALSE));
     }
     else {
-       if (AOP(oper)->type != AOP_ACC) {
-           CLRC;
-           emitcode("or","a,%s",aopGet(AOP(oper),0,FALSE));
-       }
+  if (AOP(oper)->type != AOP_ACC) {
+      CLRC;
+      emitcode("or","a,%s",aopGet(AOP(oper),0,FALSE));
+  }
     }
 }
 
@@ -1358,12 +1358,12 @@ static void genNot (iCode *ic)
 
     /* if in bit space then a special case */
     if (AOP_TYPE(IC_LEFT(ic)) == AOP_CRY) {
-       wassert(0);
+  wassert(0);
     }
 
     /* if type float then do float */
     if (IS_FLOAT(optype)) {
-       wassert(0);
+  wassert(0);
     }
 
     toBoolean(IC_LEFT(ic));
@@ -1393,17 +1393,17 @@ static void genCpl (iCode *ic)
     aopOp (IC_LEFT(ic),ic,FALSE, FALSE);
     aopOp (IC_RESULT(ic),ic,TRUE, FALSE);
 
-    /* if both are in bit space then 
+    /* if both are in bit space then
     a special case */
     if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY &&
-        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) { 
-       wassert(0);
-    } 
+        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) {
+  wassert(0);
+    }
 
     size = AOP_SIZE(IC_RESULT(ic));
     while (size--) {
         char *l = aopGet(AOP(IC_LEFT(ic)),offset,FALSE);
-        MOVA(l);       
+        MOVA(l);
         emitcode("cpl","");
         aopPut(AOP(IC_RESULT(ic)),"a",offset++);
     }
@@ -1428,17 +1428,17 @@ static void genUminus (iCode *ic)
     /* if both in bit space then special
     case */
     if (AOP_TYPE(IC_RESULT(ic)) == AOP_CRY &&
-        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) { 
-       wassert(0);
+        AOP_TYPE(IC_LEFT(ic)) == AOP_CRY ) {
+  wassert(0);
         goto release;
-    } 
+    }
 
     optype = operandType(IC_LEFT(ic));
     rtype = operandType(IC_RESULT(ic));
 
     /* if float then do float stuff */
     if (IS_FLOAT(optype)) {
-       wassert(0);
+  wassert(0);
         goto release;
     }
 
@@ -1448,8 +1448,8 @@ static void genUminus (iCode *ic)
     CLRC ;
     while(size--) {
         char *l = aopGet(AOP(IC_LEFT(ic)),offset,FALSE);
-       emit2("ld a,!zero");
-       emit2("sbc a,%s",l);
+  emit2("ld a,!zero");
+  emit2("sbc a,%s",l);
         aopPut(AOP(IC_RESULT(ic)),"a",offset++);
     }
 
@@ -1458,9 +1458,9 @@ static void genUminus (iCode *ic)
     if ((size = (AOP_SIZE(IC_RESULT(ic)) - AOP_SIZE(IC_LEFT(ic))))) {
         emit2("rlc a");
         emit2("sbc a,a");
-        while (size--) 
+        while (size--)
             aopPut(AOP(IC_RESULT(ic)),"a",offset++);
-    }       
+    }
 
 release:
     /* release the aops */
@@ -1482,7 +1482,7 @@ static void _pop(PAIR_ID pairId)
 
 
 /*-----------------------------------------------------------------*/
-/* assignResultValue -                                            */
+/* assignResultValue -               */
 /*-----------------------------------------------------------------*/
 void assignResultValue(operand * oper)
 {
@@ -1494,22 +1494,22 @@ void assignResultValue(operand * oper)
 
 #if 0
     if (!IS_GB)
-       wassert(size <= 2);
+  wassert(size <= 2);
 #endif
     if (IS_GB && size == 4 && requiresHL(AOP(oper))) {
-       /* We do it the hard way here. */
-       _push(PAIR_HL);
-       aopPut(AOP(oper), _fReturn[0], 0);
-       aopPut(AOP(oper), _fReturn[1], 1);
-       emitcode("pop", "de");
-       _G.stack.pushed -= 2;
-       aopPut(AOP(oper), _fReturn[0], 2);
-       aopPut(AOP(oper), _fReturn[1], 3);
+  /* We do it the hard way here. */
+  _push(PAIR_HL);
+  aopPut(AOP(oper), _fReturn[0], 0);
+  aopPut(AOP(oper), _fReturn[1], 1);
+  emitcode("pop", "de");
+  _G.stack.pushed -= 2;
+  aopPut(AOP(oper), _fReturn[0], 2);
+  aopPut(AOP(oper), _fReturn[1], 3);
     }
     else {
-       while (size--) {
-           aopPut(AOP(oper), _fReturn[size], size);
-       }
+  while (size--) {
+      aopPut(AOP(oper), _fReturn[size], size);
+  }
     }
 }
 
@@ -1521,7 +1521,7 @@ static void genIpush (iCode *ic)
     int size, offset = 0 ;
     char *l;
 
-    /* if this is not a parm push : ie. it is spill push 
+    /* if this is not a parm push : ie. it is spill push
        and spill push is always done on the local stack */
     if (!ic->parmPush) {
         /* and the item is spilt then do nothing */
@@ -1531,29 +1531,29 @@ static void genIpush (iCode *ic)
         aopOp(IC_LEFT(ic),ic,FALSE, FALSE);
         size = AOP_SIZE(IC_LEFT(ic));
         /* push it on the stack */
-       if (isPair(AOP(IC_LEFT(ic)))) {
-           emitcode("push", getPairName(AOP(IC_LEFT(ic))));
-           _G.stack.pushed += 2;
-       }
-       else {
-           offset = size;
-           while (size--) {
-               /* Simple for now - load into A and PUSH AF */
-               if (AOP(IC_LEFT(ic))->type == AOP_IY) {
-                   char *l = aopGetLitWordLong(AOP(IC_LEFT(ic)), --offset, FALSE);
-                   wassert(l);
-                   emit2("ld a,(%s)", l);
-               }
-               else {
-                   l = aopGet(AOP(IC_LEFT(ic)), --offset, FALSE);
-                   emit2("ld a,%s", l);
-               }
-               emit2("push af");
-               emit2("inc sp");
-               _G.stack.pushed++;
-           }
-       }
-       return ;        
+  if (isPair(AOP(IC_LEFT(ic)))) {
+      emitcode("push", getPairName(AOP(IC_LEFT(ic))));
+      _G.stack.pushed += 2;
+  }
+  else {
+      offset = size;
+      while (size--) {
+    /* Simple for now - load into A and PUSH AF */
+    if (AOP(IC_LEFT(ic))->type == AOP_IY) {
+        char *l = aopGetLitWordLong(AOP(IC_LEFT(ic)), --offset, FALSE);
+        wassert(l);
+        emit2("ld a,(%s)", l);
+    }
+    else {
+        l = aopGet(AOP(IC_LEFT(ic)), --offset, FALSE);
+        emit2("ld a,%s", l);
+    }
+    emit2("push af");
+    emit2("inc sp");
+    _G.stack.pushed++;
+      }
+  }
+  return ;
     }
 
     /* Hmmm... what about saving the currently used registers
@@ -1565,43 +1565,43 @@ static void genIpush (iCode *ic)
     size = AOP_SIZE(IC_LEFT(ic));
 
     if (isPair(AOP(IC_LEFT(ic)))) {
-       _G.stack.pushed+=2;
-       emitcode("push", "%s", getPairName(AOP(IC_LEFT(ic))));
+  _G.stack.pushed+=2;
+  emitcode("push", "%s", getPairName(AOP(IC_LEFT(ic))));
     }
     else {
-       if (size == 2) {
-           fetchHL(AOP(IC_LEFT(ic)));
-           emitcode("push", "hl");
-           spillPair(PAIR_HL);
-           _G.stack.pushed += 2;
-           goto release;
-       }
-       if (size == 4) {
-           fetchPairLong(PAIR_HL, AOP(IC_LEFT(ic)), 2);
-           emitcode("push", "hl");
-           spillPair(PAIR_HL);
-           _G.stack.pushed += 2;
-           fetchPairLong(PAIR_HL, AOP(IC_LEFT(ic)), 0);
-           emitcode("push", "hl");
-           spillPair(PAIR_HL);
-           _G.stack.pushed += 2;
-           goto release;
-       }
-       offset = size;
-       while (size--) {
-           if (AOP(IC_LEFT(ic))->type == AOP_IY) {
-               char *l = aopGetLitWordLong(AOP(IC_LEFT(ic)), --offset, FALSE);
-               wassert(l);
-               emit2("ld a,(%s)", l);
-           }
-           else {
-               l = aopGet(AOP(IC_LEFT(ic)), --offset, FALSE);
-               emit2("ld a,%s", l);
-           }
-           emitcode("push", "af");
-           emitcode("inc", "sp");
-           _G.stack.pushed++;
-       }       
+  if (size == 2) {
+      fetchHL(AOP(IC_LEFT(ic)));
+      emitcode("push", "hl");
+      spillPair(PAIR_HL);
+      _G.stack.pushed += 2;
+      goto release;
+  }
+  if (size == 4) {
+      fetchPairLong(PAIR_HL, AOP(IC_LEFT(ic)), 2);
+      emitcode("push", "hl");
+      spillPair(PAIR_HL);
+      _G.stack.pushed += 2;
+      fetchPairLong(PAIR_HL, AOP(IC_LEFT(ic)), 0);
+      emitcode("push", "hl");
+      spillPair(PAIR_HL);
+      _G.stack.pushed += 2;
+      goto release;
+  }
+  offset = size;
+  while (size--) {
+      if (AOP(IC_LEFT(ic))->type == AOP_IY) {
+    char *l = aopGetLitWordLong(AOP(IC_LEFT(ic)), --offset, FALSE);
+    wassert(l);
+    emit2("ld a,(%s)", l);
+      }
+      else {
+    l = aopGet(AOP(IC_LEFT(ic)), --offset, FALSE);
+    emit2("ld a,%s", l);
+      }
+      emitcode("push", "af");
+      emitcode("inc", "sp");
+      _G.stack.pushed++;
+  }
     }
  release:
     freeAsmop(IC_LEFT(ic),NULL,ic);
@@ -1623,15 +1623,15 @@ static void genIpop (iCode *ic)
     size = AOP_SIZE(IC_LEFT(ic));
     offset = (size-1);
     if (isPair(AOP(IC_LEFT(ic)))) {
-       emitcode("pop", getPairName(AOP(IC_LEFT(ic))));
+  emitcode("pop", getPairName(AOP(IC_LEFT(ic))));
     }
     else {
-       while (size--) {
-           emitcode("dec", "sp");
-           emitcode("pop", "hl");
-           spillPair(PAIR_HL);
-           aopPut(AOP(IC_LEFT(ic)), "l", offset--);
-       }
+  while (size--) {
+      emitcode("dec", "sp");
+      emitcode("pop", "hl");
+      spillPair(PAIR_HL);
+      aopPut(AOP(IC_LEFT(ic)), "l", offset--);
+  }
     }
 
     freeAsmop(IC_LEFT(ic),NULL,ic);
@@ -1642,13 +1642,13 @@ static int _isPairUsed(iCode *ic, PAIR_ID pairId)
     int ret = 0;
     switch (pairId) {
     case PAIR_DE:
-       if (bitVectBitValue(ic->rUsed, D_IDX))
-           ret++;
-       if (bitVectBitValue(ic->rUsed, E_IDX))
-           ret++;
-       break;
+  if (bitVectBitValue(ic->rUsed, D_IDX))
+      ret++;
+  if (bitVectBitValue(ic->rUsed, E_IDX))
+      ret++;
+  break;
     default:
-       wassert(0);
+  wassert(0);
     }
     return ret;
 }
@@ -1660,25 +1660,25 @@ static int _opUsesPair(operand *op, iCode *ic, PAIR_ID pairId)
     symbol *sym = OP_SYMBOL(op);
 
     if (sym->isspilt || sym->nRegs == 0)
-       return 0;
+  return 0;
 
     aopOp(op, ic, FALSE, FALSE);
-    
+
     aop = AOP(op);
     if (aop->type == AOP_REG) {
-       int i;
-       for (i=0; i < aop->size; i++) {
-           if (pairId == PAIR_DE) {
-               emit2("; name %s", aop->aopu.aop_reg[i]->name);
-               if (!strcmp(aop->aopu.aop_reg[i]->name, "e"))
-                   ret++;
-               if (!strcmp(aop->aopu.aop_reg[i]->name, "d"))
-                   ret++;
-           }
-           else {
-               wassert(0);
-           }
-       }
+  int i;
+  for (i=0; i < aop->size; i++) {
+      if (pairId == PAIR_DE) {
+    emit2("; name %s", aop->aopu.aop_reg[i]->name);
+    if (!strcmp(aop->aopu.aop_reg[i]->name, "e"))
+        ret++;
+    if (!strcmp(aop->aopu.aop_reg[i]->name, "d"))
+        ret++;
+      }
+      else {
+    wassert(0);
+      }
+  }
     }
 
     freeAsmop(IC_LEFT(ic),NULL,ic);
@@ -1690,18 +1690,18 @@ static void setArea(int inHome)
 {
     static int lastArea = 0;
 
-    /*    
+    /*
     if (_G.in_home != inHome) {
-       if (inHome) {
-           const char *sz = port->mem.code_name;
-           port->mem.code_name = "HOME";
-           emit2("!area", CODE_NAME);
-           port->mem.code_name = sz;
-       }
-       else
-       emit2("!area", CODE_NAME);*/
-       _G.in_home = inHome;
-       //    }
+  if (inHome) {
+      const char *sz = port->mem.code_name;
+      port->mem.code_name = "HOME";
+      emit2("!area", CODE_NAME);
+      port->mem.code_name = sz;
+  }
+  else
+  emit2("!area", CODE_NAME);*/
+  _G.in_home = inHome;
+  //    }
 }
 
 static bool isInHome(void)
@@ -1709,7 +1709,7 @@ static bool isInHome(void)
     return _G.in_home;
 }
 
-/** Emit the code for a call statement 
+/** Emit the code for a call statement
  */
 static void emitCall(iCode *ic, bool ispcall)
 {
@@ -1718,115 +1718,115 @@ static void emitCall(iCode *ic, bool ispcall)
 
     /* if caller saves & we have not saved then */
     if (!ic->regsSaved) {
-       /* PENDING */
+  /* PENDING */
     }
-    
+
     /* if send set is not empty then assign */
     if (sendSet) {
-       iCode *sic;
-       int send = 0;
-       int n = elementsInSet(sendSet);
-       if (IS_Z80 && n == 2 && _isPairUsed(ic, PAIR_DE)) {
-           /* Only push de if it is used and if it's not used
-              in the return value */
-           /* Panic if partly used */
-           if (_opUsesPair(IC_RESULT(ic), ic, PAIR_DE) == 1) {
-               emit2("; Warning: de crossover");
-           }
-           else if (!_opUsesPair(IC_RESULT(ic), ic, PAIR_DE)) {
-               /* Store away de */
-               _push(PAIR_DE);
-               pushed_de = 1;
-           }
-       }
-       /* PENDING: HACK */
-       if (IS_Z80 && n == 2 ) {
-           /* Want to load HL first, then DE as HL may = DE */
-           sic = setFirstItem(sendSet);
-           sic = setNextItem(sendSet);
-           aopOp(IC_LEFT(sic),sic,FALSE, FALSE);
-           fetchPair(PAIR_HL, AOP(IC_LEFT(sic)));
-           send++;
-           freeAsmop (IC_LEFT(sic),NULL,sic);
-           sic = setFirstItem(sendSet);
-           aopOp(IC_LEFT(sic),sic,FALSE, FALSE);
-           fetchPair(PAIR_DE, AOP(IC_LEFT(sic)));
-           send++;
-           freeAsmop (IC_LEFT(sic),NULL,sic);
-       }
-       else {
-           for (sic = setFirstItem(sendSet) ; sic ; 
-                sic = setNextItem(sendSet)) {
-               int size;
-               aopOp(IC_LEFT(sic),sic,FALSE, FALSE);
-               size = AOP_SIZE(IC_LEFT(sic));
-               wassert(size <= 2);
-               /* Always send in pairs */
-               switch (send) {
-               case 0:
-                   if (IS_Z80 && n == 1)
-                       fetchPair(PAIR_HL, AOP(IC_LEFT(sic)));
-                   else
-                       fetchPair(PAIR_DE, AOP(IC_LEFT(sic)));
-                   break;
-               case 1:
-                   fetchPair(PAIR_HL, AOP(IC_LEFT(sic)));
-                   break;
-               default:
-                   /* Send set too big */
-                   wassert(0);
-               }
-               send++;
-               freeAsmop (IC_LEFT(sic),NULL,sic);
-           }
-       }
-       sendSet = NULL;
-       if (pushed_de) {
-       }
+  iCode *sic;
+  int send = 0;
+  int n = elementsInSet(sendSet);
+  if (IS_Z80 && n == 2 && _isPairUsed(ic, PAIR_DE)) {
+      /* Only push de if it is used and if it's not used
+         in the return value */
+      /* Panic if partly used */
+      if (_opUsesPair(IC_RESULT(ic), ic, PAIR_DE) == 1) {
+    emit2("; Warning: de crossover");
+      }
+      else if (!_opUsesPair(IC_RESULT(ic), ic, PAIR_DE)) {
+    /* Store away de */
+    _push(PAIR_DE);
+    pushed_de = 1;
+      }
+  }
+  /* PENDING: HACK */
+  if (IS_Z80 && n == 2 ) {
+      /* Want to load HL first, then DE as HL may = DE */
+      sic = setFirstItem(sendSet);
+      sic = setNextItem(sendSet);
+      aopOp(IC_LEFT(sic),sic,FALSE, FALSE);
+      fetchPair(PAIR_HL, AOP(IC_LEFT(sic)));
+      send++;
+      freeAsmop (IC_LEFT(sic),NULL,sic);
+      sic = setFirstItem(sendSet);
+      aopOp(IC_LEFT(sic),sic,FALSE, FALSE);
+      fetchPair(PAIR_DE, AOP(IC_LEFT(sic)));
+      send++;
+      freeAsmop (IC_LEFT(sic),NULL,sic);
+  }
+  else {
+      for (sic = setFirstItem(sendSet) ; sic ;
+     sic = setNextItem(sendSet)) {
+    int size;
+    aopOp(IC_LEFT(sic),sic,FALSE, FALSE);
+    size = AOP_SIZE(IC_LEFT(sic));
+    wassert(size <= 2);
+    /* Always send in pairs */
+    switch (send) {
+    case 0:
+        if (IS_Z80 && n == 1)
+      fetchPair(PAIR_HL, AOP(IC_LEFT(sic)));
+        else
+      fetchPair(PAIR_DE, AOP(IC_LEFT(sic)));
+        break;
+    case 1:
+        fetchPair(PAIR_HL, AOP(IC_LEFT(sic)));
+        break;
+    default:
+        /* Send set too big */
+        wassert(0);
+    }
+    send++;
+    freeAsmop (IC_LEFT(sic),NULL,sic);
+      }
+  }
+  sendSet = NULL;
+  if (pushed_de) {
+  }
     }
 
     if (ispcall) {
-       if (IS_BANKEDCALL(detype)) {
-           werror(W_INDIR_BANKED);
-       }
-       aopOp(IC_LEFT(ic),ic,FALSE, FALSE);
-
-       if (isLitWord(AOP(IC_LEFT(ic)))) {
-           emitcode("", "; Special case where the pCall is to a constant");
-           emitcode("call", aopGetLitWordLong(AOP(IC_LEFT(ic)), 0, FALSE));
-       }
-       else {
-           symbol *rlbl = newiTempLabel(NULL);
-           spillPair(PAIR_HL);
-           emit2("ld hl,!immed!tlabel", (rlbl->key+100));
-           emitcode("push", "hl");
-           _G.stack.pushed += 2;
-           
-           fetchHL(AOP(IC_LEFT(ic)));
-           emit2("jp !*hl");
-           emit2("!tlabeldef", (rlbl->key+100));
-           _G.stack.pushed -= 2;
-       }
-       freeAsmop(IC_LEFT(ic),NULL,ic); 
+  if (IS_BANKEDCALL(detype)) {
+      werror(W_INDIR_BANKED);
+  }
+  aopOp(IC_LEFT(ic),ic,FALSE, FALSE);
+
+  if (isLitWord(AOP(IC_LEFT(ic)))) {
+      emitcode("", "; Special case where the pCall is to a constant");
+      emitcode("call", aopGetLitWordLong(AOP(IC_LEFT(ic)), 0, FALSE));
+  }
+  else {
+      symbol *rlbl = newiTempLabel(NULL);
+      spillPair(PAIR_HL);
+      emit2("ld hl,!immed!tlabel", (rlbl->key+100));
+      emitcode("push", "hl");
+      _G.stack.pushed += 2;
+
+      fetchHL(AOP(IC_LEFT(ic)));
+      emit2("jp !*hl");
+      emit2("!tlabeldef", (rlbl->key+100));
+      _G.stack.pushed -= 2;
+  }
+  freeAsmop(IC_LEFT(ic),NULL,ic);
     }
     else {
-       char *name = OP_SYMBOL(IC_LEFT(ic))->rname[0] ?
-           OP_SYMBOL(IC_LEFT(ic))->rname :
-           OP_SYMBOL(IC_LEFT(ic))->name;
-       if (IS_BANKEDCALL(detype)) {
-           emit2("call banked_call");
-           emit2("!dws", name);
-           emit2("!dw !bankimmeds", name);
-       }
-       else {
-           /* make the call */
-           emit2("call %s", name);
-       }
+  char *name = OP_SYMBOL(IC_LEFT(ic))->rname[0] ?
+      OP_SYMBOL(IC_LEFT(ic))->rname :
+      OP_SYMBOL(IC_LEFT(ic))->name;
+  if (IS_BANKEDCALL(detype)) {
+      emit2("call banked_call");
+      emit2("!dws", name);
+      emit2("!dw !bankimmeds", name);
+  }
+  else {
+      /* make the call */
+      emit2("call %s", name);
+  }
     }
     spillCached();
 
     /* if we need assign a result value */
-    if ((IS_ITEMP(IC_RESULT(ic)) && 
+    if ((IS_ITEMP(IC_RESULT(ic)) &&
          (OP_SYMBOL(IC_RESULT(ic))->nRegs ||
           OP_SYMBOL(IC_RESULT(ic))->spildir )) ||
         IS_TRUE_SYMOP(IC_RESULT(ic)) ) {
@@ -1835,38 +1835,38 @@ static void emitCall(iCode *ic, bool ispcall)
         aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
         accInUse--;
 
-       assignResultValue(IC_RESULT(ic));
-               
+  assignResultValue(IC_RESULT(ic));
+
         freeAsmop(IC_RESULT(ic),NULL, ic);
     }
 
     /* adjust the stack for parameters if required */
     if (IC_LEFT(ic)->parmBytes) {
-       int i = IC_LEFT(ic)->parmBytes;
-       _G.stack.pushed -= i;
-       if (IS_GB) {
-           emit2("!ldaspsp", i);
-       }
-       else {
-           spillCached();
-           if (i>6) {
-               emitcode("ld", "hl,#%d", i);
-               emitcode("add", "hl,sp");
-               emitcode("ld", "sp,hl");
-           }
-           else {
-               while (i>1) {
-                   emitcode("pop", "hl");
-                   i-=2;
-               }
-               if (i) 
-                   emitcode("inc", "sp");
-           }
-           spillCached();
-       }
+  int i = IC_LEFT(ic)->parmBytes;
+  _G.stack.pushed -= i;
+  if (IS_GB) {
+      emit2("!ldaspsp", i);
+  }
+  else {
+      spillCached();
+      if (i>6) {
+    emitcode("ld", "hl,#%d", i);
+    emitcode("add", "hl,sp");
+    emitcode("ld", "sp,hl");
+      }
+      else {
+    while (i>1) {
+        emitcode("pop", "hl");
+        i-=2;
+    }
+    if (i)
+        emitcode("inc", "sp");
+      }
+      spillCached();
+  }
     }
     if (pushed_de)
-       _pop(PAIR_DE);
+  _pop(PAIR_DE);
 }
 
 /*-----------------------------------------------------------------*/
@@ -1896,7 +1896,7 @@ static int resultRemat (iCode *ic)
 
     if (IC_RESULT(ic) && IS_ITEMP(IC_RESULT(ic))) {
         symbol *sym = OP_SYMBOL(IC_RESULT(ic));
-        if (sym->remat && !POINTER_SET(ic)) 
+        if (sym->remat && !POINTER_SET(ic))
             return 1;
     }
 
@@ -1918,7 +1918,7 @@ static void genFunction (iCode *ic)
 
     /* PENDING: hack */
     if (!IS_STATIC(sym->etype)) {
-       addSetIfnotP(&publics, sym);
+  addSetIfnotP(&publics, sym);
     }
 
     /* create the function header */
@@ -1926,17 +1926,17 @@ static void genFunction (iCode *ic)
     /* PENDING: portability. */
     emit2("__%s_start:", sym->rname);
     emit2("!functionlabeldef", sym->rname);
-   
+
     fetype = getSpec(operandType(IC_LEFT(ic)));
-    
+
     /* if critical function then turn interrupts off */
     if (SPEC_CRTCL(fetype))
-       emit2("!di");
+  emit2("!di");
 
     /* if this is an interrupt service routine then
     save acc, b, dpl, dph  */
     if (IS_ISR(sym->etype)) {
-       emit2("!pusha");
+  emit2("!pusha");
     }
     /* PENDING: callee-save etc */
 
@@ -1945,39 +1945,39 @@ static void genFunction (iCode *ic)
     _G.stack.pushed_de = 0;
     _G.stack.param_offset = 0;
     if (sym->regsUsed) {
-       int i;
-       for ( i = 0 ; i < sym->regsUsed->size ; i++) {
-           if (bitVectBitValue(sym->regsUsed, i)) {
-               switch (i) {
-               case C_IDX:
-               case B_IDX:
-                   _G.stack.pushed_bc = 1;
-                   break;
-               case D_IDX:
-               case E_IDX:
-                   if (IS_Z80)
-                       _G.stack.pushed_de = 1;
-                   break;
-               }
-           }
-       }
-       if (_G.stack.pushed_bc) {
-           emit2("push bc");
-           _G.stack.param_offset += 2;
-       }
-       if (_G.stack.pushed_de) {
-           emit2("push de");
-           _G.stack.param_offset += 2;
-       }
+  int i;
+  for ( i = 0 ; i < sym->regsUsed->size ; i++) {
+      if (bitVectBitValue(sym->regsUsed, i)) {
+    switch (i) {
+    case C_IDX:
+    case B_IDX:
+        _G.stack.pushed_bc = 1;
+        break;
+    case D_IDX:
+    case E_IDX:
+        if (IS_Z80)
+      _G.stack.pushed_de = 1;
+        break;
+    }
+      }
+  }
+  if (_G.stack.pushed_bc) {
+      emit2("push bc");
+      _G.stack.param_offset += 2;
+  }
+  if (_G.stack.pushed_de) {
+      emit2("push de");
+      _G.stack.param_offset += 2;
+  }
     }
 
     /* adjust the stack for the function */
     _G.stack.last = sym->stack;
 
     if (sym->stack)
-       emit2("!enterx", sym->stack);
+  emit2("!enterx", sym->stack);
     else
-       emit2("!enter");
+  emit2("!enter");
     _G.stack.offset = sym->stack;
 }
 
@@ -1989,40 +1989,40 @@ static void genEndFunction (iCode *ic)
     symbol *sym = OP_SYMBOL(IC_LEFT(ic));
 
     if (IS_ISR(sym->etype)) {
-       wassert(0);
+  wassert(0);
     }
     else {
         if (SPEC_CRTCL(sym->etype))
-           emit2("!ei");
-       
-       /* PENDING: calleeSave */
-
-       /* if debug then send end of function */
-       if (options.debug && currFunc) { 
-           debugLine = 1;
-           emitcode("","C$%s$%d$%d$%d ==.",
-                    ic->filename,currFunc->lastLine,
-                    ic->level,ic->block); 
-           if (IS_STATIC(currFunc->etype))         
-               emitcode("","XF%s$%s$0$0 ==.",moduleName,currFunc->name); 
-           else
-               emitcode("","XG$%s$0$0 ==.",currFunc->name);
-           debugLine = 0;
-       }
-       if (_G.stack.offset)
-           emit2("!leavex", _G.stack.offset);
-       else
-           emit2("!leave");
-
-       if (_G.stack.pushed_de)
-           emit2("pop de");
-       if (_G.stack.pushed_bc)
-           emit2("pop bc");
-       /* Both baned and non-banked just ret */
-       emit2("ret");
-       
-       /* PENDING: portability. */
-       emit2("__%s_end:", sym->rname);
+      emit2("!ei");
+
+  /* PENDING: calleeSave */
+
+  /* if debug then send end of function */
+  if (options.debug && currFunc) {
+      debugLine = 1;
+      emitcode("","C$%s$%d$%d$%d ==.",
+         ic->filename,currFunc->lastLine,
+         ic->level,ic->block);
+      if (IS_STATIC(currFunc->etype))
+    emitcode("","XF%s$%s$0$0 ==.",moduleName,currFunc->name);
+      else
+    emitcode("","XG$%s$0$0 ==.",currFunc->name);
+      debugLine = 0;
+  }
+  if (_G.stack.offset)
+      emit2("!leavex", _G.stack.offset);
+  else
+      emit2("!leave");
+
+  if (_G.stack.pushed_de)
+      emit2("pop de");
+  if (_G.stack.pushed_bc)
+      emit2("pop bc");
+  /* Both baned and non-banked just ret */
+  emit2("ret");
+
+  /* PENDING: portability. */
+  emit2("__%s_end:", sym->rname);
     }
     _G.flush_statics = 1;
     _G.stack.pushed = 0;
@@ -2038,48 +2038,48 @@ static void genRet (iCode *ic)
     /* Errk.  This is a hack until I can figure out how
        to cause dehl to spill on a call */
     int size,offset = 0;
-    
+
     /* if we have no return value then
        just generate the "ret" */
-    if (!IC_LEFT(ic)) 
-       goto jumpret;       
-    
+    if (!IC_LEFT(ic))
+  goto jumpret;
+
     /* we have something to return then
        move the return value into place */
     aopOp(IC_LEFT(ic),ic,FALSE, FALSE);
     size = AOP_SIZE(IC_LEFT(ic));
-    
+
     if ((size == 2) && ((l = aopGetWord(AOP(IC_LEFT(ic)), 0)))) {
-       if (IS_GB) {
-           emitcode("ld", "de,%s", l);
-       }
-       else {
-           emitcode("ld", "hl,%s", l);
-       }
+  if (IS_GB) {
+      emitcode("ld", "de,%s", l);
+  }
+  else {
+      emitcode("ld", "hl,%s", l);
+  }
     }
     else {
-       if (IS_GB && size == 4 && requiresHL(AOP(IC_LEFT(ic)))) {
-           fetchPair(PAIR_DE, AOP(IC_LEFT(ic)));
-           fetchPairLong(PAIR_HL, AOP(IC_LEFT(ic)), 2);
-       }
-       else {
-           while (size--) {
-               l = aopGet(AOP(IC_LEFT(ic)),offset,
-                          FALSE);
-               if (strcmp(_fReturn[offset],l))
-                   emitcode("ld","%s,%s", _fReturn[offset++],l);
-           }
-       }
+  if (IS_GB && size == 4 && requiresHL(AOP(IC_LEFT(ic)))) {
+      fetchPair(PAIR_DE, AOP(IC_LEFT(ic)));
+      fetchPairLong(PAIR_HL, AOP(IC_LEFT(ic)), 2);
+  }
+  else {
+      while (size--) {
+    l = aopGet(AOP(IC_LEFT(ic)),offset,
+         FALSE);
+    if (strcmp(_fReturn[offset],l))
+        emitcode("ld","%s,%s", _fReturn[offset++],l);
+      }
+  }
     }
     freeAsmop (IC_LEFT(ic),NULL,ic);
-    
+
  jumpret:
-       /* generate a jump to the return label
-          if the next is not the return statement */
+  /* generate a jump to the return label
+     if the next is not the return statement */
     if (!(ic->next && ic->next->op == LABEL &&
-         IC_LABEL(ic->next) == returnLabel))
-       
-       emit2("jp !tlabel", returnLabel->key+100);
+    IC_LABEL(ic->next) == returnLabel))
+
+  emit2("jp !tlabel", returnLabel->key+100);
 }
 
 /*-----------------------------------------------------------------*/
@@ -2112,39 +2112,39 @@ static bool genPlusIncr (iCode *ic)
     PAIR_ID resultId = getPairId(AOP(IC_RESULT(ic)));
 
     /* will try to generate an increment */
-    /* if the right side is not a literal 
+    /* if the right side is not a literal
        we cannot */
     if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT)
         return FALSE;
-    
+
     emitcode("", "; genPlusIncr");
 
     icount = floatFromVal(AOP(IC_RIGHT(ic))->aopu.aop_lit);
-    
+
     /* If result is a pair */
     if (resultId != PAIR_INVALID) {
-       if (isLitWord(AOP(IC_LEFT(ic)))) {
-           fetchLitPair(getPairId(AOP(IC_RESULT(ic))), AOP(IC_LEFT(ic)), icount);
-           return TRUE;
-       }
-       if (isPair(AOP(IC_LEFT(ic))) && resultId == PAIR_HL && icount > 2) {
-           fetchPair(resultId, AOP(IC_RIGHT(ic)));
-           emitcode("add", "hl,%s", getPairName(AOP(IC_LEFT(ic))));
-           return TRUE;
-       }
-       if (icount > 5)
-           return FALSE;
-       /* Inc a pair */
-       if (!sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic)))) {
-           if (icount > 2)
-               return FALSE;
-           movLeft2Result(IC_LEFT(ic), 0, IC_RESULT(ic), 0, 0);
-           movLeft2Result(IC_LEFT(ic), 1, IC_RESULT(ic), 1, 0);
-       }
-       while (icount--) {
-           emitcode("inc", "%s", getPairName(AOP(IC_RESULT(ic))));
-       }
-       return TRUE;
+  if (isLitWord(AOP(IC_LEFT(ic)))) {
+      fetchLitPair(getPairId(AOP(IC_RESULT(ic))), AOP(IC_LEFT(ic)), icount);
+      return TRUE;
+  }
+  if (isPair(AOP(IC_LEFT(ic))) && resultId == PAIR_HL && icount > 2) {
+      fetchPair(resultId, AOP(IC_RIGHT(ic)));
+      emitcode("add", "hl,%s", getPairName(AOP(IC_LEFT(ic))));
+      return TRUE;
+  }
+  if (icount > 5)
+      return FALSE;
+  /* Inc a pair */
+  if (!sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic)))) {
+      if (icount > 2)
+    return FALSE;
+      movLeft2Result(IC_LEFT(ic), 0, IC_RESULT(ic), 0, 0);
+      movLeft2Result(IC_LEFT(ic), 1, IC_RESULT(ic), 1, 0);
+  }
+  while (icount--) {
+      emitcode("inc", "%s", getPairName(AOP(IC_RESULT(ic))));
+  }
+  return TRUE;
     }
 
     /* if the literal value of the right hand side
@@ -2156,17 +2156,17 @@ static bool genPlusIncr (iCode *ic)
     if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) &&
         size > 1 &&
         icount == 1
-       ) {
-       int offset = 0;
-       symbol *tlbl = NULL;
-       tlbl = newiTempLabel(NULL);
-       while (size--) {
-           emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)), offset++, FALSE));
-           if (size) {
-               emit2("!shortjp nz,!tlabel", tlbl->key+100);
-           }
-       }
-       emitLabel(tlbl->key+100);
+  ) {
+  int offset = 0;
+  symbol *tlbl = NULL;
+  tlbl = newiTempLabel(NULL);
+  while (size--) {
+      emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)), offset++, FALSE));
+      if (size) {
+    emit2("!shortjp nz,!tlabel", tlbl->key+100);
+      }
+  }
+  emitLabel(tlbl->key+100);
         return TRUE;
     }
 
@@ -2174,16 +2174,16 @@ static bool genPlusIncr (iCode *ic)
     if (AOP_SIZE(IC_RESULT(ic)) > 1 ||
         AOP_SIZE(IC_LEFT(ic)) > 1   )
         return FALSE ;
-    
+
     /* we can if the aops of the left & result match or
        if they are in registers and the registers are the
        same */
     if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) ) {
-       while (icount--)
-           emitcode ("inc","%s",aopGet(AOP(IC_LEFT(ic)),0, FALSE));
+  while (icount--)
+      emitcode ("inc","%s",aopGet(AOP(IC_LEFT(ic)),0, FALSE));
         return TRUE ;
     }
-    
+
     return FALSE ;
 }
 
@@ -2195,12 +2195,12 @@ void outBitAcc(operand *result)
     symbol *tlbl = newiTempLabel(NULL);
     /* if the result is a bit */
     if (AOP_TYPE(result) == AOP_CRY){
-       wassert(0);
+  wassert(0);
     }
     else {
         emit2("!shortjp z,!tlabel", tlbl->key+100);
-       emit2("ld a,!one");
-       emitLabel(tlbl->key+100);
+  emit2("ld a,!one");
+  emitLabel(tlbl->key+100);
         outAcc(result);
     }
 }
@@ -2225,8 +2225,8 @@ static void genPlus (iCode *ic)
        in ACC */
 
     if ((AOP_TYPE(IC_LEFT(ic)) == AOP_LIT) ||
-       (AOP_NEEDSACC(IC_LEFT(ic))) ||
-       AOP_TYPE(IC_RIGHT(ic)) == AOP_ACC ){
+  (AOP_NEEDSACC(IC_LEFT(ic))) ||
+  AOP_TYPE(IC_RIGHT(ic)) == AOP_ACC ){
         operand *t = IC_RIGHT(ic);
         IC_RIGHT(ic) = IC_LEFT(ic);
         IC_LEFT(ic) = t;
@@ -2236,21 +2236,21 @@ static void genPlus (iCode *ic)
     space */
     if (AOP_TYPE(IC_LEFT(ic)) == AOP_CRY &&
         AOP_TYPE(IC_RIGHT(ic)) == AOP_CRY) {
-       /* Cant happen */
-       wassert(0);
+  /* Cant happen */
+  wassert(0);
     }
 
     /* if left in bit space & right literal */
     if (AOP_TYPE(IC_LEFT(ic)) == AOP_CRY &&
         AOP_TYPE(IC_RIGHT(ic)) == AOP_LIT) {
-       /* Can happen I guess */
-       wassert(0);
+  /* Can happen I guess */
+  wassert(0);
     }
 
     /* if I can do an increment instead
     of add then GOOD for ME */
     if (genPlusIncr (ic) == TRUE)
-        goto release;   
+        goto release;
 
     emit2("; genPlusIncr failed");
 
@@ -2258,114 +2258,114 @@ static void genPlus (iCode *ic)
 
     /* Special case when left and right are constant */
     if (isPair(AOP(IC_RESULT(ic)))) {
-       char *left, *right;
-       
-       left = aopGetLitWordLong(AOP(IC_LEFT(ic)), 0, FALSE);
-       right = aopGetLitWordLong(AOP(IC_RIGHT(ic)), 0, FALSE);
-       if (left && right) {
-           /* It's a pair */
-           /* PENDING: fix */
-           char buffer[100];
-           sprintf(buffer, "#(%s + %s)", left, right);
-           emitcode("ld", "%s,%s", getPairName(AOP(IC_RESULT(ic))), buffer);
-           goto release;
-       }
+  char *left, *right;
+
+  left = aopGetLitWordLong(AOP(IC_LEFT(ic)), 0, FALSE);
+  right = aopGetLitWordLong(AOP(IC_RIGHT(ic)), 0, FALSE);
+  if (left && right) {
+      /* It's a pair */
+      /* PENDING: fix */
+      char buffer[100];
+      sprintf(buffer, "#(%s + %s)", left, right);
+      emitcode("ld", "%s,%s", getPairName(AOP(IC_RESULT(ic))), buffer);
+      goto release;
+  }
     }
 
     if (isPair(AOP(IC_RIGHT(ic))) && getPairId(AOP(IC_RESULT(ic))) == PAIR_HL) {
-       /* Fetch into HL then do the add */
-       spillPair(PAIR_HL);
-       fetchPair(PAIR_HL, AOP(IC_LEFT(ic)));
-       emitcode("add", "hl,%s", getPairName(AOP(IC_RIGHT(ic))));
-       goto release;
+  /* Fetch into HL then do the add */
+  spillPair(PAIR_HL);
+  fetchPair(PAIR_HL, AOP(IC_LEFT(ic)));
+  emitcode("add", "hl,%s", getPairName(AOP(IC_RIGHT(ic))));
+  goto release;
     }
 
     /* Special case:
        ld hl,sp+n trashes C so we cant afford to do it during an
        add with stack based varibles.  Worst case is:
-               ld  hl,sp+left
-       ld  a,(hl)
-       ld  hl,sp+right
-       add (hl)
-       ld  hl,sp+result
-       ld  (hl),a
-       ld  hl,sp+left+1
-       ld  a,(hl)
-       ld  hl,sp+right+1
-       adc (hl)
-       ld  hl,sp+result+1
-       ld  (hl),a
-       So you cant afford to load up hl if either left, right, or result
-       is on the stack (*sigh*)  The alt is:
-       ld  hl,sp+left
-       ld  de,(hl)
-       ld  hl,sp+right
-       ld  hl,(hl)
-       add hl,de
-       ld  hl,sp+result
-       ld  (hl),hl
-       Combinations in here are:
-        * If left or right are in bc then the loss is small - trap later
-        * If the result is in bc then the loss is also small
+        ld  hl,sp+left
+  ld  a,(hl)
+  ld  hl,sp+right
+  add (hl)
+  ld  hl,sp+result
+  ld  (hl),a
+  ld  hl,sp+left+1
+  ld  a,(hl)
+  ld  hl,sp+right+1
+  adc (hl)
+  ld  hl,sp+result+1
+  ld  (hl),a
+  So you cant afford to load up hl if either left, right, or result
+  is on the stack (*sigh*)  The alt is:
+  ld  hl,sp+left
+  ld  de,(hl)
+  ld  hl,sp+right
+  ld  hl,(hl)
+  add hl,de
+  ld  hl,sp+result
+  ld  (hl),hl
+  Combinations in here are:
+   * If left or right are in bc then the loss is small - trap later
+   * If the result is in bc then the loss is also small
     */
     if (IS_GB) {
-       if (AOP_TYPE(IC_LEFT(ic)) == AOP_STK ||
-           AOP_TYPE(IC_RIGHT(ic)) == AOP_STK ||
-           AOP_TYPE(IC_RESULT(ic)) == AOP_STK) {
-           if ((AOP_SIZE(IC_LEFT(ic)) == 2 ||
-               AOP_SIZE(IC_RIGHT(ic)) == 2) &&
-               (AOP_SIZE(IC_LEFT(ic)) <= 2 &&
-                AOP_SIZE(IC_RIGHT(ic)) <= 2)) {
-               if (getPairId(AOP(IC_RIGHT(ic))) == PAIR_BC) {
-                   /* Swap left and right */
-                   operand *t = IC_RIGHT(ic);
-                   IC_RIGHT(ic) = IC_LEFT(ic);
-                   IC_LEFT(ic) = t;
-               }
-               if (getPairId(AOP(IC_LEFT(ic))) == PAIR_BC) {
-                   fetchPair(PAIR_HL, AOP(IC_RIGHT(ic)));
-                   emit2("add hl,bc");
-               }
-               else {
-                   fetchPair(PAIR_DE, AOP(IC_LEFT(ic)));
-                   fetchPair(PAIR_HL, AOP(IC_RIGHT(ic)));
-                   emit2("add hl,de");
-               }
-               commitPair(AOP(IC_RESULT(ic)), PAIR_HL);
-               goto release;
-           }
-           else if (size == 4) {
-               emit2("; WARNING: This add is probably broken.\n");
-           }
-       }
+  if (AOP_TYPE(IC_LEFT(ic)) == AOP_STK ||
+      AOP_TYPE(IC_RIGHT(ic)) == AOP_STK ||
+      AOP_TYPE(IC_RESULT(ic)) == AOP_STK) {
+      if ((AOP_SIZE(IC_LEFT(ic)) == 2 ||
+    AOP_SIZE(IC_RIGHT(ic)) == 2) &&
+    (AOP_SIZE(IC_LEFT(ic)) <= 2 &&
+     AOP_SIZE(IC_RIGHT(ic)) <= 2)) {
+    if (getPairId(AOP(IC_RIGHT(ic))) == PAIR_BC) {
+        /* Swap left and right */
+        operand *t = IC_RIGHT(ic);
+        IC_RIGHT(ic) = IC_LEFT(ic);
+        IC_LEFT(ic) = t;
+    }
+    if (getPairId(AOP(IC_LEFT(ic))) == PAIR_BC) {
+        fetchPair(PAIR_HL, AOP(IC_RIGHT(ic)));
+        emit2("add hl,bc");
+    }
+    else {
+        fetchPair(PAIR_DE, AOP(IC_LEFT(ic)));
+        fetchPair(PAIR_HL, AOP(IC_RIGHT(ic)));
+        emit2("add hl,de");
+    }
+    commitPair(AOP(IC_RESULT(ic)), PAIR_HL);
+    goto release;
+      }
+      else if (size == 4) {
+    emit2("; WARNING: This add is probably broken.\n");
+      }
+  }
     }
 
     while(size--) {
-       if (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) {
-           MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE));
-           if(offset == 0)
-               emit2("add a,%s",
-                     aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
-           else
-               emit2("adc a,%s",
-                     aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
-       } else {
-           MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE));
-           if(offset == 0)
-               emit2("add a,%s",
-                     aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
-           else
-               emit2("adc a,%s",
-                     aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
-       }
-       aopPut(AOP(IC_RESULT(ic)),"a",offset++);      
-    }
-   
+  if (AOP_TYPE(IC_LEFT(ic)) == AOP_ACC) {
+      MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE));
+      if(offset == 0)
+    emit2("add a,%s",
+          aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
+      else
+    emit2("adc a,%s",
+          aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
+  } else {
+      MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE));
+      if(offset == 0)
+    emit2("add a,%s",
+          aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
+      else
+    emit2("adc a,%s",
+          aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
+  }
+  aopPut(AOP(IC_RESULT(ic)),"a",offset++);
+    }
+
 release:
     freeAsmop(IC_LEFT(ic),NULL,ic);
     freeAsmop(IC_RIGHT(ic),NULL,ic);
     freeAsmop(IC_RESULT(ic),NULL,ic);
-    
+
 }
 
 /*-----------------------------------------------------------------*/
@@ -2394,14 +2394,14 @@ static bool genMinusDec (iCode *ic)
         (size > 1) &&
         (icount == 1)) {
         symbol *tlbl = newiTempLabel(NULL);
-       emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE));
-       emitcode("jp", "np," LABEL_STR ,tlbl->key+100);
-    
-       emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE));
-       if(size == 4) {
-           wassert(0);
-       }
-       emitLabel(tlbl->key+100);
+  emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE));
+  emitcode("jp", "np," LABEL_STR ,tlbl->key+100);
+
+  emitcode("dec","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE));
+  if(size == 4) {
+      wassert(0);
+  }
+  emitLabel(tlbl->key+100);
         return TRUE;
     }
 #endif
@@ -2409,18 +2409,18 @@ static bool genMinusDec (iCode *ic)
     /* if decrement 16 bits in register */
     if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) &&
         (size > 1) && isPair(AOP(IC_RESULT(ic)))) {
-       while (icount--)
-           emitcode("dec", "%s", getPairName(AOP(IC_RESULT(ic))));
+  while (icount--)
+      emitcode("dec", "%s", getPairName(AOP(IC_RESULT(ic))));
         return TRUE;
     }
 
     /* If result is a pair */
     if (isPair(AOP(IC_RESULT(ic)))) {
-       movLeft2Result(IC_LEFT(ic), 0, IC_RESULT(ic), 0, 0);
-       movLeft2Result(IC_LEFT(ic), 1, IC_RESULT(ic), 1, 0);
-       while (icount--)
-           emitcode("dec", "%s", getPairName(AOP(IC_RESULT(ic))));
-       return TRUE;
+  movLeft2Result(IC_LEFT(ic), 0, IC_RESULT(ic), 0, 0);
+  movLeft2Result(IC_LEFT(ic), 1, IC_RESULT(ic), 1, 0);
+  while (icount--)
+      emitcode("dec", "%s", getPairName(AOP(IC_RESULT(ic))));
+  return TRUE;
     }
 
     /* if the sizes are greater than 1 then we cannot */
@@ -2431,7 +2431,7 @@ static bool genMinusDec (iCode *ic)
     /* we can if the aops of the left & result match or if they are in
        registers and the registers are the same */
     if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic)))) {
-        while (icount--) 
+        while (icount--)
             emitcode ("dec","%s",aopGet(AOP(IC_RESULT(ic)),0,FALSE));
         return TRUE ;
     }
@@ -2455,15 +2455,15 @@ static void genMinus (iCode *ic)
     /* if both left & right are in bit space */
     if (AOP_TYPE(IC_LEFT(ic)) == AOP_CRY &&
         AOP_TYPE(IC_RIGHT(ic)) == AOP_CRY) {
-       wassert(0);
+  wassert(0);
         goto release ;
     }
 
     /* if I can do an decrement instead of subtract then GOOD for ME */
     if (genMinusDec (ic) == TRUE)
-        goto release;   
+        goto release;
 
-    size = getDataSize(IC_RESULT(ic));   
+    size = getDataSize(IC_RESULT(ic));
 
     if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT){
     }
@@ -2474,70 +2474,70 @@ static void genMinus (iCode *ic)
 
     /* Same logic as genPlus */
     if (IS_GB) {
-       if (AOP_TYPE(IC_LEFT(ic)) == AOP_STK ||
-           AOP_TYPE(IC_RIGHT(ic)) == AOP_STK ||
-           AOP_TYPE(IC_RESULT(ic)) == AOP_STK) {
-           if ((AOP_SIZE(IC_LEFT(ic)) == 2 ||
-               AOP_SIZE(IC_RIGHT(ic)) == 2) &&
-               (AOP_SIZE(IC_LEFT(ic)) <= 2 &&
-                AOP_SIZE(IC_RIGHT(ic)) <= 2)) {
-               PAIR_ID left = getPairId(AOP(IC_LEFT(ic)));
-               PAIR_ID right = getPairId(AOP(IC_RIGHT(ic)));
-
-               if (left == PAIR_INVALID && right == PAIR_INVALID) {
-                   left = PAIR_DE;
-                   right = PAIR_HL;
-               }
-               else if (right == PAIR_INVALID)
-                   right = PAIR_DE;
-               else if (left == PAIR_INVALID)
-                   left = PAIR_DE;
-               
-               fetchPair(left, AOP(IC_LEFT(ic)));
-               /* Order is important.  Right may be HL */
-               fetchPair(right, AOP(IC_RIGHT(ic)));
-
-               emit2("ld a,%s", _pairs[left].l);
-               emit2("sub a,%s", _pairs[right].l);
-               emit2("ld e,a");
-               emit2("ld a,%s", _pairs[left].h);
-               emit2("sbc a,%s", _pairs[right].h);
-
-               aopPut(AOP(IC_RESULT(ic)), "a", 1);
-               aopPut(AOP(IC_RESULT(ic)), "e", 0);
-               goto release;
-           }
-           else if (size == 4) {
-               emit2("; WARNING: This sub is probably broken.\n");
-           }
-       }
-    }
-    
+  if (AOP_TYPE(IC_LEFT(ic)) == AOP_STK ||
+      AOP_TYPE(IC_RIGHT(ic)) == AOP_STK ||
+      AOP_TYPE(IC_RESULT(ic)) == AOP_STK) {
+      if ((AOP_SIZE(IC_LEFT(ic)) == 2 ||
+    AOP_SIZE(IC_RIGHT(ic)) == 2) &&
+    (AOP_SIZE(IC_LEFT(ic)) <= 2 &&
+     AOP_SIZE(IC_RIGHT(ic)) <= 2)) {
+    PAIR_ID left = getPairId(AOP(IC_LEFT(ic)));
+    PAIR_ID right = getPairId(AOP(IC_RIGHT(ic)));
+
+    if (left == PAIR_INVALID && right == PAIR_INVALID) {
+        left = PAIR_DE;
+        right = PAIR_HL;
+    }
+    else if (right == PAIR_INVALID)
+        right = PAIR_DE;
+    else if (left == PAIR_INVALID)
+        left = PAIR_DE;
+
+    fetchPair(left, AOP(IC_LEFT(ic)));
+    /* Order is important.  Right may be HL */
+    fetchPair(right, AOP(IC_RIGHT(ic)));
+
+    emit2("ld a,%s", _pairs[left].l);
+    emit2("sub a,%s", _pairs[right].l);
+    emit2("ld e,a");
+    emit2("ld a,%s", _pairs[left].h);
+    emit2("sbc a,%s", _pairs[right].h);
+
+    aopPut(AOP(IC_RESULT(ic)), "a", 1);
+    aopPut(AOP(IC_RESULT(ic)), "e", 0);
+    goto release;
+      }
+      else if (size == 4) {
+    emit2("; WARNING: This sub is probably broken.\n");
+      }
+  }
+    }
+
     /* if literal, add a,#-lit, else normal subb */
     while (size--) {
-       MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE));    
-       if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT) {
-           if (!offset)
-               emitcode("sub","a,%s",
-                        aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
-           else
-               emitcode("sbc","a,%s",
-                        aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
-       }
-       else{
-           /* first add without previous c */
-           if (!offset)
-               emit2("add a,!immedbyte", (unsigned int)(lit & 0x0FFL));
-           else
-               emit2("adc a,!immedbyte", (unsigned int)((lit >> (offset*8)) & 0x0FFL));
-       }
-       aopPut(AOP(IC_RESULT(ic)),"a",offset++);      
-    }
-    
-    if (AOP_SIZE(IC_RESULT(ic)) == 3 && 
-       AOP_SIZE(IC_LEFT(ic)) == 3   &&
-       !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
-       wassert(0);
+  MOVA(aopGet(AOP(IC_LEFT(ic)),offset,FALSE));
+  if (AOP_TYPE(IC_RIGHT(ic)) != AOP_LIT) {
+      if (!offset)
+    emitcode("sub","a,%s",
+       aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
+      else
+    emitcode("sbc","a,%s",
+       aopGet(AOP(IC_RIGHT(ic)),offset,FALSE));
+  }
+  else{
+      /* first add without previous c */
+      if (!offset)
+    emit2("add a,!immedbyte", (unsigned int)(lit & 0x0FFL));
+      else
+    emit2("adc a,!immedbyte", (unsigned int)((lit >> (offset*8)) & 0x0FFL));
+  }
+  aopPut(AOP(IC_RESULT(ic)),"a",offset++);
+    }
+
+    if (AOP_SIZE(IC_RESULT(ic)) == 3 &&
+  AOP_SIZE(IC_LEFT(ic)) == 3   &&
+  !sameRegs(AOP(IC_RESULT(ic)),AOP(IC_LEFT(ic))))
+  wassert(0);
 
 release:
     freeAsmop(IC_LEFT(ic),NULL,ic);
@@ -2584,47 +2584,47 @@ static void genIfxJump (iCode *ic, char *jval)
     supplied is true */
     if (IC_TRUE(ic)) {
         jlbl = IC_TRUE(ic);
-       if (!strcmp(jval, "a")) {
-           inst = "nz";
-       }
-       else if (!strcmp(jval, "c")) {
-           inst = "c";
-       }
-       else if (!strcmp(jval, "nc")) {
-           inst = "nc";
-       }
-       else {
-           /* The buffer contains the bit on A that we should test */
-           inst = "nz";
-       }
+  if (!strcmp(jval, "a")) {
+      inst = "nz";
+  }
+  else if (!strcmp(jval, "c")) {
+      inst = "c";
+  }
+  else if (!strcmp(jval, "nc")) {
+      inst = "nc";
+  }
+  else {
+      /* The buffer contains the bit on A that we should test */
+      inst = "nz";
+  }
     }
     else {
         /* false label is present */
         jlbl = IC_FALSE(ic) ;
-       if (!strcmp(jval, "a")) {
-           inst = "z";
-       }
-       else if (!strcmp(jval, "c")) {
-           inst = "nc";
-       }
-       else if (!strcmp(jval, "nc")) {
-           inst = "c";
-       }
-       else {
-           /* The buffer contains the bit on A that we should test */
-           inst = "z";
-       }
+  if (!strcmp(jval, "a")) {
+      inst = "z";
+  }
+  else if (!strcmp(jval, "c")) {
+      inst = "nc";
+  }
+  else if (!strcmp(jval, "nc")) {
+      inst = "c";
+  }
+  else {
+      /* The buffer contains the bit on A that we should test */
+      inst = "z";
+  }
     }
     /* Z80 can do a conditional long jump */
     if (!strcmp(jval, "a")) {
-       emitcode("or", "a,a");
+  emitcode("or", "a,a");
     }
     else if (!strcmp(jval, "c")) {
     }
     else if (!strcmp(jval, "nc")) {
     }
     else {
-       emitcode("bit", "%s,a", jval);
+  emitcode("bit", "%s,a", jval);
     }
     emit2("jp %s,!tlabel", inst, jlbl->key+100);
 
@@ -2649,8 +2649,8 @@ static void genCmp (operand *left,operand *right,
     /* if left & right are bit variables */
     if (AOP_TYPE(left) == AOP_CRY &&
         AOP_TYPE(right) == AOP_CRY ) {
-       /* Cant happen on the Z80 */
-       wassert(0);
+  /* Cant happen on the Z80 */
+  wassert(0);
     } else {
         /* subtract right from left if at the
         end the carry flag is set then we know that
@@ -2658,118 +2658,118 @@ static void genCmp (operand *left,operand *right,
         size = max(AOP_SIZE(left),AOP_SIZE(right));
 
         /* if unsigned char cmp with lit, just compare */
-        if((size == 1) && 
+        if((size == 1) &&
            (AOP_TYPE(right) == AOP_LIT && AOP_TYPE(left) != AOP_DIR )){
-           emitcode("ld", "a,%s", aopGet(AOP(left), offset, FALSE));
-           if (sign) {
-               emit2("xor a,!immedbyte", 0x80);
-               emit2("cp %s^!constbyte", aopGet(AOP(right), offset, FALSE), 0x80);
-           }
-           else 
-               emitcode("cp", "%s", aopGet(AOP(right), offset, FALSE));
-        } 
-       else {
-           /* Special cases:
-              On the GB:
-                 If the left or the right is a lit:
-                       Load -lit into HL, add to right via, check sense.
-           */
-           if (size == 2 && (AOP_TYPE(right) == AOP_LIT || AOP_TYPE(left) == AOP_LIT)) {
-               PAIR_ID id = PAIR_DE;
-               asmop *lit = AOP(right);
-               asmop *op = AOP(left);
-               swap_sense = TRUE;
-
-               if (AOP_TYPE(left) == AOP_LIT) {
-                   swap_sense = FALSE;
-                   lit = AOP(left);
-                   op = AOP(right);
-               }
-               if (sign) {
-                   emit2("ld e,%s", aopGet(op, 0, 0));
-                   emit2("ld a,%s", aopGet(op, 1, 0));
-                   emit2("xor a,!immedbyte", 0x80);
-                   emit2("ld d,a");
-               }
-               else {
-                   id = getPairId(op);
-                   if (id == PAIR_INVALID) {
-                       fetchPair(PAIR_DE, op);
-                       id = PAIR_DE;
-                   }
-               }
-               spillPair(PAIR_HL);
-               emit2("ld hl,%s", fetchLitSpecial(lit, TRUE, sign));
-               emit2("add hl,%s", _getPairIdName(id));
-               goto release;
-           }
+      emitcode("ld", "a,%s", aopGet(AOP(left), offset, FALSE));
+      if (sign) {
+    emit2("xor a,!immedbyte", 0x80);
+    emit2("cp %s^!constbyte", aopGet(AOP(right), offset, FALSE), 0x80);
+      }
+      else
+    emitcode("cp", "%s", aopGet(AOP(right), offset, FALSE));
+        }
+  else {
+      /* Special cases:
+         On the GB:
+            If the left or the right is a lit:
+        Load -lit into HL, add to right via, check sense.
+      */
+      if (size == 2 && (AOP_TYPE(right) == AOP_LIT || AOP_TYPE(left) == AOP_LIT)) {
+    PAIR_ID id = PAIR_DE;
+    asmop *lit = AOP(right);
+    asmop *op = AOP(left);
+    swap_sense = TRUE;
+
+    if (AOP_TYPE(left) == AOP_LIT) {
+        swap_sense = FALSE;
+        lit = AOP(left);
+        op = AOP(right);
+    }
+    if (sign) {
+        emit2("ld e,%s", aopGet(op, 0, 0));
+        emit2("ld a,%s", aopGet(op, 1, 0));
+        emit2("xor a,!immedbyte", 0x80);
+        emit2("ld d,a");
+    }
+    else {
+        id = getPairId(op);
+        if (id == PAIR_INVALID) {
+      fetchPair(PAIR_DE, op);
+      id = PAIR_DE;
+        }
+    }
+    spillPair(PAIR_HL);
+    emit2("ld hl,%s", fetchLitSpecial(lit, TRUE, sign));
+    emit2("add hl,%s", _getPairIdName(id));
+    goto release;
+      }
             if(AOP_TYPE(right) == AOP_LIT) {
                 lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
                 /* optimize if(x < 0) or if(x >= 0) */
                 if (lit == 0L){
                     if (!sign) {
-                       /* No sign so it's always false */
+      /* No sign so it's always false */
                         CLRC;
                     }
                     else{
-                       /* Just load in the top most bit */
+      /* Just load in the top most bit */
                         MOVA(aopGet(AOP(left),AOP_SIZE(left)-1,FALSE));
                         if(!(AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) && ifx) {
                             genIfxJump (ifx,"7");
                             return;
                         }
-                        else    
+                        else
                             emitcode("rlc","a");
                     }
                     goto release;
                 }
             }
-           if (sign) {
-               /* First setup h and l contaning the top most bytes XORed */
-               bool fDidXor = FALSE;
-               if (AOP_TYPE(left) == AOP_LIT){
-                   unsigned long lit = (unsigned long)
-                       floatFromVal(AOP(left)->aopu.aop_lit);
-                   emit2("ld %s,!immedbyte", _fTmp[0],
-                            0x80 ^ (unsigned int)((lit >> ((size-1)*8)) & 0x0FFL));
-               }
-               else {
-                   emitcode("ld", "a,%s", aopGet(AOP(left), size-1, FALSE));
-                   emit2("xor a,!immedbyte", 0x80);
-                   emitcode("ld", "%s,a", _fTmp[0]);
-                   fDidXor = TRUE;
-               }
-               if (AOP_TYPE(right) == AOP_LIT) {
-                   unsigned long lit = (unsigned long)
-                       floatFromVal(AOP(right)->aopu.aop_lit);
-                   emit2("ld %s,!immedbyte", _fTmp[1],
-                            0x80 ^ (unsigned int)((lit >> ((size-1)*8)) & 0x0FFL));
-               }
-               else {
-                   emitcode("ld", "a,%s", aopGet(AOP(right), size-1, FALSE));
-                   emit2("xor a,!immedbyte", 0x80);
-                   emitcode("ld", "%s,a", _fTmp[1]);
-                   fDidXor = TRUE;
-               }
-               if (!fDidXor)
-                   CLRC;
-           }
-           else {
-               CLRC;
-           }
+      if (sign) {
+    /* First setup h and l contaning the top most bytes XORed */
+    bool fDidXor = FALSE;
+    if (AOP_TYPE(left) == AOP_LIT){
+        unsigned long lit = (unsigned long)
+      floatFromVal(AOP(left)->aopu.aop_lit);
+        emit2("ld %s,!immedbyte", _fTmp[0],
+           0x80 ^ (unsigned int)((lit >> ((size-1)*8)) & 0x0FFL));
+    }
+    else {
+        emitcode("ld", "a,%s", aopGet(AOP(left), size-1, FALSE));
+        emit2("xor a,!immedbyte", 0x80);
+        emitcode("ld", "%s,a", _fTmp[0]);
+        fDidXor = TRUE;
+    }
+    if (AOP_TYPE(right) == AOP_LIT) {
+        unsigned long lit = (unsigned long)
+      floatFromVal(AOP(right)->aopu.aop_lit);
+        emit2("ld %s,!immedbyte", _fTmp[1],
+           0x80 ^ (unsigned int)((lit >> ((size-1)*8)) & 0x0FFL));
+    }
+    else {
+        emitcode("ld", "a,%s", aopGet(AOP(right), size-1, FALSE));
+        emit2("xor a,!immedbyte", 0x80);
+        emitcode("ld", "%s,a", _fTmp[1]);
+        fDidXor = TRUE;
+    }
+    if (!fDidXor)
+        CLRC;
+      }
+      else {
+    CLRC;
+      }
             while (size--) {
-               /* Do a long subtract */
-               if (!sign || size ) {
-                   MOVA(aopGet(AOP(left),offset,FALSE));
-               }
+    /* Do a long subtract */
+    if (!sign || size ) {
+        MOVA(aopGet(AOP(left),offset,FALSE));
+    }
                 if (sign && size == 0) {
-                   emitcode("ld", "a,%s", _fTmp[0]);
-                   emitcode("sbc", "a,%s", _fTmp[1]);
-               }
-               else {
-                   /* Subtract through, propagating the carry */
-                   emitcode("sbc","a,%s ; 2",aopGet(AOP(right),offset++,FALSE));
-               }
+        emitcode("ld", "a,%s", _fTmp[0]);
+        emitcode("sbc", "a,%s", _fTmp[1]);
+    }
+    else {
+        /* Subtract through, propagating the carry */
+        emitcode("sbc","a,%s ; 2",aopGet(AOP(right),offset++,FALSE));
+    }
             }
         }
     }
@@ -2868,56 +2868,56 @@ static void gencjneshort(operand *left, operand *right, symbol *lbl)
     /* if the right side is a literal then anything goes */
     if (AOP_TYPE(right) == AOP_LIT &&
         AOP_TYPE(left) != AOP_DIR ) {
-       if (lit == 0) {
-           emitcode("ld", "a,%s", aopGet(AOP(left), offset, FALSE));
-           if (size > 1) {
-               size--;
-               offset++;
-               while (size--) {
-                   emitcode("or", "a,%s", aopGet(AOP(left), offset, FALSE));
-               }
-           }
-           else {
-               emitcode("or", "a,a");
-           }
-           emit2("jp nz,!tlabel", lbl->key+100);
-       }
-       else {
-           while (size--) {
-               emitcode("ld", "a,%s ; 2", aopGet(AOP(left),offset,FALSE));
-               if ((AOP_TYPE(right) == AOP_LIT) && lit == 0)
-                   emitcode("or", "a,a");
-               else 
-                   emitcode("cp", "a,%s", aopGet(AOP(right),offset,FALSE));
-               emit2("jp nz,!tlabel", lbl->key+100);
-               offset++;
-           }
-       }
+  if (lit == 0) {
+      emitcode("ld", "a,%s", aopGet(AOP(left), offset, FALSE));
+      if (size > 1) {
+    size--;
+    offset++;
+    while (size--) {
+        emitcode("or", "a,%s", aopGet(AOP(left), offset, FALSE));
+    }
+      }
+      else {
+    emitcode("or", "a,a");
+      }
+      emit2("jp nz,!tlabel", lbl->key+100);
+  }
+  else {
+      while (size--) {
+    emitcode("ld", "a,%s ; 2", aopGet(AOP(left),offset,FALSE));
+    if ((AOP_TYPE(right) == AOP_LIT) && lit == 0)
+        emitcode("or", "a,a");
+    else
+        emitcode("cp", "a,%s", aopGet(AOP(right),offset,FALSE));
+    emit2("jp nz,!tlabel", lbl->key+100);
+    offset++;
+      }
+  }
     }
     /* if the right side is in a register or in direct space or
-    if the left is a pointer register & right is not */    
+    if the left is a pointer register & right is not */
     else if (AOP_TYPE(right) == AOP_REG ||
-             AOP_TYPE(right) == AOP_DIR || 
+             AOP_TYPE(right) == AOP_DIR ||
              (AOP_TYPE(left) == AOP_DIR && AOP_TYPE(right) == AOP_LIT)) {
         while (size--) {
             MOVA(aopGet(AOP(left),offset,FALSE));
             if((AOP_TYPE(left) == AOP_DIR && AOP_TYPE(right) == AOP_LIT) &&
                ((unsigned int)((lit >> (offset*8)) & 0x0FFL) == 0))
-               /* PENDING */
+    /* PENDING */
                 emit2("jp nz,!tlabel", lbl->key+100);
             else {
-               emitcode("cp", "%s ; 4", aopGet(AOP(right),offset,FALSE));
-               emit2("jp nz,!tlabel", lbl->key+100);
-           }
+    emitcode("cp", "%s ; 4", aopGet(AOP(right),offset,FALSE));
+    emit2("jp nz,!tlabel", lbl->key+100);
+      }
             offset++;
         }
     } else {
         /* right is a pointer reg need both a & b */
-       /* PENDING: is this required? */
+  /* PENDING: is this required? */
         while(size--) {
             MOVA(aopGet(AOP(right),offset,FALSE));
-           emitcode("cp", "%s ; 5", aopGet(AOP(left), offset, FALSE));
-           emit2("!shortjp nz,!tlabel", lbl->key+100);
+      emitcode("cp", "%s ; 5", aopGet(AOP(left), offset, FALSE));
+      emit2("!shortjp nz,!tlabel", lbl->key+100);
             offset++;
         }
     }
@@ -2965,20 +2965,20 @@ static void genCmpEq (iCode *ic, iCode *ifx)
         /* if they are both bit variables */
         if (AOP_TYPE(left) == AOP_CRY &&
             ((AOP_TYPE(right) == AOP_CRY) || (AOP_TYPE(right) == AOP_LIT))) {
-           wassert(0);
+      wassert(0);
         } else {
             tlbl = newiTempLabel(NULL);
             gencjneshort(left, right, tlbl);
             if ( IC_TRUE(ifx) ) {
-               emit2("jp !tlabel", IC_TRUE(ifx)->key+100);
-               emitLabel(tlbl->key+100);
+    emit2("jp !tlabel", IC_TRUE(ifx)->key+100);
+    emitLabel(tlbl->key+100);
             } else {
-               /* PENDING: do this better */
+    /* PENDING: do this better */
                 symbol *lbl = newiTempLabel(NULL);
-               emit2("!shortjp !tlabel", lbl->key+100);
+    emit2("!shortjp !tlabel", lbl->key+100);
                 emitLabel(tlbl->key+100);
                 emit2("jp !tlabel", IC_FALSE(ifx)->key+100);
-               emitLabel(lbl->key+100);             
+    emitLabel(lbl->key+100);
             }
         }
         /* mark the icode as generated */
@@ -2989,21 +2989,21 @@ static void genCmpEq (iCode *ic, iCode *ifx)
     /* if they are both bit variables */
     if (AOP_TYPE(left) == AOP_CRY &&
         ((AOP_TYPE(right) == AOP_CRY) || (AOP_TYPE(right) == AOP_LIT))) {
-       wassert(0);
+  wassert(0);
     } else {
-        gencjne(left,right,newiTempLabel(NULL));    
+        gencjne(left,right,newiTempLabel(NULL));
         if (AOP_TYPE(result) == AOP_CRY && AOP_SIZE(result)) {
-           wassert(0);
+      wassert(0);
         }
         if (ifx) {
-           genIfxJump(ifx,"a");
-           goto release;
+      genIfxJump(ifx,"a");
+      goto release;
         }
         /* if the result is used in an arithmetic operation
         then put the result in place */
         if (AOP_TYPE(result) != AOP_CRY) {
             outAcc(result);
-       }
+  }
         /* leave the result in acc */
     }
 
@@ -3052,13 +3052,13 @@ static void genAndOp (iCode *ic)
     /* if both are bit variables */
     if (AOP_TYPE(left) == AOP_CRY &&
         AOP_TYPE(right) == AOP_CRY ) {
-       wassert(0);
+  wassert(0);
     } else {
         tlbl = newiTempLabel(NULL);
-        toBoolean(left);    
-       emit2("!shortjp z,!tlabel", tlbl->key+100);
+        toBoolean(left);
+  emit2("!shortjp z,!tlabel", tlbl->key+100);
         toBoolean(right);
-       emitLabel(tlbl->key+100);
+  emitLabel(tlbl->key+100);
         outBitAcc(result);
     }
 
@@ -3085,13 +3085,13 @@ static void genOrOp (iCode *ic)
     /* if both are bit variables */
     if (AOP_TYPE(left) == AOP_CRY &&
         AOP_TYPE(right) == AOP_CRY ) {
-       wassert(0);
+  wassert(0);
     } else {
         tlbl = newiTempLabel(NULL);
         toBoolean(left);
-       emit2("!shortjp nz,!tlabel", tlbl->key+100);
+  emit2("!shortjp nz,!tlabel", tlbl->key+100);
         toBoolean(right);
-       emitLabel(tlbl->key+100);
+  emitLabel(tlbl->key+100);
         outBitAcc(result);
     }
 
@@ -3113,7 +3113,7 @@ int isLiteralBit(unsigned long lit)
     0x1000000L,0x2000000L,0x4000000L,0x8000000L,
     0x10000000L,0x20000000L,0x40000000L,0x80000000L};
     int idx;
-    
+
     for(idx = 0; idx < 32; idx++)
         if(lit == pw[idx])
             return idx+1;
@@ -3128,13 +3128,13 @@ static void jmpTrueOrFalse (iCode *ic, symbol *tlbl)
     // ugly but optimized by peephole
     if(IC_TRUE(ic)){
         symbol *nlbl = newiTempLabel(NULL);
-       emit2("jp !tlabel", nlbl->key+100);                 
+  emit2("jp !tlabel", nlbl->key+100);
         emitLabel(tlbl->key+100);
-       emit2("jp !tlabel", IC_TRUE(ic)->key+100);
+  emit2("jp !tlabel", IC_TRUE(ic)->key+100);
         emitLabel(nlbl->key+100);
     }
     else{
-       emit2("jp !tlabel", IC_FALSE(ic)->key+100);
+  emit2("jp !tlabel", IC_FALSE(ic)->key+100);
         emitLabel(tlbl->key+100);
     }
     ic->generated = 1;
@@ -3146,7 +3146,7 @@ static void jmpTrueOrFalse (iCode *ic, symbol *tlbl)
 static void genAnd (iCode *ic, iCode *ifx)
 {
     operand *left, *right, *result;
-    int size, offset=0;  
+    int size, offset=0;
     unsigned long lit = 0L;
     int bytelit = 0;
 
@@ -3165,7 +3165,7 @@ static void genAnd (iCode *ic, iCode *ifx)
 
     /* if left is a literal & right is not then exchange them */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       AOP_NEEDSACC(left)) {
+  AOP_NEEDSACC(left)) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -3191,7 +3191,7 @@ static void genAnd (iCode *ic, iCode *ifx)
     size = AOP_SIZE(result);
 
     if (AOP_TYPE(left) == AOP_CRY){
-       wassert(0);
+  wassert(0);
         goto release ;
     }
 
@@ -3207,42 +3207,42 @@ static void genAnd (iCode *ic, iCode *ifx)
             MOVA(aopGet(AOP(left),posbit>>3,FALSE));
             // bit = left & 2^n
             if(size) {
-               wassert(0);
+    wassert(0);
                 emitcode("mov","c,acc.%d",posbit&0x07);
-           }
+      }
             // if(left &  2^n)
             else{
                 if (ifx) {
                     sprintf(buffer, "%d", posbit&0x07);
                     genIfxJump(ifx, buffer);
                 }
-               else {
-                   wassert(0);
-               }
+    else {
+        wassert(0);
+    }
                 goto release;
             }
         } else {
             symbol *tlbl = newiTempLabel(NULL);
             int sizel = AOP_SIZE(left);
             if(size) {
-               wassert(0);
+    wassert(0);
                 emitcode("setb","c");
-           }
+      }
             while(sizel--){
                 if((bytelit = ((lit >> (offset*8)) & 0x0FFL)) != 0x0L){
                     MOVA( aopGet(AOP(left),offset,FALSE));
                     // byte ==  2^n ?
                     if((posbit = isLiteralBit(bytelit)) != 0) {
-                       wassert(0);
+      wassert(0);
                         emitcode("jb","acc.%d,%05d$",(posbit-1)&0x07,tlbl->key+100);
-                   }
+        }
                     else{
                         if(bytelit != 0x0FFL)
                             emitcode("and","a,%s",
                                      aopGet(AOP(right),offset,FALSE));
-                       else
-                           /* For the flags */
-                           emit2("or a,a");
+      else
+          /* For the flags */
+          emit2("or a,a");
                         emit2("!shortjp nz,!tlabel", tlbl->key+100);
                     }
                 }
@@ -3251,7 +3251,7 @@ static void genAnd (iCode *ic, iCode *ifx)
             // bit = left & literal
             if (size){
                 emitcode("clr","c");
-               emit2("!tlabeldef", tlbl->key+100);
+    emit2("!tlabeldef", tlbl->key+100);
             }
             // if(left & literal)
             else{
@@ -3271,59 +3271,59 @@ static void genAnd (iCode *ic, iCode *ifx)
                 if((bytelit = (int)((lit >> (offset*8)) & 0x0FFL)) == 0x0FF)
                     continue;
                 else {
-                   if (bytelit == 0)
-                       aopPut(AOP(result),zero,offset);
-                   else {
-                       MOVA(aopGet(AOP(left),offset,FALSE));
-                       emitcode("and","a,%s",
-                                aopGet(AOP(right),offset,FALSE));
-                       aopPut(AOP(left), "a", offset);
-                   }
-               }
+        if (bytelit == 0)
+      aopPut(AOP(result),zero,offset);
+        else {
+      MOVA(aopGet(AOP(left),offset,FALSE));
+      emitcode("and","a,%s",
+         aopGet(AOP(right),offset,FALSE));
+      aopPut(AOP(left), "a", offset);
+        }
+    }
 
             } else {
-               if (AOP_TYPE(left) == AOP_ACC) {
-                   wassert(0);
-               }
-               else {
-                   MOVA(aopGet(AOP(left),offset,FALSE));
-                   emitcode("and","a,%s",
-                            aopGet(AOP(right),offset,FALSE));
-                   aopPut(AOP(left), "a", offset);
-               }
+    if (AOP_TYPE(left) == AOP_ACC) {
+        wassert(0);
+    }
+    else {
+        MOVA(aopGet(AOP(left),offset,FALSE));
+        emitcode("and","a,%s",
+           aopGet(AOP(right),offset,FALSE));
+        aopPut(AOP(left), "a", offset);
+    }
             }
         }
     } else {
         // left & result in different registers
         if(AOP_TYPE(result) == AOP_CRY){
-           wassert(0);
+      wassert(0);
         } else {
-           for(;(size--);offset++) {
-               // normal case
-               // result = left & right
-               if(AOP_TYPE(right) == AOP_LIT){
-                   if((bytelit = (int)((lit >> (offset*8)) & 0x0FFL)) == 0x0FF){
-                       aopPut(AOP(result),
-                              aopGet(AOP(left),offset,FALSE),
-                              offset);
-                       continue;
-                   } else if(bytelit == 0){
-                       aopPut(AOP(result),zero,offset);
-                       continue;
-                   }
-               }
-               // faster than result <- left, anl result,right
-               // and better if result is SFR
-               if (AOP_TYPE(left) == AOP_ACC) 
-                   emitcode("and","a,%s",aopGet(AOP(right),offset,FALSE));
-               else {
-                   MOVA(aopGet(AOP(left),offset,FALSE));
-                   emitcode("and","a,%s",
-                            aopGet(AOP(right),offset,FALSE));
-               }
-               aopPut(AOP(result),"a",offset);
-           }
-       }
+      for(;(size--);offset++) {
+    // normal case
+    // result = left & right
+    if(AOP_TYPE(right) == AOP_LIT){
+        if((bytelit = (int)((lit >> (offset*8)) & 0x0FFL)) == 0x0FF){
+      aopPut(AOP(result),
+             aopGet(AOP(left),offset,FALSE),
+             offset);
+      continue;
+        } else if(bytelit == 0){
+      aopPut(AOP(result),zero,offset);
+      continue;
+        }
+    }
+    // faster than result <- left, anl result,right
+    // and better if result is SFR
+    if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("and","a,%s",aopGet(AOP(right),offset,FALSE));
+    else {
+        MOVA(aopGet(AOP(left),offset,FALSE));
+        emitcode("and","a,%s",
+           aopGet(AOP(right),offset,FALSE));
+    }
+    aopPut(AOP(result),"a",offset);
+      }
+  }
 
     }
 
@@ -3357,7 +3357,7 @@ static void genOr (iCode *ic, iCode *ifx)
 
     /* if left is a literal & right is not then exchange them */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       AOP_NEEDSACC(left)) {
+  AOP_NEEDSACC(left)) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -3383,14 +3383,14 @@ static void genOr (iCode *ic, iCode *ifx)
     size = AOP_SIZE(result);
 
     if (AOP_TYPE(left) == AOP_CRY){
-       wassert(0);
+  wassert(0);
         goto release ;
     }
 
     if((AOP_TYPE(right) == AOP_LIT) &&
        (AOP_TYPE(result) == AOP_CRY) &&
        (AOP_TYPE(left) != AOP_CRY)){
-       wassert(0);
+  wassert(0);
         goto release ;
     }
 
@@ -3401,26 +3401,26 @@ static void genOr (iCode *ic, iCode *ifx)
                 if(((lit >> (offset*8)) & 0x0FFL) == 0x00L)
                     continue;
                 else {
-                   MOVA(aopGet(AOP(left),offset,FALSE));
-                   emitcode("or","a,%s",
-                            aopGet(AOP(right),offset,FALSE));
-                   aopPut(AOP(result),"a", offset);
-               }
+        MOVA(aopGet(AOP(left),offset,FALSE));
+        emitcode("or","a,%s",
+           aopGet(AOP(right),offset,FALSE));
+        aopPut(AOP(result),"a", offset);
+    }
             } else {
-               if (AOP_TYPE(left) == AOP_ACC) 
-                   emitcode("or","a,%s",aopGet(AOP(right),offset,FALSE));
-               else {              
-                   MOVA(aopGet(AOP(left),offset,FALSE));
-                   emitcode("or","a,%s",
-                            aopGet(AOP(right),offset,FALSE));
-                   aopPut(AOP(result),"a", offset);
-               }
+    if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("or","a,%s",aopGet(AOP(right),offset,FALSE));
+    else {
+        MOVA(aopGet(AOP(left),offset,FALSE));
+        emitcode("or","a,%s",
+           aopGet(AOP(right),offset,FALSE));
+        aopPut(AOP(result),"a", offset);
+    }
             }
         }
     } else {
         // left & result in different registers
         if(AOP_TYPE(result) == AOP_CRY){
-           wassert(0);
+      wassert(0);
         } else for(;(size--);offset++){
             // normal case
             // result = left & right
@@ -3434,17 +3434,17 @@ static void genOr (iCode *ic, iCode *ifx)
             }
             // faster than result <- left, anl result,right
             // and better if result is SFR
-           if (AOP_TYPE(left) == AOP_ACC) 
-               emitcode("or","a,%s",aopGet(AOP(right),offset,FALSE));
-           else {
-               MOVA(aopGet(AOP(left),offset,FALSE));
-               emitcode("or","a,%s",
-                        aopGet(AOP(right),offset,FALSE));
-           }
-           aopPut(AOP(result),"a",offset);                     
-           /* PENDING: something weird is going on here.  Add exception. */
-           if (AOP_TYPE(result) == AOP_ACC)
-               break;
+      if (AOP_TYPE(left) == AOP_ACC)
+    emitcode("or","a,%s",aopGet(AOP(right),offset,FALSE));
+      else {
+    MOVA(aopGet(AOP(left),offset,FALSE));
+    emitcode("or","a,%s",
+       aopGet(AOP(right),offset,FALSE));
+      }
+      aopPut(AOP(result),"a",offset);
+      /* PENDING: something weird is going on here.  Add exception. */
+      if (AOP_TYPE(result) == AOP_ACC)
+    break;
         }
     }
 
@@ -3469,7 +3469,7 @@ static void genXor (iCode *ic, iCode *ifx)
 
     /* if left is a literal & right is not then exchange them */
     if ((AOP_TYPE(left) == AOP_LIT && AOP_TYPE(right) != AOP_LIT) ||
-       AOP_NEEDSACC(left)) {
+  AOP_NEEDSACC(left)) {
         operand *tmp = right ;
         right = left;
         left = tmp;
@@ -3495,14 +3495,14 @@ static void genXor (iCode *ic, iCode *ifx)
     size = AOP_SIZE(result);
 
     if (AOP_TYPE(left) == AOP_CRY){
-       wassert(0);
+  wassert(0);
         goto release ;
     }
 
     if((AOP_TYPE(right) == AOP_LIT) &&
        (AOP_TYPE(result) == AOP_CRY) &&
        (AOP_TYPE(left) != AOP_CRY)){
-       wassert(0);
+  wassert(0);
         goto release ;
     }
 
@@ -3513,26 +3513,26 @@ static void genXor (iCode *ic, iCode *ifx)
                 if(((lit >> (offset*8)) & 0x0FFL) == 0x00L)
                     continue;
                 else {
-                   MOVA(aopGet(AOP(right),offset,FALSE));
-                   emitcode("xor","a,%s",
-                            aopGet(AOP(left),offset,FALSE));
-                   aopPut(AOP(result),"a",0);
-               }
+        MOVA(aopGet(AOP(right),offset,FALSE));
+        emitcode("xor","a,%s",
+           aopGet(AOP(left),offset,FALSE));
+        aopPut(AOP(result),"a",0);
+    }
             } else {
-               if (AOP_TYPE(left) == AOP_ACC) 
-                   emitcode("xor","a,%s",aopGet(AOP(right),offset,FALSE));
-               else {              
-                   MOVA(aopGet(AOP(right),offset,FALSE));
-                   emitcode("xor","a,%s",
-                            aopGet(AOP(left),offset,FALSE));
-                   aopPut(AOP(result),"a",0);
-               }
+    if (AOP_TYPE(left) == AOP_ACC)
+        emitcode("xor","a,%s",aopGet(AOP(right),offset,FALSE));
+    else {
+        MOVA(aopGet(AOP(right),offset,FALSE));
+        emitcode("xor","a,%s",
+           aopGet(AOP(left),offset,FALSE));
+        aopPut(AOP(result),"a",0);
+    }
             }
         }
     } else {
         // left & result in different registers
         if(AOP_TYPE(result) == AOP_CRY){
-           wassert(0);
+      wassert(0);
         } else for(;(size--);offset++){
             // normal case
             // result = left & right
@@ -3546,15 +3546,15 @@ static void genXor (iCode *ic, iCode *ifx)
             }
             // faster than result <- left, anl result,right
             // and better if result is SFR
-           if (AOP_TYPE(left) == AOP_ACC) 
-               emitcode("xor","a,%s",aopGet(AOP(right),offset,FALSE));
-           else {
-               MOVA(aopGet(AOP(right),offset,FALSE));
-               emitcode("xor","a,%s",
-                        aopGet(AOP(left),offset,FALSE));
-               aopPut(AOP(result),"a",0);
-           }
-           aopPut(AOP(result),"a",offset);                     
+      if (AOP_TYPE(left) == AOP_ACC)
+    emitcode("xor","a,%s",aopGet(AOP(right),offset,FALSE));
+      else {
+    MOVA(aopGet(AOP(right),offset,FALSE));
+    emitcode("xor","a,%s",
+       aopGet(AOP(left),offset,FALSE));
+    aopPut(AOP(result),"a",0);
+      }
+      aopPut(AOP(result),"a",offset);
         }
     }
 
@@ -3572,7 +3572,7 @@ static void genInline (iCode *ic)
     char buffer[MAX_INLINEASM];
     char *bp = buffer;
     char *bp1= buffer;
-    
+
     inLine += (!options.asmpeep);
     strcpy(buffer,IC_INLINE(ic));
 
@@ -3611,7 +3611,7 @@ static void genRRC (iCode *ic)
 /* genRLC - generate code for rotate left with carry               */
 /*-----------------------------------------------------------------*/
 static void genRLC (iCode *ic)
-{    
+{
     wassert(0);
 }
 
@@ -3626,36 +3626,36 @@ static void shiftR2Left2Result (operand *left, int offl,
     movLeft2Result(left, offl+1, result, offr+1, 0);
 
     if (sign) {
-       wassert(0);
+  wassert(0);
     }
     else {
-       /*      if (AOP(result)->type == AOP_REG) {*/
-           int size = 2;
-           int offset = 0;
-           symbol *tlbl , *tlbl1;
-           char *l;
-
-           tlbl = newiTempLabel(NULL);
-           tlbl1 = newiTempLabel(NULL);
-               
-           /* Left is already in result - so now do the shift */
-           if (shCount>1) {
-               emit2("ld a,!immedbyte+1", shCount);
-               emit2("!shortjp !tlabel", tlbl1->key+100); 
-               emitLabel(tlbl->key+100);    
-           }
-
-           emitcode("or", "a,a");
-           offset = size;
-           while (size--) {
-               l = aopGet(AOP(result), --offset, FALSE);
-               emitcode("rr","%s", l);         
-           }
-           if (shCount>1) {
-               emitLabel(tlbl1->key+100);
-               emitcode("dec", "a");
-               emit2("!shortjp nz,!tlabel", tlbl->key+100);
-           }
+  /*  if (AOP(result)->type == AOP_REG) {*/
+      int size = 2;
+      int offset = 0;
+      symbol *tlbl , *tlbl1;
+      char *l;
+
+      tlbl = newiTempLabel(NULL);
+      tlbl1 = newiTempLabel(NULL);
+
+      /* Left is already in result - so now do the shift */
+      if (shCount>1) {
+    emit2("ld a,!immedbyte+1", shCount);
+    emit2("!shortjp !tlabel", tlbl1->key+100);
+    emitLabel(tlbl->key+100);
+      }
+
+      emitcode("or", "a,a");
+      offset = size;
+      while (size--) {
+    l = aopGet(AOP(result), --offset, FALSE);
+    emitcode("rr","%s", l);
+      }
+      if (shCount>1) {
+    emitLabel(tlbl1->key+100);
+    emitcode("dec", "a");
+    emit2("!shortjp nz,!tlabel", tlbl->key+100);
+      }
     }
 }
 
@@ -3667,40 +3667,40 @@ static void shiftL2Left2Result (operand *left, int offl,
 {
     if(sameRegs(AOP(result), AOP(left)) &&
        ((offl + MSB16) == offr)){
-       wassert(0);
+  wassert(0);
     } else {
-       /* Copy left into result */
-       movLeft2Result(left, offl, result, offr, 0);
-       movLeft2Result(left, offl+1, result, offr+1, 0);
+  /* Copy left into result */
+  movLeft2Result(left, offl, result, offr, 0);
+  movLeft2Result(left, offl+1, result, offr+1, 0);
     }
     /* PENDING: for now just see if it'll work. */
     /*if (AOP(result)->type == AOP_REG) { */
     {
-       int size = 2;
-       int offset = 0;
-       symbol *tlbl , *tlbl1;
-       char *l;
-
-       tlbl = newiTempLabel(NULL);
-       tlbl1 = newiTempLabel(NULL);
-
-       /* Left is already in result - so now do the shift */
-       if (shCount>1) {
-           emit2("ld a,!immedbyte+1", shCount);
-           emit2("!shortjp !tlabel", tlbl1->key+100); 
-           emitLabel(tlbl->key+100);    
-       }
-
-       emitcode("or", "a,a");
-       while (size--) {
-           l = aopGet(AOP(result),offset++,FALSE);
-           emitcode("rl","%s", l);         
-       }
-       if (shCount>1) {
-           emitLabel(tlbl1->key+100);
-           emitcode("dec", "a");
-           emit2("!shortjp nz,!tlabel", tlbl->key+100);
-       }
+  int size = 2;
+  int offset = 0;
+  symbol *tlbl , *tlbl1;
+  char *l;
+
+  tlbl = newiTempLabel(NULL);
+  tlbl1 = newiTempLabel(NULL);
+
+  /* Left is already in result - so now do the shift */
+  if (shCount>1) {
+      emit2("ld a,!immedbyte+1", shCount);
+      emit2("!shortjp !tlabel", tlbl1->key+100);
+      emitLabel(tlbl->key+100);
+  }
+
+  emitcode("or", "a,a");
+  while (size--) {
+      l = aopGet(AOP(result),offset++,FALSE);
+      emitcode("rl","%s", l);
+  }
+  if (shCount>1) {
+      emitLabel(tlbl1->key+100);
+      emitcode("dec", "a");
+      emit2("!shortjp nz,!tlabel", tlbl->key+100);
+  }
     }
 }
 
@@ -3754,16 +3754,16 @@ static void AccLsh (int shCount)
     if(shCount != 0) {
         if(shCount == 1) {
             emitcode("add","a,a");
-       }
+  }
         else if(shCount == 2) {
-           emitcode("add","a,a");
-           emitcode("add","a,a");
-       } else {
-           /* rotate left accumulator */
-           AccRol(shCount);
-           /* and kill the lower order bits */
-           emit2("and a,!immedbyte", SLMask[shCount]);
-       }
+      emitcode("add","a,a");
+      emitcode("add","a,a");
+  } else {
+      /* rotate left accumulator */
+      AccRol(shCount);
+      /* and kill the lower order bits */
+      emit2("and a,!immedbyte", SLMask[shCount]);
+  }
     }
 }
 
@@ -3797,26 +3797,26 @@ static void genlshTwo (operand *result,operand *left, int shCount)
         if (size > 1){
             if (shCount) {
                 movLeft2Result(left, LSB, result, MSB16, 0);
-               aopPut(AOP(result),zero, 0);   
-               shiftL1Left2Result(left, MSB16, result, MSB16, shCount);
-           }
+    aopPut(AOP(result),zero, 0);
+    shiftL1Left2Result(left, MSB16, result, MSB16, shCount);
+      }
             else {
                 movLeft2Result(left, LSB, result, MSB16, 0);
-               aopPut(AOP(result),zero, 0);   
-           }
+    aopPut(AOP(result),zero, 0);
+      }
         }
-       else {
-           aopPut(AOP(result),zero,LSB);   
-       }
+  else {
+      aopPut(AOP(result),zero,LSB);
+  }
     }
     /*  1 <= shCount <= 7 */
-    else {  
+    else {
         if(size == 1) {
-           wassert(0);
-       }
+      wassert(0);
+  }
         else {
             shiftL2Left2Result(left, LSB, result, LSB, shCount);
-       }
+  }
     }
 }
 
@@ -3824,7 +3824,7 @@ static void genlshTwo (operand *result,operand *left, int shCount)
 /* genlshOne - left shift a one byte quantity by known count       */
 /*-----------------------------------------------------------------*/
 static void genlshOne (operand *result, operand *left, int shCount)
-{       
+{
     shiftL1Left2Result(left, LSB, result, LSB, shCount);
 }
 
@@ -3835,7 +3835,7 @@ static void genLeftShiftLiteral (operand *left,
                                  operand *right,
                                  operand *result,
                                  iCode *ic)
-{    
+{
     int shCount = (int) floatFromVal (AOP(right)->aopu.aop_lit);
     int size;
 
@@ -3853,7 +3853,7 @@ static void genLeftShiftLiteral (operand *left,
 
     /* I suppose that the left size >= result size */
     if (shCount == 0) {
-       wassert(0);
+  wassert(0);
     }
 
     else if(shCount >= (size * 8))
@@ -3861,17 +3861,17 @@ static void genLeftShiftLiteral (operand *left,
             aopPut(AOP(result),zero,size);
     else{
         switch (size) {
-       case 1:
-           genlshOne (result,left,shCount);
-           break;
-       case 2:
-           genlshTwo (result,left,shCount);
-           break;
-       case 4:
-           wassert(0);
-           break;
-       default:
-           wassert(0);
+  case 1:
+      genlshOne (result,left,shCount);
+      break;
+  case 2:
+      genlshTwo (result,left,shCount);
+      break;
+  case 4:
+      wassert(0);
+      break;
+  default:
+      wassert(0);
         }
     }
     freeAsmop(left,NULL,ic);
@@ -3894,7 +3894,7 @@ static void genLeftShift (iCode *ic)
 
     aopOp(right,ic,FALSE, FALSE);
 
-    /* if the shift count is known then do it 
+    /* if the shift count is known then do it
     as efficiently as possible */
     if (AOP_TYPE(right) == AOP_LIT) {
         genLeftShiftLiteral (left,right,result,ic);
@@ -3920,7 +3920,7 @@ static void genLeftShift (iCode *ic)
         offset = 0;
         while (size--) {
             l = aopGet(AOP(left),offset,FALSE);
-           aopPut(AOP(result),l,offset);
+      aopPut(AOP(result),l,offset);
             offset++;
         }
     }
@@ -3928,25 +3928,25 @@ static void genLeftShift (iCode *ic)
     size = AOP_SIZE(result);
     offset = 0;
     while (size--) {
-       l = aopGet(AOP(left),offset,FALSE);
-       aopPut(AOP(result),l,offset);
-       offset++;
+  l = aopGet(AOP(left),offset,FALSE);
+  aopPut(AOP(result),l,offset);
+  offset++;
     }
 #endif
 
 
     tlbl = newiTempLabel(NULL);
     size = AOP_SIZE(result);
-    offset = 0 ;   
+    offset = 0 ;
     tlbl1 = newiTempLabel(NULL);
 
-    emit2("!shortjp !tlabel", tlbl1->key+100); 
-    emitLabel(tlbl->key+100);    
+    emit2("!shortjp !tlabel", tlbl1->key+100);
+    emitLabel(tlbl->key+100);
     l = aopGet(AOP(result),offset,FALSE);
     emitcode("or", "a,a");
     while (size--) {
         l = aopGet(AOP(result),offset++,FALSE);
-        emitcode("rl","%s", l);         
+        emitcode("rl","%s", l);
     }
     emitLabel(tlbl1->key+100);
     emitcode("dec", "a");
@@ -3970,17 +3970,17 @@ static void genrshOne (operand *result,operand *left, int shCount)
 
     l = aopGet(AOP(left),0,FALSE);
     if (AOP(result)->type == AOP_REG) {
-       aopPut(AOP(result), l, 0);
-       l = aopGet(AOP(result), 0, FALSE);
-       while (shCount--) 
-           emitcode("srl", "%s", l);
+  aopPut(AOP(result), l, 0);
+  l = aopGet(AOP(result), 0, FALSE);
+  while (shCount--)
+      emitcode("srl", "%s", l);
     }
     else {
-       MOVA(l);
-       while (shCount--) {
-           emitcode("srl", "a");
-       }
-       aopPut(AOP(result),"a",0);
+  MOVA(l);
+  while (shCount--) {
+      emitcode("srl", "a");
+  }
+  aopPut(AOP(result),"a",0);
     }
 }
 
@@ -3990,10 +3990,10 @@ static void genrshOne (operand *result,operand *left, int shCount)
 static void AccRsh (int shCount)
 {
     if(shCount != 0){
-       /* rotate right accumulator */
-       AccRol(8 - shCount);
-       /* and kill the higher order bits */
-       emit2("and a,!immedbyte", SRMask[shCount]);
+  /* rotate right accumulator */
+  AccRol(8 - shCount);
+  /* and kill the higher order bits */
+  emit2("and a,!immedbyte", SRMask[shCount]);
     }
 }
 
@@ -4006,7 +4006,7 @@ static void shiftR1Left2Result (operand *left, int offl,
 {
     MOVA(aopGet(AOP(left),offl,FALSE));
     if (sign) {
-       wassert(0);
+  wassert(0);
     }
     else {
         AccRsh(shCount);
@@ -4026,15 +4026,15 @@ static void genrshTwo (operand *result,operand *left,
         if (shCount) {
             shiftR1Left2Result(left, MSB16, result, LSB,
                                shCount, sign);
-       }
+  }
         else {
             movLeft2Result(left, MSB16, result, LSB, sign);
-       }
-       aopPut(AOP(result),zero,1);
+  }
+  aopPut(AOP(result),zero,1);
     }
     /*  1 <= shCount <= 7 */
     else {
-        shiftR2Left2Result(left, LSB, result, LSB, shCount, sign); 
+        shiftR2Left2Result(left, LSB, result, LSB, shCount, sign);
     }
 }
 
@@ -4045,7 +4045,7 @@ static void genRightShiftLiteral (operand *left,
                                  operand *right,
                                  operand *result,
                                  iCode *ic)
-{    
+{
     int shCount = (int) floatFromVal (AOP(right)->aopu.aop_lit);
     int size;
 
@@ -4061,7 +4061,7 @@ static void genRightShiftLiteral (operand *left,
 
     /* I suppose that the left size >= result size */
     if (shCount == 0) {
-       wassert(0);
+  wassert(0);
     }
 
     else if(shCount >= (size * 8))
@@ -4069,18 +4069,18 @@ static void genRightShiftLiteral (operand *left,
             aopPut(AOP(result),zero,size);
     else{
         switch (size) {
-       case 1:
-           genrshOne(result, left, shCount);
-           break;
-       case 2:
-           /* PENDING: sign support */
-           genrshTwo(result, left, shCount, FALSE);
-           break;
-       case 4:
-           wassert(0);
-           break;
-       default:
-           wassert(0);
+  case 1:
+      genrshOne(result, left, shCount);
+      break;
+  case 2:
+      /* PENDING: sign support */
+      genrshTwo(result, left, shCount, FALSE);
+      break;
+  case 4:
+      wassert(0);
+      break;
+  default:
+      wassert(0);
         }
     }
     freeAsmop(left,NULL,ic);
@@ -4119,7 +4119,7 @@ static void genRightShift (iCode *ic)
 
     aopOp(right,ic,FALSE, FALSE);
 
-    /* if the shift count is known then do it 
+    /* if the shift count is known then do it
     as efficiently as possible */
     if (AOP_TYPE(right) == AOP_LIT) {
         genRightShiftLiteral(left,right,result,ic);
@@ -4131,14 +4131,14 @@ static void genRightShift (iCode *ic)
 
     /* now move the left to the result if they are not the
     same */
-    if (!sameRegs(AOP(left),AOP(result)) && 
+    if (!sameRegs(AOP(left),AOP(result)) &&
         AOP_SIZE(result) > 1) {
 
         size = AOP_SIZE(result);
         offset=0;
         while (size--) {
             l = aopGet(AOP(left),offset,FALSE);
-           aopPut(AOP(result),l,offset);
+      aopPut(AOP(result),l,offset);
             offset++;
         }
     }
@@ -4156,15 +4156,15 @@ static void genRightShift (iCode *ic)
     emitLabel(tlbl->key+100);
     while (size--) {
         l = aopGet(AOP(result),offset--,FALSE);
-       if (first) {
-           if (is_signed)
-               emitcode("sra", "%s", l);
-           else
-               emitcode("srl", "%s", l);
-           first = 0;
-       }
-       else
-           emitcode("rr", "%s", l);
+  if (first) {
+      if (is_signed)
+    emitcode("sra", "%s", l);
+      else
+    emitcode("srl", "%s", l);
+      first = 0;
+  }
+  else
+      emitcode("rr", "%s", l);
     }
     emitLabel(tlbl1->key+100);
     emitcode("dec", "a");
@@ -4185,24 +4185,24 @@ static void genGenPointerGet (operand *left,
     int pair = PAIR_HL;
 
     if (IS_GB)
-       pair = PAIR_DE;
+  pair = PAIR_DE;
 
     aopOp(left,ic,FALSE, FALSE);
     aopOp(result,ic,FALSE, FALSE);
-    
+
     if (isPair(AOP(left)) && AOP_SIZE(result)==1) {
-       /* Just do it */
-       if (isPtrPair(AOP(left))) 
-           {
-               tsprintf(buffer, "!*pair", getPairName(AOP(left)));
-               aopPut(AOP(result), buffer, 0);
-           }
-       else {
-           emit2("ld a,!*pair", getPairName(AOP(left)));
-           aopPut(AOP(result),"a", 0);
-       }
-       freeAsmop(left,NULL,ic);
-       goto release;
+  /* Just do it */
+  if (isPtrPair(AOP(left)))
+      {
+    tsprintf(buffer, "!*pair", getPairName(AOP(left)));
+    aopPut(AOP(result), buffer, 0);
+      }
+  else {
+      emit2("ld a,!*pair", getPairName(AOP(left)));
+      aopPut(AOP(result),"a", 0);
+  }
+  freeAsmop(left,NULL,ic);
+  goto release;
     }
 
     /* For now we always load into IY */
@@ -4214,25 +4214,25 @@ static void genGenPointerGet (operand *left,
 
     /* if bit then unpack */
     if (IS_BITVAR(retype)) {
-       wassert(0);
+  wassert(0);
     }
     else {
         size = AOP_SIZE(result);
         offset = 0 ;
 
         while (size--) {
-           /* PENDING: make this better */
-           if (!IS_GB && AOP(result)->type == AOP_REG) {
-               aopPut(AOP(result), "!*hl", offset++);
-           }
-           else {
-               emit2("ld a,!*pair", _pairs[pair].name);
-               aopPut(AOP(result),"a",offset++);
-           }
-           if (size) {
-               emit2("inc %s", _pairs[pair].name);
-               _G.pairs[pair].offset++;
-           }
+      /* PENDING: make this better */
+      if (!IS_GB && AOP(result)->type == AOP_REG) {
+    aopPut(AOP(result), "!*hl", offset++);
+      }
+      else {
+    emit2("ld a,!*pair", _pairs[pair].name);
+    aopPut(AOP(result),"a",offset++);
+      }
+      if (size) {
+    emit2("inc %s", _pairs[pair].name);
+    _G.pairs[pair].offset++;
+      }
         }
     }
 
@@ -4262,7 +4262,7 @@ static void genPointerGet (iCode *ic)
 bool isRegOrLit(asmop *aop)
 {
     if (aop->type == AOP_REG || aop->type == AOP_LIT || aop->type == AOP_IMMD)
-       return TRUE;
+  return TRUE;
     return FALSE;
 }
 
@@ -4271,7 +4271,7 @@ bool isRegOrLit(asmop *aop)
 /*-----------------------------------------------------------------*/
 static void genGenPointerSet (operand *right,
                               operand *result, iCode *ic)
-{    
+{
     int size, offset ;
     sym_link *retype = getSpec(operandType(right));
     PAIR_ID pairId = PAIR_HL;
@@ -4280,34 +4280,34 @@ static void genGenPointerSet (operand *right,
     aopOp(right,ic,FALSE, FALSE);
 
     if (IS_GB)
-       pairId = PAIR_DE;
+  pairId = PAIR_DE;
 
     /* Handle the exceptions first */
     if (isPair(AOP(result)) && (AOP_SIZE(right)==1)) {
-       /* Just do it */
-       char *l = aopGet(AOP(right), 0, FALSE);
-       const char *pair = getPairName(AOP(result));
-       if (canAssignToPtr(l) && isPtr(pair)) {
-           emit2("ld !*pair,%s", pair, l);
-       }
-       else {
-           MOVA(l);
-           emit2("ld !*pair,a", pair);
-       }
-       goto release;
-    }
-       
-    /* if the operand is already in dptr 
+  /* Just do it */
+  char *l = aopGet(AOP(right), 0, FALSE);
+  const char *pair = getPairName(AOP(result));
+  if (canAssignToPtr(l) && isPtr(pair)) {
+      emit2("ld !*pair,%s", pair, l);
+  }
+  else {
+      MOVA(l);
+      emit2("ld !*pair,a", pair);
+  }
+  goto release;
+    }
+
+    /* if the operand is already in dptr
        then we do nothing else we move the value to dptr */
     if (AOP_TYPE(result) != AOP_STR) {
-       fetchPair(pairId, AOP(result));
+  fetchPair(pairId, AOP(result));
     }
     /* so hl know contains the address */
     freeAsmop(result,NULL,ic);
 
     /* if bit then unpack */
     if (IS_BITVAR(retype)) {
-       wassert(0);
+  wassert(0);
     }
     else {
         size = AOP_SIZE(right);
@@ -4315,18 +4315,18 @@ static void genGenPointerSet (operand *right,
 
         while (size--) {
             char *l = aopGet(AOP(right),offset,FALSE);
-           if (isRegOrLit(AOP(right)) && !IS_GB) {
-               emit2("ld !*pair,%s", _pairs[pairId].name, l);
-           }
-           else {
-               MOVA(l);
-               emit2("ld !*pair,a", _pairs[pairId].name);
-           }
-           if (size) {
-               emitcode("inc", _pairs[pairId].name);
-               _G.pairs[pairId].offset++;
-           }
-           offset++;
+      if (isRegOrLit(AOP(right)) && !IS_GB) {
+    emit2("ld !*pair,%s", _pairs[pairId].name, l);
+      }
+      else {
+    MOVA(l);
+    emit2("ld !*pair,a", _pairs[pairId].name);
+      }
+      if (size) {
+    emitcode("inc", _pairs[pairId].name);
+    _G.pairs[pairId].offset++;
+      }
+      offset++;
         }
     }
     release:
@@ -4337,7 +4337,7 @@ static void genGenPointerSet (operand *right,
 /* genPointerSet - stores the value into a pointer location        */
 /*-----------------------------------------------------------------*/
 static void genPointerSet (iCode *ic)
-{    
+{
     operand *right, *result ;
     sym_link *type, *etype;
 
@@ -4348,7 +4348,7 @@ static void genPointerSet (iCode *ic)
     move it to the correct pointer register */
     type = operandType(result);
     etype = getSpec(type);
-    
+
     genGenPointerSet (right,result,ic);
 }
 
@@ -4375,14 +4375,14 @@ static void genIfx (iCode *ic, iCode *popIc)
         genIpop(popIc);
 
     /* if the condition is  a bit variable */
-    if (isbit && IS_ITEMP(cond) && 
-       SPIL_LOC(cond))
-       genIfxJump(ic,SPIL_LOC(cond)->rname);
+    if (isbit && IS_ITEMP(cond) &&
+  SPIL_LOC(cond))
+  genIfxJump(ic,SPIL_LOC(cond)->rname);
     else
-       if (isbit && !IS_ITEMP(cond))
-           genIfxJump(ic,OP_SYMBOL(cond)->rname);
-       else
-           genIfxJump(ic,"a");
+  if (isbit && !IS_ITEMP(cond))
+      genIfxJump(ic,OP_SYMBOL(cond)->rname);
+  else
+      genIfxJump(ic,"a");
 
     ic->generated = 1;
 }
@@ -4396,42 +4396,42 @@ static void genAddrOf (iCode *ic)
 
     aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
 
-    /* if the operand is on the stack then we 
+    /* if the operand is on the stack then we
     need to get the stack offset of this
     variable */
     if (IS_GB) {
-       if (sym->onStack) {
-           spillCached();
-           if (sym->stack <= 0) {
-               emit2("!ldahlsp", sym->stack + _G.stack.pushed + _G.stack.offset);
-           }
-           else {
-               emit2("!ldahlsp", sym->stack + _G.stack.pushed + _G.stack.offset + _G.stack.param_offset);
-           }
-           emitcode("ld", "d,h");
-           emitcode("ld", "e,l");
-       }
-       else {
-           emit2("ld de,!hashedstr", sym->rname);
-       }
-       aopPut(AOP(IC_RESULT(ic)), "e", 0);
-       aopPut(AOP(IC_RESULT(ic)), "d", 1);
+  if (sym->onStack) {
+      spillCached();
+      if (sym->stack <= 0) {
+    emit2("!ldahlsp", sym->stack + _G.stack.pushed + _G.stack.offset);
+      }
+      else {
+    emit2("!ldahlsp", sym->stack + _G.stack.pushed + _G.stack.offset + _G.stack.param_offset);
+      }
+      emitcode("ld", "d,h");
+      emitcode("ld", "e,l");
+  }
+  else {
+      emit2("ld de,!hashedstr", sym->rname);
+  }
+  aopPut(AOP(IC_RESULT(ic)), "e", 0);
+  aopPut(AOP(IC_RESULT(ic)), "d", 1);
     }
     else {
-       spillCached();
-       if (sym->onStack) {
-           /* if it has an offset  then we need to compute it */
-           if (sym->stack > 0) 
-               emitcode("ld", "hl,#%d+%d+%d+%d", sym->stack, _G.stack.pushed, _G.stack.offset, _G.stack.param_offset);
-           else
-               emitcode("ld", "hl,#%d+%d+%d", sym->stack, _G.stack.pushed, _G.stack.offset);
-           emitcode("add", "hl,sp");
-       }
-       else {
-           emitcode("ld", "hl,#%s", sym->rname);
-       }
-       aopPut(AOP(IC_RESULT(ic)), "l", 0);
-       aopPut(AOP(IC_RESULT(ic)), "h", 1);
+  spillCached();
+  if (sym->onStack) {
+      /* if it has an offset  then we need to compute it */
+      if (sym->stack > 0)
+    emitcode("ld", "hl,#%d+%d+%d+%d", sym->stack, _G.stack.pushed, _G.stack.offset, _G.stack.param_offset);
+      else
+    emitcode("ld", "hl,#%d+%d+%d", sym->stack, _G.stack.pushed, _G.stack.offset);
+      emitcode("add", "hl,sp");
+  }
+  else {
+      emitcode("ld", "hl,#%s", sym->rname);
+  }
+  aopPut(AOP(IC_RESULT(ic)), "l", 0);
+  aopPut(AOP(IC_RESULT(ic)), "h", 1);
     }
     freeAsmop(IC_RESULT(ic),NULL,ic);
 }
@@ -4451,7 +4451,7 @@ static void genAssign (iCode *ic)
 #if 1
     /* Dont bother assigning if they are the same */
     if (operandsEqu (IC_RESULT(ic),IC_RIGHT(ic))) {
-       emitcode("", "; (operands are equal %u)", operandsEqu(IC_RESULT(ic),IC_RIGHT(ic)));
+  emitcode("", "; (operands are equal %u)", operandsEqu(IC_RESULT(ic),IC_RIGHT(ic)));
         return;
     }
 #endif
@@ -4461,13 +4461,13 @@ static void genAssign (iCode *ic)
 
     /* if they are the same registers */
     if (sameRegs(AOP(right),AOP(result))) {
-       emitcode("", "; (registers are the same)");
+  emitcode("", "; (registers are the same)");
         goto release;
     }
 
     /* if the result is a bit */
     if (AOP_TYPE(result) == AOP_CRY) {
-       wassert(0);
+  wassert(0);
     }
 
     /* general case */
@@ -4475,65 +4475,65 @@ static void genAssign (iCode *ic)
     offset = 0;
 
     if(AOP_TYPE(right) == AOP_LIT)
-       lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
+  lit = (unsigned long)floatFromVal(AOP(right)->aopu.aop_lit);
     if (isPair(AOP(result))) {
-       fetchPair(getPairId(AOP(result)), AOP(right));
+  fetchPair(getPairId(AOP(result)), AOP(right));
     }
     else if((size > 1) &&
        (AOP_TYPE(result) != AOP_REG) &&
        (AOP_TYPE(right) == AOP_LIT) &&
        !IS_FLOAT(operandType(right)) &&
        (lit < 256L)) {
-       bool fXored = FALSE;
-       offset = 0;
-       /* Work from the top down.
-          Done this way so that we can use the cached copy of 0
-          in A for a fast clear */
-       while (size--) {
-           if((unsigned int)((lit >> (offset*8)) & 0x0FFL)== 0) {
-               if (!fXored && size>1) {
-                   emitcode("xor", "a,a");
-                   fXored = TRUE;
-               }
-               if (fXored) {
-                   aopPut(AOP(result),"a",offset);
-               }
-               else {
-                   aopPut(AOP(result), zero, offset);
-               }
-           }
-           else
-               aopPut(AOP(result),
-                      aopGet(AOP(right),offset,FALSE),
-                      offset);
-           offset++;
-       }
+  bool fXored = FALSE;
+  offset = 0;
+  /* Work from the top down.
+     Done this way so that we can use the cached copy of 0
+     in A for a fast clear */
+  while (size--) {
+      if((unsigned int)((lit >> (offset*8)) & 0x0FFL)== 0) {
+    if (!fXored && size>1) {
+        emitcode("xor", "a,a");
+        fXored = TRUE;
+    }
+    if (fXored) {
+        aopPut(AOP(result),"a",offset);
+    }
+    else {
+        aopPut(AOP(result), zero, offset);
+    }
+      }
+      else
+    aopPut(AOP(result),
+           aopGet(AOP(right),offset,FALSE),
+           offset);
+      offset++;
+  }
     }
     else if (size == 2 && requiresHL(AOP(right)) && requiresHL(AOP(result)) && IS_GB) {
-       /* Special case.  Load into a and d, then load out. */
-       MOVA(aopGet(AOP(right), 0, FALSE));
-       emitcode("ld", "e,%s", aopGet(AOP(right), 1, FALSE));
-       aopPut(AOP(result), "a", 0);
-       aopPut(AOP(result), "e", 1);
+  /* Special case.  Load into a and d, then load out. */
+  MOVA(aopGet(AOP(right), 0, FALSE));
+  emitcode("ld", "e,%s", aopGet(AOP(right), 1, FALSE));
+  aopPut(AOP(result), "a", 0);
+  aopPut(AOP(result), "e", 1);
     } else {
-       while (size--) {
-           /* PENDING: do this check better */
-           if (requiresHL(AOP(right)) && requiresHL(AOP(result))) {
-               MOVA(aopGet(AOP(right), offset, FALSE));
-               aopPut(AOP(result), "a", offset);
-           }
-           else 
-               aopPut(AOP(result),
-                      aopGet(AOP(right),offset,FALSE),
-                      offset);
-           offset++;
-       }
-    }
-    
+  while (size--) {
+      /* PENDING: do this check better */
+      if (requiresHL(AOP(right)) && requiresHL(AOP(result))) {
+    MOVA(aopGet(AOP(right), offset, FALSE));
+    aopPut(AOP(result), "a", offset);
+      }
+      else
+    aopPut(AOP(result),
+           aopGet(AOP(right),offset,FALSE),
+           offset);
+      offset++;
+  }
+    }
+
 release:
     freeAsmop(right,NULL,ic);
     freeAsmop(result,NULL,ic);
-}   
+}
 
 /*-----------------------------------------------------------------*/
 /* genJumpTab - genrates code for jump table                       */
@@ -4547,7 +4547,7 @@ static void genJumpTab (iCode *ic)
     /* get the condition into accumulator */
     l = aopGet(AOP(IC_JTCOND(ic)),0,FALSE);
     if (!IS_GB)
-       emitcode("push", "de");
+  emitcode("push", "de");
     emitcode("ld", "e,%s", l);
     emit2("ld d,!zero");
     jtab = newiTempLabel(NULL);
@@ -4558,13 +4558,13 @@ static void genJumpTab (iCode *ic)
     emitcode("add", "hl,de");
     freeAsmop(IC_JTCOND(ic),NULL,ic);
     if (!IS_GB)
-       emitcode("pop", "de");
+  emitcode("pop", "de");
     emit2("jp !*hl");
     emitLabel(jtab->key+100);
     /* now generate the jump labels */
     for (jtab = setFirstItem(IC_JTLABELS(ic)) ; jtab;
          jtab = setNextItem(IC_JTLABELS(ic)))
-       emit2("jp !tlabel", jtab->key+100);
+  emit2("jp !tlabel", jtab->key+100);
 }
 
 /*-----------------------------------------------------------------*/
@@ -4586,7 +4586,7 @@ static void genCast (iCode *ic)
 
     /* if the result is a bit */
     if (AOP_TYPE(result) == AOP_CRY) {
-       wassert(0);
+  wassert(0);
     }
 
     /* if they are the same size : or less */
@@ -4612,10 +4612,10 @@ static void genCast (iCode *ic)
 #if 0
     /* if the result is of type pointer */
     if (IS_PTR(ctype)) {
-       wassert(0);
+  wassert(0);
     }
 #endif
-    
+
     /* so we now know that the size of destination is greater
     than the size of the source */
     /* we move to result for the size of source */
@@ -4639,11 +4639,11 @@ static void genCast (iCode *ic)
         char *l = aopGet(AOP(right),AOP_SIZE(right) - 1,
                          FALSE);
         MOVA(l);
-       emitcode("", "; genCast: sign extend untested.");
+  emitcode("", "; genCast: sign extend untested.");
         emitcode("rla", "");
         emitcode("sbc", "a,a");
         while (size--)
-            aopPut(AOP(result),"a",offset++);   
+            aopPut(AOP(result),"a",offset++);
     }
 
 release:
@@ -4655,16 +4655,16 @@ release:
 /* genReceive - generate code for a receive iCode                  */
 /*-----------------------------------------------------------------*/
 static void genReceive (iCode *ic)
-{    
-    if (isOperandInFarSpace(IC_RESULT(ic)) && 
-       ( OP_SYMBOL(IC_RESULT(ic))->isspilt ||
-         IS_TRUE_SYMOP(IC_RESULT(ic))) ) {
-       wassert(0);
+{
+    if (isOperandInFarSpace(IC_RESULT(ic)) &&
+  ( OP_SYMBOL(IC_RESULT(ic))->isspilt ||
+    IS_TRUE_SYMOP(IC_RESULT(ic))) ) {
+  wassert(0);
     } else {
-       accInUse++;
-       aopOp(IC_RESULT(ic),ic,FALSE, FALSE);  
-       accInUse--;
-       assignResultValue(IC_RESULT(ic));       
+  accInUse++;
+  aopOp(IC_RESULT(ic),ic,FALSE, FALSE);
+  accInUse--;
+  assignResultValue(IC_RESULT(ic));
     }
 
     freeAsmop(IC_RESULT(ic),NULL,ic);
@@ -4680,302 +4680,302 @@ void genZ80Code (iCode *lic)
 
     /* HACK */
     if (IS_GB) {
-       _fReturn = _gbz80_return;
-       _fTmp = _gbz80_return;
+  _fReturn = _gbz80_return;
+  _fTmp = _gbz80_return;
     }
     else {
-       _fReturn = _z80_return;
-       _fTmp = _z80_return;
+  _fReturn = _z80_return;
+  _fTmp = _z80_return;
     }
     tsprintf(zero, "!zero");
 
     lineHead = lineCurr = NULL;
 
     /* if debug information required */
-    if (options.debug && currFunc) { 
-       cdbSymbol(currFunc,cdbFile,FALSE,TRUE);
-       debugLine = 1;
-       if (IS_STATIC(currFunc->etype))
-           emitcode("","F%s$%s$0$0 ==.",moduleName,currFunc->name); 
-       else
-           emitcode("","G$%s$0$0 ==.",currFunc->name);
-       debugLine = 0;
+    if (options.debug && currFunc) {
+  cdbSymbol(currFunc,cdbFile,FALSE,TRUE);
+  debugLine = 1;
+  if (IS_STATIC(currFunc->etype))
+      emitcode("","F%s$%s$0$0 ==.",moduleName,currFunc->name);
+  else
+      emitcode("","G$%s$0$0 ==.",currFunc->name);
+  debugLine = 0;
     }
     /* stack pointer name */
     spname = "sp";
-    
+
+
     for (ic = lic ; ic ; ic = ic->next ) {
-       
-       if ( cln != ic->lineno ) {
-           if ( options.debug ) {
-               debugLine = 1;
-               emitcode("","C$%s$%d$%d$%d ==.",
-                        ic->filename,ic->lineno,
-                        ic->level,ic->block);
-               debugLine = 0;
-           }
-           emitcode(";","%s %d",ic->filename,ic->lineno);
-           cln = ic->lineno ;
-       }
-       /* if the result is marked as
-          spilt and rematerializable or code for
-          this has already been generated then
-          do nothing */
-       if (resultRemat(ic) || ic->generated ) 
-           continue ;
-       
-       /* depending on the operation */
-       switch (ic->op) {
-       case '!' :
-           emitcode("", "; genNot");
-           genNot(ic);
-           break;
-           
-       case '~' :
-           emitcode("", "; genCpl");
-           genCpl(ic);
-           break;
-           
-       case UNARYMINUS:
-           emitcode("", "; genUminus");
-           genUminus (ic);
-           break;
-           
-       case IPUSH:
-           emitcode("", "; genIpush");
-           genIpush (ic);
-           break;
-           
-       case IPOP:
-           /* IPOP happens only when trying to restore a 
-              spilt live range, if there is an ifx statement
-              following this pop then the if statement might
-              be using some of the registers being popped which
-              would destory the contents of the register so
-              we need to check for this condition and handle it */
-           if (ic->next            && 
-               ic->next->op == IFX &&
-               regsInCommon(IC_LEFT(ic),IC_COND(ic->next))) {
-               emitcode("", "; genIfx");
-               genIfx (ic->next,ic);
-           }
-           else {
-               emitcode("", "; genIpop");
-               genIpop (ic);
-           }
-           break; 
-           
-       case CALL:
-           emitcode("", "; genCall");
-           genCall (ic);
-           break;
-           
-       case PCALL:
-           emitcode("", "; genPcall");
-           genPcall (ic);
-           break;
-           
-       case FUNCTION:
-           emitcode("", "; genFunction");
-           genFunction (ic);
-           break;
-           
-       case ENDFUNCTION:
-           emitcode("", "; genEndFunction");
-           genEndFunction (ic);
-           break;
-           
-       case RETURN:
-           emitcode("", "; genRet");
-           genRet (ic);
-           break;
-           
-       case LABEL:
-           emitcode("", "; genLabel");
-           genLabel (ic);
-           break;
-           
-       case GOTO:
-           emitcode("", "; genGoto");
-           genGoto (ic);
-           break;
-           
-       case '+' :
-           emitcode("", "; genPlus");
-           genPlus (ic) ;
-           break;
-           
-       case '-' :
-           emitcode("", "; genMinus");
-           genMinus (ic);
-           break;
-           
-       case '*' :
-           emitcode("", "; genMult");
-           genMult (ic);
-           break;
-           
-       case '/' :
-           emitcode("", "; genDiv");
-           genDiv (ic) ;
-           break;
-           
-       case '%' :
-           emitcode("", "; genMod");
-           genMod (ic);
-           break;
-           
-       case '>' :
-           emitcode("", "; genCmpGt");
-           genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic));                 
-           break;
-           
-       case '<' :
-           emitcode("", "; genCmpLt");
-           genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case LE_OP:
-       case GE_OP:
-       case NE_OP:
-           
-           /* note these two are xlated by algebraic equivalence
-              during parsing SDCC.y */
-           werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
-                  "got '>=' or '<=' shouldn't have come here");
-           break;      
-           
-       case EQ_OP:
-           emitcode("", "; genCmpEq");
-           genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;          
-           
-       case AND_OP:
-           emitcode("", "; genAndOp");
-           genAndOp (ic);
-           break;
-           
-       case OR_OP:
-           emitcode("", "; genOrOp");
-           genOrOp (ic);
-           break;
-           
-       case '^' :
-           emitcode("", "; genXor");
-           genXor (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case '|' :
-           emitcode("", "; genOr");
-           genOr (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case BITWISEAND:
-           emitcode("", "; genAnd");
+
+  if ( cln != ic->lineno ) {
+      if ( options.debug ) {
+    debugLine = 1;
+    emitcode("","C$%s$%d$%d$%d ==.",
+       ic->filename,ic->lineno,
+       ic->level,ic->block);
+    debugLine = 0;
+      }
+      emitcode(";","%s %d",ic->filename,ic->lineno);
+      cln = ic->lineno ;
+  }
+  /* if the result is marked as
+     spilt and rematerializable or code for
+     this has already been generated then
+     do nothing */
+  if (resultRemat(ic) || ic->generated )
+      continue ;
+
+  /* depending on the operation */
+  switch (ic->op) {
+  case '!' :
+      emitcode("", "; genNot");
+      genNot(ic);
+      break;
+
+  case '~' :
+      emitcode("", "; genCpl");
+      genCpl(ic);
+      break;
+
+  case UNARYMINUS:
+      emitcode("", "; genUminus");
+      genUminus (ic);
+      break;
+
+  case IPUSH:
+      emitcode("", "; genIpush");
+      genIpush (ic);
+      break;
+
+  case IPOP:
+      /* IPOP happens only when trying to restore a
+         spilt live range, if there is an ifx statement
+         following this pop then the if statement might
+         be using some of the registers being popped which
+         would destory the contents of the register so
+         we need to check for this condition and handle it */
+      if (ic->next            &&
+    ic->next->op == IFX &&
+    regsInCommon(IC_LEFT(ic),IC_COND(ic->next))) {
+    emitcode("", "; genIfx");
+    genIfx (ic->next,ic);
+      }
+      else {
+    emitcode("", "; genIpop");
+    genIpop (ic);
+      }
+      break;
+
+  case CALL:
+      emitcode("", "; genCall");
+      genCall (ic);
+      break;
+
+  case PCALL:
+      emitcode("", "; genPcall");
+      genPcall (ic);
+      break;
+
+  case FUNCTION:
+      emitcode("", "; genFunction");
+      genFunction (ic);
+      break;
+
+  case ENDFUNCTION:
+      emitcode("", "; genEndFunction");
+      genEndFunction (ic);
+      break;
+
+  case RETURN:
+      emitcode("", "; genRet");
+      genRet (ic);
+      break;
+
+  case LABEL:
+      emitcode("", "; genLabel");
+      genLabel (ic);
+      break;
+
+  case GOTO:
+      emitcode("", "; genGoto");
+      genGoto (ic);
+      break;
+
+  case '+' :
+      emitcode("", "; genPlus");
+      genPlus (ic) ;
+      break;
+
+  case '-' :
+      emitcode("", "; genMinus");
+      genMinus (ic);
+      break;
+
+  case '*' :
+      emitcode("", "; genMult");
+      genMult (ic);
+      break;
+
+  case '/' :
+      emitcode("", "; genDiv");
+      genDiv (ic) ;
+      break;
+
+  case '%' :
+      emitcode("", "; genMod");
+      genMod (ic);
+      break;
+
+  case '>' :
+      emitcode("", "; genCmpGt");
+      genCmpGt (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case '<' :
+      emitcode("", "; genCmpLt");
+      genCmpLt (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case LE_OP:
+  case GE_OP:
+  case NE_OP:
+
+      /* note these two are xlated by algebraic equivalence
+         during parsing SDCC.y */
+      werror(E_INTERNAL_ERROR,__FILE__,__LINE__,
+       "got '>=' or '<=' shouldn't have come here");
+      break;
+
+  case EQ_OP:
+      emitcode("", "; genCmpEq");
+      genCmpEq (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case AND_OP:
+      emitcode("", "; genAndOp");
+      genAndOp (ic);
+      break;
+
+  case OR_OP:
+      emitcode("", "; genOrOp");
+      genOrOp (ic);
+      break;
+
+  case '^' :
+      emitcode("", "; genXor");
+      genXor (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case '|' :
+      emitcode("", "; genOr");
+      genOr (ic,ifxForOp(IC_RESULT(ic),ic));
+      break;
+
+  case BITWISEAND:
+      emitcode("", "; genAnd");
             genAnd (ic,ifxForOp(IC_RESULT(ic),ic));
-           break;
-           
-       case INLINEASM:
-           emitcode("", "; genInline");
-           genInline (ic);
-           break;
-           
-       case RRC:
-           emitcode("", "; genRRC");
-           genRRC (ic);
-           break;
-           
-       case RLC:
-           emitcode("", "; genRLC");
-           genRLC (ic);
-           break;
-           
-       case GETHBIT:
-           emitcode("", "; genHBIT");
-           wassert(0);
-           
-       case LEFT_OP:
-           emitcode("", "; genLeftShift");
-           genLeftShift (ic);
-           break;
-           
-       case RIGHT_OP:
-           emitcode("", "; genRightShift");
-           genRightShift (ic);
-           break;
-           
-       case GET_VALUE_AT_ADDRESS:
-           emitcode("", "; genPointerGet");
-           genPointerGet(ic);
-           break;
-           
-       case '=' :
-
-           if (POINTER_SET(ic)) {
-               emitcode("", "; genAssign (pointer)");
-               genPointerSet(ic);
-           }
-           else {
-               emitcode("", "; genAssign");
-               genAssign(ic);
-           }
-           break;
-           
-       case IFX:
-           emitcode("", "; genIfx");
-           genIfx (ic,NULL);
-           break;
-           
-       case ADDRESS_OF:
-           emitcode("", "; genAddrOf");
-           genAddrOf (ic);
-           break;
-           
-       case JUMPTABLE:
-           emitcode("", "; genJumpTab");
-           genJumpTab (ic);
-           break;
-           
-       case CAST:
-           emitcode("", "; genCast");
-           genCast (ic);
-           break;
-           
-       case RECEIVE:
-           emitcode("", "; genReceive");
-           genReceive(ic);
-           break;
-           
-       case SEND:
-           emitcode("", "; addSet");
-           addSet(&sendSet,ic);
-           break;
-
-       default :
-           ic = ic;
-           /*      piCode(ic,stdout); */
-           
+      break;
+
+  case INLINEASM:
+      emitcode("", "; genInline");
+      genInline (ic);
+      break;
+
+  case RRC:
+      emitcode("", "; genRRC");
+      genRRC (ic);
+      break;
+
+  case RLC:
+      emitcode("", "; genRLC");
+      genRLC (ic);
+      break;
+
+  case GETHBIT:
+      emitcode("", "; genHBIT");
+      wassert(0);
+
+  case LEFT_OP:
+      emitcode("", "; genLeftShift");
+      genLeftShift (ic);
+      break;
+
+  case RIGHT_OP:
+      emitcode("", "; genRightShift");
+      genRightShift (ic);
+      break;
+
+  case GET_VALUE_AT_ADDRESS:
+      emitcode("", "; genPointerGet");
+      genPointerGet(ic);
+      break;
+
+  case '=' :
+
+      if (POINTER_SET(ic)) {
+    emitcode("", "; genAssign (pointer)");
+    genPointerSet(ic);
+      }
+      else {
+    emitcode("", "; genAssign");
+    genAssign(ic);
+      }
+      break;
+
+  case IFX:
+      emitcode("", "; genIfx");
+      genIfx (ic,NULL);
+      break;
+
+  case ADDRESS_OF:
+      emitcode("", "; genAddrOf");
+      genAddrOf (ic);
+      break;
+
+  case JUMPTABLE:
+      emitcode("", "; genJumpTab");
+      genJumpTab (ic);
+      break;
+
+  case CAST:
+      emitcode("", "; genCast");
+      genCast (ic);
+      break;
+
+  case RECEIVE:
+      emitcode("", "; genReceive");
+      genReceive(ic);
+      break;
+
+  case SEND:
+      emitcode("", "; addSet");
+      addSet(&sendSet,ic);
+      break;
+
+  default :
+      ic = ic;
+      /*      piCode(ic,stdout); */
+
         }
     }
-    
 
-    /* now we are ready to call the 
+
+    /* now we are ready to call the
        peep hole optimizer */
     if (!options.nopeep)
-       peepHole (&lineHead);
+  peepHole (&lineHead);
 
     /* This is unfortunate */
     /* now do the actual printing */
     {
-       FILE *fp = codeOutFile;
-       if (isInHome() && codeOutFile == code->oFile)
-           codeOutFile = home->oFile;
-       printLine (lineHead, codeOutFile);
-       if (_G.flush_statics) {
-           flushStatics();
-           _G.flush_statics = 0;
-       }
-       codeOutFile = fp;
+  FILE *fp = codeOutFile;
+  if (isInHome() && codeOutFile == code->oFile)
+      codeOutFile = home->oFile;
+  printLine (lineHead, codeOutFile);
+  if (_G.flush_statics) {
+      flushStatics();
+      _G.flush_statics = 0;
+  }
+  codeOutFile = fp;
     }
 }
index 920286eb028155de53f217e985e41f373a17d39c..05ca4fe38f20f9ac82ad8e21d7f266afe1d7e49b 100644 (file)
@@ -10,25 +10,23 @@ functions.
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 
 ===============================================================================
 */
 
-//#include "SDCCerr.h"
-
 #include <stdio.h>
 #include <malloc.h>
 #include <stdlib.h>
@@ -37,7 +35,7 @@ functions.
 #include "newalloc.h"
 /*
 -------------------------------------------------------------------------------
-Clear_realloc - Reallocate a memory block and clear any memory added with 
+Clear_realloc - Reallocate a memory block and clear any memory added with
 out of memory error detection
 
 -------------------------------------------------------------------------------
@@ -53,8 +51,8 @@ NewPtr = realloc(OldPtr,NewSize) ;
 if (!NewPtr)
   {
   printf("ERROR - No more memory\n") ;
-//  werror(E_OUT_OF_MEM,__FILE__,NewSize);
-  exit (1);                               
+/*  werror(E_OUT_OF_MEM,__FILE__,NewSize);*/
+  exit (1);
   }
 
 if (NewPtr)
@@ -80,8 +78,8 @@ NewPtr = realloc(OldPtr,NewSize) ;
 if (!NewPtr)
   {
   printf("ERROR - No more memory\n") ;
-//  werror(E_OUT_OF_MEM,__FILE__,NewSize);
-  exit (1);                               
+/*  werror(E_OUT_OF_MEM,__FILE__,NewSize);*/
+  exit (1);
   }
 
 return NewPtr ;
@@ -94,18 +92,18 @@ all data to zero and checking for out of memory errors.
 -------------------------------------------------------------------------------
 */
 
-void *Safe_calloc(size_t Size)
+void *Safe_calloc(size_t Elements,size_t Size)
 
 {
 void *NewPtr ;
 
-NewPtr = calloc(Size,1) ;
+NewPtr = calloc(Elements,Size) ;
 
 if (!NewPtr)
   {
   printf("ERROR - No more memory\n") ;
-//  werror(E_OUT_OF_MEM,__FILE__,Size);
-  exit (1);                               
+/*  werror(E_OUT_OF_MEM,__FILE__,Size);*/
+  exit (1);
   }
 
 return NewPtr ;
@@ -128,8 +126,8 @@ NewPtr = malloc(Size) ;
 if (!NewPtr)
   {
   printf("ERROR - No more memory\n") ;
-//  werror(E_OUT_OF_MEM,__FILE__,Size);
-  exit (1);                               
+/*  werror(E_OUT_OF_MEM,__FILE__,Size);*/
+  exit (1);
   }
 
 return NewPtr ;
index e27957fa38be8f34a163d4903caf9dd9835df281..e0fb3309b6dac6bf3a9ca8f7ba7b29c13038bace 100644 (file)
@@ -10,19 +10,19 @@ functions.
    under the terms of the GNU General Public License as published by the
    Free Software Foundation; either version 2, or (at your option) any
    later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-   
+
    In other words, you are welcome to use, share and improve this program.
    You are forbidden to forbid anyone else to use, share and improve
-   what you give them.   Help stamp out software-hoarding!  
+   what you give them.   Help stamp out software-hoarding!
 
 ===============================================================================
 */
@@ -35,7 +35,7 @@ functions.
 
 /*
 -------------------------------------------------------------------------------
-Clear_realloc - Reallocate a memory block and clear any memory added with 
+Clear_realloc - Reallocate a memory block and clear any memory added with
 out of memory error detection
 
 -------------------------------------------------------------------------------
@@ -60,7 +60,7 @@ all data to zero and checking for out or memory errors.
 -------------------------------------------------------------------------------
 */
 
-void *Safe_calloc(size_t Size) ;
+void *Safe_calloc(size_t Elements,size_t Size) ;
 
 /*
 -------------------------------------------------------------------------------
index fefe22e74f04cd016c0958fa0c28e2c2f97715ed..2f5e72be565c122a6800c9190a8f5e55cf128c7a 100644 (file)
@@ -1,9 +1,9 @@
 #if defined(_MSC_VER)
 
 #include <stdlib.h>
-#include "i386/i386.h" 
+#include "i386/i386.h"
 #include "i386/xm-i386.h"
-#define alloca Safe_calloc
+#define alloca(x) Safe_calloc(1,(x))
 #define bcopy(s, d, n)  memcpy(d, s, n)
 #define bcmp memcmp
 #define bzero(p, l) memset(p, 0, l)
 
 #else
 
-#include "i386/i386.h" 
-#include "i386/xm-linux.h"  
+#include "i386/i386.h"
+#include "i386/xm-linux.h"
 
 #ifndef __BORLANDC__
-#define alloca Safe_calloc
+#define alloca(x) Safe_calloc(1,(x))
 #else
 #include <string.h>
 #include <stdlib.h>
@@ -27,4 +27,4 @@
 #define rindex strrchr
 #endif
 
-#endif // _MSC_VER
\ No newline at end of file
+#endif  // _MSC_VER
\ No newline at end of file
index 4efe80df1f13d45509505e2443579f40a044da63..f1bac6ad49934874c5324534f078538a848560a9 100644 (file)
@@ -96,10 +96,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #ifndef VMS
 #ifndef USG
 #if !defined(_MSC_VER)
-#include <sys/time.h>          /* for __DATE__ and __TIME__ */
+#include <sys/time.h>   /* for __DATE__ and __TIME__ */
 #include <sys/resource.h>
 #else
-/*#include <sys/param.h>                        CYGNUS LOCAL: shebs -noquiet */
+/*#include <sys/param.h>       CYGNUS LOCAL: shebs -noquiet */
 // #include <sys/times.h>
 #include <time.h>
 #include <fcntl.h>
@@ -200,7 +200,7 @@ static char *predefs = "";
 #define WCHAR_TYPE "int"
 #endif
 #define CPP_WCHAR_TYPE(PFILE) \
-       (CPP_OPTIONS (PFILE)->cplusplus ? "__wchar_t" : WCHAR_TYPE)
+  (CPP_OPTIONS (PFILE)->cplusplus ? "__wchar_t" : WCHAR_TYPE)
 
 /* The string value for __USER_LABEL_PREFIX__ */
 
@@ -226,14 +226,14 @@ struct tokenlist_list {
 };
 
 struct assertion_hashnode {
-  struct assertion_hashnode *next;     /* double links for easy deletion */
+  struct assertion_hashnode *next;  /* double links for easy deletion */
   struct assertion_hashnode *prev;
   /* also, a back pointer to this node's hash
      chain is kept, in case the node is the head
      of the chain and gets deleted. */
   struct assertion_hashnode **bucket_hdr;
-  int length;                  /* length of token, for quick comparison */
-  U_CHAR *name;                        /* the actual name */
+  int length;     /* length of token, for quick comparison */
+  U_CHAR *name;     /* the actual name */
   /* List of token-sequences.  */
   struct tokenlist_list *value;
 };
@@ -311,7 +311,7 @@ static struct arglist *read_token_list ();
 static void free_token_list ();
 static int safe_read ();
 static void push_macro_expansion PARAMS ((cpp_reader *,
-                                         U_CHAR*, int, HASHNODE*));
+            U_CHAR*, int, HASHNODE*));
 static struct cpp_pending *nreverse_pending PARAMS ((struct cpp_pending*));
 //extern char *xrealloc ();
 //extern char *xcalloc ();
@@ -379,11 +379,11 @@ struct file_name_list
 /* -I directories are added to the end, then the defaults are added. */
 /* The */
 static struct default_include {
-  char *fname;                 /* The name of the directory.  */
-  int cplusplus;               /* Only look here if we're compiling C++.  */
-  int cxx_aware;               /* Includes in this directory don't need to
-                                  be wrapped in extern "C" when compiling
-                                  C++.  */
+  char *fname;      /* The name of the directory.  */
+  int cplusplus;    /* Only look here if we're compiling C++.  */
+  int cxx_aware;    /* Includes in this directory don't need to
+           be wrapped in extern "C" when compiling
+           C++.  */
 } include_defaults_array[]
 #ifdef INCLUDE_DEFAULTS
   = INCLUDE_DEFAULTS;
@@ -424,13 +424,13 @@ static struct default_include {
 /* `struct directive' defines one #-directive, including how to handle it.  */
 
 struct directive {
-  int length;                  /* Length of name */
-  int (*func)();               /* Function to handle directive */
-  char *name;                  /* Name of directive */
-  enum node_type type;         /* Code which describes which directive. */
+  int length;     /* Length of name */
+  int (*func)();    /* Function to handle directive */
+  char *name;     /* Name of directive */
+  enum node_type type;    /* Code which describes which directive. */
   char command_reads_line;      /* One if rest of line is read by func. */
-  char traditional_comments;   /* Nonzero: keep comments if -traditional.  */
-  char pass_thru;              /* Copy preprocessed directive to output file.*/
+  char traditional_comments;  /* Nonzero: keep comments if -traditional.  */
+  char pass_thru;   /* Copy preprocessed directive to output file.*/
 };
 
 /* Here is the actual list of #-directives, most-often-used first.
@@ -528,24 +528,24 @@ quote_string (
       {
       default:
         if (isprint (c))
-         CPP_PUTC_Q (pfile, c);
-       else
-         {
-           sprintf (CPP_PWRITTEN (pfile), "\\%03o", c);
-           CPP_ADJUST_WRITTEN (pfile, 4);
-         }
-       break;
+    CPP_PUTC_Q (pfile, c);
+  else
+    {
+      sprintf (CPP_PWRITTEN (pfile), "\\%03o", c);
+      CPP_ADJUST_WRITTEN (pfile, 4);
+    }
+  break;
 
       case '\"':
       case '\\':
-       CPP_PUTC_Q (pfile, '\\');
-       CPP_PUTC_Q (pfile, c);
-       break;
-      
+  CPP_PUTC_Q (pfile, '\\');
+  CPP_PUTC_Q (pfile, c);
+  break;
+
       case '\0':
-       CPP_PUTC_Q (pfile, '\"');
-       CPP_NUL_TERMINATE_Q (pfile);
-       return;
+  CPP_PUTC_Q (pfile, '\"');
+  CPP_NUL_TERMINATE_Q (pfile);
+  return;
       }
 }
 
@@ -609,15 +609,15 @@ cpp_define (
       p++;
       q = &buf[p - str];
       while (*p)
-       {
+  {
       if (*p == '\\' && p[1] == '\n')
-       p += 2;
+  p += 2;
       else
-       *q++ = *p++;
+  *q++ = *p++;
     }
     *q = 0;
   }
-  
+
   do_define (pfile, NULL, buf, buf + strlen (buf));
 }
 \f
@@ -661,7 +661,7 @@ make_assertion (
     cpp_error (pfile, "malformed option `%s %s'", option, str);
     return;
   }
-  
+
   ip = cpp_push_buffer (pfile, buf, strlen (buf));
   do_assert (pfile, NULL, NULL, NULL);
   cpp_pop_buffer (pfile);
@@ -733,7 +733,7 @@ deps_output (
     {
       pfile->deps_allocated_size = (pfile->deps_size + size + 50) * 2;
       pfile->deps_buffer = (char *) Safe_realloc(pfile->deps_buffer,
-                                             pfile->deps_allocated_size);
+                pfile->deps_allocated_size);
     }
   if (spacer == ' ' && pfile->deps_column > 0)
     pfile->deps_buffer[pfile->deps_size++] = ' ';
@@ -766,20 +766,20 @@ path_include (
       /* Find the end of this name.  */
       while (*q != 0 && *q != PATH_SEPARATOR) q++;
       if (p == q) {
-       /* An empty name in the path stands for the current directory.  */
-       name = (char *) Safe_malloc (2);
-       name[0] = '.';
-       name[1] = 0;
+  /* An empty name in the path stands for the current directory.  */
+  name = (char *) Safe_malloc (2);
+  name[0] = '.';
+  name[1] = 0;
       } else {
-       /* Otherwise use the directory that is named.  */
-       name = (char *) Safe_malloc (q - p + 1);
-       bcopy (p, name, q - p);
-       name[q - p] = 0;
+  /* Otherwise use the directory that is named.  */
+  name = (char *) Safe_malloc (q - p + 1);
+  bcopy (p, name, q - p);
+  name[q - p] = 0;
       }
 
       dirtmp = (struct file_name_list *)
-       Safe_malloc (sizeof (struct file_name_list));
-      dirtmp->next = 0;                /* New one goes on the end */
+  Safe_malloc (sizeof (struct file_name_list));
+      dirtmp->next = 0;   /* New one goes on the end */
       dirtmp->control_macro = 0;
       dirtmp->c_system_include_path = 0;
       dirtmp->fname = name;
@@ -789,7 +789,7 @@ path_include (
       /* Advance past this name.  */
       p = q;
       if (*p == 0)
-       break;
+  break;
       /* Skip the colon.  */
       p++;
     }
@@ -919,56 +919,56 @@ skip_comment (
   while (PEEKC() == '\\' && PEEKN(1) == '\n')
     {
       if (linep)
-       (*linep)++;
+  (*linep)++;
       FORWARD(2);
     }
   if (PEEKC() == '*')
     {
       FORWARD(1);
       for (;;)
-       {
-         int prev_c = c;
-         c = GETC ();
-         if (c == EOF)
-           return EOF;
-         while (c == '\\' && PEEKC() == '\n')
-           {
-             if (linep)
-               (*linep)++;
-             FORWARD(1), c = GETC();
-           }
-         if (prev_c == '*' && c == '/')
-           return ' ';
-         if (c == '\n' && linep)
-           (*linep)++;
-       }
+  {
+    int prev_c = c;
+    c = GETC ();
+    if (c == EOF)
+      return EOF;
+    while (c == '\\' && PEEKC() == '\n')
+      {
+        if (linep)
+    (*linep)++;
+        FORWARD(1), c = GETC();
+      }
+    if (prev_c == '*' && c == '/')
+      return ' ';
+    if (c == '\n' && linep)
+      (*linep)++;
+  }
     }
   else if (PEEKC() == '/' && CPP_OPTIONS (pfile)->cplusplus_comments)
     {
       FORWARD(1);
       for (;;)
-       {
-         c = GETC ();
-         if (c == EOF)
-           return ' '; /* Allow // to be terminated by EOF. */
-         while (c == '\\' && PEEKC() == '\n')
-           {
-             FORWARD(1);
-             c = GETC();
-             if (linep)
-               (*linep)++;
-           }
-         if (c == '\n')
-           {
-             /* Don't consider final '\n' to be part of comment. */
-             FORWARD(-1);
-             return ' ';
-           }
-       }
+  {
+    c = GETC ();
+    if (c == EOF)
+      return ' '; /* Allow // to be terminated by EOF. */
+    while (c == '\\' && PEEKC() == '\n')
+      {
+        FORWARD(1);
+        c = GETC();
+        if (linep)
+    (*linep)++;
+      }
+    if (c == '\n')
+      {
+        /* Don't consider final '\n' to be part of comment. */
+        FORWARD(-1);
+        return ' ';
+      }
+  }
     }
   else
     return '/';
-}     
+}
 
 /* Skip whitespace \-newline and comments.  Does not macro-expand.  */
 void
@@ -979,29 +979,29 @@ cpp_skip_hspace (
     {
       int c = PEEKC();
       if (c == EOF)
-       return; /* FIXME */
+  return; /* FIXME */
       if (is_hor_space[c])
-       {
-         if ((c == '\f' || c == '\v') && CPP_PEDANTIC (pfile))
-           cpp_pedwarn (pfile, "%s in preprocessing directive",
-                        c == '\f' ? "formfeed" : "vertical tab");
-         FORWARD(1);
-       }
+  {
+    if ((c == '\f' || c == '\v') && CPP_PEDANTIC (pfile))
+      cpp_pedwarn (pfile, "%s in preprocessing directive",
+       c == '\f' ? "formfeed" : "vertical tab");
+    FORWARD(1);
+  }
       else if (c == '/')
-       {
-         FORWARD (1);
-         c = skip_comment (pfile, NULL);
-         if (c == '/')
-           FORWARD(-1);
-         if (c == EOF || c == '/')
-           return;
-       }
+  {
+    FORWARD (1);
+    c = skip_comment (pfile, NULL);
+    if (c == '/')
+      FORWARD(-1);
+    if (c == EOF || c == '/')
+      return;
+  }
       else if (c == '\\' && PEEKN(1) == '\n') {
-       FORWARD(2);
+  FORWARD(2);
       }
       else if (c == '@' && CPP_BUFFER (pfile)->has_escapes
-              && is_hor_space[PEEKN(1)])
-       FORWARD(2);
+         && is_hor_space[PEEKN(1)])
+  FORWARD(2);
       else return;
     }
 }
@@ -1019,39 +1019,39 @@ copy_rest_of_line (
       int c = GETC();
       int nextc;
       switch (c)
-       {
-       case EOF:
-         goto end_directive;
-       case '\\':
-         if (PEEKC() == '\n')
-           {
-             FORWARD (1);
-             continue;
-           }
-       case '\'':
-       case '\"':
-         goto scan_directive_token;
-         break;
-       case '/':
-         nextc = PEEKC();
-         if (nextc == '*' || (opts->cplusplus_comments && nextc == '/'))
-           goto scan_directive_token;
-         break;
-       case '\f':
-       case '\v':
-         if (CPP_PEDANTIC (pfile))
-           cpp_pedwarn (pfile, "%s in preprocessing directive",
-                        c == '\f' ? "formfeed" : "vertical tab");
-         break;
-
-       case '\n':
-         FORWARD(-1);
-         goto end_directive;
-       scan_directive_token:
-         FORWARD(-1);
-         cpp_get_token (pfile);
-         continue;
-       }
+  {
+  case EOF:
+    goto end_directive;
+  case '\\':
+    if (PEEKC() == '\n')
+      {
+        FORWARD (1);
+        continue;
+      }
+  case '\'':
+  case '\"':
+    goto scan_directive_token;
+    break;
+  case '/':
+    nextc = PEEKC();
+    if (nextc == '*' || (opts->cplusplus_comments && nextc == '/'))
+      goto scan_directive_token;
+    break;
+  case '\f':
+  case '\v':
+    if (CPP_PEDANTIC (pfile))
+      cpp_pedwarn (pfile, "%s in preprocessing directive",
+       c == '\f' ? "formfeed" : "vertical tab");
+    break;
+
+  case '\n':
+    FORWARD(-1);
+    goto end_directive;
+  scan_directive_token:
+    FORWARD(-1);
+    cpp_get_token (pfile);
+    continue;
+  }
       CPP_PUTC (pfile, c);
     }
  end_directive: ;
@@ -1087,7 +1087,7 @@ handle_directive (
     {
       /* Handle # followed by a line number.  */
       if (CPP_PEDANTIC (pfile))
-       cpp_pedwarn (pfile, "`#' followed by integer");
+  cpp_pedwarn (pfile, "`#' followed by integer");
       do_line (pfile, NULL);
       goto done_a_directive;
     }
@@ -1108,16 +1108,16 @@ handle_directive (
     U_CHAR *p = ident;
     while (is_idchar[*p]) {
       if (*p < '0' || *p > '9')
-       break;
+  break;
       p++;
     }
     /* Avoid error for `###' and similar cases unless -pedantic.  */
     if (p == ident) {
       while (*p == '#' || is_hor_space[*p]) p++;
       if (*p == '\n') {
-       if (pedantic && !lang_asm)
-         cpp_warning (pfile, "invalid preprocessor directive");
-       return 0;
+  if (pedantic && !lang_asm)
+    cpp_warning (pfile, "invalid preprocessor directive");
+  return 0;
       }
     }
 
@@ -1134,7 +1134,7 @@ handle_directive (
   for (kt = directive_table; ; kt++) {
     if (kt->length <= 0)
       goto not_a_directive;
-    if (kt->length == ident_length && !strncmp (kt->name, ident, ident_length)) 
+    if (kt->length == ident_length && !strncmp (kt->name, ident, ident_length))
       break;
   }
 
@@ -1142,17 +1142,17 @@ handle_directive (
     {
       /* Nonzero means do not delete comments within the directive.
          #define needs this when -traditional.  */
-       int comments = CPP_TRADITIONAL (pfile) && kt->traditional_comments; 
-       int save_put_out_comments = CPP_OPTIONS (pfile)->put_out_comments;
-       CPP_OPTIONS (pfile)->put_out_comments = comments;
-       after_ident = CPP_WRITTEN (pfile);
-       copy_rest_of_line (pfile);
-       CPP_OPTIONS (pfile)->put_out_comments = save_put_out_comments;
+  int comments = CPP_TRADITIONAL (pfile) && kt->traditional_comments;
+  int save_put_out_comments = CPP_OPTIONS (pfile)->put_out_comments;
+  CPP_OPTIONS (pfile)->put_out_comments = comments;
+  after_ident = CPP_WRITTEN (pfile);
+  copy_rest_of_line (pfile);
+  CPP_OPTIONS (pfile)->put_out_comments = save_put_out_comments;
     }
 
   /* For #pragma and #define, we may want to pass through the directive.
      Other directives may create output, but we don't want the directive
-     itself out, so we pop it now.  For example #include may write a 
+     itself out, so we pop it now.  For example #include may write a
      command (see comment in do_include), and conditionals may emit
      #failed ... #endfailed stuff.  But note that popping the buffer
      means the parameters to kt->func may point after pfile->limit
@@ -1166,12 +1166,12 @@ handle_directive (
   (*kt->func) (pfile, kt, pfile->token_buffer + after_ident, line_end);
   if (kt->pass_thru
       || (kt->type == T_DEFINE
-         && CPP_OPTIONS (pfile)->dump_macros == dump_definitions))
+    && CPP_OPTIONS (pfile)->dump_macros == dump_definitions))
     {
       /* Just leave the entire #define in the output stack. */
     }
   else if (kt->type == T_DEFINE
-          && CPP_OPTIONS (pfile)->dump_macros == dump_names)
+     && CPP_OPTIONS (pfile)->dump_macros == dump_names)
     {
       U_CHAR *p = pfile->token_buffer + old_written + 7;  /* Skip "#define". */
       SKIP_WHITE_SPACE (p);
@@ -1242,7 +1242,7 @@ struct arglist {
    in that list, or -1 for a macro name that wants no argument list.
    MACRONAME is the macro name itself (so we can avoid recursive expansion)
    and NAMELEN is its length in characters.
-   
+
    Note that comments, backslash-newlines, and leading white space
    have already been deleted from the argument.  */
 
@@ -1281,12 +1281,12 @@ collect_expansion (
      so this is an upper bound.  The extra 5 are for invented
      leading and trailing newline-marker and final null.  */
   maxsize = (sizeof (DEFINITION)
-            + (limit - p) + 5);
+       + (limit - p) + 5);
   /* Occurrences of '@' get doubled, so allocate extra space for them. */
   while (p < limit)
     if (*p++ == '@')
       maxsize++;
-  defn = (DEFINITION *) Safe_calloc(maxsize);
+  defn = (DEFINITION *) Safe_calloc(1,maxsize);
 
   defn->nargs = nargs;
   exp_p = defn->expansion = (U_CHAR *) defn + sizeof (DEFINITION);
@@ -1320,99 +1320,99 @@ collect_expansion (
             expected_delimiter = '\0';
         } else
           expected_delimiter = c;
-       break;
+  break;
 
       case '\\':
-       if (p < limit && expected_delimiter) {
-         /* In a string, backslash goes through
-            and makes next char ordinary.  */
-         *exp_p++ = *p++;
-       }
-       break;
+  if (p < limit && expected_delimiter) {
+    /* In a string, backslash goes through
+       and makes next char ordinary.  */
+    *exp_p++ = *p++;
+  }
+  break;
 
       case '@':
-       /* An '@' in a string or character constant stands for itself,
-          and does not need to be escaped. */
-       if (!expected_delimiter)
-         *exp_p++ = c;
-       break;
+  /* An '@' in a string or character constant stands for itself,
+     and does not need to be escaped. */
+  if (!expected_delimiter)
+    *exp_p++ = c;
+  break;
 
       case '#':
-       /* # is ordinary inside a string.  */
-       if (expected_delimiter)
-         break;
-       if (p < limit && *p == '#') {
-         /* ##: concatenate preceding and following tokens.  */
-         /* Take out the first #, discard preceding whitespace.  */
-         exp_p--;
-         while (exp_p > lastp && is_hor_space[exp_p[-1]])
-           --exp_p;
-         /* Skip the second #.  */
-         p++;
-         /* Discard following whitespace.  */
-         SKIP_WHITE_SPACE (p);
-         concat = p;
-         if (p == limit)
-           cpp_error (pfile, "`##' at end of macro definition");
-       } else if (nargs >= 0) {
-         /* Single #: stringify following argument ref.
-            Don't leave the # in the expansion.  */
-         exp_p--;
-         SKIP_WHITE_SPACE (p);
-         if (p == limit || ! is_idstart[*p])
-           cpp_error (pfile,
-                    "`#' operator is not followed by a macro argument name");
-         else
-           stringify = p;
-       }
-       break;
+  /* # is ordinary inside a string.  */
+  if (expected_delimiter)
+    break;
+  if (p < limit && *p == '#') {
+    /* ##: concatenate preceding and following tokens.  */
+    /* Take out the first #, discard preceding whitespace.  */
+    exp_p--;
+    while (exp_p > lastp && is_hor_space[exp_p[-1]])
+      --exp_p;
+    /* Skip the second #.  */
+    p++;
+    /* Discard following whitespace.  */
+    SKIP_WHITE_SPACE (p);
+    concat = p;
+    if (p == limit)
+      cpp_error (pfile, "`##' at end of macro definition");
+  } else if (nargs >= 0) {
+    /* Single #: stringify following argument ref.
+       Don't leave the # in the expansion.  */
+    exp_p--;
+    SKIP_WHITE_SPACE (p);
+    if (p == limit || ! is_idstart[*p])
+      cpp_error (pfile,
+         "`#' operator is not followed by a macro argument name");
+    else
+      stringify = p;
+  }
+  break;
       }
     } else {
       /* In -traditional mode, recognize arguments inside strings and
-        and character constants, and ignore special properties of #.
-        Arguments inside strings are considered "stringified", but no
-        extra quote marks are supplied.  */
+   and character constants, and ignore special properties of #.
+   Arguments inside strings are considered "stringified", but no
+   extra quote marks are supplied.  */
       switch (c) {
       case '\'':
       case '\"':
-       if (expected_delimiter != '\0') {
-         if (c == expected_delimiter)
-           expected_delimiter = '\0';
-       } else
-         expected_delimiter = c;
-       break;
+  if (expected_delimiter != '\0') {
+    if (c == expected_delimiter)
+      expected_delimiter = '\0';
+  } else
+    expected_delimiter = c;
+  break;
 
       case '\\':
-       /* Backslash quotes delimiters and itself, but not macro args.  */
-       if (expected_delimiter != 0 && p < limit
-           && (*p == expected_delimiter || *p == '\\')) {
-         *exp_p++ = *p++;
-         continue;
-       }
-       break;
+  /* Backslash quotes delimiters and itself, but not macro args.  */
+  if (expected_delimiter != 0 && p < limit
+      && (*p == expected_delimiter || *p == '\\')) {
+    *exp_p++ = *p++;
+    continue;
+  }
+  break;
 
       case '/':
-       if (expected_delimiter != '\0') /* No comments inside strings.  */
-         break;
-       if (*p == '*') {
-         /* If we find a comment that wasn't removed by handle_directive,
-            this must be -traditional.  So replace the comment with
-            nothing at all.  */
-         exp_p--;
-         p += 1;
-         while (p < limit && !(p[-2] == '*' && p[-1] == '/'))
-           p++;
+  if (expected_delimiter != '\0') /* No comments inside strings.  */
+    break;
+  if (*p == '*') {
+    /* If we find a comment that wasn't removed by handle_directive,
+       this must be -traditional.  So replace the comment with
+       nothing at all.  */
+    exp_p--;
+    p += 1;
+    while (p < limit && !(p[-2] == '*' && p[-1] == '/'))
+      p++;
 #if 0
-         /* Mark this as a concatenation-point, as if it had been ##.  */
-         concat = p;
+    /* Mark this as a concatenation-point, as if it had been ##.  */
+    concat = p;
 #endif
-       }
-       else if (*p == '/') {
-           /* A c++ comment.  Discard to the end of line */
-           exp_p--;
-           p = limit;
-       }
-       break;
+  }
+  else if (*p == '/') {
+      /* A c++ comment.  Discard to the end of line */
+      exp_p--;
+      p = limit;
+  }
+  break;
       }
     }
 
@@ -1426,68 +1426,68 @@ collect_expansion (
       id_len = p - id_beg;
 
       if (is_idstart[c]) {
-       register struct arglist *arg;
-
-       for (arg = arglist; arg != NULL; arg = arg->next) {
-         struct reflist *tpat;
-
-         if (arg->name[0] == c
-             && arg->length == id_len
-             && strncmp (arg->name, id_beg, id_len) == 0) {
-           if (expected_delimiter && CPP_OPTIONS (pfile)->warn_stringify) {
-             if (CPP_TRADITIONAL (pfile)) {
-               cpp_warning (pfile, "macro argument `%.*s' is stringified.",
-                            id_len, arg->name);
-             } else {
-               cpp_warning (pfile,
-                   "macro arg `%.*s' would be stringified with -traditional.",
-                            id_len, arg->name);
-             }
-           }
-           /* If ANSI, don't actually substitute inside a string.  */
-           if (!CPP_TRADITIONAL (pfile) && expected_delimiter)
-             break;
-           /* make a pat node for this arg and append it to the end of
-              the pat list */
-           tpat = (struct reflist *) Safe_malloc (sizeof (struct reflist));
-           tpat->next = NULL;
-           tpat->raw_before = concat == id_beg;
-           tpat->raw_after = 0;
-           tpat->rest_args = arg->rest_args;
-           tpat->stringify = (CPP_TRADITIONAL (pfile)
-                              ? expected_delimiter != '\0'
-                              : stringify == id_beg);
-
-           if (endpat == NULL)
-             defn->pattern = tpat;
-           else
-             endpat->next = tpat;
-           endpat = tpat;
-
-           tpat->argno = arg->argno;
-           tpat->nchars = exp_p - lastp;
-           {
-             register U_CHAR *p1 = p;
-             SKIP_WHITE_SPACE (p1);
-             if (p1 + 2 <= limit && p1[0] == '#' && p1[1] == '#')
-               tpat->raw_after = 1;
-           }
-           lastp = exp_p;      /* place to start copying from next time */
-           skipped_arg = 1;
-           break;
-         }
-       }
+  register struct arglist *arg;
+
+  for (arg = arglist; arg != NULL; arg = arg->next) {
+    struct reflist *tpat;
+
+    if (arg->name[0] == c
+        && arg->length == id_len
+        && strncmp (arg->name, id_beg, id_len) == 0) {
+      if (expected_delimiter && CPP_OPTIONS (pfile)->warn_stringify) {
+        if (CPP_TRADITIONAL (pfile)) {
+    cpp_warning (pfile, "macro argument `%.*s' is stringified.",
+           id_len, arg->name);
+        } else {
+    cpp_warning (pfile,
+        "macro arg `%.*s' would be stringified with -traditional.",
+           id_len, arg->name);
+        }
+      }
+      /* If ANSI, don't actually substitute inside a string.  */
+      if (!CPP_TRADITIONAL (pfile) && expected_delimiter)
+        break;
+      /* make a pat node for this arg and append it to the end of
+         the pat list */
+      tpat = (struct reflist *) Safe_malloc (sizeof (struct reflist));
+      tpat->next = NULL;
+      tpat->raw_before = concat == id_beg;
+      tpat->raw_after = 0;
+      tpat->rest_args = arg->rest_args;
+      tpat->stringify = (CPP_TRADITIONAL (pfile)
+             ? expected_delimiter != '\0'
+             : stringify == id_beg);
+
+      if (endpat == NULL)
+        defn->pattern = tpat;
+      else
+        endpat->next = tpat;
+      endpat = tpat;
+
+      tpat->argno = arg->argno;
+      tpat->nchars = exp_p - lastp;
+      {
+        register U_CHAR *p1 = p;
+        SKIP_WHITE_SPACE (p1);
+        if (p1 + 2 <= limit && p1[0] == '#' && p1[1] == '#')
+    tpat->raw_after = 1;
+      }
+      lastp = exp_p;  /* place to start copying from next time */
+      skipped_arg = 1;
+      break;
+    }
+  }
       }
 
       /* If this was not a macro arg, copy it into the expansion.  */
       if (! skipped_arg) {
-       register U_CHAR *lim1 = p;
-       p = id_beg;
-       while (p != lim1)
-         *exp_p++ = *p++;
-       if (stringify == id_beg)
-         cpp_error (pfile,
-                  "`#' operator should be followed by a macro argument name");
+  register U_CHAR *lim1 = p;
+  p = id_beg;
+  while (p != lim1)
+    *exp_p++ = *p++;
+  if (stringify == id_beg)
+    cpp_error (pfile,
+       "`#' operator should be followed by a macro argument name");
       }
     }
   }
@@ -1519,21 +1519,21 @@ collect_expansion (
 }
 
 /*
- * special extension string that can be added to the last macro argument to 
+ * special extension string that can be added to the last macro argument to
  * allow it to absorb the "rest" of the arguments when expanded.  Ex:
- *             #define wow(a, b...)            process (b, a, b)
- *             { wow (1, 2, 3); }      ->      { process (2, 3, 1, 2, 3); }
- *             { wow (one, two); }     ->      { process (two, one, two); }
+ *    #define wow(a, b...)    process (b, a, b)
+ *    { wow (1, 2, 3); }  ->  { process (2, 3, 1, 2, 3); }
+ *    { wow (one, two); } ->  { process (two, one, two); }
  * if this "rest_arg" is used with the concat token '##' and if it is not
  * supplied then the token attached to with ## will not be outputted.  Ex:
- *             #define wow (a, b...)           process (b ## , a, ## b)
- *             { wow (1, 2); }         ->      { process (2, 1, 2); }
- *             { wow (one); }          ->      { process (one); {
+ *    #define wow (a, b...)   process (b ## , a, ## b)
+ *    { wow (1, 2); }   ->  { process (2, 1, 2); }
+ *    { wow (one); }    ->  { process (one); {
  */
 static char rest_extension[] = "...";
-#define REST_EXTENSION_LENGTH  (sizeof (rest_extension) - 1)
+#define REST_EXTENSION_LENGTH (sizeof (rest_extension) - 1)
 
-/* Create a DEFINITION node from a #define directive.  Arguments are 
+/* Create a DEFINITION node from a #define directive.  Arguments are
    as for do_define. */
 static MACRODEF
 create_definition (
@@ -1541,15 +1541,15 @@ create_definition (
      cpp_reader *pfile,
      int predefinition)
 {
-  U_CHAR *bp;                  /* temp ptr into input buffer */
-  U_CHAR *symname;             /* remember where symbol name starts */
-  int sym_length;              /* and how long it is */
+  U_CHAR *bp;     /* temp ptr into input buffer */
+  U_CHAR *symname;    /* remember where symbol name starts */
+  int sym_length;   /* and how long it is */
   int rest_args = 0;
   long line, col;
   char *file = CPP_BUFFER (pfile) ? CPP_BUFFER (pfile)->nominal_fname : "";
   DEFINITION *defn;
-  int arglengths = 0;          /* Accumulate lengths of arg names
-                                  plus number of args.  */
+  int arglengths = 0;   /* Accumulate lengths of arg names
+           plus number of args.  */
   MACRODEF mdef;
   cpp_buf_line_and_col (CPP_BUFFER (pfile), &line, &col);
 
@@ -1558,7 +1558,7 @@ create_definition (
   while (is_hor_space[*bp])
     bp++;
 
-  symname = bp;                        /* remember where it starts */
+  symname = bp;     /* remember where it starts */
 
   sym_length = check_macro_name (pfile, bp, "macro");
   bp += sym_length;
@@ -1571,7 +1571,7 @@ create_definition (
     struct arglist *arg_ptrs = NULL;
     int argno = 0;
 
-    bp++;                      /* skip '(' */
+    bp++;     /* skip '(' */
     SKIP_WHITE_SPACE (bp);
 
     /* Loop over macro argument names.  */
@@ -1586,58 +1586,58 @@ create_definition (
       arg_ptrs = temp;
 
       if (rest_args)
-       cpp_pedwarn (pfile, "another parameter follows `%s'", rest_extension);
+  cpp_pedwarn (pfile, "another parameter follows `%s'", rest_extension);
 
       if (!is_idstart[*bp])
-       cpp_pedwarn (pfile, "invalid character in macro parameter name");
-      
+  cpp_pedwarn (pfile, "invalid character in macro parameter name");
+
       /* Find the end of the arg name.  */
       while (is_idchar[*bp]) {
-       bp++;
-       /* do we have a "special" rest-args extension here? */
-       if (limit - bp > REST_EXTENSION_LENGTH &&
-           strncmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0) {
-         rest_args = 1;
-         temp->rest_args = 1;
-         break;
-       }
+  bp++;
+  /* do we have a "special" rest-args extension here? */
+  if (limit - bp > REST_EXTENSION_LENGTH &&
+      strncmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0) {
+    rest_args = 1;
+    temp->rest_args = 1;
+    break;
+  }
       }
       temp->length = bp - temp->name;
       if (rest_args == 1)
-       bp += REST_EXTENSION_LENGTH;
+  bp += REST_EXTENSION_LENGTH;
       arglengths += temp->length + 2;
       SKIP_WHITE_SPACE (bp);
       if (temp->length == 0 || (*bp != ',' && *bp != ')')) {
-       cpp_error (pfile, "badly punctuated parameter list in `#define'");
-       goto nope;
+  cpp_error (pfile, "badly punctuated parameter list in `#define'");
+  goto nope;
       }
       if (*bp == ',') {
-       bp++;
-       SKIP_WHITE_SPACE (bp);
+  bp++;
+  SKIP_WHITE_SPACE (bp);
       }
       if (bp >= limit) {
-       cpp_error (pfile, "unterminated parameter list in `#define'");
-       goto nope;
+  cpp_error (pfile, "unterminated parameter list in `#define'");
+  goto nope;
       }
       {
-       struct arglist *otemp;
-
-       for (otemp = temp->next; otemp != NULL; otemp = otemp->next)
-         if (temp->length == otemp->length &&
-           strncmp (temp->name, otemp->name, temp->length) == 0) {
-             U_CHAR *name;
-
-             name = (U_CHAR *) alloca (temp->length + 1);
-             (void) strncpy (name, temp->name, temp->length);
-             name[temp->length] = '\0';
-             cpp_error (pfile,
-                        "duplicate argument name `%s' in `#define'", name);
-             goto nope;
-         }
+  struct arglist *otemp;
+
+  for (otemp = temp->next; otemp != NULL; otemp = otemp->next)
+    if (temp->length == otemp->length &&
+      strncmp (temp->name, otemp->name, temp->length) == 0) {
+        U_CHAR *name;
+
+        name = (U_CHAR *) alloca (temp->length + 1);
+        (void) strncpy (name, temp->name, temp->length);
+        name[temp->length] = '\0';
+        cpp_error (pfile,
+       "duplicate argument name `%s' in `#define'", name);
+        goto nope;
+    }
       }
     }
 
-    ++bp;                      /* skip paren */
+    ++bp;     /* skip paren */
     SKIP_WHITE_SPACE (bp);
     /* now everything from bp before limit is the definition. */
     defn = collect_expansion (pfile, bp, limit, argno, arg_ptrs);
@@ -1651,12 +1651,12 @@ create_definition (
       struct arglist *temp;
       int i = 0;
       for (temp = arg_ptrs; temp; temp = temp->next) {
-       bcopy (temp->name, &defn->args.argnames[i], temp->length);
-       i += temp->length;
-       if (temp->next != 0) {
-         defn->args.argnames[i++] = ',';
-         defn->args.argnames[i++] = ' ';
-       }
+  bcopy (temp->name, &defn->args.argnames[i], temp->length);
+  i += temp->length;
+  if (temp->next != 0) {
+    defn->args.argnames[i++] = ',';
+    defn->args.argnames[i++] = ' ';
+  }
       }
       defn->args.argnames[i] = 0;
     }
@@ -1665,26 +1665,26 @@ create_definition (
 
     if (bp < limit)
       {
-       if (is_hor_space[*bp]) {
-         bp++;
-         SKIP_WHITE_SPACE (bp);
-       } else {
-         switch (*bp) {
-           case '!':  case '"':  case '#':  case '%':  case '&':  case '\'':
-           case ')':  case '*':  case '+':  case ',':  case '-':  case '.':
-           case '/':  case ':':  case ';':  case '<':  case '=':  case '>':
-           case '?':  case '[':  case '\\': case ']':  case '^':  case '{':
-           case '|':  case '}':  case '~':
-             cpp_warning (pfile, "missing white space after `#define %.*s'",
-                          sym_length, symname);
-             break;
-
-           default:
-             cpp_pedwarn (pfile, "missing white space after `#define %.*s'",
-                          sym_length, symname);
-             break;
-         }
-       }
+  if (is_hor_space[*bp]) {
+    bp++;
+    SKIP_WHITE_SPACE (bp);
+  } else {
+    switch (*bp) {
+      case '!':  case '"':  case '#':  case '%':  case '&':  case '\'':
+      case ')':  case '*':  case '+':  case ',':  case '-':  case '.':
+      case '/':  case ':':  case ';':  case '<':  case '=':  case '>':
+      case '?':  case '[':  case '\\': case ']':  case '^':  case '{':
+      case '|':  case '}':  case '~':
+        cpp_warning (pfile, "missing white space after `#define %.*s'",
+         sym_length, symname);
+        break;
+
+      default:
+        cpp_pedwarn (pfile, "missing white space after `#define %.*s'",
+         sym_length, symname);
+        break;
+    }
+  }
       }
     /* now everything from bp before limit is the definition. */
     defn = collect_expansion (pfile, bp, limit, -1, NULL_PTR);
@@ -1725,7 +1725,7 @@ check_macro_name (
   if (sym_length == 0)
     cpp_error (pfile, "invalid %s name", usage);
   else if (!is_idstart[*symname]) {
-    U_CHAR *msg;                       /* what pain... */
+    U_CHAR *msg;      /* what pain... */
     msg = (U_CHAR *) alloca (sym_length + 1);
     bcopy (symname, msg, sym_length);
     msg[sym_length] = 0;
@@ -1756,11 +1756,11 @@ compare_defs (
   for (a1 = d1->pattern, a2 = d2->pattern; a1 && a2;
        a1 = a1->next, a2 = a2->next) {
     if (!((a1->nchars == a2->nchars && ! strncmp (p1, p2, a1->nchars))
-         || ! comp_def_part (first, p1, a1->nchars, p2, a2->nchars, 0))
-       || a1->argno != a2->argno
-       || a1->stringify != a2->stringify
-       || a1->raw_before != a2->raw_before
-       || a1->raw_after != a2->raw_after)
+    || ! comp_def_part (first, p1, a1->nchars, p2, a2->nchars, 0))
+  || a1->argno != a2->argno
+  || a1->stringify != a2->stringify
+  || a1->raw_before != a2->raw_before
+  || a1->raw_after != a2->raw_after)
       return 1;
     first = 0;
     p1 += a1->nchars;
@@ -1769,7 +1769,7 @@ compare_defs (
   if (a1 != a2)
     return 1;
   if (comp_def_part (first, p1, d1->length - (p1 - d1->expansion),
-                    p2, d2->length - (p2 - d2->expansion), 1))
+         p2, d2->length - (p2 - d2->expansion), 1))
     return 1;
   return 0;
 }
@@ -1844,32 +1844,32 @@ do_define (
       int ok = 0;
       /* Redefining a precompiled key is ok.  */
       if (hp->type == T_PCSTRING)
-       ok = 1;
+  ok = 1;
       /* Redefining a macro is ok if the definitions are the same.  */
       else if (hp->type == T_MACRO)
-       ok = ! compare_defs (mdef.defn, hp->value.defn);
+  ok = ! compare_defs (mdef.defn, hp->value.defn);
       /* Redefining a constant is ok with -D.  */
       else if (hp->type == T_CONST)
         ok = ! CPP_OPTIONS (pfile)->done_initializing;
       /* Print the warning if it's not ok.  */
       if (!ok)
-       {
-         U_CHAR *msg;          /* what pain... */
-
-         /* If we are passing through #define and #undef directives, do
-            that for this re-definition now.  */
-         if (CPP_OPTIONS (pfile)->debug_output && keyword)
-           pass_thru_directive (buf, limit, pfile, keyword);
-
-         msg = (U_CHAR *) alloca (mdef.symlen + 22);
-         *msg = '`';
-         bcopy (mdef.symnam, msg + 1, mdef.symlen);
-         strcpy ((char *) (msg + mdef.symlen + 1), "' redefined");
-         cpp_pedwarn (pfile, msg);
-         if (hp->type == T_MACRO)
-           cpp_pedwarn_with_file_and_line (pfile, hp->value.defn->file, hp->value.defn->line,
-                                     "this is the location of the previous definition");
-       }
+  {
+    U_CHAR *msg;    /* what pain... */
+
+    /* If we are passing through #define and #undef directives, do
+       that for this re-definition now.  */
+    if (CPP_OPTIONS (pfile)->debug_output && keyword)
+      pass_thru_directive (buf, limit, pfile, keyword);
+
+    msg = (U_CHAR *) alloca (mdef.symlen + 22);
+    *msg = '`';
+    bcopy (mdef.symnam, msg + 1, mdef.symlen);
+    strcpy ((char *) (msg + mdef.symlen + 1), "' redefined");
+    cpp_pedwarn (pfile, msg);
+    if (hp->type == T_MACRO)
+      cpp_pedwarn_with_file_and_line (pfile, hp->value.defn->file, hp->value.defn->line,
+              "this is the location of the previous definition");
+  }
       /* Replace the old definition.  */
       hp->type = T_MACRO;
       hp->value.defn = mdef.defn;
@@ -1877,11 +1877,11 @@ do_define (
   else
     {
       /* If we are passing through #define and #undef directives, do
-        that for this new definition now.  */
+   that for this new definition now.  */
       if (CPP_OPTIONS (pfile)->debug_output && keyword)
-       pass_thru_directive (buf, limit, pfile, keyword);
+  pass_thru_directive (buf, limit, pfile, keyword);
       install (mdef.symnam, mdef.symlen, T_MACRO, 0,
-              (char *) mdef.defn, hashcode);
+         (char *) mdef.defn, hashcode);
     }
 
   return 0;
@@ -1898,7 +1898,7 @@ nope:
    `stringified_length' is the length the argument would have
    if stringified.
    `use_count' is the number of times this macro arg is substituted
-   into the macro.  If the actual use count exceeds 10, 
+   into the macro.  If the actual use count exceeds 10,
    the value stored is 10. */
 
 /* raw and expanded are relative to ARG_BASE */
@@ -1938,7 +1938,7 @@ cpp_push_buffer (
   buf->underflow = null_underflow;
   buf->buf = buf->cur = buffer;
   buf->alimit = buf->rlimit = buffer + length;
-  
+
   return buf;
 }
 
@@ -1971,12 +1971,12 @@ cpp_scan_buffer (
     {
       enum cpp_token token = cpp_get_token (pfile);
       if (token == CPP_EOF) /* Should not happen ... */
-       break;
+  break;
       if (token == CPP_POP && CPP_BUFFER (pfile) == buffer)
-       {
-         cpp_pop_buffer (pfile);
-         break;
-       }
+  {
+    cpp_pop_buffer (pfile);
+    break;
+  }
     }
 }
 
@@ -2047,9 +2047,9 @@ adjust_position (
     {
       U_CHAR ch = *buf++;
       if (ch == '\n')
-       (*linep)++, (*colp) = 1;
+  (*linep)++, (*colp) = 1;
       else
-       (*colp)++;
+  (*colp)++;
     }
 }
 
@@ -2065,7 +2065,7 @@ update_position (
   for (mark = pbuf->marks;  mark != NULL; mark = mark->next)
     {
       if (pbuf->buf + mark->position < new_pos)
-       new_pos = pbuf->buf + mark->position;
+  new_pos = pbuf->buf + mark->position;
     }
   pbuf->line_base += new_pos - old_pos;
   adjust_position (old_pos, new_pos, &pbuf->lineno, &pbuf->colno);
@@ -2116,7 +2116,7 @@ count_newlines (
     {
       U_CHAR ch = *buf++;
       if (ch == '\n')
-       count++;
+  count++;
     }
   return count;
 }
@@ -2161,8 +2161,8 @@ output_line_command (
     if (line > pfile->lineno && line < pfile->lineno + 8) {
       CPP_RESERVE (pfile, 20);
       while (line > pfile->lineno) {
-       CPP_PUTC_Q (pfile, '\n');
-       pfile->lineno++;
+  CPP_PUTC_Q (pfile, '\n');
+  pfile->lineno++;
       }
       return;
     }
@@ -2189,9 +2189,9 @@ output_line_command (
 
 // modification for SDC51
   if (*ip->nominal_fname == '\0')
-       quote_string (pfile,"standard input");
+  quote_string (pfile,"standard input");
   else
-       quote_string (pfile, ip->nominal_fname); 
+  quote_string (pfile, ip->nominal_fname);
   if (file_change != same_file) {
     CPP_PUTC_Q (pfile, ' ');
     CPP_PUTC_Q (pfile, file_change == enter_file ? '1' : '2');
@@ -2236,35 +2236,35 @@ macarg (
     {
       token = cpp_get_token (pfile);
       switch (token)
-       {
-       case CPP_EOF:
-         goto done;
-       case CPP_POP:
-         /* If we've hit end of file, it's an error (reported by caller).
-            Ditto if it's the end of cpp_expand_to_buffer text.
-            If we've hit end of macro, just continue.  */
-         if (! CPP_IS_MACRO_BUFFER (CPP_BUFFER (pfile)))
-           goto done;
-         break;
-       case CPP_LPAREN:
-         paren++;
-         break;
-       case CPP_RPAREN:
-         if (--paren < 0)
-           goto found;
-         break;
-       case CPP_COMMA:
-         /* if we've returned to lowest level and
-            we aren't absorbing all args */
-         if (paren == 0 && rest_args == 0)
-           goto found;
-         break;
-       found:
-         /* Remove ',' or ')' from argument buffer. */
-         CPP_ADJUST_WRITTEN (pfile, -1);
-         goto done;
+  {
+  case CPP_EOF:
+    goto done;
+  case CPP_POP:
+    /* If we've hit end of file, it's an error (reported by caller).
+       Ditto if it's the end of cpp_expand_to_buffer text.
+       If we've hit end of macro, just continue.  */
+    if (! CPP_IS_MACRO_BUFFER (CPP_BUFFER (pfile)))
+      goto done;
+    break;
+  case CPP_LPAREN:
+    paren++;
+    break;
+  case CPP_RPAREN:
+    if (--paren < 0)
+      goto found;
+    break;
+  case CPP_COMMA:
+    /* if we've returned to lowest level and
+       we aren't absorbing all args */
+    if (paren == 0 && rest_args == 0)
+      goto found;
+    break;
+  found:
+    /* Remove ',' or ')' from argument buffer. */
+    CPP_ADJUST_WRITTEN (pfile, -1);
+    goto done;
       default: ;
-       }
+  }
     }
 
  done:
@@ -2300,14 +2300,14 @@ change_newlines (
     case '\"':
       /* Notice and skip strings, so that we don't delete newlines in them.  */
       {
-       int quotec = c;
-       while (ibp < limit) {
-         *obp++ = c = *ibp++;
-         if (c == quotec)
-           break;
-         if (c == '\n' && quotec == '\'')
-           break;
-       }
+  int quotec = c;
+  while (ibp < limit) {
+    *obp++ = c = *ibp++;
+    if (c == quotec)
+      break;
+    if (c == '\n' && quotec == '\'')
+      break;
+  }
       }
       break;
     }
@@ -2329,8 +2329,8 @@ timestamp (
 }
 
 static char *monthnames[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
-                            "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
-                           };
+           "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
+          };
 
 /*
  * expand things like __FILE__.  Place the expansion into the output
@@ -2348,25 +2348,25 @@ special_symbol (
   cpp_buffer *ip = NULL;
   struct tm *timebuf;
 
-  int paren = 0;               /* For special `defined' keyword */
+  int paren = 0;    /* For special `defined' keyword */
 
 #if 0
   if (pcp_outfile && pcp_inside_if
       && hp->type != T_SPEC_DEFINED && hp->type != T_CONST)
     cpp_error (pfile,
-              "Predefined macro `%s' used inside `#if' during precompilation",
-              hp->name);
+         "Predefined macro `%s' used inside `#if' during precompilation",
+         hp->name);
 #endif
-    
+
   for (ip = CPP_BUFFER (pfile); ; ip = CPP_PREV_BUFFER (ip))
     {
       if (ip == NULL)
-       {
-         cpp_error (pfile, "cccp error: not in any file?!");
-         return;                       /* the show must go on */
-       }
+  {
+    cpp_error (pfile, "cccp error: not in any file?!");
+    return;     /* the show must go on */
+  }
       if (ip->fname != NULL)
-       break;
+  break;
     }
 
   switch (hp->type)
@@ -2374,26 +2374,26 @@ special_symbol (
     case T_FILE:
     case T_BASE_FILE:
       {
-       char *string;
-       if (hp->type == T_BASE_FILE)
-         {
-           while (CPP_PREV_BUFFER (ip))
-             ip = CPP_PREV_BUFFER (ip);
-         }
-       string = ip->nominal_fname;
-
-       if (!string)
-         string = "";
-       CPP_RESERVE (pfile, 3 + 4 * strlen (string));
-       quote_string (pfile, string);
-       return;
+  char *string;
+  if (hp->type == T_BASE_FILE)
+    {
+      while (CPP_PREV_BUFFER (ip))
+        ip = CPP_PREV_BUFFER (ip);
+    }
+  string = ip->nominal_fname;
+
+  if (!string)
+    string = "";
+  CPP_RESERVE (pfile, 3 + 4 * strlen (string));
+  quote_string (pfile, string);
+  return;
       }
 
     case T_INCLUDE_LEVEL:
       true_indepth = 0;
       for (ip = CPP_BUFFER (pfile);  ip != NULL; ip = CPP_PREV_BUFFER (ip))
-       if (ip->fname != NULL)
-         true_indepth++;
+  if (ip->fname != NULL)
+    true_indepth++;
 
       buf = (char *) alloca (8); /* Eight bytes ought to be more than enough */
       sprintf (buf, "%d", true_indepth - 1);
@@ -2433,19 +2433,19 @@ special_symbol (
       sprintf (buf, "%d", hp->value.ival);
 #if 0
       if (pcp_inside_if && pcp_outfile)
-       /* Output a precondition for this macro use */
-       fprintf (pcp_outfile, "#define %s %d\n", hp->name, hp->value.ival);
+  /* Output a precondition for this macro use */
+  fprintf (pcp_outfile, "#define %s %d\n", hp->name, hp->value.ival);
 #endif
       break;
 
     case T_SPECLINE:
       {
-       long line = ip->lineno;
-       long col = ip->colno;
-       adjust_position (CPP_LINE_BASE (ip), ip->cur, &line, &col);
+  long line = ip->lineno;
+  long col = ip->colno;
+  adjust_position (CPP_LINE_BASE (ip), ip->cur, &line, &col);
 
-       buf = (char *) alloca (10);
-       sprintf (buf, "%d", line);
+  buf = (char *) alloca (10);
+  sprintf (buf, "%d", line);
       }
       break;
 
@@ -2454,58 +2454,58 @@ special_symbol (
       buf = (char *) alloca (20);
       timebuf = timestamp (pfile);
       if (hp->type == T_DATE)
-       sprintf (buf, "\"%s %2d %4d\"", monthnames[timebuf->tm_mon],
-                timebuf->tm_mday, timebuf->tm_year + 1900);
+  sprintf (buf, "\"%s %2d %4d\"", monthnames[timebuf->tm_mon],
+     timebuf->tm_mday, timebuf->tm_year + 1900);
       else
-       sprintf (buf, "\"%02d:%02d:%02d\"", timebuf->tm_hour, timebuf->tm_min,
-                timebuf->tm_sec);
+  sprintf (buf, "\"%02d:%02d:%02d\"", timebuf->tm_hour, timebuf->tm_min,
+     timebuf->tm_sec);
       break;
 
     case T_SPEC_DEFINED:
-      buf = " 0 ";             /* Assume symbol is not defined */
+      buf = " 0 ";    /* Assume symbol is not defined */
       ip = CPP_BUFFER (pfile);
       SKIP_WHITE_SPACE (ip->cur);
       if (*ip->cur == '(')
-       {
-         paren++;
-         ip->cur++;                    /* Skip over the paren */
-         SKIP_WHITE_SPACE (ip->cur);
-       }
+  {
+    paren++;
+    ip->cur++;      /* Skip over the paren */
+    SKIP_WHITE_SPACE (ip->cur);
+  }
 
       if (!is_idstart[*ip->cur])
-       goto oops;
+  goto oops;
       if (hp = cpp_lookup (pfile, ip->cur, -1, -1))
-       {
+  {
 #if 0
-         if (pcp_outfile && pcp_inside_if
-             && (hp->type == T_CONST
-                 || (hp->type == T_MACRO && hp->value.defn->predefined)))
-           /* Output a precondition for this macro use. */
-           fprintf (pcp_outfile, "#define %s\n", hp->name);
+    if (pcp_outfile && pcp_inside_if
+        && (hp->type == T_CONST
+      || (hp->type == T_MACRO && hp->value.defn->predefined)))
+      /* Output a precondition for this macro use. */
+      fprintf (pcp_outfile, "#define %s\n", hp->name);
 #endif
-         buf = " 1 ";
-       }
+    buf = " 1 ";
+  }
 #if 0
       else
-       if (pcp_outfile && pcp_inside_if)
-         {
-           /* Output a precondition for this macro use */
-           U_CHAR *cp = ip->bufp;
-           fprintf (pcp_outfile, "#undef ");
-           while (is_idchar[*cp]) /* Ick! */
-             fputc (*cp++, pcp_outfile);
-           putc ('\n', pcp_outfile);
-         }
+  if (pcp_outfile && pcp_inside_if)
+    {
+      /* Output a precondition for this macro use */
+      U_CHAR *cp = ip->bufp;
+      fprintf (pcp_outfile, "#undef ");
+      while (is_idchar[*cp]) /* Ick! */
+        fputc (*cp++, pcp_outfile);
+      putc ('\n', pcp_outfile);
+    }
 #endif
       while (is_idchar[*ip->cur])
-       ++ip->cur;
+  ++ip->cur;
       SKIP_WHITE_SPACE (ip->cur);
       if (paren)
-       {
-         if (*ip->cur != ')')
-           goto oops;
-         ++ip->cur;
-       }
+  {
+    if (*ip->cur != ')')
+      goto oops;
+    ++ip->cur;
+  }
       break;
 
     oops:
@@ -2563,9 +2563,9 @@ initialize_builtins (
       cpp_buffer *pbuffer = CPP_BUFFER (pfile);
 
       while (CPP_PREV_BUFFER (pbuffer))
-       pbuffer = CPP_PREV_BUFFER (pbuffer);
+  pbuffer = CPP_PREV_BUFFER (pbuffer);
       sprintf (directive, " __BASE_FILE__ \"%s\"\n",
-              pbuffer->nominal_fname);
+         pbuffer->nominal_fname);
       output_line_command (pfile, 0, same_file);
       pass_thru_directive (directive, &directive[strlen (directive)], pfile, dp);
 
@@ -2590,30 +2590,30 @@ initialize_builtins (
       pass_thru_directive (directive, &directive[strlen (directive)], pfile, dp);
 
       sprintf (directive, " __DATE__ \"%s %2d %4d\"\n",
-              monthnames[timebuf->tm_mon],
-              timebuf->tm_mday, timebuf->tm_year + 1900);
+         monthnames[timebuf->tm_mon],
+         timebuf->tm_mday, timebuf->tm_year + 1900);
       output_line_command (pfile, 0, same_file);
       pass_thru_directive (directive, &directive[strlen (directive)], pfile, dp);
 
       sprintf (directive, " __TIME__ \"%02d:%02d:%02d\"\n",
-              timebuf->tm_hour, timebuf->tm_min, timebuf->tm_sec);
+         timebuf->tm_hour, timebuf->tm_min, timebuf->tm_sec);
       output_line_command (pfile, 0, same_file);
       pass_thru_directive (directive, &directive[strlen (directive)], pfile, dp);
 
       if (!CPP_TRADITIONAL (pfile))
-       {
+  {
           sprintf (directive, " __STDC__ 1");
           output_line_command (pfile, 0, same_file);
           pass_thru_directive (directive, &directive[strlen (directive)],
-                              pfile, dp);
-       }
+             pfile, dp);
+  }
       if (CPP_OPTIONS (pfile)->objc)
-       {
+  {
           sprintf (directive, " __OBJC__ 1");
           output_line_command (pfile, 0, same_file);
           pass_thru_directive (directive, &directive[strlen (directive)],
-                              pfile, dp);
-       }
+             pfile, dp);
+  }
     }
 }
 \f
@@ -2628,18 +2628,18 @@ unsafe_chars (
     {
     case '+': case '-':
       if (c2 == c1 || c2 == '=')
-       return 1;
+  return 1;
       goto letter;
     case '.':
     case '0': case '1': case '2': case '3': case '4':
     case '5': case '6': case '7': case '8': case '9':
     case 'e': case 'E':
       if (c2 == '-' || c2 == '+')
-       return 1; /* could extend a pre-processing number */
+  return 1; /* could extend a pre-processing number */
       goto letter;
     case 'L':
       if (c2 == '\'' || c2 == '\"')
-       return 1;   /* Could turn into L"xxx" or L'xxx'. */
+  return 1;   /* Could turn into L"xxx" or L'xxx'. */
       goto letter;
     letter:
     case '_':
@@ -2711,87 +2711,87 @@ macroexpand (
       args = (struct argdata *) alloca ((nargs + 1) * sizeof (struct argdata));
 
       for (i = 0; i < nargs; i++)
-       {
-         args[i].raw = args[i].expanded = 0;
-         args[i].raw_length = 0; 
-         args[i].expand_length = args[i].stringified_length = -1;
-         args[i].use_count = 0;
-       }
+  {
+    args[i].raw = args[i].expanded = 0;
+    args[i].raw_length = 0;
+    args[i].expand_length = args[i].stringified_length = -1;
+    args[i].use_count = 0;
+  }
 
       /* Parse all the macro args that are supplied.  I counts them.
-        The first NARGS args are stored in ARGS.
-        The rest are discarded.  If rest_args is set then we assume
-        macarg absorbed the rest of the args. */
+   The first NARGS args are stored in ARGS.
+   The rest are discarded.  If rest_args is set then we assume
+   macarg absorbed the rest of the args. */
       i = 0;
       rest_args = 0;
       rest_args = 0;
       FORWARD(1); /* Discard the open-parenthesis before the first arg.  */
       do
-       {
-         if (rest_args)
-           continue;
-         if (i < nargs || (nargs == 0 && i == 0))
-           {
-             /* if we are working on last arg which absorbs rest of args... */
-             if (i == nargs - 1 && defn->rest_args)
-               rest_args = 1;
-             args[i].raw = CPP_WRITTEN (pfile);
-             token = macarg (pfile, rest_args);
-             args[i].raw_length = CPP_WRITTEN (pfile) - args[i].raw;
-             args[i].newlines = 0; /* FIXME */
-           }
-         else
-           token = macarg (pfile, 0);
-         if (token == CPP_EOF || token == CPP_POP)
-           {
-             cpp_error_with_line (pfile, start_line, start_column,
-                                  "unterminated macro call");
-             return;
-           }
-         i++;
-       } while (token == CPP_COMMA);
+  {
+    if (rest_args)
+      continue;
+    if (i < nargs || (nargs == 0 && i == 0))
+      {
+        /* if we are working on last arg which absorbs rest of args... */
+        if (i == nargs - 1 && defn->rest_args)
+    rest_args = 1;
+        args[i].raw = CPP_WRITTEN (pfile);
+        token = macarg (pfile, rest_args);
+        args[i].raw_length = CPP_WRITTEN (pfile) - args[i].raw;
+        args[i].newlines = 0; /* FIXME */
+      }
+    else
+      token = macarg (pfile, 0);
+    if (token == CPP_EOF || token == CPP_POP)
+      {
+        cpp_error_with_line (pfile, start_line, start_column,
+           "unterminated macro call");
+        return;
+      }
+    i++;
+  } while (token == CPP_COMMA);
 
       /* If we got one arg but it was just whitespace, call that 0 args.  */
       if (i == 1)
-       {
-         register U_CHAR *bp = ARG_BASE + args[0].raw;
-         register U_CHAR *lim = bp + args[0].raw_length;
-         /* cpp.texi says for foo ( ) we provide one argument.
-            However, if foo wants just 0 arguments, treat this as 0.  */
-         if (nargs == 0)
-           while (bp != lim && is_space[*bp]) bp++;
-         if (bp == lim)
-           i = 0;
-       }
+  {
+    register U_CHAR *bp = ARG_BASE + args[0].raw;
+    register U_CHAR *lim = bp + args[0].raw_length;
+    /* cpp.texi says for foo ( ) we provide one argument.
+       However, if foo wants just 0 arguments, treat this as 0.  */
+    if (nargs == 0)
+      while (bp != lim && is_space[*bp]) bp++;
+    if (bp == lim)
+      i = 0;
+  }
 
       /* Don't output an error message if we have already output one for
-        a parse error above.  */
+   a parse error above.  */
       rest_zero = 0;
       if (nargs == 0 && i > 0)
-       {
-         cpp_error (pfile, "arguments given to macro `%s'", hp->name);
-       }
+  {
+    cpp_error (pfile, "arguments given to macro `%s'", hp->name);
+  }
       else if (i < nargs)
-       {
-         /* traditional C allows foo() if foo wants one argument.  */
-         if (nargs == 1 && i == 0 && CPP_TRADITIONAL (pfile))
-           ;
-         /* the rest args token is allowed to absorb 0 tokens */
-         else if (i == nargs - 1 && defn->rest_args)
-           rest_zero = 1;
-         else if (i == 0)
-           cpp_error (pfile, "macro `%s' used without args", hp->name);
-         else if (i == 1)
-           cpp_error (pfile, "macro `%s' used with just one arg", hp->name);
-         else
-           cpp_error (pfile, "macro `%s' used with only %d args",
-                      hp->name, i);
+  {
+    /* traditional C allows foo() if foo wants one argument.  */
+    if (nargs == 1 && i == 0 && CPP_TRADITIONAL (pfile))
+      ;
+    /* the rest args token is allowed to absorb 0 tokens */
+    else if (i == nargs - 1 && defn->rest_args)
+      rest_zero = 1;
+    else if (i == 0)
+      cpp_error (pfile, "macro `%s' used without args", hp->name);
+    else if (i == 1)
+      cpp_error (pfile, "macro `%s' used with just one arg", hp->name);
+    else
+      cpp_error (pfile, "macro `%s' used with only %d args",
+           hp->name, i);
       }
       else if (i > nargs)
-       {
-         cpp_error (pfile,
-                    "macro `%s' used with too many (%d) args", hp->name, i);
-       }
+  {
+    cpp_error (pfile,
+         "macro `%s' used with too many (%d) args", hp->name, i);
+  }
     }
 
   /* If macro wants zero args, we parsed the arglist for checking only.
@@ -2804,252 +2804,252 @@ macroexpand (
   else
     {
       register U_CHAR *exp = defn->expansion;
-      register int offset;     /* offset in expansion,
-                                  copied a piece at a time */
-      register int totlen;     /* total amount of exp buffer filled so far */
+      register int offset;  /* offset in expansion,
+           copied a piece at a time */
+      register int totlen;  /* total amount of exp buffer filled so far */
 
       register struct reflist *ap, *last_ap;
 
       /* Macro really takes args.  Compute the expansion of this call.  */
 
       /* Compute length in characters of the macro's expansion.
-        Also count number of times each arg is used.  */
+   Also count number of times each arg is used.  */
       xbuf_len = defn->length;
       for (ap = defn->pattern; ap != NULL; ap = ap->next)
-       {
-         if (ap->stringify)
-           {
-             register struct argdata *arg = &args[ap->argno];
-             /* Stringify it it hasn't already been */
-             if (arg->stringified_length < 0)
-               {
-                 int arglen = arg->raw_length;
-                 int escaped = 0;
-                 int in_string = 0;
-                 int c;
-                 /* Initially need_space is -1.  Otherwise, 1 means the
-                    previous character was a space, but we suppressed it;
-                    0 means the previous character was a non-space. */
-                 int need_space = -1;
-                 i = 0;
-                 arg->stringified = CPP_WRITTEN (pfile);
-                 if (!CPP_TRADITIONAL (pfile))
-                   CPP_PUTC (pfile, '\"'); /* insert beginning quote */
-                 for (; i < arglen; i++)
-                   {
-                     c = (ARG_BASE + arg->raw)[i];
-
-                     if (! in_string)
-                       {
-                         /* Internal sequences of whitespace are replaced by
-                            one space except within an string or char token.*/
-                         if (is_space[c])
-                           {
-                             if (CPP_WRITTEN (pfile) > arg->stringified
-                                 && (CPP_PWRITTEN (pfile))[-1] == '@')
-                               {
-                                 /* "@ " escape markers are removed */
-                                 CPP_ADJUST_WRITTEN (pfile, -1);
-                                 continue;
-                               }
-                             if (need_space == 0)
-                               need_space = 1;
-                             continue;
-                           }
-                         else if (need_space > 0)
-                           CPP_PUTC (pfile, ' ');
-                         need_space = 0;
-                       }
-
-                     if (escaped)
-                       escaped = 0;
-                     else
-                       {
-                         if (c == '\\')
-                           escaped = 1;
-                         if (in_string)
-                           {
-                             if (c == in_string)
-                               in_string = 0;
-                           }
-                         else if (c == '\"' || c == '\'')
-                           in_string = c;
-                       }
-
-                     /* Escape these chars */
-                     if (c == '\"' || (in_string && c == '\\'))
-                       CPP_PUTC (pfile, '\\');
-                     if (isprint (c))
-                       CPP_PUTC (pfile, c);
-                     else
-                       {
-                         CPP_RESERVE (pfile, 4);
-                         sprintf (CPP_PWRITTEN (pfile), "\\%03o",
-                                  (unsigned int) c);
-                         CPP_ADJUST_WRITTEN (pfile, 4);
-                       }
-                   }
-                 if (!CPP_TRADITIONAL (pfile))
-                   CPP_PUTC (pfile, '\"'); /* insert ending quote */
-                 arg->stringified_length
-                   = CPP_WRITTEN (pfile) - arg->stringified;
-               }
-             xbuf_len += args[ap->argno].stringified_length;
-           }
-         else if (ap->raw_before || ap->raw_after || CPP_TRADITIONAL (pfile))
-           /* Add 4 for two newline-space markers to prevent
-              token concatenation.  */
-           xbuf_len += args[ap->argno].raw_length + 4;
-         else
-           {
-             /* We have an ordinary (expanded) occurrence of the arg.
-                So compute its expansion, if we have not already.  */
-             if (args[ap->argno].expand_length < 0)
-               {
-                 args[ap->argno].expanded = CPP_WRITTEN (pfile);
-                 cpp_expand_to_buffer (pfile,
-                                       ARG_BASE + args[ap->argno].raw,
-                                       args[ap->argno].raw_length);
-
-                 args[ap->argno].expand_length
-                   = CPP_WRITTEN (pfile) - args[ap->argno].expanded;
-               }
-
-             /* Add 4 for two newline-space markers to prevent
-                token concatenation.  */
-             xbuf_len += args[ap->argno].expand_length + 4;
-           }
-         if (args[ap->argno].use_count < 10)
-           args[ap->argno].use_count++;
-       }
+  {
+    if (ap->stringify)
+      {
+        register struct argdata *arg = &args[ap->argno];
+        /* Stringify it it hasn't already been */
+        if (arg->stringified_length < 0)
+    {
+      int arglen = arg->raw_length;
+      int escaped = 0;
+      int in_string = 0;
+      int c;
+      /* Initially need_space is -1.  Otherwise, 1 means the
+         previous character was a space, but we suppressed it;
+         0 means the previous character was a non-space. */
+      int need_space = -1;
+      i = 0;
+      arg->stringified = CPP_WRITTEN (pfile);
+      if (!CPP_TRADITIONAL (pfile))
+        CPP_PUTC (pfile, '\"'); /* insert beginning quote */
+      for (; i < arglen; i++)
+        {
+          c = (ARG_BASE + arg->raw)[i];
+
+          if (! in_string)
+      {
+        /* Internal sequences of whitespace are replaced by
+           one space except within an string or char token.*/
+        if (is_space[c])
+          {
+            if (CPP_WRITTEN (pfile) > arg->stringified
+          && (CPP_PWRITTEN (pfile))[-1] == '@')
+        {
+          /* "@ " escape markers are removed */
+          CPP_ADJUST_WRITTEN (pfile, -1);
+          continue;
+        }
+            if (need_space == 0)
+        need_space = 1;
+            continue;
+          }
+        else if (need_space > 0)
+          CPP_PUTC (pfile, ' ');
+        need_space = 0;
+      }
+
+          if (escaped)
+      escaped = 0;
+          else
+      {
+        if (c == '\\')
+          escaped = 1;
+        if (in_string)
+          {
+            if (c == in_string)
+        in_string = 0;
+          }
+        else if (c == '\"' || c == '\'')
+          in_string = c;
+      }
+
+          /* Escape these chars */
+          if (c == '\"' || (in_string && c == '\\'))
+      CPP_PUTC (pfile, '\\');
+          if (isprint (c))
+      CPP_PUTC (pfile, c);
+          else
+      {
+        CPP_RESERVE (pfile, 4);
+        sprintf (CPP_PWRITTEN (pfile), "\\%03o",
+           (unsigned int) c);
+        CPP_ADJUST_WRITTEN (pfile, 4);
+      }
+        }
+      if (!CPP_TRADITIONAL (pfile))
+        CPP_PUTC (pfile, '\"'); /* insert ending quote */
+      arg->stringified_length
+        = CPP_WRITTEN (pfile) - arg->stringified;
+    }
+        xbuf_len += args[ap->argno].stringified_length;
+      }
+    else if (ap->raw_before || ap->raw_after || CPP_TRADITIONAL (pfile))
+      /* Add 4 for two newline-space markers to prevent
+         token concatenation.  */
+      xbuf_len += args[ap->argno].raw_length + 4;
+    else
+      {
+        /* We have an ordinary (expanded) occurrence of the arg.
+     So compute its expansion, if we have not already.  */
+        if (args[ap->argno].expand_length < 0)
+    {
+      args[ap->argno].expanded = CPP_WRITTEN (pfile);
+      cpp_expand_to_buffer (pfile,
+          ARG_BASE + args[ap->argno].raw,
+          args[ap->argno].raw_length);
+
+      args[ap->argno].expand_length
+        = CPP_WRITTEN (pfile) - args[ap->argno].expanded;
+    }
+
+        /* Add 4 for two newline-space markers to prevent
+     token concatenation.  */
+        xbuf_len += args[ap->argno].expand_length + 4;
+      }
+    if (args[ap->argno].use_count < 10)
+      args[ap->argno].use_count++;
+  }
 
       xbuf = (U_CHAR *) Safe_malloc (xbuf_len + 1);
 
       /* Generate in XBUF the complete expansion
-        with arguments substituted in.
-        TOTLEN is the total size generated so far.
-        OFFSET is the index in the definition
-        of where we are copying from.  */
+   with arguments substituted in.
+   TOTLEN is the total size generated so far.
+   OFFSET is the index in the definition
+   of where we are copying from.  */
       offset = totlen = 0;
       for (last_ap = NULL, ap = defn->pattern; ap != NULL;
-          last_ap = ap, ap = ap->next)
-       {
-         register struct argdata *arg = &args[ap->argno];
-         int count_before = totlen;
-
-         /* Add chars to XBUF.  */
-         for (i = 0; i < ap->nchars; i++, offset++)
-           xbuf[totlen++] = exp[offset];
-
-         /* If followed by an empty rest arg with concatenation,
-            delete the last run of nonwhite chars.  */
-         if (rest_zero && totlen > count_before
-             && ((ap->rest_args && ap->raw_before)
-                 || (last_ap != NULL && last_ap->rest_args
-                     && last_ap->raw_after)))
-           {
-             /* Delete final whitespace.  */
-             while (totlen > count_before && is_space[xbuf[totlen - 1]])
-               totlen--;
-
-             /* Delete the nonwhites before them.  */
-             while (totlen > count_before && ! is_space[xbuf[totlen - 1]])
-               totlen--;
-           }
-
-         if (ap->stringify != 0)
-           {
-             bcopy (ARG_BASE + arg->stringified,
-                    xbuf + totlen, arg->stringified_length);
-             totlen += arg->stringified_length;
-           }
-         else if (ap->raw_before || ap->raw_after || CPP_TRADITIONAL (pfile))
-           {
-             U_CHAR *p1 = ARG_BASE + arg->raw;
-             U_CHAR *l1 = p1 + arg->raw_length;
-             if (ap->raw_before)
-               {
-                 while (p1 != l1 && is_space[*p1]) p1++;
-                 while (p1 != l1 && is_idchar[*p1])
-                   xbuf[totlen++] = *p1++;
-               }
-             if (ap->raw_after)
-               {
-                 /* Arg is concatenated after: delete trailing whitespace,
-                    whitespace markers, and no-reexpansion markers.  */
-                 while (p1 != l1)
-                   {
-                     if (is_space[l1[-1]]) l1--;
-                     else if (l1[-1] == '-')
-                       {
-                         U_CHAR *p2 = l1 - 1;
-                         /* If a `-' is preceded by an odd number of newlines then it
-                            and the last newline are a no-reexpansion marker.  */
-                         while (p2 != p1 && p2[-1] == '\n') p2--;
-                         if ((l1 - 1 - p2) & 1) {
-                           l1 -= 2;
-                         }
-                         else break;
-                       }
-                     else break;
-                   }
-               }
-
-             bcopy (p1, xbuf + totlen, l1 - p1);
-             totlen += l1 - p1;
-           }
-         else
-           {
-             U_CHAR *expanded = ARG_BASE + arg->expanded;
-             if (!ap->raw_before && totlen > 0 && arg->expand_length
-                 && !CPP_TRADITIONAL(pfile)
-                 && unsafe_chars (xbuf[totlen-1], expanded[0]))
-               {
-                 xbuf[totlen++] = '@';
-                 xbuf[totlen++] = ' ';
-               }
-
-             bcopy (expanded, xbuf + totlen, arg->expand_length);
-             totlen += arg->expand_length;
-
-             if (!ap->raw_after && totlen > 0 && offset < defn->length
-                 && !CPP_TRADITIONAL(pfile)
-                 && unsafe_chars (xbuf[totlen-1], exp[offset]))
-               {
-                 xbuf[totlen++] = '@';
-                 xbuf[totlen++] = ' ';
-               }
-
-             /* If a macro argument with newlines is used multiple times,
-                then only expand the newlines once.  This avoids creating
-                output lines which don't correspond to any input line,
-                which confuses gdb and gcov.  */
-             if (arg->use_count > 1 && arg->newlines > 0)
-               {
-                 /* Don't bother doing change_newlines for subsequent
-                    uses of arg.  */
-                 arg->use_count = 1;
-                 arg->expand_length
-                   = change_newlines (expanded, arg->expand_length);
-               }
-           }
-
-         if (totlen > xbuf_len)
-           abort ();
+     last_ap = ap, ap = ap->next)
+  {
+    register struct argdata *arg = &args[ap->argno];
+    int count_before = totlen;
+
+    /* Add chars to XBUF.  */
+    for (i = 0; i < ap->nchars; i++, offset++)
+      xbuf[totlen++] = exp[offset];
+
+    /* If followed by an empty rest arg with concatenation,
+       delete the last run of nonwhite chars.  */
+    if (rest_zero && totlen > count_before
+        && ((ap->rest_args && ap->raw_before)
+      || (last_ap != NULL && last_ap->rest_args
+          && last_ap->raw_after)))
+      {
+        /* Delete final whitespace.  */
+        while (totlen > count_before && is_space[xbuf[totlen - 1]])
+    totlen--;
+
+        /* Delete the nonwhites before them.  */
+        while (totlen > count_before && ! is_space[xbuf[totlen - 1]])
+    totlen--;
+      }
+
+    if (ap->stringify != 0)
+      {
+        bcopy (ARG_BASE + arg->stringified,
+         xbuf + totlen, arg->stringified_length);
+        totlen += arg->stringified_length;
+      }
+    else if (ap->raw_before || ap->raw_after || CPP_TRADITIONAL (pfile))
+      {
+        U_CHAR *p1 = ARG_BASE + arg->raw;
+        U_CHAR *l1 = p1 + arg->raw_length;
+        if (ap->raw_before)
+    {
+      while (p1 != l1 && is_space[*p1]) p1++;
+      while (p1 != l1 && is_idchar[*p1])
+        xbuf[totlen++] = *p1++;
+    }
+        if (ap->raw_after)
+    {
+      /* Arg is concatenated after: delete trailing whitespace,
+         whitespace markers, and no-reexpansion markers.  */
+      while (p1 != l1)
+        {
+          if (is_space[l1[-1]]) l1--;
+          else if (l1[-1] == '-')
+      {
+        U_CHAR *p2 = l1 - 1;
+        /* If a `-' is preceded by an odd number of newlines then it
+           and the last newline are a no-reexpansion marker.  */
+        while (p2 != p1 && p2[-1] == '\n') p2--;
+        if ((l1 - 1 - p2) & 1) {
+          l1 -= 2;
+        }
+        else break;
+      }
+          else break;
+        }
+    }
+
+        bcopy (p1, xbuf + totlen, l1 - p1);
+        totlen += l1 - p1;
+      }
+    else
+      {
+        U_CHAR *expanded = ARG_BASE + arg->expanded;
+        if (!ap->raw_before && totlen > 0 && arg->expand_length
+      && !CPP_TRADITIONAL(pfile)
+      && unsafe_chars (xbuf[totlen-1], expanded[0]))
+    {
+      xbuf[totlen++] = '@';
+      xbuf[totlen++] = ' ';
+    }
+
+        bcopy (expanded, xbuf + totlen, arg->expand_length);
+        totlen += arg->expand_length;
+
+        if (!ap->raw_after && totlen > 0 && offset < defn->length
+      && !CPP_TRADITIONAL(pfile)
+      && unsafe_chars (xbuf[totlen-1], exp[offset]))
+    {
+      xbuf[totlen++] = '@';
+      xbuf[totlen++] = ' ';
+    }
+
+        /* If a macro argument with newlines is used multiple times,
+     then only expand the newlines once.  This avoids creating
+     output lines which don't correspond to any input line,
+     which confuses gdb and gcov.  */
+        if (arg->use_count > 1 && arg->newlines > 0)
+    {
+      /* Don't bother doing change_newlines for subsequent
+         uses of arg.  */
+      arg->use_count = 1;
+      arg->expand_length
+        = change_newlines (expanded, arg->expand_length);
+    }
+      }
+
+    if (totlen > xbuf_len)
+      abort ();
       }
 
       /* if there is anything left of the definition
-        after handling the arg list, copy that in too. */
+   after handling the arg list, copy that in too. */
 
       for (i = offset; i < defn->length; i++)
-       {
-         /* if we've reached the end of the macro */
-         if (exp[i] == ')')
-           rest_zero = 0;
-         if (! (rest_zero && last_ap != NULL && last_ap->rest_args
-                && last_ap->raw_after))
-           xbuf[totlen++] = exp[i];
-       }
+  {
+    /* if we've reached the end of the macro */
+    if (exp[i] == ')')
+      rest_zero = 0;
+    if (! (rest_zero && last_ap != NULL && last_ap->rest_args
+     && last_ap->raw_after))
+      xbuf[totlen++] = exp[i];
+  }
 
       xbuf[totlen] = 0;
       xbuf_len = totlen;
@@ -3065,11 +3065,11 @@ macroexpand (
 
   /* Pop the space we've used in the token_buffer for argument expansion. */
   CPP_SET_WRITTEN (pfile, old_written);
-    
+
   /* Recursive macro use sometimes works traditionally.
      #define foo(x,y) bar (x (y,0), y)
      foo (foo, baz)  */
-  
+
   if (!CPP_TRADITIONAL (pfile))
     hp->type = T_DISABLED;
 }
@@ -3105,7 +3105,7 @@ push_macro_expansion (
 
   if (xbuf[0] == '@' && xbuf[1] == ' '
       && (is_idchar[xbuf[2]] || xbuf[2] == '(' || xbuf[2] == '\''
-         || xbuf[2] == '\"'))
+    || xbuf[2] == '\"'))
     mbuf->cur += 2;
 }
 \f
@@ -3122,19 +3122,19 @@ get_directive_token (
       enum cpp_token token;
       cpp_skip_hspace (pfile);
       if (PEEKC () == '\n')
-         return CPP_VSPACE;
+    return CPP_VSPACE;
       token = cpp_get_token (pfile);
       switch (token)
       {
       case CPP_POP:
-         if (! CPP_IS_MACRO_BUFFER (CPP_BUFFER (pfile)))
-             return token;
-         /* ... else fall though ... */
+    if (! CPP_IS_MACRO_BUFFER (CPP_BUFFER (pfile)))
+        return token;
+    /* ... else fall though ... */
       case CPP_HSPACE:  case CPP_COMMENT:
-         CPP_SET_WRITTEN (pfile, old_written);
-         break;
+    CPP_SET_WRITTEN (pfile, old_written);
+    break;
       default:
-         return token;
+    return token;
       }
     }
 }
@@ -3155,30 +3155,30 @@ do_include (
 {
   int importing = (keyword->type == T_IMPORT);
   int skip_dirs = (keyword->type == T_INCLUDE_NEXT);
-  char *fname;         /* Dynamically allocated fname buffer */
+  char *fname;    /* Dynamically allocated fname buffer */
   char *pcftry;
   char *pcfname;
-  U_CHAR *fbeg, *fend;         /* Beginning and end of fname */
+  U_CHAR *fbeg, *fend;    /* Beginning and end of fname */
   enum cpp_token token;
 
   /* Chain of dirs to search */
   struct file_name_list *search_start = CPP_OPTIONS (pfile)->include;
-  struct file_name_list dsp[1];        /* First in chain, if #include "..." */
+  struct file_name_list dsp[1]; /* First in chain, if #include "..." */
   struct file_name_list *searchptr = 0;
   long old_written = CPP_WRITTEN (pfile);
 
   int flen;
 
-  int f;                       /* file number */
+  int f;      /* file number */
 
-  int retried = 0;             /* Have already tried macro
-                                  expanding the include line*/
-  int angle_brackets = 0;      /* 0 for "...", 1 for <...> */
+  int retried = 0;    /* Have already tried macro
+           expanding the include line*/
+  int angle_brackets = 0; /* 0 for "...", 1 for <...> */
   int pcf = -1;
   char *pcfbuf;
   char *pcfbuflimit;
   int pcfnum;
-  f= -1;                       /* JF we iz paranoid! */
+  f= -1;      /* JF we iz paranoid! */
 
   if (importing && CPP_OPTIONS (pfile)->warn_import
       && !CPP_OPTIONS (pfile)->inhibit_warnings
@@ -3208,56 +3208,56 @@ do_include (
       fbeg = pfile->token_buffer + old_written + 1;
       fend = CPP_PWRITTEN (pfile) - 1;
       if (fbeg[-1] == '<')
-       {
-         angle_brackets = 1;
-         /* If -I-, start with the first -I dir after the -I-.  */
-         if (CPP_OPTIONS (pfile)->first_bracket_include)
-           search_start = CPP_OPTIONS (pfile)->first_bracket_include;
-       }
+  {
+    angle_brackets = 1;
+    /* If -I-, start with the first -I dir after the -I-.  */
+    if (CPP_OPTIONS (pfile)->first_bracket_include)
+      search_start = CPP_OPTIONS (pfile)->first_bracket_include;
+  }
       /* If -I- was specified, don't search current dir, only spec'd ones. */
       else if (! CPP_OPTIONS (pfile)->ignore_srcdir)
-       {
-         cpp_buffer *fp;
-         /* We have "filename".  Figure out directory this source
-            file is coming from and put it on the front of the list. */
-
-         for (fp = CPP_BUFFER (pfile); fp != NULL; fp = CPP_PREV_BUFFER (fp))
-           {
-             int n;
-             char *ep,*nam;
-
-             if ((nam = fp->nominal_fname) != NULL)
-               {
-                 /* Found a named file.  Figure out dir of the file,
-                    and put it in front of the search list.  */
-                 dsp[0].next = search_start;
-                 search_start = dsp;
+  {
+    cpp_buffer *fp;
+    /* We have "filename".  Figure out directory this source
+       file is coming from and put it on the front of the list. */
+
+    for (fp = CPP_BUFFER (pfile); fp != NULL; fp = CPP_PREV_BUFFER (fp))
+      {
+        int n;
+        char *ep,*nam;
+
+        if ((nam = fp->nominal_fname) != NULL)
+    {
+      /* Found a named file.  Figure out dir of the file,
+         and put it in front of the search list.  */
+      dsp[0].next = search_start;
+      search_start = dsp;
 #ifndef VMS
-                 ep = rindex (nam, '/');
-#else                          /* VMS */
-                 ep = rindex (nam, ']');
-                 if (ep == NULL) ep = rindex (nam, '>');
-                 if (ep == NULL) ep = rindex (nam, ':');
-                 if (ep != NULL) ep++;
-#endif                         /* VMS */
-                 if (ep != NULL)
-                   {
-                     n = ep - nam;
-                     dsp[0].fname = (char *) alloca (n + 1);
-                     strncpy (dsp[0].fname, nam, n);
-                     dsp[0].fname[n] = '\0';
-                     if (n + INCLUDE_LEN_FUDGE > pfile->max_include_len)
-                       pfile->max_include_len = n + INCLUDE_LEN_FUDGE;
-                   }
-                 else
-                   {
-                     dsp[0].fname = 0; /* Current directory */
-                   }
-                 dsp[0].got_name_map = 0;
-                 break;
-               }
-           }
-       }
+      ep = rindex (nam, '/');
+#else       /* VMS */
+      ep = rindex (nam, ']');
+      if (ep == NULL) ep = rindex (nam, '>');
+      if (ep == NULL) ep = rindex (nam, ':');
+      if (ep != NULL) ep++;
+#endif        /* VMS */
+      if (ep != NULL)
+        {
+          n = ep - nam;
+          dsp[0].fname = (char *) alloca (n + 1);
+          strncpy (dsp[0].fname, nam, n);
+          dsp[0].fname[n] = '\0';
+          if (n + INCLUDE_LEN_FUDGE > pfile->max_include_len)
+      pfile->max_include_len = n + INCLUDE_LEN_FUDGE;
+        }
+      else
+        {
+          dsp[0].fname = 0; /* Current directory */
+        }
+      dsp[0].got_name_map = 0;
+      break;
+    }
+      }
+  }
     }
 #ifdef VMS
   else if (token == CPP_NAME)
@@ -3268,11 +3268,11 @@ do_include (
        * code from case '<' is repeated here) and generates a warning.
        */
       cpp_warning (pfile,
-                  "VAX-C-style include specification found, use '#include <filename.h>' !");
+       "VAX-C-style include specification found, use '#include <filename.h>' !");
       angle_brackets = 1;
       /* If -I-, start with the first -I dir after the -I-.  */
       if (CPP_OPTIONS (pfile)->first_bracket_include)
-       search_start = CPP_OPTIONS (pfile)->first_bracket_include;
+  search_start = CPP_OPTIONS (pfile)->first_bracket_include;
       fbeg = pfile->token_buffer + old_written;
       fend = CPP_PWRITTEN (pfile);
     }
@@ -3280,7 +3280,7 @@ do_include (
   else
     {
       cpp_error (pfile,
-                "`#%s' expects \"FILENAME\" or <FILENAME>", keyword->name);
+     "`#%s' expects \"FILENAME\" or <FILENAME>", keyword->name);
       CPP_SET_WRITTEN (pfile, old_written);
       skip_rest_of_line (pfile);
       return 0;
@@ -3293,7 +3293,7 @@ do_include (
     {
       cpp_error (pfile, "junk at end of `#include'");
       while (token != CPP_VSPACE && token != CPP_EOF && token != CPP_POP)
-       token = get_directive_token (pfile);
+  token = get_directive_token (pfile);
     }
 
   /* For #include_next, skip in the search path
@@ -3302,16 +3302,16 @@ do_include (
     {
       cpp_buffer *fp;
       for (fp = CPP_BUFFER (pfile); fp != NULL; fp = CPP_PREV_BUFFER (fp))
-       if (fp->fname != NULL)
-         {
-           /* fp->dir is null if the containing file was specified with
-              an absolute file name.  In that case, don't skip anything.  */
-           if (fp->dir == SELF_DIR_DUMMY)
-             search_start = CPP_OPTIONS (pfile)->include;
-           else if (fp->dir)
-             search_start = fp->dir->next;
-           break;
-         }
+  if (fp->fname != NULL)
+    {
+      /* fp->dir is null if the containing file was specified with
+         an absolute file name.  In that case, don't skip anything.  */
+      if (fp->dir == SELF_DIR_DUMMY)
+        search_start = CPP_OPTIONS (pfile)->include;
+      else if (fp->dir)
+        search_start = fp->dir->next;
+      break;
+    }
     }
 
   CPP_SET_WRITTEN (pfile, old_written);
@@ -3342,59 +3342,59 @@ do_include (
     else
       f = open_include_file (pfile, fname, NULL_PTR);
     if (f == -2)
-      return 0;                /* Already included this file */
+      return 0;   /* Already included this file */
   } else {
     /* Search directory path, trying to open the file.
        Copy each filename tried into FNAME.  */
 
     for (searchptr = search_start; searchptr; searchptr = searchptr->next) {
       if (searchptr->fname) {
-       /* The empty string in a search path is ignored.
-          This makes it possible to turn off entirely
-          a standard piece of the list.  */
-       if (searchptr->fname[0] == 0)
-         continue;
-       strcpy (fname, searchptr->fname);
-       strcat (fname, "/");
-       fname[strlen (fname) + flen] = 0;
+  /* The empty string in a search path is ignored.
+     This makes it possible to turn off entirely
+     a standard piece of the list.  */
+  if (searchptr->fname[0] == 0)
+    continue;
+  strcpy (fname, searchptr->fname);
+  strcat (fname, "/");
+  fname[strlen (fname) + flen] = 0;
       } else {
-       fname[0] = 0;
+  fname[0] = 0;
       }
       strncat (fname, fbeg, flen);
 #ifdef VMS
       /* Change this 1/2 Unix 1/2 VMS file specification into a
          full VMS file specification */
       if (searchptr->fname && (searchptr->fname[0] != 0)) {
-       /* Fix up the filename */
-       hack_vms_include_specification (fname);
+  /* Fix up the filename */
+  hack_vms_include_specification (fname);
       } else {
-       /* This is a normal VMS filespec, so use it unchanged.  */
-       strncpy (fname, fbeg, flen);
-       fname[flen] = 0;
-       /* if it's '#include filename', add the missing .h */
-       if (index(fname,'.')==NULL) {
-         strcat (fname, ".h");
-       }
+        /* This is a normal VMS filespec, so use it unchanged.  */
+  strncpy (fname, fbeg, flen);
+  fname[flen] = 0;
+  /* if it's '#include filename', add the missing .h */
+  if (index(fname,'.')==NULL) {
+    strcat (fname, ".h");
+  }
       }
 #endif /* VMS */
       /* ??? There are currently 3 separate mechanisms for avoiding processing
-        of redundant include files: #import, #pragma once, and
-        redundant_include_p.  It would be nice if they were unified.  */
+   of redundant include files: #import, #pragma once, and
+   redundant_include_p.  It would be nice if they were unified.  */
       if (redundant_include_p (pfile, fname))
-       return 0;
+  return 0;
       if (importing)
-       f = lookup_import (pfile, fname, searchptr);
+  f = lookup_import (pfile, fname, searchptr);
       else
-       f = open_include_file (pfile, fname, searchptr);
+  f = open_include_file (pfile, fname, searchptr);
       if (f == -2)
-       return 0;                       /* Already included this file */
+  return 0;     /* Already included this file */
 #ifdef EACCES
       else if (f == -1 && errno == EACCES)
-       cpp_warning (pfile, "Header file %s exists, but is not readable",
-                    fname);
+  cpp_warning (pfile, "Header file %s exists, but is not readable",
+         fname);
 #endif
       if (f >= 0)
-       break;
+  break;
     }
   }
 
@@ -3404,57 +3404,57 @@ do_include (
       strncpy (fname, fbeg, flen);
       fname[flen] = 0;
       /* If generating dependencies and -MG was specified, we assume missing
-        files are leaf files, living in the same directory as the source file
-        or other similar place; these missing files may be generated from
-        other files and may not exist yet (eg: y.tab.h).  */
+   files are leaf files, living in the same directory as the source file
+   or other similar place; these missing files may be generated from
+   other files and may not exist yet (eg: y.tab.h).  */
 
       if (CPP_OPTIONS(pfile)->print_deps_missing_files
-         && CPP_PRINT_DEPS (pfile)
-         > (angle_brackets || (pfile->system_include_depth > 0)))
-       {
-         /* If it was requested as a system header file,
-            then assume it belongs in the first place to look for such.  */
-         if (angle_brackets)
-           {
-             for (searchptr = search_start; searchptr;
-                  searchptr = searchptr->next)
-               {
-                 if (searchptr->fname)
-                   {
-                     char *p;
-
-                     if (searchptr->fname[0] == 0)
-                       continue;
-                     p = (char *) alloca (strlen (searchptr->fname)
-                                          + strlen (fname) + 2);
-                     strcpy (p, searchptr->fname);
-                     strcat (p, "/");
-                     strcat (p, fname);
-                     deps_output (pfile, p, ' ');
-                     break;
-                   }
-               }
-           }
-         else
-           {
-             /* Otherwise, omit the directory, as if the file existed
-                in the directory with the source.  */
-             deps_output (pfile, fname, ' ');
-           }
-       }
+    && CPP_PRINT_DEPS (pfile)
+    > (angle_brackets || (pfile->system_include_depth > 0)))
+  {
+    /* If it was requested as a system header file,
+       then assume it belongs in the first place to look for such.  */
+    if (angle_brackets)
+      {
+        for (searchptr = search_start; searchptr;
+       searchptr = searchptr->next)
+    {
+      if (searchptr->fname)
+        {
+          char *p;
+
+          if (searchptr->fname[0] == 0)
+      continue;
+          p = (char *) alloca (strlen (searchptr->fname)
+             + strlen (fname) + 2);
+          strcpy (p, searchptr->fname);
+          strcat (p, "/");
+          strcat (p, fname);
+          deps_output (pfile, p, ' ');
+          break;
+        }
+    }
+      }
+    else
+      {
+        /* Otherwise, omit the directory, as if the file existed
+     in the directory with the source.  */
+        deps_output (pfile, fname, ' ');
+      }
+  }
       /* If -M was specified, and this header file won't be added to the
-        dependency list, then don't count this as an error, because we can
-        still produce correct output.  Otherwise, we can't produce correct
-        output, because there may be dependencies we need inside the missing
-        file, and we don't know what directory this missing file exists in.*/
+   dependency list, then don't count this as an error, because we can
+   still produce correct output.  Otherwise, we can't produce correct
+   output, because there may be dependencies we need inside the missing
+   file, and we don't know what directory this missing file exists in.*/
       else if (CPP_PRINT_DEPS (pfile)
-              && (CPP_PRINT_DEPS (pfile)
-                  <= (angle_brackets || (pfile->system_include_depth > 0))))
-       cpp_warning (pfile, "No include path in which to find %s", fname);
+         && (CPP_PRINT_DEPS (pfile)
+       <= (angle_brackets || (pfile->system_include_depth > 0))))
+  cpp_warning (pfile, "No include path in which to find %s", fname);
       else if (search_start)
-       cpp_error_from_errno (pfile, fname);
+  cpp_error_from_errno (pfile, fname);
       else
-       cpp_error (pfile, "No include path in which to find %s", fname);
+  cpp_error (pfile, "No include path in which to find %s", fname);
     }
   else {
     /* Check to see if this include file is a once-only include file.
@@ -3464,14 +3464,14 @@ do_include (
 
     for (ptr = pfile->dont_repeat_files; ptr; ptr = ptr->next) {
       if (!strcmp (ptr->fname, fname)) {
-       close (f);
-        return 0;                              /* This file was once'd. */
+  close (f);
+        return 0;       /* This file was once'd. */
       }
     }
 
     for (ptr = pfile->all_include_files; ptr; ptr = ptr->next) {
       if (!strcmp (ptr->fname, fname))
-        break;                         /* This file was included before. */
+        break;        /* This file was included before. */
     }
 
     if (ptr == 0) {
@@ -3488,17 +3488,17 @@ do_include (
 
       /* For -M, add this file to the dependencies.  */
       if (CPP_PRINT_DEPS (pfile)
-         > (angle_brackets || (pfile->system_include_depth > 0)))
-       deps_output (pfile, fname, ' ');
-    }   
+    > (angle_brackets || (pfile->system_include_depth > 0)))
+  deps_output (pfile, fname, ' ');
+    }
 
     /* Handle -H option.  */
     if (CPP_OPTIONS(pfile)->print_include_names)
       {
-       cpp_buffer *buf = CPP_BUFFER (pfile);
-       while ((buf = CPP_PREV_BUFFER (buf)) != NULL)
-         putc ('.', stderr);
-       fprintf (stderr, "%s\n", fname);
+  cpp_buffer *buf = CPP_BUFFER (pfile);
+  while ((buf = CPP_PREV_BUFFER (buf)) != NULL)
+    putc ('.', stderr);
+  fprintf (stderr, "%s\n", fname);
       }
 
     if (angle_brackets)
@@ -3516,48 +3516,48 @@ do_include (
 #if 0
     if (!no_precomp)
       {
-       struct stat stat_f;
-
-       fstat (f, &stat_f);
-
-       do {
-         sprintf (pcftry, "%s%d", fname, pcfnum++);
-
-         pcf = open (pcftry, O_RDONLY, 0666);
-         if (pcf != -1)
-           {
-             struct stat s;
-
-             fstat (pcf, &s);
-             if (bcmp ((char *) &stat_f.st_ino, (char *) &s.st_ino,
-                       sizeof (s.st_ino))
-                 || stat_f.st_dev != s.st_dev)
-               {
-                 pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
-                 /* Don't need it any more.  */
-                 close (pcf);
-               }
-             else
-               {
-                 /* Don't need it at all.  */
-                 close (pcf);
-                 break;
-               }
-           }
-       } while (pcf != -1 && !pcfbuf);
-      }
-#endif
-    
-    /* Actually process the file */
-    cpp_push_buffer (pfile, NULL, 0);
-    if (finclude (pfile, f, fname, is_system_include (pfile, fname),
-                 searchptr != dsp ? searchptr : SELF_DIR_DUMMY))
+  struct stat stat_f;
+
+  fstat (f, &stat_f);
+
+  do {
+    sprintf (pcftry, "%s%d", fname, pcfnum++);
+
+    pcf = open (pcftry, O_RDONLY, 0666);
+    if (pcf != -1)
       {
-       output_line_command (pfile, 0, enter_file);
-       pfile->only_seen_white = 2;
-      }
+        struct stat s;
 
-    if (angle_brackets)
+        fstat (pcf, &s);
+        if (bcmp ((char *) &stat_f.st_ino, (char *) &s.st_ino,
+      sizeof (s.st_ino))
+      || stat_f.st_dev != s.st_dev)
+    {
+      pcfbuf = check_precompiled (pcf, fname, &pcfbuflimit);
+      /* Don't need it any more.  */
+      close (pcf);
+    }
+        else
+    {
+      /* Don't need it at all.  */
+      close (pcf);
+      break;
+    }
+      }
+  } while (pcf != -1 && !pcfbuf);
+      }
+#endif
+
+    /* Actually process the file */
+    cpp_push_buffer (pfile, NULL, 0);
+    if (finclude (pfile, f, fname, is_system_include (pfile, fname),
+      searchptr != dsp ? searchptr : SELF_DIR_DUMMY))
+      {
+  output_line_command (pfile, 0, enter_file);
+  pfile->only_seen_white = 2;
+      }
+
+    if (angle_brackets)
       pfile->system_include_depth--;
   }
   return 0;
@@ -3575,8 +3575,8 @@ redundant_include_p (
   struct file_name_list *l = pfile->all_include_files;
   for (; l; l = l->next)
     if (! strcmp (name, l->fname)
-       && l->control_macro
-       && cpp_lookup (pfile, l->control_macro, -1, -1))
+  && l->control_macro
+  && cpp_lookup (pfile, l->control_macro, -1, -1))
       return 1;
   return 0;
 }
@@ -3606,12 +3606,12 @@ is_system_include (
       register unsigned length = strlen (sys_dir);
 
       if (! strncmp (sys_dir, filename, length) && filename[length] == '/')
-       {
-         if (searchptr->c_system_include_path)
-           return 2;
-         else
-           return 1;
-       }
+  {
+    if (searchptr->c_system_include_path)
+      return 2;
+    else
+      return 1;
+  }
     }
   return 0;
 }
@@ -3731,26 +3731,26 @@ convert_string (
     {
       U_CHAR c = *in++;
       switch (c)
-       {
-       case '\0':
-         return NULL;
-       case '\"':
-         limit = in;
-         break;
-       case '\\':
-         if (handle_escapes)
-           {
-             char *bpc = (char *) in;
-             int i = (U_CHAR) cpp_parse_escape (pfile, &bpc);
-             in = (U_CHAR *) bpc;
-             if (i >= 0)
-               *result++ = (U_CHAR)c;
-             break;
-           }
-         /* else fall through */
-       default:
-         *result++ = c;
-       }
+  {
+  case '\0':
+    return NULL;
+  case '\"':
+    limit = in;
+    break;
+  case '\\':
+    if (handle_escapes)
+      {
+        char *bpc = (char *) in;
+        int i = (U_CHAR) cpp_parse_escape (pfile, &bpc);
+        in = (U_CHAR *) bpc;
+        if (i >= 0)
+    *result++ = (U_CHAR)c;
+        break;
+      }
+    /* else fall through */
+  default:
+    *result++ = c;
+  }
     }
   *result = 0;
   return result;
@@ -3816,8 +3816,8 @@ do_line (
     end_name = convert_string (pfile, fname, fname, CPP_PWRITTEN (pfile), 1);
     if (end_name == NULL)
     {
-       cpp_error (pfile, "invalid format `#line' command");
-       goto bad_line_directive;
+  cpp_error (pfile, "invalid format `#line' command");
+  goto bad_line_directive;
     }
 
     fname_length = end_name - fname;
@@ -3827,32 +3827,32 @@ do_line (
     if (token != CPP_VSPACE && token != CPP_EOF && token != CPP_POP) {
       p = pfile->token_buffer + num_start;
       if (CPP_PEDANTIC (pfile))
-       cpp_pedwarn (pfile, "garbage at end of `#line' command");
+  cpp_pedwarn (pfile, "garbage at end of `#line' command");
 
       if (token != CPP_NUMBER || *p < '0' || *p > '4' || p[1] != '\0')
       {
-       cpp_error (pfile, "invalid format `#line' command");
-       goto bad_line_directive;
+  cpp_error (pfile, "invalid format `#line' command");
+  goto bad_line_directive;
       }
       if (*p == '1')
-       file_change = enter_file;
+  file_change = enter_file;
       else if (*p == 2)
-       file_change = leave_file;
+  file_change = leave_file;
       else if (*p == 3)
-       ip->system_header_p = 1;
+  ip->system_header_p = 1;
       else /* if (*p == 4) */
-       ip->system_header_p = 2;
+  ip->system_header_p = 2;
 
       CPP_SET_WRITTEN (pfile, num_start);
       token = get_directive_token (pfile);
       p = pfile->token_buffer + num_start;
       if (token == CPP_NUMBER && p[1] == '\0' && (*p == '3' || *p== '4')) {
-       ip->system_header_p = *p == 3 ? 1 : 2;
-       token = get_directive_token (pfile);
+  ip->system_header_p = *p == 3 ? 1 : 2;
+  token = get_directive_token (pfile);
       }
       if (token != CPP_VSPACE) {
-       cpp_error (pfile, "invalid format `#line' command");
-       goto bad_line_directive;
+  cpp_error (pfile, "invalid format `#line' command");
+  goto bad_line_directive;
       }
     }
 
@@ -3860,13 +3860,13 @@ do_line (
       &fname_table[hashf (fname, fname_length, FNAME_HASHSIZE)];
     for (hp = *hash_bucket; hp != NULL; hp = hp->next)
       if (hp->length == fname_length &&
-         strncmp (hp->value.cpval, fname, fname_length) == 0) {
-       ip->nominal_fname = hp->value.cpval;
-       break;
+    strncmp (hp->value.cpval, fname, fname_length) == 0) {
+  ip->nominal_fname = hp->value.cpval;
+  break;
       }
     if (hp == 0) {
       /* Didn't find it; cons up a new one.  */
-      hp = (HASHNODE *) Safe_calloc(sizeof (HASHNODE) + fname_length + 1);
+      hp = (HASHNODE *) Safe_calloc(1,sizeof (HASHNODE) + fname_length + 1);
       hp->next = *hash_bucket;
       *hash_bucket = hp;
 
@@ -3916,11 +3916,11 @@ do_undef (
   while ((hp = cpp_lookup (pfile, buf, sym_length, -1)) != NULL)
     {
       /* If we are generating additional info for debugging (with -g) we
-        need to pass through all effective #undef commands.  */
+   need to pass through all effective #undef commands.  */
       if (CPP_OPTIONS (pfile)->debug_output && keyword)
-       pass_thru_directive (orig_buf, limit, pfile, keyword);
+  pass_thru_directive (orig_buf, limit, pfile, keyword);
       if (hp->type != T_MACRO)
-       cpp_warning (pfile, "undefining `%s'", hp->name);
+  cpp_warning (pfile, "undefining `%s'", hp->name);
       delete_macro (hp);
     }
 
@@ -3988,12 +3988,12 @@ do_once (
   for (ip = CPP_BUFFER (pfile); ; ip = CPP_PREV_BUFFER (ip))
     {
       if (ip == NULL)
-       return 0;
+  return 0;
       if (ip->fname != NULL)
-       break;
+  break;
     }
 
-    
+
   new = (struct file_name_list *) Safe_malloc (sizeof (struct file_name_list));
   new->next = pfile->dont_repeat_files;
   pfile->dont_repeat_files = new;
@@ -4057,14 +4057,14 @@ do_pragma (
     fname = p + 1;
     p = (U_CHAR *) index (fname, '\"');
     fname_len = p != NULL ? p - fname : strlen (fname);
-    
+
     for (ptr = pfile->all_include_files; ptr; ptr = ptr->next) {
       inc_fname = (U_CHAR *) rindex (ptr->fname, '/');
       inc_fname = inc_fname ? inc_fname + 1 : (U_CHAR *) ptr->fname;
       if (inc_fname && !strncmp (inc_fname, fname, fname_len))
-       cpp_warning (pfile,
-          "`#pragma implementation' for `%s' appears after file is included",
-                    fname);
+  cpp_warning (pfile,
+     "`#pragma implementation' for `%s' appears after file is included",
+         fname);
     }
   }
 
@@ -4114,8 +4114,8 @@ do_sccs (
 /*
  * handle #if command by
  *   1) inserting special `defined' keyword into the hash table
- *     that gets turned into 0 or 1 by special_symbol (thus,
- *     if the luser has a symbol called `defined' already, it won't
+ *  that gets turned into 0 or 1 by special_symbol (thus,
+ *  if the luser has a symbol called `defined' already, it won't
  *      work inside the #if command)
  *   2) rescan the input into a temporary output buffer
  *   3) pass the output buffer to the yacc parser and collect a value
@@ -4156,9 +4156,9 @@ do_elif (
       fprintf (stderr, " (matches line %d", pfile->if_stack->lineno);
 #endif
       if (pfile->if_stack->fname != NULL && CPP_BUFFER (pfile)->fname != NULL
-         && strcmp (pfile->if_stack->fname,
-                    CPP_BUFFER (pfile)->nominal_fname) != 0)
-       fprintf (stderr, ", file %s", pfile->if_stack->fname);
+    && strcmp (pfile->if_stack->fname,
+         CPP_BUFFER (pfile)->nominal_fname) != 0)
+  fprintf (stderr, ", file %s", pfile->if_stack->fname);
       fprintf (stderr, ")\n");
     }
     pfile->if_stack->type = T_ELIF;
@@ -4171,7 +4171,7 @@ do_elif (
     if (value == 0)
       skip_if_group (pfile, 0);
     else {
-      ++pfile->if_stack->if_succeeded; /* continue processing input */
+      ++pfile->if_stack->if_succeeded;  /* continue processing input */
       output_line_command (pfile, 1, same_file);
     }
   }
@@ -4197,7 +4197,7 @@ eval_if_expression (
 
   value = cpp_parse_expr (pfile);
   pfile->pcp_inside_if = 0;
-  delete_macro (save_defined); /* clean up special symbol */
+  delete_macro (save_defined);  /* clean up special symbol */
 
   CPP_SET_WRITTEN (pfile, old_written); /* Pop */
 
@@ -4241,23 +4241,23 @@ do_xifdef (
     {
       skip = (keyword->type == T_IFDEF);
       if (! CPP_TRADITIONAL (pfile))
-       cpp_pedwarn (pfile, "`#%s' with no argument", keyword->name);
+  cpp_pedwarn (pfile, "`#%s' with no argument", keyword->name);
     }
   else if (token == CPP_NAME)
     {
       HASHNODE *hp = cpp_lookup (pfile, ident, ident_length, -1);
       skip = (hp == NULL) ^ (keyword->type == T_IFNDEF);
       if (start_of_file && !skip)
-       {
-         control_macro = (U_CHAR *) Safe_malloc (ident_length + 1);
-         bcopy (ident, control_macro, ident_length + 1);
-       }
+  {
+    control_macro = (U_CHAR *) Safe_malloc (ident_length + 1);
+    bcopy (ident, control_macro, ident_length + 1);
+  }
     }
   else
     {
       skip = (keyword->type == T_IFDEF);
       if (! CPP_TRADITIONAL (pfile))
-       cpp_error (pfile, "`#%s' with invalid argument", keyword->name);
+  cpp_error (pfile, "`#%s' with invalid argument", keyword->name);
     }
 
   if (!CPP_TRADITIONAL (pfile))
@@ -4265,7 +4265,7 @@ do_xifdef (
       cpp_skip_hspace (pfile);
       c = PEEKC ();
       if (c != EOF && c != '\n')
-       cpp_pedwarn (pfile, "garbage at end of `#%s' argument", keyword->name);
+  cpp_pedwarn (pfile, "garbage at end of `#%s' argument", keyword->name);
     }
   skip_rest_of_line (pfile);
 
@@ -4273,13 +4273,13 @@ do_xifdef (
     if (pcp_outfile) {
       /* Output a precondition for this macro.  */
       if (hp && hp->value.defn->predefined)
-       fprintf (pcp_outfile, "#define %s\n", hp->name);
+  fprintf (pcp_outfile, "#define %s\n", hp->name);
       else {
-       U_CHAR *cp = buf;
-       fprintf (pcp_outfile, "#undef ");
-       while (is_idchar[*cp]) /* Ick! */
-         fputc (*cp++, pcp_outfile);
-       putc ('\n', pcp_outfile);
+  U_CHAR *cp = buf;
+  fprintf (pcp_outfile, "#undef ");
+  while (is_idchar[*cp]) /* Ick! */
+    fputc (*cp++, pcp_outfile);
+  putc ('\n', pcp_outfile);
       }
 #endif
 
@@ -4301,7 +4301,7 @@ conditional_skip (
 {
   IF_STACK_FRAME *temp;
 
-  temp = (IF_STACK_FRAME *) Safe_calloc(sizeof (IF_STACK_FRAME));
+  temp = (IF_STACK_FRAME *) Safe_calloc(1,sizeof (IF_STACK_FRAME));
   temp->fname = CPP_BUFFER (pfile)->nominal_fname;
 #if 0
   temp->lineno = CPP_BUFFER (pfile)->lineno;
@@ -4373,7 +4373,7 @@ skip_if_group (
       pfile->limit = ident;
 #if 0
       if (ident_length == 0)
-       goto not_a_directive;
+  goto not_a_directive;
 
       /* Handle # followed by a line number.  */
 
@@ -4381,95 +4381,95 @@ skip_if_group (
 #endif
 
       for (kt = directive_table; kt->length >= 0; kt++)
-       {
-         IF_STACK_FRAME *temp;
-         if (ident_length == kt->length
-             && strncmp (ident, kt->name, kt->length) == 0)
-           {
-             /* If we are asked to return on next directive, do so now.  */
-             if (any)
-               goto done;
-
-             switch (kt->type)
-               {
-               case T_IF:
-               case T_IFDEF:
-               case T_IFNDEF:
-                 temp
-                   = (IF_STACK_FRAME *) Safe_calloc(sizeof (IF_STACK_FRAME));
-                 temp->next = pfile->if_stack;
-                 pfile->if_stack = temp;
+  {
+    IF_STACK_FRAME *temp;
+    if (ident_length == kt->length
+        && strncmp (ident, kt->name, kt->length) == 0)
+      {
+        /* If we are asked to return on next directive, do so now.  */
+        if (any)
+    goto done;
+
+        switch (kt->type)
+    {
+    case T_IF:
+    case T_IFDEF:
+    case T_IFNDEF:
+      temp
+        = (IF_STACK_FRAME *) Safe_calloc(1,sizeof (IF_STACK_FRAME));
+      temp->next = pfile->if_stack;
+      pfile->if_stack = temp;
 #if 0
-                 temp->lineno = CPP_BUFFER(pfile)->lineno;
+      temp->lineno = CPP_BUFFER(pfile)->lineno;
 #endif
-                 temp->fname = CPP_BUFFER(pfile)->nominal_fname;
-                 temp->type = kt->type;
-                 break;
-               case T_ELSE:
-               case T_ENDIF:
-                 if (CPP_PEDANTIC (pfile) && pfile->if_stack != save_if_stack)
-                   validate_else (pfile,
-                                  kt->type == T_ELSE ? "#else" : "#endif");
-               case T_ELIF:
-                 if (pfile->if_stack == CPP_BUFFER (pfile)->if_stack)
-                   {
-                     cpp_error (pfile,
-                                "`#%s' not within a conditional", kt->name);
-                     break;
-                   }
-                 else if (pfile->if_stack == save_if_stack)
-                   goto done;          /* found what we came for */
-
-                 if (kt->type != T_ENDIF)
-                   {
-                     if (pfile->if_stack->type == T_ELSE)
-                       cpp_error (pfile, "`#else' or `#elif' after `#else'");
-                     pfile->if_stack->type = kt->type;
-                     break;
-                   }
-
-                 temp = pfile->if_stack;
-                 pfile->if_stack = temp->next;
-                 free (temp);
-                 break;
-             default: ;
-               }
-             break;
-           }
-         /* Don't let erroneous code go by.  */
-         if (kt->length < 0 && !CPP_OPTIONS (pfile)->lang_asm
-             && CPP_PEDANTIC (pfile))
-           cpp_pedwarn (pfile, "invalid preprocessor directive name");
-       }
+      temp->fname = CPP_BUFFER(pfile)->nominal_fname;
+      temp->type = kt->type;
+      break;
+    case T_ELSE:
+    case T_ENDIF:
+      if (CPP_PEDANTIC (pfile) && pfile->if_stack != save_if_stack)
+        validate_else (pfile,
+           kt->type == T_ELSE ? "#else" : "#endif");
+    case T_ELIF:
+      if (pfile->if_stack == CPP_BUFFER (pfile)->if_stack)
+        {
+          cpp_error (pfile,
+         "`#%s' not within a conditional", kt->name);
+          break;
+        }
+      else if (pfile->if_stack == save_if_stack)
+        goto done;    /* found what we came for */
+
+      if (kt->type != T_ENDIF)
+        {
+          if (pfile->if_stack->type == T_ELSE)
+      cpp_error (pfile, "`#else' or `#elif' after `#else'");
+          pfile->if_stack->type = kt->type;
+          break;
+        }
+
+      temp = pfile->if_stack;
+      pfile->if_stack = temp->next;
+      free (temp);
+      break;
+        default: ;
+    }
+        break;
+      }
+    /* Don't let erroneous code go by.  */
+    if (kt->length < 0 && !CPP_OPTIONS (pfile)->lang_asm
+        && CPP_PEDANTIC (pfile))
+      cpp_pedwarn (pfile, "invalid preprocessor directive name");
+  }
       c = GETC ();
     }
   /* We're in the middle of a line.  Skip the rest of it. */
   for (;;) {
     switch (c)
       {
-       long old;
+  long old;
       case EOF:
-       goto done;
-      case '/':                        /* possible comment */
-       c = skip_comment (pfile, NULL);
-       if (c == EOF)
-         goto done;
-       break;
+  goto done;
+      case '/':     /* possible comment */
+  c = skip_comment (pfile, NULL);
+  if (c == EOF)
+    goto done;
+  break;
       case '\"':
       case '\'':
-       FORWARD(-1);
-       old = CPP_WRITTEN (pfile);
-       cpp_get_token (pfile);
-       CPP_SET_WRITTEN (pfile, old);
-       break;
+  FORWARD(-1);
+  old = CPP_WRITTEN (pfile);
+  cpp_get_token (pfile);
+  CPP_SET_WRITTEN (pfile, old);
+  break;
       case '\\':
-       /* Char after backslash loses its special meaning.  */
-       if (PEEKC() == '\n')
-         FORWARD (1);
-       break;
+  /* Char after backslash loses its special meaning.  */
+  if (PEEKC() == '\n')
+    FORWARD (1);
+  break;
       case '\n':
-       goto beg_of_line;
-       break;
+  goto beg_of_line;
+  break;
       }
     c = GETC ();
   }
@@ -4515,7 +4515,7 @@ do_else (
       cpp_error (pfile, "`#else' after `#else'");
       fprintf (stderr, " (matches line %d", pfile->if_stack->lineno);
       if (strcmp (pfile->if_stack->fname, ip->nominal_fname) != 0)
-       fprintf (stderr, ", file %s", pfile->if_stack->fname);
+  fprintf (stderr, ", file %s", pfile->if_stack->fname);
       fprintf (stderr, ")\n");
     }
     pfile->if_stack->type = T_ELSE;
@@ -4524,7 +4524,7 @@ do_else (
   if (pfile->if_stack->if_succeeded)
     skip_if_group (pfile, 0);
   else {
-    ++pfile->if_stack->if_succeeded;   /* continue processing input */
+    ++pfile->if_stack->if_succeeded;  /* continue processing input */
     output_line_command (pfile, 1, same_file);
   }
   return 0;
@@ -4551,52 +4551,52 @@ do_endif (
       IF_STACK_FRAME *temp = pfile->if_stack;
       pfile->if_stack = temp->next;
       if (temp->control_macro != 0)
-       {
-         /* This #endif matched a #ifndef at the start of the file.
-            See if it is at the end of the file.  */
-         struct parse_marker start_mark;
-         int c;
-
-         parse_set_mark (&start_mark, pfile);
-
-         for (;;)
-           {
-             cpp_skip_hspace (pfile);
-             c = GETC ();
-             if (c != '\n')
-               break;
-           }
-         parse_goto_mark (&start_mark, pfile);
-         parse_clear_mark (&start_mark);
-
-         if (c == EOF)
-           {
-             /* If we get here, this #endif ends a #ifndef
-                that contains all of the file (aside from whitespace).
-                Arrange not to include the file again
-                if the macro that was tested is defined.
-
-                Do not do this for the top-level file in a -include or any
-                file in a -imacros.  */
+  {
+    /* This #endif matched a #ifndef at the start of the file.
+       See if it is at the end of the file.  */
+    struct parse_marker start_mark;
+    int c;
+
+    parse_set_mark (&start_mark, pfile);
+
+    for (;;)
+      {
+        cpp_skip_hspace (pfile);
+        c = GETC ();
+        if (c != '\n')
+    break;
+      }
+    parse_goto_mark (&start_mark, pfile);
+    parse_clear_mark (&start_mark);
+
+    if (c == EOF)
+      {
+        /* If we get here, this #endif ends a #ifndef
+     that contains all of the file (aside from whitespace).
+     Arrange not to include the file again
+     if the macro that was tested is defined.
+
+     Do not do this for the top-level file in a -include or any
+     file in a -imacros.  */
 #if 0
 FIXME!
-             if (indepth != 0
-                 && ! (indepth == 1 && pfile->no_record_file)
-                 && ! (pfile->no_record_file && no_output))
+        if (indepth != 0
+      && ! (indepth == 1 && pfile->no_record_file)
+      && ! (pfile->no_record_file && no_output))
 #endif
-               {
-                 struct file_name_list *ifile = pfile->all_include_files;
-                 
-                 for ( ; ifile != NULL; ifile = ifile->next)
-                   {
-                     if (!strcmp (ifile->fname, CPP_BUFFER (pfile)->fname))
-                       {
-                         ifile->control_macro = temp->control_macro;
-                         break;
-                       }
-                   }
-               }
-           }
+    {
+      struct file_name_list *ifile = pfile->all_include_files;
+
+      for ( ; ifile != NULL; ifile = ifile->next)
+        {
+          if (!strcmp (ifile->fname, CPP_BUFFER (pfile)->fname))
+      {
+        ifile->control_macro = temp->control_macro;
+        break;
+      }
+        }
+    }
+      }
         }
       free (temp);
       output_line_command (pfile, 1, same_file);
@@ -4618,12 +4618,12 @@ validate_else (
   c = PEEKC ();
   if (c != EOF && c != '\n')
     cpp_pedwarn (pfile,
-                "text following `%s' violates ANSI standard", directive);
+     "text following `%s' violates ANSI standard", directive);
 }
 
 /* Get the next token, and add it to the text in pfile->token_buffer.
    Return the kind of token we got. */
-  
+
 
 enum cpp_token
 cpp_get_token (
@@ -4641,629 +4641,629 @@ cpp_get_token (
     {
     handle_eof:
       if (CPP_BUFFER (pfile)->seen_eof)
-       {
-         if (cpp_pop_buffer (pfile) != CPP_NULL_BUFFER (pfile))
-           goto get_next;
-         else
-           return CPP_EOF;
-       }
+  {
+    if (cpp_pop_buffer (pfile) != CPP_NULL_BUFFER (pfile))
+      goto get_next;
+    else
+      return CPP_EOF;
+  }
       else
-       {
-         cpp_buffer *next_buf
-           = CPP_PREV_BUFFER (CPP_BUFFER (pfile));
-         CPP_BUFFER (pfile)->seen_eof = 1;
-         if (CPP_BUFFER (pfile)->nominal_fname && next_buf != 0)
-           {
-             /* We're about to return from an #include file.
-                Emit #line information now (as part of the CPP_POP) result.
-                But the #line refers to the file we will pop to. */
-             cpp_buffer *cur_buffer = CPP_BUFFER (pfile);
-             CPP_BUFFER (pfile) = next_buf;
-             pfile->input_stack_listing_current = 0;
-             output_line_command (pfile, 0, leave_file);
-             CPP_BUFFER (pfile) = cur_buffer;
-           }
-         return CPP_POP;
-       }
+  {
+    cpp_buffer *next_buf
+      = CPP_PREV_BUFFER (CPP_BUFFER (pfile));
+    CPP_BUFFER (pfile)->seen_eof = 1;
+    if (CPP_BUFFER (pfile)->nominal_fname && next_buf != 0)
+      {
+        /* We're about to return from an #include file.
+     Emit #line information now (as part of the CPP_POP) result.
+     But the #line refers to the file we will pop to. */
+        cpp_buffer *cur_buffer = CPP_BUFFER (pfile);
+        CPP_BUFFER (pfile) = next_buf;
+        pfile->input_stack_listing_current = 0;
+        output_line_command (pfile, 0, leave_file);
+        CPP_BUFFER (pfile) = cur_buffer;
+      }
+    return CPP_POP;
+  }
     }
   else
     {
       switch (c)
-       {
-         long newlines;
-         struct parse_marker start_mark;
-       case '/':
-         if (PEEKC () == '=')
-           goto op2;
-         if (opts->put_out_comments)
-           parse_set_mark (&start_mark, pfile);
-         newlines = 0;
-         cpp_buf_line_and_col (cpp_file_buffer (pfile),
-                               &start_line, &start_column);
-         c = skip_comment (pfile, &newlines);
-         if (opts->put_out_comments && (c == '/' || c == EOF))
-           parse_clear_mark (&start_mark);
-         if (c == '/')
-           goto randomchar;
-         if (c == EOF)
-           {
-             cpp_error_with_line (pfile, start_line, start_column,
-                                  "unterminated comment");
-             goto handle_eof;
-           }
-         c = '/';  /* Initial letter of comment. */
-       return_comment:
-         /* Comments are equivalent to spaces.
-            For -traditional, a comment is equivalent to nothing.  */
-         if (opts->put_out_comments)
-           {
-             cpp_buffer *pbuf = CPP_BUFFER (pfile);
-             long dummy;
-             U_CHAR *start = pbuf->buf + start_mark.position;
-             int len = pbuf->cur - start;
-             CPP_RESERVE(pfile, 1 + len);
-             CPP_PUTC_Q (pfile, c);
-             CPP_PUTS_Q (pfile, start, len);
-             pfile->lineno += newlines;
-             parse_clear_mark (&start_mark);
-             return CPP_COMMENT;
-           }
-         else if (CPP_TRADITIONAL (pfile))
-           {
-             return CPP_COMMENT;
-           }
-         else
-           {
+  {
+    long newlines;
+    struct parse_marker start_mark;
+  case '/':
+    if (PEEKC () == '=')
+      goto op2;
+    if (opts->put_out_comments)
+      parse_set_mark (&start_mark, pfile);
+    newlines = 0;
+    cpp_buf_line_and_col (cpp_file_buffer (pfile),
+        &start_line, &start_column);
+    c = skip_comment (pfile, &newlines);
+    if (opts->put_out_comments && (c == '/' || c == EOF))
+      parse_clear_mark (&start_mark);
+    if (c == '/')
+      goto randomchar;
+    if (c == EOF)
+      {
+        cpp_error_with_line (pfile, start_line, start_column,
+           "unterminated comment");
+        goto handle_eof;
+      }
+    c = '/';  /* Initial letter of comment. */
+  return_comment:
+    /* Comments are equivalent to spaces.
+       For -traditional, a comment is equivalent to nothing.  */
+    if (opts->put_out_comments)
+      {
+        cpp_buffer *pbuf = CPP_BUFFER (pfile);
+        long dummy;
+        U_CHAR *start = pbuf->buf + start_mark.position;
+        int len = pbuf->cur - start;
+        CPP_RESERVE(pfile, 1 + len);
+        CPP_PUTC_Q (pfile, c);
+        CPP_PUTS_Q (pfile, start, len);
+        pfile->lineno += newlines;
+        parse_clear_mark (&start_mark);
+        return CPP_COMMENT;
+      }
+    else if (CPP_TRADITIONAL (pfile))
+      {
+        return CPP_COMMENT;
+      }
+    else
+      {
 #if 0
-             /* This may not work if cpp_get_token is called recursively,
-                since many places look for horizontal space. */
-             if (newlines)
-               {
-                 /* Copy the newlines into the output buffer, in order to
-                    avoid the pain of a #line every time a multiline comment
-                    is seen.  */
-                 CPP_RESERVE(pfile, newlines);
-                 while (--newlines >= 0)
-                   {
-                     CPP_PUTC_Q (pfile, '\n');
-                     pfile->lineno++;
-                   }
-                 return CPP_VSPACE;
-               }
+        /* This may not work if cpp_get_token is called recursively,
+     since many places look for horizontal space. */
+        if (newlines)
+    {
+      /* Copy the newlines into the output buffer, in order to
+         avoid the pain of a #line every time a multiline comment
+         is seen.  */
+      CPP_RESERVE(pfile, newlines);
+      while (--newlines >= 0)
+        {
+          CPP_PUTC_Q (pfile, '\n');
+          pfile->lineno++;
+        }
+      return CPP_VSPACE;
+    }
 #endif
-             CPP_RESERVE(pfile, 1);
-             CPP_PUTC_Q (pfile, ' ');
-             return CPP_HSPACE;
-           }
+        CPP_RESERVE(pfile, 1);
+        CPP_PUTC_Q (pfile, ' ');
+        return CPP_HSPACE;
+      }
 #if 0
-         if (opts->for_lint) {
-           U_CHAR *argbp;
-           int cmdlen, arglen;
-           char *lintcmd = get_lintcmd (ibp, limit, &argbp, &arglen, &cmdlen);
-           
-           if (lintcmd != NULL) {
-             /* I believe it is always safe to emit this newline: */
-             obp[-1] = '\n';
-             bcopy ("#pragma lint ", (char *) obp, 13);
-             obp += 13;
-             bcopy (lintcmd, (char *) obp, cmdlen);
-             obp += cmdlen;
-
-             if (arglen != 0) {
-               *(obp++) = ' ';
-               bcopy (argbp, (char *) obp, arglen);
-               obp += arglen;
-             }
-
-             /* OK, now bring us back to the state we were in before we entered
-                this branch.  We need #line b/c the newline for the pragma
-                could fuck things up. */
-             output_line_command (pfile, 0, same_file);
-             *(obp++) = ' ';   /* just in case, if comments are copied thru */
-             *(obp++) = '/';
-           }
-         }
+    if (opts->for_lint) {
+      U_CHAR *argbp;
+      int cmdlen, arglen;
+      char *lintcmd = get_lintcmd (ibp, limit, &argbp, &arglen, &cmdlen);
+
+      if (lintcmd != NULL) {
+        /* I believe it is always safe to emit this newline: */
+        obp[-1] = '\n';
+        bcopy ("#pragma lint ", (char *) obp, 13);
+        obp += 13;
+        bcopy (lintcmd, (char *) obp, cmdlen);
+        obp += cmdlen;
+
+        if (arglen != 0) {
+    *(obp++) = ' ';
+    bcopy (argbp, (char *) obp, arglen);
+    obp += arglen;
+        }
+
+        /* OK, now bring us back to the state we were in before we entered
+     this branch.  We need #line b/c the newline for the pragma
+     could fuck things up. */
+        output_line_command (pfile, 0, same_file);
+        *(obp++) = ' '; /* just in case, if comments are copied thru */
+        *(obp++) = '/';
+      }
+    }
 #endif
 
-       case '#':
+  case '#':
 #if 0
-         /* If this is expanding a macro definition, don't recognize
-            preprocessor directives.  */
-         if (ip->macro != 0)
-           goto randomchar;
-         /* If this is expand_into_temp_buffer, recognize them
-            only after an actual newline at this level,
-            not at the beginning of the input level.  */
-         if (ip->fname == 0 && beg_of_line == ip->buf)
-           goto randomchar;
-         if (ident_length)
-           goto specialchar;
+    /* If this is expanding a macro definition, don't recognize
+       preprocessor directives.  */
+    if (ip->macro != 0)
+      goto randomchar;
+    /* If this is expand_into_temp_buffer, recognize them
+       only after an actual newline at this level,
+       not at the beginning of the input level.  */
+    if (ip->fname == 0 && beg_of_line == ip->buf)
+      goto randomchar;
+    if (ident_length)
+      goto specialchar;
 #endif
 
-         if (!pfile->only_seen_white)
-           goto randomchar;
-         if (handle_directive (pfile))
-           return CPP_DIRECTIVE;
-         pfile->only_seen_white = 0;
-         return CPP_OTHER;
-
-       case '\"':
-       case '\'':
-         /* A single quoted string is treated like a double -- some
-            programs (e.g., troff) are perverse this way */
-         cpp_buf_line_and_col (cpp_file_buffer (pfile),
-                               &start_line, &start_column);
-         old_written = CPP_WRITTEN (pfile);
-       string:
-         CPP_PUTC (pfile, c);
-         while (1)
-           {
-             int cc = GETC();
-             if (cc == EOF)
-               {
-                 if (CPP_IS_MACRO_BUFFER (CPP_BUFFER (pfile)))
-                   {
-                     /* try harder: this string crosses a macro expansion
-                        boundary.  This can happen naturally if -traditional.
-                        Otherwise, only -D can make a macro with an unmatched
-                        quote.  */
-                       cpp_buffer *next_buf
-                           = CPP_PREV_BUFFER (CPP_BUFFER (pfile));
-                       (*CPP_BUFFER (pfile)->cleanup)
-                           (CPP_BUFFER (pfile), pfile);
-                       CPP_BUFFER (pfile) = next_buf;
-                       continue;
-                   }
-                 if (!CPP_TRADITIONAL (pfile))
-                   {
-                     cpp_error_with_line (pfile, start_line, start_column,
-                             "unterminated string or character constant");
-                     if (pfile->multiline_string_line != start_line
-                         && pfile->multiline_string_line != 0)
-                       cpp_error_with_line (pfile,
-                                            pfile->multiline_string_line, -1,
-                              "possible real start of unterminated constant");
-                     pfile->multiline_string_line = 0;
-                   }
-                 break;
-               }
-             CPP_PUTC (pfile, cc);
-             switch (cc)
-               {
-               case '\n':
-                 /* Traditionally, end of line ends a string constant with
-                no error.  So exit the loop and record the new line.  */
-                 if (CPP_TRADITIONAL (pfile))
-                   goto while2end;
-                 if (c == '\'')
-                   {
-                     cpp_error_with_line (pfile, start_line, start_column,
-                                          "unterminated character constant");
-                     goto while2end;
-                   }
-                 if (CPP_PEDANTIC (pfile)
-                     && pfile->multiline_string_line == 0)
-                   {
-                     cpp_pedwarn_with_line (pfile, start_line, start_column,
-                              "string constant runs past end of line");
-                   }
-                 if (pfile->multiline_string_line == 0)
-                   pfile->multiline_string_line = start_line;
-                 break;
-               
-               case '\\':
-                 cc = GETC();
-                 if (cc == '\n')
-                   {
-                     /* Backslash newline is replaced by nothing at all. */
-                     CPP_ADJUST_WRITTEN (pfile, -1);
-                     pfile->lineno++;
-                   }
-                 else
-                   {
-                     /* ANSI stupidly requires that in \\ the second \
-                        is *not* prevented from combining with a newline.  */
-                     NEWLINE_FIX1(cc);
-                     if (cc != EOF)
-                       CPP_PUTC (pfile, cc);
-                   }
-                 break;
-
-               case '\"':
-               case '\'':
-                 if (cc == c)
-                   goto while2end;
-                 break;
-               }
-           }
-       while2end:
-         pfile->lineno += count_newlines (pfile->token_buffer + old_written,
-                                          CPP_PWRITTEN (pfile));
-         pfile->only_seen_white = 0;
-         return c == '\'' ? CPP_CHAR : CPP_STRING;
-
-       case '$':
-         if (!opts->dollars_in_ident)
-           goto randomchar;
-         goto letter;
-
-       case ':':
-         if (opts->cplusplus && PEEKC () == ':')
-           goto op2;
-         goto randomchar;
-
-       case '&':
-       case '+':
-       case '|':
-         NEWLINE_FIX;
-         c2 = PEEKC ();
-         if (c2 == c || c2 == '=')
-           goto op2;
-         goto randomchar;
-
-       case '*':
-       case '!':
-       case '%':
-       case '=':
-       case '^':
-         NEWLINE_FIX;
-         if (PEEKC () == '=')
-           goto op2;
-         goto randomchar;
-
-       case '-':
-         NEWLINE_FIX;
-         c2 = PEEKC ();
-         if (c2 == '-' && opts->chill)
-           {
-             /* Chill style comment */
-             if (opts->put_out_comments)
-               parse_set_mark (&start_mark, pfile);
-             FORWARD(1);  /* Skip second '-'. */
-             for (;;)
-               {
-                 c = GETC ();
-                 if (c == EOF)
-                   break;
-                 if (c == '\n')
-                   {
-                     /* Don't consider final '\n' to be part of comment. */
-                     FORWARD(-1);
-                     break;
-                   }
-               }
-             c = '-';
-             goto return_comment;
-           }
-         if (c2 == '-' || c2 == '=' || c2 == '>')
-           goto op2;
-         goto randomchar;
-
-       case '<':
-         if (pfile->parsing_include_directive)
-           {
-             for (;;)
-               {
-                 CPP_PUTC (pfile, c);
-                 if (c == '>')
-                   break;
-                 c = GETC ();
-                 NEWLINE_FIX1 (c);
-                 if (c == '\n' || c == EOF)
-                   {
-                     cpp_error (pfile,
-                                "missing '>' in `#include <FILENAME>'");
-                     break;
-                   }
-               }
-             return CPP_STRING;
-           }
-         /* else fall through */
-       case '>':
-         NEWLINE_FIX;
-         c2 = PEEKC ();
-         if (c2 == '=')
-           goto op2;
-         if (c2 != c)
-           goto randomchar;
-         FORWARD(1);
-         CPP_RESERVE (pfile, 4);
-         CPP_PUTC (pfile, c);
-         CPP_PUTC (pfile, c2);
-         NEWLINE_FIX;
-         c3 = PEEKC ();
-         if (c3 == '=')
-           CPP_PUTC_Q (pfile, GETC ());
-         CPP_NUL_TERMINATE_Q (pfile);
-         pfile->only_seen_white = 0;
-         return CPP_OTHER;
-
-       case '@':
-         if (CPP_BUFFER (pfile)->has_escapes)
-           {
-             c = GETC ();
-             if (c == '-')
-               {
-                 if (pfile->output_escapes)
-                   CPP_PUTS (pfile, "@-", 2);
-                 parse_name (pfile, GETC ());
-                 return CPP_NAME;
-               }
-             else if (is_space [c])
-               {
-                 CPP_RESERVE (pfile, 2);
-                 if (pfile->output_escapes)
-                   CPP_PUTC_Q (pfile, '@');
-                 CPP_PUTC_Q (pfile, c);
-                 return CPP_HSPACE;
-               }
-           }
-         if (pfile->output_escapes)
-           {
-             CPP_PUTS (pfile, "@@", 2);
-             return CPP_OTHER;
-           }
-         goto randomchar;
-
-       case '.':
-         NEWLINE_FIX;
-         c2 = PEEKC ();
-         if (isdigit(c2))
-           {
-             CPP_RESERVE(pfile, 2);
-             CPP_PUTC_Q (pfile, '.');
-             c = GETC ();
-             goto number;
-           }
-         /* FIXME - misses the case "..\\\n." */
-         if (c2 == '.' && PEEKN(1) == '.')
-           {
-             CPP_RESERVE(pfile, 4);
-             CPP_PUTC_Q (pfile, '.');
-             CPP_PUTC_Q (pfile, '.');
-             CPP_PUTC_Q (pfile, '.');
-             FORWARD (2);
-             CPP_NUL_TERMINATE_Q (pfile);
-             pfile->only_seen_white = 0;
-             return CPP_3DOTS;
-           }
-         goto randomchar;
-
-       op2:
-         token = CPP_OTHER;
-         pfile->only_seen_white = 0;
+    if (!pfile->only_seen_white)
+      goto randomchar;
+    if (handle_directive (pfile))
+      return CPP_DIRECTIVE;
+    pfile->only_seen_white = 0;
+    return CPP_OTHER;
+
+  case '\"':
+  case '\'':
+    /* A single quoted string is treated like a double -- some
+       programs (e.g., troff) are perverse this way */
+    cpp_buf_line_and_col (cpp_file_buffer (pfile),
+        &start_line, &start_column);
+    old_written = CPP_WRITTEN (pfile);
+  string:
+    CPP_PUTC (pfile, c);
+    while (1)
+      {
+        int cc = GETC();
+        if (cc == EOF)
+    {
+      if (CPP_IS_MACRO_BUFFER (CPP_BUFFER (pfile)))
+        {
+          /* try harder: this string crosses a macro expansion
+       boundary.  This can happen naturally if -traditional.
+       Otherwise, only -D can make a macro with an unmatched
+       quote.  */
+      cpp_buffer *next_buf
+          = CPP_PREV_BUFFER (CPP_BUFFER (pfile));
+      (*CPP_BUFFER (pfile)->cleanup)
+          (CPP_BUFFER (pfile), pfile);
+      CPP_BUFFER (pfile) = next_buf;
+      continue;
+        }
+      if (!CPP_TRADITIONAL (pfile))
+        {
+          cpp_error_with_line (pfile, start_line, start_column,
+            "unterminated string or character constant");
+          if (pfile->multiline_string_line != start_line
+        && pfile->multiline_string_line != 0)
+      cpp_error_with_line (pfile,
+               pfile->multiline_string_line, -1,
+             "possible real start of unterminated constant");
+          pfile->multiline_string_line = 0;
+        }
+      break;
+    }
+        CPP_PUTC (pfile, cc);
+        switch (cc)
+    {
+    case '\n':
+      /* Traditionally, end of line ends a string constant with
+     no error.  So exit the loop and record the new line.  */
+      if (CPP_TRADITIONAL (pfile))
+        goto while2end;
+      if (c == '\'')
+        {
+          cpp_error_with_line (pfile, start_line, start_column,
+             "unterminated character constant");
+          goto while2end;
+        }
+      if (CPP_PEDANTIC (pfile)
+          && pfile->multiline_string_line == 0)
+        {
+          cpp_pedwarn_with_line (pfile, start_line, start_column,
+             "string constant runs past end of line");
+        }
+      if (pfile->multiline_string_line == 0)
+        pfile->multiline_string_line = start_line;
+      break;
+
+    case '\\':
+      cc = GETC();
+      if (cc == '\n')
+        {
+          /* Backslash newline is replaced by nothing at all. */
+          CPP_ADJUST_WRITTEN (pfile, -1);
+          pfile->lineno++;
+        }
+      else
+        {
+          /* ANSI stupidly requires that in \\ the second \
+       is *not* prevented from combining with a newline.  */
+          NEWLINE_FIX1(cc);
+          if (cc != EOF)
+      CPP_PUTC (pfile, cc);
+        }
+      break;
+
+    case '\"':
+    case '\'':
+      if (cc == c)
+        goto while2end;
+      break;
+    }
+      }
+  while2end:
+    pfile->lineno += count_newlines (pfile->token_buffer + old_written,
+             CPP_PWRITTEN (pfile));
+    pfile->only_seen_white = 0;
+    return c == '\'' ? CPP_CHAR : CPP_STRING;
+
+  case '$':
+    if (!opts->dollars_in_ident)
+      goto randomchar;
+    goto letter;
+
+  case ':':
+    if (opts->cplusplus && PEEKC () == ':')
+      goto op2;
+    goto randomchar;
+
+  case '&':
+  case '+':
+  case '|':
+    NEWLINE_FIX;
+    c2 = PEEKC ();
+    if (c2 == c || c2 == '=')
+      goto op2;
+    goto randomchar;
+
+  case '*':
+  case '!':
+  case '%':
+  case '=':
+  case '^':
+    NEWLINE_FIX;
+    if (PEEKC () == '=')
+      goto op2;
+    goto randomchar;
+
+  case '-':
+    NEWLINE_FIX;
+    c2 = PEEKC ();
+    if (c2 == '-' && opts->chill)
+      {
+        /* Chill style comment */
+        if (opts->put_out_comments)
+    parse_set_mark (&start_mark, pfile);
+        FORWARD(1);  /* Skip second '-'. */
+        for (;;)
+    {
+      c = GETC ();
+      if (c == EOF)
+        break;
+      if (c == '\n')
+        {
+          /* Don't consider final '\n' to be part of comment. */
+          FORWARD(-1);
+          break;
+        }
+    }
+        c = '-';
+        goto return_comment;
+      }
+    if (c2 == '-' || c2 == '=' || c2 == '>')
+      goto op2;
+    goto randomchar;
+
+  case '<':
+    if (pfile->parsing_include_directive)
+      {
+        for (;;)
+    {
+      CPP_PUTC (pfile, c);
+      if (c == '>')
+        break;
+      c = GETC ();
+      NEWLINE_FIX1 (c);
+      if (c == '\n' || c == EOF)
+        {
+          cpp_error (pfile,
+         "missing '>' in `#include <FILENAME>'");
+          break;
+        }
+    }
+        return CPP_STRING;
+      }
+    /* else fall through */
+  case '>':
+    NEWLINE_FIX;
+    c2 = PEEKC ();
+    if (c2 == '=')
+      goto op2;
+    if (c2 != c)
+      goto randomchar;
+    FORWARD(1);
+    CPP_RESERVE (pfile, 4);
+    CPP_PUTC (pfile, c);
+    CPP_PUTC (pfile, c2);
+    NEWLINE_FIX;
+    c3 = PEEKC ();
+    if (c3 == '=')
+      CPP_PUTC_Q (pfile, GETC ());
+    CPP_NUL_TERMINATE_Q (pfile);
+    pfile->only_seen_white = 0;
+    return CPP_OTHER;
+
+  case '@':
+    if (CPP_BUFFER (pfile)->has_escapes)
+      {
+        c = GETC ();
+        if (c == '-')
+    {
+      if (pfile->output_escapes)
+        CPP_PUTS (pfile, "@-", 2);
+      parse_name (pfile, GETC ());
+      return CPP_NAME;
+    }
+        else if (is_space [c])
+    {
+      CPP_RESERVE (pfile, 2);
+      if (pfile->output_escapes)
+        CPP_PUTC_Q (pfile, '@');
+      CPP_PUTC_Q (pfile, c);
+      return CPP_HSPACE;
+    }
+      }
+    if (pfile->output_escapes)
+      {
+        CPP_PUTS (pfile, "@@", 2);
+        return CPP_OTHER;
+      }
+    goto randomchar;
+
+  case '.':
+    NEWLINE_FIX;
+    c2 = PEEKC ();
+    if (isdigit(c2))
+      {
+        CPP_RESERVE(pfile, 2);
+        CPP_PUTC_Q (pfile, '.');
+        c = GETC ();
+        goto number;
+      }
+    /* FIXME - misses the case "..\\\n." */
+    if (c2 == '.' && PEEKN(1) == '.')
+      {
+        CPP_RESERVE(pfile, 4);
+        CPP_PUTC_Q (pfile, '.');
+        CPP_PUTC_Q (pfile, '.');
+        CPP_PUTC_Q (pfile, '.');
+        FORWARD (2);
+        CPP_NUL_TERMINATE_Q (pfile);
+        pfile->only_seen_white = 0;
+        return CPP_3DOTS;
+      }
+    goto randomchar;
+
+  op2:
+    token = CPP_OTHER;
+    pfile->only_seen_white = 0;
         op2any:
-         CPP_RESERVE(pfile, 3);
-         CPP_PUTC_Q (pfile, c);
-         CPP_PUTC_Q (pfile, GETC ());
-         CPP_NUL_TERMINATE_Q (pfile);
-         return token;
-
-       case 'L':
-         NEWLINE_FIX;
-         c2 = PEEKC ();
-         if ((c2 == '\'' || c2 == '\"') && !CPP_TRADITIONAL (pfile))
-           {
-             CPP_PUTC (pfile, c);
-             c = GETC ();
-             goto string;
-           }
-         goto letter;
-
-       case '0': case '1': case '2': case '3': case '4':
-       case '5': case '6': case '7': case '8': case '9':
-       number:
-         c2  = '.';
-         for (;;)
-           {
-             CPP_RESERVE (pfile, 2);
-             CPP_PUTC_Q (pfile, c);
-             NEWLINE_FIX;
-             c = PEEKC ();
-             if (c == EOF)
-               break;
-             if (!is_idchar[c] && c != '.'
-                 && ((c2 != 'e' && c2 != 'E') || (c != '+' && c != '-')))
-               break;
-             FORWARD(1);
-             c2= c;
-           }
-         CPP_NUL_TERMINATE_Q (pfile);
-         pfile->only_seen_white = 0;
-         return CPP_NUMBER;
-       case 'b': case 'c': case 'd': case 'h': case 'o':
-       case 'B': case 'C': case 'D': case 'H': case 'O':
-         if (opts->chill && PEEKC () == '\'')
-           {
-             pfile->only_seen_white = 0;
-             CPP_RESERVE (pfile, 2);
-             CPP_PUTC_Q (pfile, c);
-             CPP_PUTC_Q (pfile, '\'');
-             FORWARD(1);
-             for (;;)
-               {
-                 c = GETC();
-                 if (c == EOF)
-                   goto chill_number_eof;
-                 if (!is_idchar[c])
-                   {
-                     if (c == '\\' && PEEKC() == '\n')
-                       {
-                         FORWARD(2);
-                         continue;
-                       }
-                     break;
-                   }
-                 CPP_PUTC (pfile, c);
-               }
-             if (c == '\'')
-               {
-                 CPP_RESERVE (pfile, 2);
-                 CPP_PUTC_Q (pfile, c);
-                 CPP_NUL_TERMINATE_Q (pfile);
-                 return CPP_STRING;
-               }
-             else
-               {
-                 FORWARD(-1);
-               chill_number_eof:
-                 CPP_NUL_TERMINATE (pfile);
-                 return CPP_NUMBER;
-               }
-           }
-         else
-           goto letter;
-       case '_':
-       case 'a': case 'e': case 'f': case 'g': case 'i': case 'j':
-       case 'k': case 'l': case 'm': case 'n': case 'p': case 'q':
-       case 'r': case 's': case 't': case 'u': case 'v': case 'w':
-       case 'x': case 'y': case 'z':
-       case 'A': case 'E': case 'F': case 'G': case 'I': case 'J':
-       case 'K': case 'M': case 'N': case 'P': case 'Q': case 'R':
-       case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
-       case 'Y': case 'Z':
+    CPP_RESERVE(pfile, 3);
+    CPP_PUTC_Q (pfile, c);
+    CPP_PUTC_Q (pfile, GETC ());
+    CPP_NUL_TERMINATE_Q (pfile);
+    return token;
+
+  case 'L':
+    NEWLINE_FIX;
+    c2 = PEEKC ();
+    if ((c2 == '\'' || c2 == '\"') && !CPP_TRADITIONAL (pfile))
+      {
+        CPP_PUTC (pfile, c);
+        c = GETC ();
+        goto string;
+      }
+    goto letter;
+
+  case '0': case '1': case '2': case '3': case '4':
+  case '5': case '6': case '7': case '8': case '9':
+  number:
+    c2  = '.';
+    for (;;)
+      {
+        CPP_RESERVE (pfile, 2);
+        CPP_PUTC_Q (pfile, c);
+        NEWLINE_FIX;
+        c = PEEKC ();
+        if (c == EOF)
+    break;
+        if (!is_idchar[c] && c != '.'
+      && ((c2 != 'e' && c2 != 'E') || (c != '+' && c != '-')))
+    break;
+        FORWARD(1);
+        c2= c;
+      }
+    CPP_NUL_TERMINATE_Q (pfile);
+    pfile->only_seen_white = 0;
+    return CPP_NUMBER;
+  case 'b': case 'c': case 'd': case 'h': case 'o':
+  case 'B': case 'C': case 'D': case 'H': case 'O':
+    if (opts->chill && PEEKC () == '\'')
+      {
+        pfile->only_seen_white = 0;
+        CPP_RESERVE (pfile, 2);
+        CPP_PUTC_Q (pfile, c);
+        CPP_PUTC_Q (pfile, '\'');
+        FORWARD(1);
+        for (;;)
+    {
+      c = GETC();
+      if (c == EOF)
+        goto chill_number_eof;
+      if (!is_idchar[c])
+        {
+          if (c == '\\' && PEEKC() == '\n')
+      {
+        FORWARD(2);
+        continue;
+      }
+          break;
+        }
+      CPP_PUTC (pfile, c);
+    }
+        if (c == '\'')
+    {
+      CPP_RESERVE (pfile, 2);
+      CPP_PUTC_Q (pfile, c);
+      CPP_NUL_TERMINATE_Q (pfile);
+      return CPP_STRING;
+    }
+        else
+    {
+      FORWARD(-1);
+    chill_number_eof:
+      CPP_NUL_TERMINATE (pfile);
+      return CPP_NUMBER;
+    }
+      }
+    else
+      goto letter;
+  case '_':
+  case 'a': case 'e': case 'f': case 'g': case 'i': case 'j':
+  case 'k': case 'l': case 'm': case 'n': case 'p': case 'q':
+  case 'r': case 's': case 't': case 'u': case 'v': case 'w':
+  case 'x': case 'y': case 'z':
+  case 'A': case 'E': case 'F': case 'G': case 'I': case 'J':
+  case 'K': case 'M': case 'N': case 'P': case 'Q': case 'R':
+  case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
+  case 'Y': case 'Z':
         letter:
           {
-           HASHNODE *hp;
-           unsigned char *ident;
-           int before_name_written = CPP_WRITTEN (pfile);
-           int ident_len;
-           parse_name (pfile, c);
-           pfile->only_seen_white = 0;
-           if (pfile->no_macro_expand)
-             return CPP_NAME;
-           ident = pfile->token_buffer + before_name_written;
-           ident_len = CPP_PWRITTEN (pfile) - ident;
-           hp = cpp_lookup (pfile, ident, ident_len, -1);
-           if (!hp)
-             return CPP_NAME;
-           if (hp->type == T_DISABLED)
-             {
-               if (pfile->output_escapes)
-                 { /* Return "@-IDENT", followed by '\0'. */
-                   int i;
-                   CPP_RESERVE (pfile, 3);
-                   ident = pfile->token_buffer + before_name_written;
-                   CPP_ADJUST_WRITTEN (pfile, 2);
-                   for (i = ident_len; i >= 0; i--) ident[i+2] = ident[i];
-                   ident[0] = '@';
-                   ident[1] = '-';
-                 }
-               return CPP_NAME;
-             }
-
-           /* If macro wants an arglist, verify that a '(' follows.
-              first skip all whitespace, copying it to the output
-              after the macro name.  Then, if there is no '(',
-              decide this is not a macro call and leave things that way.  */
-           if (hp->type == T_MACRO && hp->value.defn->nargs >= 0)
-           {
-             struct parse_marker macro_mark;
-             int is_macro_call;
-             while (CPP_IS_MACRO_BUFFER (CPP_BUFFER (pfile)))
-               {
-                 cpp_buffer *next_buf;
-                 cpp_skip_hspace (pfile);
-                 if (PEEKC () != EOF)
-                   break;
-                 next_buf = CPP_PREV_BUFFER (CPP_BUFFER (pfile));
-                 (*CPP_BUFFER (pfile)->cleanup) (CPP_BUFFER (pfile), pfile);
-                 CPP_BUFFER (pfile) = next_buf;
-               }
-             parse_set_mark (&macro_mark, pfile);
-             for (;;)
-               {
-                 cpp_skip_hspace (pfile);
-                 c = PEEKC ();
-                 is_macro_call = c == '(';
-                 if (c != '\n')
-                   break;
-                 FORWARD (1);
-               }
-             if (!is_macro_call)
-               parse_goto_mark (&macro_mark, pfile);
-             parse_clear_mark (&macro_mark);
-             if (!is_macro_call)
-               return CPP_NAME;
-           }
-           /* This is now known to be a macro call. */
-
-           /* it might not actually be a macro.  */
-           if (hp->type != T_MACRO) {
-             int xbuf_len;  U_CHAR *xbuf;
-             CPP_SET_WRITTEN (pfile, before_name_written);
-             special_symbol (hp, pfile);
-             xbuf_len = CPP_WRITTEN (pfile) - before_name_written;
-             xbuf = (U_CHAR *) Safe_malloc (xbuf_len + 1);
-             CPP_SET_WRITTEN (pfile, before_name_written);
-             bcopy (CPP_PWRITTEN (pfile), xbuf, xbuf_len + 1);
-             push_macro_expansion (pfile, xbuf, xbuf_len, hp);
-           }
-           else
-             {
-               /* Expand the macro, reading arguments as needed,
-                  and push the expansion on the input stack.  */
-               macroexpand (pfile, hp);
-               CPP_SET_WRITTEN (pfile, before_name_written);
-             }
-
-           /* An extra "@ " is added to the end of a macro expansion
-              to prevent accidental token pasting.  We prefer to avoid
-              unneeded extra spaces (for the sake of cpp-using tools like
-              imake).  Here we remove the space if it is safe to do so. */
-           if (pfile->buffer->rlimit - pfile->buffer->cur >= 3
-               && pfile->buffer->rlimit[-2] == '@'
-               && pfile->buffer->rlimit[-1] == ' ')
-             {
-               int c1 = pfile->buffer->rlimit[-3];
-               int c2 = CPP_BUF_PEEK (CPP_PREV_BUFFER (CPP_BUFFER (pfile)));
-               if (c2 == EOF || ! unsafe_chars (c1, c2))
-                 pfile->buffer->rlimit -= 2;
-             }
-         }
-         goto get_next;
-
-       case ' ':  case '\t':  case '\v':  case '\r':
-         for (;;)
-           {
-             CPP_PUTC (pfile, c);
-             c = PEEKC ();
-             if (c == EOF || !is_hor_space[c])
-               break;
-             FORWARD(1);
-           }
-         return CPP_HSPACE;
+      HASHNODE *hp;
+      unsigned char *ident;
+      int before_name_written = CPP_WRITTEN (pfile);
+      int ident_len;
+      parse_name (pfile, c);
+      pfile->only_seen_white = 0;
+      if (pfile->no_macro_expand)
+        return CPP_NAME;
+      ident = pfile->token_buffer + before_name_written;
+      ident_len = CPP_PWRITTEN (pfile) - ident;
+      hp = cpp_lookup (pfile, ident, ident_len, -1);
+      if (!hp)
+        return CPP_NAME;
+      if (hp->type == T_DISABLED)
+        {
+    if (pfile->output_escapes)
+      { /* Return "@-IDENT", followed by '\0'. */
+        int i;
+        CPP_RESERVE (pfile, 3);
+        ident = pfile->token_buffer + before_name_written;
+        CPP_ADJUST_WRITTEN (pfile, 2);
+        for (i = ident_len; i >= 0; i--) ident[i+2] = ident[i];
+        ident[0] = '@';
+        ident[1] = '-';
+      }
+    return CPP_NAME;
+        }
+
+      /* If macro wants an arglist, verify that a '(' follows.
+         first skip all whitespace, copying it to the output
+         after the macro name.  Then, if there is no '(',
+         decide this is not a macro call and leave things that way.  */
+      if (hp->type == T_MACRO && hp->value.defn->nargs >= 0)
+      {
+        struct parse_marker macro_mark;
+        int is_macro_call;
+        while (CPP_IS_MACRO_BUFFER (CPP_BUFFER (pfile)))
+          {
+      cpp_buffer *next_buf;
+      cpp_skip_hspace (pfile);
+      if (PEEKC () != EOF)
+        break;
+      next_buf = CPP_PREV_BUFFER (CPP_BUFFER (pfile));
+      (*CPP_BUFFER (pfile)->cleanup) (CPP_BUFFER (pfile), pfile);
+      CPP_BUFFER (pfile) = next_buf;
+          }
+        parse_set_mark (&macro_mark, pfile);
+        for (;;)
+    {
+      cpp_skip_hspace (pfile);
+      c = PEEKC ();
+      is_macro_call = c == '(';
+      if (c != '\n')
+        break;
+      FORWARD (1);
+    }
+        if (!is_macro_call)
+    parse_goto_mark (&macro_mark, pfile);
+        parse_clear_mark (&macro_mark);
+        if (!is_macro_call)
+    return CPP_NAME;
+      }
+      /* This is now known to be a macro call. */
+
+      /* it might not actually be a macro.  */
+      if (hp->type != T_MACRO) {
+        int xbuf_len;  U_CHAR *xbuf;
+        CPP_SET_WRITTEN (pfile, before_name_written);
+        special_symbol (hp, pfile);
+        xbuf_len = CPP_WRITTEN (pfile) - before_name_written;
+        xbuf = (U_CHAR *) Safe_malloc (xbuf_len + 1);
+        CPP_SET_WRITTEN (pfile, before_name_written);
+        bcopy (CPP_PWRITTEN (pfile), xbuf, xbuf_len + 1);
+        push_macro_expansion (pfile, xbuf, xbuf_len, hp);
+      }
+      else
+        {
+    /* Expand the macro, reading arguments as needed,
+       and push the expansion on the input stack.  */
+    macroexpand (pfile, hp);
+    CPP_SET_WRITTEN (pfile, before_name_written);
+        }
+
+      /* An extra "@ " is added to the end of a macro expansion
+         to prevent accidental token pasting.  We prefer to avoid
+         unneeded extra spaces (for the sake of cpp-using tools like
+         imake).  Here we remove the space if it is safe to do so. */
+      if (pfile->buffer->rlimit - pfile->buffer->cur >= 3
+    && pfile->buffer->rlimit[-2] == '@'
+    && pfile->buffer->rlimit[-1] == ' ')
+        {
+    int c1 = pfile->buffer->rlimit[-3];
+    int c2 = CPP_BUF_PEEK (CPP_PREV_BUFFER (CPP_BUFFER (pfile)));
+    if (c2 == EOF || ! unsafe_chars (c1, c2))
+      pfile->buffer->rlimit -= 2;
+        }
+    }
+    goto get_next;
+
+  case ' ':  case '\t':  case '\v':  case '\r':
+    for (;;)
+      {
+        CPP_PUTC (pfile, c);
+        c = PEEKC ();
+        if (c == EOF || !is_hor_space[c])
+    break;
+        FORWARD(1);
+      }
+    return CPP_HSPACE;
 
         case '\\':
-         c2 = PEEKC ();
-         if (c2 != '\n')
-           goto randomchar;
-         token = CPP_HSPACE;
-         goto op2any;
-
-       case '\n':
-         CPP_PUTC (pfile, c);
-         if (pfile->only_seen_white == 0)
-           pfile->only_seen_white = 1;
-         pfile->lineno++;
-         output_line_command (pfile, 1, same_file);
-         return CPP_VSPACE;
-
-       case '(': token = CPP_LPAREN;    goto char1;
-       case ')': token = CPP_RPAREN;    goto char1;
-       case '{': token = CPP_LBRACE;    goto char1;
-       case '}': token = CPP_RBRACE;    goto char1;
-       case ',': token = CPP_COMMA;     goto char1;
-       case ';': token = CPP_SEMICOLON; goto char1;
-
-       randomchar:
-       default:
-         token = CPP_OTHER;
-       char1:
-         pfile->only_seen_white = 0;
-         CPP_PUTC (pfile, c);
-         return token;
-       }
+    c2 = PEEKC ();
+    if (c2 != '\n')
+      goto randomchar;
+    token = CPP_HSPACE;
+    goto op2any;
+
+  case '\n':
+    CPP_PUTC (pfile, c);
+    if (pfile->only_seen_white == 0)
+      pfile->only_seen_white = 1;
+    pfile->lineno++;
+    output_line_command (pfile, 1, same_file);
+    return CPP_VSPACE;
+
+  case '(': token = CPP_LPAREN;    goto char1;
+  case ')': token = CPP_RPAREN;    goto char1;
+  case '{': token = CPP_LBRACE;    goto char1;
+  case '}': token = CPP_RBRACE;    goto char1;
+  case ',': token = CPP_COMMA;     goto char1;
+  case ';': token = CPP_SEMICOLON; goto char1;
+
+  randomchar:
+  default:
+    token = CPP_OTHER;
+  char1:
+    pfile->only_seen_white = 0;
+    CPP_PUTC (pfile, c);
+    return token;
+  }
     }
 }
 
@@ -5277,8 +5277,8 @@ cpp_get_non_space_token (
     {
       enum cpp_token token = cpp_get_token (pfile);
       if (token != CPP_COMMENT && token != CPP_POP
-         && token != CPP_HSPACE && token != CPP_VSPACE)
-       return token;
+    && token != CPP_HSPACE && token != CPP_VSPACE)
+  return token;
       CPP_SET_WRITTEN (pfile, old_written);
     }
 }
@@ -5293,20 +5293,20 @@ parse_name (
   {
       if (! is_idchar[c])
       {
-         if (c == '\\' && PEEKC() == '\n')
-         {
-             FORWARD(2);
-             continue;
-         }
-         FORWARD (-1);
-         break;
+    if (c == '\\' && PEEKC() == '\n')
+    {
+        FORWARD(2);
+        continue;
+    }
+    FORWARD (-1);
+    break;
       }
 
       CPP_RESERVE(pfile, 2); /* One more for final NUL. */
       CPP_PUTC_Q (pfile, c);
       c = GETC();
       if (c == EOF)
-       break;
+  break;
   }
   CPP_NUL_TERMINATE_Q (pfile);
   return 1;
@@ -5317,7 +5317,7 @@ parse_name (
 
 /* Hash a file name for import_hash_table.  */
 
-static int 
+static int
 import_hash (
      char *f)
 {
@@ -5351,7 +5351,7 @@ lookup_import (
 
   while (i) {
     if (!strcmp (filename, i->name))
-      return -2;               /* return found */
+      return -2;    /* return found */
     i = i->next;
   }
   /* Open it and try a match on inode/dev */
@@ -5363,16 +5363,16 @@ lookup_import (
     i = pfile->import_hash_table[h];
     while (i) {
       /* Compare the inode and the device.
-        Supposedly on some systems the inode is not a scalar.  */
+   Supposedly on some systems the inode is not a scalar.  */
       if (!bcmp ((char *) &i->inode, (char *) &sb.st_ino, sizeof (sb.st_ino))
-         && i->dev == sb.st_dev) {
+    && i->dev == sb.st_dev) {
         close (fd);
-        return -2;             /* return found */
+        return -2;    /* return found */
       }
       i = i->next;
     }
   }
-  return fd;                   /* Not found, return open file */
+  return fd;      /* Not found, return open file */
 }
 
 /* Add the file FNAME, open on descriptor FD, to import_hash_table.  */
@@ -5432,15 +5432,15 @@ read_filename_string (
     {
       *set++ = ch;
       while ((ch = getc (f)) != EOF && ! is_space[ch])
-       {
-         if (set - alloc == len)
-           {
-             len *= 2;
-             alloc = Safe_realloc(alloc, len + 1);
-             set = alloc + len / 2;
-           }
-         *set++ = ch;
-       }
+  {
+    if (set - alloc == len)
+      {
+        len *= 2;
+        alloc = Safe_realloc(alloc, len + 1);
+        set = alloc + len / 2;
+      }
+    *set++ = ch;
+  }
     }
   *set = '\0';
   ungetc (ch, f);
@@ -5472,7 +5472,7 @@ read_name_map (
       return map_list_ptr->map_list_map;
 
   map_list_ptr = ((struct file_name_map_list *)
-                 Safe_malloc (sizeof (struct file_name_map_list)));
+      Safe_malloc (sizeof (struct file_name_map_list)));
   map_list_ptr->map_list_name = savestring (dirname);
   map_list_ptr->map_list_map = NULL;
 
@@ -5490,48 +5490,48 @@ read_name_map (
       int dirlen = strlen (dirname);
 
       while ((ch = getc (f)) != EOF)
-       {
-         char *from, *to;
-         struct file_name_map *ptr;
-
-         if (is_space[ch])
-           continue;
-         from = read_filename_string (ch, f);
-         while ((ch = getc (f)) != EOF && is_hor_space[ch])
-           ;
-         to = read_filename_string (ch, f);
-
-         ptr = ((struct file_name_map *)
-                Safe_malloc (sizeof (struct file_name_map)));
-         ptr->map_from = from;
-
-         /* Make the real filename absolute.  */
-         if (*to == '/')
-           ptr->map_to = to;
-         else
-           {
-             ptr->map_to = Safe_malloc (dirlen + strlen (to) + 2);
-             strcpy (ptr->map_to, dirname);
-             ptr->map_to[dirlen] = '/';
-             strcpy (ptr->map_to + dirlen + 1, to);
-             free (to);
-           }         
-
-         ptr->map_next = map_list_ptr->map_list_map;
-         map_list_ptr->map_list_map = ptr;
-
-         while ((ch = getc (f)) != '\n')
-           if (ch == EOF)
-             break;
-       }
+  {
+    char *from, *to;
+    struct file_name_map *ptr;
+
+    if (is_space[ch])
+      continue;
+    from = read_filename_string (ch, f);
+    while ((ch = getc (f)) != EOF && is_hor_space[ch])
+      ;
+    to = read_filename_string (ch, f);
+
+    ptr = ((struct file_name_map *)
+     Safe_malloc (sizeof (struct file_name_map)));
+    ptr->map_from = from;
+
+    /* Make the real filename absolute.  */
+    if (*to == '/')
+      ptr->map_to = to;
+    else
+      {
+        ptr->map_to = Safe_malloc (dirlen + strlen (to) + 2);
+        strcpy (ptr->map_to, dirname);
+        ptr->map_to[dirlen] = '/';
+        strcpy (ptr->map_to + dirlen + 1, to);
+        free (to);
+      }
+
+    ptr->map_next = map_list_ptr->map_list_map;
+    map_list_ptr->map_list_map = ptr;
+
+    while ((ch = getc (f)) != '\n')
+      if (ch == EOF)
+        break;
+  }
       fclose (f);
     }
-  
+
   map_list_ptr->map_list_next = CPP_OPTIONS (pfile)->map_list;
   CPP_OPTIONS (pfile)->map_list = map_list_ptr;
 
   return map_list_ptr->map_list_map;
-}  
+}
 
 /* Try to open include file FILENAME.  SEARCHPTR is the directory
    being tried from the include file search path.  This function maps
@@ -5551,8 +5551,8 @@ open_include_file (
   if (searchptr && ! searchptr->got_name_map)
     {
       searchptr->name_map = read_name_map (pfile,
-                                          searchptr->fname
-                                          ? searchptr->fname : ".");
+             searchptr->fname
+             ? searchptr->fname : ".");
       searchptr->got_name_map = 1;
     }
 
@@ -5561,15 +5561,15 @@ open_include_file (
     {
       from = filename;
       if (searchptr->fname)
-       from += strlen (searchptr->fname) + 1;
+  from += strlen (searchptr->fname) + 1;
       for (map = searchptr->name_map; map; map = map->map_next)
-       {
-         if (! strcmp (map->map_from, from))
-           {
-             /* Found a match.  */
-             return open (map->map_to, O_RDONLY, 0666);
-           }
-       }
+  {
+    if (! strcmp (map->map_from, from))
+      {
+        /* Found a match.  */
+        return open (map->map_to, O_RDONLY, 0666);
+      }
+  }
     }
 
   /* Try to find a mapping file for the particular directory we are
@@ -5630,7 +5630,7 @@ finclude (
   long st_size;
   long i;
   int length;
-  cpp_buffer *fp;                      /* For input stack frame */
+  cpp_buffer *fp;     /* For input stack frame */
   int missing_newline = 0;
 
   if (file_size_and_mode (f, &st_mode, &st_size) < 0)
@@ -5680,10 +5680,10 @@ finclude (
     for (;;) {
       i = safe_read (f, fp->buf + st_size, bsize - st_size);
       if (i < 0)
-       goto nope;      /* error! */
+  goto nope;      /* error! */
       st_size += i;
       if (st_size != bsize)
-       break;  /* End of file */
+  break;  /* End of file */
       bsize *= 2;
       fp->buf = (U_CHAR *) Safe_realloc(fp->buf, bsize + 2);
     }
@@ -5788,65 +5788,65 @@ push_parse_file (
     while (*p) {
       char *q;
       while (*p == ' ' || *p == '\t')
-       p++;
-      /* Handle -D options.  */ 
+  p++;
+      /* Handle -D options.  */
       if (p[0] == '-' && p[1] == 'D') {
-       q = &p[2];
-       while (*p && *p != ' ' && *p != '\t')
-         p++;
-       if (*p != 0)
-         *p++= 0;
-       if (opts->debug_output)
-         output_line_command (pfile, 0, same_file);
-       cpp_define (pfile, q);
-       while (*p == ' ' || *p == '\t')
-         p++;
+  q = &p[2];
+  while (*p && *p != ' ' && *p != '\t')
+    p++;
+  if (*p != 0)
+    *p++= 0;
+  if (opts->debug_output)
+    output_line_command (pfile, 0, same_file);
+  cpp_define (pfile, q);
+  while (*p == ' ' || *p == '\t')
+    p++;
       } else if (p[0] == '-' && p[1] == 'A') {
-       /* Handle -A options (assertions).  */ 
-       char *assertion;
-       char *past_name;
-       char *value;
-       char *past_value;
-       char *termination;
-       int save_char;
-
-       assertion = &p[2];
-       past_name = assertion;
-       /* Locate end of name.  */
-       while (*past_name && *past_name != ' '
-              && *past_name != '\t' && *past_name != '(')
-         past_name++;
-       /* Locate `(' at start of value.  */
-       value = past_name;
-       while (*value && (*value == ' ' || *value == '\t'))
-         value++;
-       if (*value++ != '(')
-         abort ();
-       while (*value && (*value == ' ' || *value == '\t'))
-         value++;
-       past_value = value;
-       /* Locate end of value.  */
-       while (*past_value && *past_value != ' '
-              && *past_value != '\t' && *past_value != ')')
-         past_value++;
-       termination = past_value;
-       while (*termination && (*termination == ' ' || *termination == '\t'))
-         termination++;
-       if (*termination++ != ')')
-         abort ();
-       if (*termination && *termination != ' ' && *termination != '\t')
-         abort ();
-       /* Temporarily null-terminate the value.  */
-       save_char = *termination;
-       *termination = '\0';
-       /* Install the assertion.  */
-       make_assertion (pfile, "-A", assertion);
-       *termination = (char) save_char;
-       p = termination;
-       while (*p == ' ' || *p == '\t')
-         p++;
+  /* Handle -A options (assertions).  */
+  char *assertion;
+  char *past_name;
+  char *value;
+  char *past_value;
+  char *termination;
+  int save_char;
+
+  assertion = &p[2];
+  past_name = assertion;
+  /* Locate end of name.  */
+  while (*past_name && *past_name != ' '
+         && *past_name != '\t' && *past_name != '(')
+    past_name++;
+  /* Locate `(' at start of value.  */
+  value = past_name;
+  while (*value && (*value == ' ' || *value == '\t'))
+    value++;
+  if (*value++ != '(')
+    abort ();
+  while (*value && (*value == ' ' || *value == '\t'))
+    value++;
+  past_value = value;
+  /* Locate end of value.  */
+  while (*past_value && *past_value != ' '
+         && *past_value != '\t' && *past_value != ')')
+    past_value++;
+  termination = past_value;
+  while (*termination && (*termination == ' ' || *termination == '\t'))
+    termination++;
+  if (*termination++ != ')')
+    abort ();
+  if (*termination && *termination != ' ' && *termination != '\t')
+    abort ();
+  /* Temporarily null-terminate the value.  */
+  save_char = *termination;
+  *termination = '\0';
+  /* Install the assertion.  */
+  make_assertion (pfile, "-A", assertion);
+  *termination = (char) save_char;
+  p = termination;
+  while (*p == ' ' || *p == '\t')
+    p++;
       } else {
-       abort ();
+  abort ();
       }
     }
   }
@@ -5860,24 +5860,24 @@ push_parse_file (
   for (pend = opts->pending;  pend;  pend = pend->next)
     {
       if (pend->cmd != NULL && pend->cmd[0] == '-')
-       {
-         switch (pend->cmd[1])
-           {
-           case 'U':
-             if (opts->debug_output)
-               output_line_command (pfile, 0, same_file);
-             do_undef (pfile, NULL, pend->arg, pend->arg + strlen (pend->arg));
-             break;
-           case 'D':
-             if (opts->debug_output)
-               output_line_command (pfile, 0, same_file);
-             cpp_define (pfile, pend->arg);
-             break;
-           case 'A':
-             make_assertion (pfile, "-A", pend->arg);
-             break;
-           }
-       }
+  {
+    switch (pend->cmd[1])
+      {
+      case 'U':
+        if (opts->debug_output)
+    output_line_command (pfile, 0, same_file);
+        do_undef (pfile, NULL, pend->arg, pend->arg + strlen (pend->arg));
+        break;
+      case 'D':
+        if (opts->debug_output)
+    output_line_command (pfile, 0, same_file);
+        cpp_define (pfile, pend->arg);
+        break;
+      case 'A':
+        make_assertion (pfile, "-A", pend->arg);
+        break;
+      }
+  }
     }
 
   opts->done_initializing = 1;
@@ -5888,17 +5888,17 @@ push_parse_file (
     switch ((opts->objc << 1) + opts->cplusplus)
       {
       case 0:
-       epath = getenv ("C_INCLUDE_PATH");
-       break;
+  epath = getenv ("C_INCLUDE_PATH");
+  break;
       case 1:
-       epath = getenv ("CPLUS_INCLUDE_PATH");
-       break;
+  epath = getenv ("CPLUS_INCLUDE_PATH");
+  break;
       case 2:
-       epath = getenv ("OBJC_INCLUDE_PATH");
-       break;
+  epath = getenv ("OBJC_INCLUDE_PATH");
+  break;
       case 3:
-       epath = getenv ("OBJCPLUS_INCLUDE_PATH");
-       break;
+  epath = getenv ("OBJCPLUS_INCLUDE_PATH");
+  break;
       }
     /* If the environment var for this language is set,
        add to the default list of include directories.  */
@@ -5908,38 +5908,38 @@ push_parse_file (
       char *startp, *endp;
 
       for (num_dirs = 1, startp = epath; *startp; startp++)
-       if (*startp == PATH_SEPARATOR)
-         num_dirs++;
+  if (*startp == PATH_SEPARATOR)
+    num_dirs++;
       include_defaults
-       = (struct default_include *) Safe_malloc ((num_dirs
-                                              * sizeof (struct default_include))
-                                             + sizeof (include_defaults_array));
+  = (struct default_include *) Safe_malloc ((num_dirs
+                 * sizeof (struct default_include))
+                + sizeof (include_defaults_array));
       startp = endp = epath;
       num_dirs = 0;
       while (1) {
         /* Handle cases like c:/usr/lib:d:/gcc/lib */
         if ((*endp == PATH_SEPARATOR)
             || *endp == 0) {
-         strncpy (nstore, startp, endp-startp);
-         if (endp == startp)
-           strcpy (nstore, ".");
-         else
-           nstore[endp-startp] = '\0';
-
-         include_defaults[num_dirs].fname = savestring (nstore);
-         include_defaults[num_dirs].cplusplus = opts->cplusplus;
-         include_defaults[num_dirs].cxx_aware = 1;
-         num_dirs++;
-         if (*endp == '\0')
-           break;
-         endp = startp = endp + 1;
-       } else
-         endp++;
+    strncpy (nstore, startp, endp-startp);
+    if (endp == startp)
+      strcpy (nstore, ".");
+    else
+      nstore[endp-startp] = '\0';
+
+    include_defaults[num_dirs].fname = savestring (nstore);
+    include_defaults[num_dirs].cplusplus = opts->cplusplus;
+    include_defaults[num_dirs].cxx_aware = 1;
+    num_dirs++;
+    if (*endp == '\0')
+      break;
+    endp = startp = endp + 1;
+  } else
+    endp++;
       }
       /* Put the usual defaults back in at the end.  */
       bcopy ((char *) include_defaults_array,
-            (char *) &include_defaults[num_dirs],
-            sizeof (include_defaults_array));
+       (char *) &include_defaults[num_dirs],
+       sizeof (include_defaults_array));
     }
   }
 
@@ -5962,42 +5962,42 @@ push_parse_file (
        These have /usr/local/lib/gcc... replaced by specd_prefix.  */
     if (specd_prefix != 0 && default_len != 0)
       for (p = include_defaults; p->fname; p++) {
-       /* Some standard dirs are only for C++.  */
-       if (!p->cplusplus
-           || (opts->cplusplus && !opts->no_standard_cplusplus_includes)) {
-         /* Does this dir start with the prefix?  */
-         if (!strncmp (p->fname, default_prefix, default_len)) {
-           /* Yes; change prefix and add to search list.  */
-           struct file_name_list *new
-             = (struct file_name_list *) Safe_malloc (sizeof (struct file_name_list));
-           int this_len = strlen (specd_prefix) + strlen (p->fname) - default_len;
-           char *str = (char *) Safe_malloc (this_len + 1);
-           strcpy (str, specd_prefix);
-           strcat (str, p->fname + default_len);
-           new->fname = str;
-           new->control_macro = 0;
-           new->c_system_include_path = !p->cxx_aware;
-           new->got_name_map = 0;
-           append_include_chain (pfile, new, new);
-           if (opts->first_system_include == 0)
-             opts->first_system_include = new;
-         }
-       }
+  /* Some standard dirs are only for C++.  */
+  if (!p->cplusplus
+      || (opts->cplusplus && !opts->no_standard_cplusplus_includes)) {
+    /* Does this dir start with the prefix?  */
+    if (!strncmp (p->fname, default_prefix, default_len)) {
+      /* Yes; change prefix and add to search list.  */
+      struct file_name_list *new
+        = (struct file_name_list *) Safe_malloc (sizeof (struct file_name_list));
+      int this_len = strlen (specd_prefix) + strlen (p->fname) - default_len;
+      char *str = (char *) Safe_malloc (this_len + 1);
+      strcpy (str, specd_prefix);
+      strcat (str, p->fname + default_len);
+      new->fname = str;
+      new->control_macro = 0;
+      new->c_system_include_path = !p->cxx_aware;
+      new->got_name_map = 0;
+      append_include_chain (pfile, new, new);
+      if (opts->first_system_include == 0)
+        opts->first_system_include = new;
+    }
+  }
       }
     /* Search ordinary names for GNU include directories.  */
     for (p = include_defaults; p->fname; p++) {
       /* Some standard dirs are only for C++.  */
       if (!p->cplusplus
-         || (opts->cplusplus && !opts->no_standard_cplusplus_includes)) {
-       struct file_name_list *new
-         = (struct file_name_list *) Safe_malloc (sizeof (struct file_name_list));
-       new->control_macro = 0;
-       new->c_system_include_path = !p->cxx_aware;
-       new->fname = p->fname;
-       new->got_name_map = 0;
-       append_include_chain (pfile, new, new);
-       if (opts->first_system_include == 0)
-         opts->first_system_include = new;
+    || (opts->cplusplus && !opts->no_standard_cplusplus_includes)) {
+  struct file_name_list *new
+    = (struct file_name_list *) Safe_malloc (sizeof (struct file_name_list));
+  new->control_macro = 0;
+  new->c_system_include_path = !p->cxx_aware;
+  new->fname = p->fname;
+  new->got_name_map = 0;
+  append_include_chain (pfile, new, new);
+  if (opts->first_system_include == 0)
+    opts->first_system_include = new;
       }
     }
   }
@@ -6013,7 +6013,7 @@ push_parse_file (
     fprintf (stderr, "#include \"...\" search starts here:\n");
     for (p = opts->include; p; p = p->next) {
       if (p == opts->first_bracket_include)
-       fprintf (stderr, "#include <...> search starts here:\n");
+  fprintf (stderr, "#include <...> search starts here:\n");
       fprintf (stderr, " %s\n", p->fname);
     }
     fprintf (stderr, "End of search list.\n");
@@ -6027,17 +6027,17 @@ push_parse_file (
   for (pend = opts->pending;  pend;  pend = pend->next)
     {
       if (pend->cmd != NULL && strcmp (pend->cmd, "-imacros") == 0)
-       {
-         int fd = open (pend->arg, O_RDONLY, 0666);
-         if (fd < 0)
-           {
-             cpp_perror_with_name (pfile, pend->arg);
-             return FATAL_EXIT_CODE;
-           }
-         cpp_push_buffer (pfile, NULL, 0);
-         finclude (pfile, fd, pend->arg, 0, NULL_PTR);
-         cpp_scan_buffer (pfile);
-       }
+  {
+    int fd = open (pend->arg, O_RDONLY, 0666);
+    if (fd < 0)
+      {
+        cpp_perror_with_name (pfile, pend->arg);
+        return FATAL_EXIT_CODE;
+      }
+    cpp_push_buffer (pfile, NULL, 0);
+    finclude (pfile, fd, pend->arg, 0, NULL_PTR);
+    cpp_scan_buffer (pfile);
+  }
     }
   opts->no_output--; pfile->no_record_file--;
 
@@ -6063,15 +6063,15 @@ push_parse_file (
 
   if (opts->print_deps == 0
       && (getenv ("SUNPRO_DEPENDENCIES") != 0
-         || getenv ("DEPENDENCIES_OUTPUT") != 0)) {
+    || getenv ("DEPENDENCIES_OUTPUT") != 0)) {
     char *spec = getenv ("DEPENDENCIES_OUTPUT");
     char *s;
     char *output_file;
 
     if (spec == 0)
       {
-       spec = getenv ("SUNPRO_DEPENDENCIES");
-       opts->print_deps = 2;
+  spec = getenv ("SUNPRO_DEPENDENCIES");
+  opts->print_deps = 2;
       }
     else
       opts->print_deps = 1;
@@ -6082,15 +6082,15 @@ push_parse_file (
     while (*s != 0 && *s != ' ') s++;
     if (*s != 0)
       {
-       opts->deps_target = s + 1;
-       output_file = (char *) Safe_malloc (s - spec + 1);
-       bcopy (spec, output_file, s - spec);
-       output_file[s - spec] = 0;
+  opts->deps_target = s + 1;
+  output_file = (char *) Safe_malloc (s - spec + 1);
+  bcopy (spec, output_file, s - spec);
+  output_file[s - spec] = 0;
       }
     else
       {
-       opts->deps_target = 0;
-       output_file = spec;
+  opts->deps_target = 0;
+  output_file = spec;
       }
 
     opts->deps_file = output_file;
@@ -6108,67 +6108,67 @@ push_parse_file (
       pfile->deps_column = 0;
 
       if (opts->deps_target)
-       deps_output (pfile, opts->deps_target, ':');
+  deps_output (pfile, opts->deps_target, ':');
       else if (*opts->in_fname == 0)
-       deps_output (pfile, "-", ':');
+  deps_output (pfile, "-", ':');
       else
-       {
-         char *p, *q;
-         int len;
+  {
+    char *p, *q;
+    int len;
 
-         /* Discard all directory prefixes from filename.  */
-         if ((q = rindex (opts->in_fname, '/')) != NULL
+    /* Discard all directory prefixes from filename.  */
+    if ((q = rindex (opts->in_fname, '/')) != NULL
 #ifdef DIR_SEPARATOR
-             && (q = rindex (opts->in_fname, DIR_SEPARATOR)) != NULL
+        && (q = rindex (opts->in_fname, DIR_SEPARATOR)) != NULL
 #endif
-             )
-           ++q;
-         else
-           q = opts->in_fname;
-
-         /* Copy remainder to mungable area.  */
-         p = (char *) alloca (strlen(q) + 8);
-         strcpy (p, q);
-
-         /* Output P, but remove known suffixes.  */
-         len = strlen (p);
-         q = p + len;
-         if (len >= 2
-             && p[len - 2] == '.'
-             && index("cCsSm", p[len - 1]))
-           q = p + (len - 2);
-         else if (len >= 3
-                  && p[len - 3] == '.'
-                  && p[len - 2] == 'c'
-                  && p[len - 1] == 'c')
-           q = p + (len - 3);
-         else if (len >= 4
-                  && p[len - 4] == '.'
-                  && p[len - 3] == 'c'
-                  && p[len - 2] == 'x'
-                  && p[len - 1] == 'x')
-           q = p + (len - 4);
-         else if (len >= 4
-                  && p[len - 4] == '.'
-                  && p[len - 3] == 'c'
-                  && p[len - 2] == 'p'
-                  && p[len - 1] == 'p')
-           q = p + (len - 4);
-
-         /* Supply our own suffix.  */
+        )
+      ++q;
+    else
+      q = opts->in_fname;
+
+    /* Copy remainder to mungable area.  */
+    p = (char *) alloca (strlen(q) + 8);
+    strcpy (p, q);
+
+    /* Output P, but remove known suffixes.  */
+    len = strlen (p);
+    q = p + len;
+    if (len >= 2
+        && p[len - 2] == '.'
+        && index("cCsSm", p[len - 1]))
+      q = p + (len - 2);
+    else if (len >= 3
+       && p[len - 3] == '.'
+       && p[len - 2] == 'c'
+       && p[len - 1] == 'c')
+      q = p + (len - 3);
+    else if (len >= 4
+       && p[len - 4] == '.'
+       && p[len - 3] == 'c'
+       && p[len - 2] == 'x'
+       && p[len - 1] == 'x')
+      q = p + (len - 4);
+    else if (len >= 4
+       && p[len - 4] == '.'
+       && p[len - 3] == 'c'
+       && p[len - 2] == 'p'
+       && p[len - 1] == 'p')
+      q = p + (len - 4);
+
+    /* Supply our own suffix.  */
 #ifndef VMS
 #ifdef _FORASXXXX_
           strcpy (q,".rel");
 #else
-         strcpy (q, ".o");
+    strcpy (q, ".o");
 #endif
 #else
-         strcpy (q, ".obj");
+    strcpy (q, ".obj");
 #endif
 
-         deps_output (pfile, p, ':');
-         deps_output (pfile, opts->in_fname, ' ');
-       }
+    deps_output (pfile, p, ':');
+    deps_output (pfile, opts->in_fname, ' ');
+  }
     }
 
 #if 0
@@ -6196,16 +6196,16 @@ push_parse_file (
   for (pend = opts->pending;  pend;  pend = pend->next)
     {
       if (pend->cmd != NULL && strcmp (pend->cmd, "-include") == 0)
-       {
-         int fd = open (pend->arg, O_RDONLY, 0666);
-         if (fd < 0)
-           {
-             cpp_perror_with_name (pfile, pend->arg);
-             return FATAL_EXIT_CODE;
-           }
-         cpp_push_buffer (pfile, NULL, 0);
-         finclude (pfile, fd, pend->arg, 0, NULL_PTR);
-       }
+  {
+    int fd = open (pend->arg, O_RDONLY, 0666);
+    if (fd < 0)
+      {
+        cpp_perror_with_name (pfile, pend->arg);
+        return FATAL_EXIT_CODE;
+      }
+    cpp_push_buffer (pfile, NULL, 0);
+    finclude (pfile, fd, pend->arg, 0, NULL_PTR);
+  }
     }
   pfile->no_record_file--;
 
@@ -6258,7 +6258,7 @@ init_parse_file (
 static struct cpp_pending *
 nreverse_pending (
      struct cpp_pending *list)
-     
+
 {
   register struct cpp_pending *prev = 0, *next, *pend;
   for (pend = list;  pend;  pend = next)
@@ -6295,458 +6295,458 @@ cpp_handle_options (
      int argc,
      char **argv)
 {
-       int i;
-       struct cpp_options *opts = CPP_OPTIONS (pfile);
-       for (i = 0; i < argc; i++) {    
-               if (argv[i][0] != '-') {
-                       if (opts->out_fname != NULL)
-                               fatal ("Usage: %s [switches] input output", argv[0]);
-                       else if (opts->in_fname != NULL)
-                               opts->out_fname = argv[i];
-                       else
-                               opts->in_fname = argv[i];
-               } else {
-                       switch (argv[i][1]) {
-                               
-                       case 'i':
-                               if (!strcmp (argv[i], "-include")
-                                       || !strcmp (argv[i], "-imacros")) {
-                                       if (i + 1 == argc)
-                                               fatal ("Filename missing after `%s' option", argv[i]);
-                                       else
-                                               push_pending (pfile, argv[i], argv[i+1]), i++;
-                               }
-                               if (!strcmp (argv[i], "-iprefix")) {
-                                       if (i + 1 == argc)
-                                               fatal ("Filename missing after `-iprefix' option");
-                                       else
-                                               opts->include_prefix = argv[++i];
-                               }
-                               if (!strcmp (argv[i], "-ifoutput")) {
-                                       opts->output_conditionals = 1;
-                               }
-                               if (!strcmp (argv[i], "-isystem")) {
-                                       struct file_name_list *dirtmp;
-                                       
-                                       if (i + 1 == argc)
-                                               fatal ("Filename missing after `-isystem' option");
-                                       
-                                       dirtmp = (struct file_name_list *)
-                                               Safe_malloc (sizeof (struct file_name_list));
-                                       dirtmp->next = 0;
-                                       dirtmp->control_macro = 0;
-                                       dirtmp->c_system_include_path = 1;
-                                       dirtmp->fname = (char *) Safe_malloc (strlen (argv[i+1]) + 1);
-                                       strcpy (dirtmp->fname, argv[++i]);
-                                       dirtmp->got_name_map = 0;
-                                       
-                                       if (opts->before_system == 0)
-                                               opts->before_system = dirtmp;
-                                       else
-                                               opts->last_before_system->next = dirtmp;
-                                       opts->last_before_system = dirtmp; /* Tail follows the last one */
-                               }
-                               /* Add directory to end of path for includes,
-                               with the default prefix at the front of its name.  */
-                               if (!strcmp (argv[i], "-iwithprefix")) {
-                                       struct file_name_list *dirtmp;
-                                       char *prefix;
-                                       
-                                       if (opts->include_prefix != 0)
-                                               prefix = opts->include_prefix;
-                                       else {
-                                               prefix = savestring (GCC_INCLUDE_DIR);
-                                               /* Remove the `include' from /usr/local/lib/gcc.../include.  */
-                                               if (!strcmp (prefix + strlen (prefix) - 8, "/include"))
-                                                       prefix[strlen (prefix) - 7] = 0;
-                                       }
-                                       
-                                       dirtmp = (struct file_name_list *)
-                                               Safe_malloc (sizeof (struct file_name_list));
-                                       dirtmp->next = 0;       /* New one goes on the end */
-                                       dirtmp->control_macro = 0;
-                                       dirtmp->c_system_include_path = 0;
-                                       if (i + 1 == argc)
-                                               fatal ("Directory name missing after `-iwithprefix' option");
-                                       
-                                       dirtmp->fname = (char *) Safe_malloc (strlen (argv[i+1])
-                                               + strlen (prefix) + 1);
-                                       strcpy (dirtmp->fname, prefix);
-                                       strcat (dirtmp->fname, argv[++i]);
-                                       dirtmp->got_name_map = 0;
-                                       
-                                       if (opts->after_include == 0)
-                                               opts->after_include = dirtmp;
-                                       else
-                                               opts->last_after_include->next = dirtmp;
-                                       opts->last_after_include = dirtmp; /* Tail follows the last one */
-                               }
-                               /* Add directory to main path for includes,
-                               with the default prefix at the front of its name.  */
-                               if (!strcmp (argv[i], "-iwithprefixbefore")) {
-                                       struct file_name_list *dirtmp;
-                                       char *prefix;
-                                       
-                                       if (opts->include_prefix != 0)
-                                               prefix = opts->include_prefix;
-                                       else {
-                                               prefix = savestring (GCC_INCLUDE_DIR);
-                                               /* Remove the `include' from /usr/local/lib/gcc.../include.  */
-                                               if (!strcmp (prefix + strlen (prefix) - 8, "/include"))
-                                                       prefix[strlen (prefix) - 7] = 0;
-                                       }
-                                       
-                                       dirtmp = (struct file_name_list *)
-                                               Safe_malloc (sizeof (struct file_name_list));
-                                       dirtmp->next = 0;       /* New one goes on the end */
-                                       dirtmp->control_macro = 0;
-                                       dirtmp->c_system_include_path = 0;
-                                       if (i + 1 == argc)
-                                               fatal ("Directory name missing after `-iwithprefixbefore' option");
-                                       
-                                       dirtmp->fname = (char *) Safe_malloc (strlen (argv[i+1])
-                                               + strlen (prefix) + 1);
-                                       strcpy (dirtmp->fname, prefix);
-                                       strcat (dirtmp->fname, argv[++i]);
-                                       dirtmp->got_name_map = 0;
-                                       
-                                       append_include_chain (pfile, dirtmp, dirtmp);
-                               }
-                               /* Add directory to end of path for includes.  */
-                               if (!strcmp (argv[i], "-idirafter")) {
-                                       struct file_name_list *dirtmp;
-                                       
-                                       dirtmp = (struct file_name_list *)
-                                               Safe_malloc (sizeof (struct file_name_list));
-                                       dirtmp->next = 0;       /* New one goes on the end */
-                                       dirtmp->control_macro = 0;
-                                       dirtmp->c_system_include_path = 0;
-                                       if (i + 1 == argc)
-                                               fatal ("Directory name missing after `-idirafter' option");
-                                       else
-                                               dirtmp->fname = argv[++i];
-                                       dirtmp->got_name_map = 0;
-                                       
-                                       if (opts->after_include == 0)
-                                               opts->after_include = dirtmp;
-                                       else
-                                               opts->last_after_include->next = dirtmp;
-                                       opts->last_after_include = dirtmp; /* Tail follows the last one */
-                               }
-                               break;
-                               
-                                       case 'o':
-                                               if (opts->out_fname != NULL)
-                                                       fatal ("Output filename specified twice");
-                                               if (i + 1 == argc)
-                                                       fatal ("Filename missing after -o option");
-                                               opts->out_fname = argv[++i];
-                                               if (!strcmp (opts->out_fname, "-"))
-                                                       opts->out_fname = "";
-                                               break;
-                                               
-                                       case 'p':
-                                               if (!strcmp (argv[i], "-pedantic"))
-                                                       CPP_PEDANTIC (pfile) = 1;
-                                               else if (!strcmp (argv[i], "-pedantic-errors")) {
-                                                       CPP_PEDANTIC (pfile) = 1;
-                                                       opts->pedantic_errors = 1;
-                                               }
+  int i;
+  struct cpp_options *opts = CPP_OPTIONS (pfile);
+  for (i = 0; i < argc; i++) {
+    if (argv[i][0] != '-') {
+      if (opts->out_fname != NULL)
+        fatal ("Usage: %s [switches] input output", argv[0]);
+      else if (opts->in_fname != NULL)
+        opts->out_fname = argv[i];
+      else
+        opts->in_fname = argv[i];
+    } else {
+      switch (argv[i][1]) {
+
+      case 'i':
+        if (!strcmp (argv[i], "-include")
+          || !strcmp (argv[i], "-imacros")) {
+          if (i + 1 == argc)
+            fatal ("Filename missing after `%s' option", argv[i]);
+          else
+            push_pending (pfile, argv[i], argv[i+1]), i++;
+        }
+        if (!strcmp (argv[i], "-iprefix")) {
+          if (i + 1 == argc)
+            fatal ("Filename missing after `-iprefix' option");
+          else
+            opts->include_prefix = argv[++i];
+        }
+        if (!strcmp (argv[i], "-ifoutput")) {
+          opts->output_conditionals = 1;
+        }
+        if (!strcmp (argv[i], "-isystem")) {
+          struct file_name_list *dirtmp;
+
+          if (i + 1 == argc)
+            fatal ("Filename missing after `-isystem' option");
+
+          dirtmp = (struct file_name_list *)
+            Safe_malloc (sizeof (struct file_name_list));
+          dirtmp->next = 0;
+          dirtmp->control_macro = 0;
+          dirtmp->c_system_include_path = 1;
+          dirtmp->fname = (char *) Safe_malloc (strlen (argv[i+1]) + 1);
+          strcpy (dirtmp->fname, argv[++i]);
+          dirtmp->got_name_map = 0;
+
+          if (opts->before_system == 0)
+            opts->before_system = dirtmp;
+          else
+            opts->last_before_system->next = dirtmp;
+          opts->last_before_system = dirtmp; /* Tail follows the last one */
+        }
+        /* Add directory to end of path for includes,
+        with the default prefix at the front of its name.  */
+        if (!strcmp (argv[i], "-iwithprefix")) {
+          struct file_name_list *dirtmp;
+          char *prefix;
+
+          if (opts->include_prefix != 0)
+            prefix = opts->include_prefix;
+          else {
+            prefix = savestring (GCC_INCLUDE_DIR);
+            /* Remove the `include' from /usr/local/lib/gcc.../include.  */
+            if (!strcmp (prefix + strlen (prefix) - 8, "/include"))
+              prefix[strlen (prefix) - 7] = 0;
+          }
+
+          dirtmp = (struct file_name_list *)
+            Safe_malloc (sizeof (struct file_name_list));
+          dirtmp->next = 0; /* New one goes on the end */
+          dirtmp->control_macro = 0;
+          dirtmp->c_system_include_path = 0;
+          if (i + 1 == argc)
+            fatal ("Directory name missing after `-iwithprefix' option");
+
+          dirtmp->fname = (char *) Safe_malloc (strlen (argv[i+1])
+            + strlen (prefix) + 1);
+          strcpy (dirtmp->fname, prefix);
+          strcat (dirtmp->fname, argv[++i]);
+          dirtmp->got_name_map = 0;
+
+          if (opts->after_include == 0)
+            opts->after_include = dirtmp;
+          else
+            opts->last_after_include->next = dirtmp;
+          opts->last_after_include = dirtmp; /* Tail follows the last one */
+        }
+        /* Add directory to main path for includes,
+        with the default prefix at the front of its name.  */
+        if (!strcmp (argv[i], "-iwithprefixbefore")) {
+          struct file_name_list *dirtmp;
+          char *prefix;
+
+          if (opts->include_prefix != 0)
+            prefix = opts->include_prefix;
+          else {
+            prefix = savestring (GCC_INCLUDE_DIR);
+            /* Remove the `include' from /usr/local/lib/gcc.../include.  */
+            if (!strcmp (prefix + strlen (prefix) - 8, "/include"))
+              prefix[strlen (prefix) - 7] = 0;
+          }
+
+          dirtmp = (struct file_name_list *)
+            Safe_malloc (sizeof (struct file_name_list));
+          dirtmp->next = 0; /* New one goes on the end */
+          dirtmp->control_macro = 0;
+          dirtmp->c_system_include_path = 0;
+          if (i + 1 == argc)
+            fatal ("Directory name missing after `-iwithprefixbefore' option");
+
+          dirtmp->fname = (char *) Safe_malloc (strlen (argv[i+1])
+            + strlen (prefix) + 1);
+          strcpy (dirtmp->fname, prefix);
+          strcat (dirtmp->fname, argv[++i]);
+          dirtmp->got_name_map = 0;
+
+          append_include_chain (pfile, dirtmp, dirtmp);
+        }
+        /* Add directory to end of path for includes.  */
+        if (!strcmp (argv[i], "-idirafter")) {
+          struct file_name_list *dirtmp;
+
+          dirtmp = (struct file_name_list *)
+            Safe_malloc (sizeof (struct file_name_list));
+          dirtmp->next = 0; /* New one goes on the end */
+          dirtmp->control_macro = 0;
+          dirtmp->c_system_include_path = 0;
+          if (i + 1 == argc)
+            fatal ("Directory name missing after `-idirafter' option");
+          else
+            dirtmp->fname = argv[++i];
+          dirtmp->got_name_map = 0;
+
+          if (opts->after_include == 0)
+            opts->after_include = dirtmp;
+          else
+            opts->last_after_include->next = dirtmp;
+          opts->last_after_include = dirtmp; /* Tail follows the last one */
+        }
+        break;
+
+          case 'o':
+            if (opts->out_fname != NULL)
+              fatal ("Output filename specified twice");
+            if (i + 1 == argc)
+              fatal ("Filename missing after -o option");
+            opts->out_fname = argv[++i];
+            if (!strcmp (opts->out_fname, "-"))
+              opts->out_fname = "";
+            break;
+
+          case 'p':
+            if (!strcmp (argv[i], "-pedantic"))
+              CPP_PEDANTIC (pfile) = 1;
+            else if (!strcmp (argv[i], "-pedantic-errors")) {
+              CPP_PEDANTIC (pfile) = 1;
+              opts->pedantic_errors = 1;
+            }
 #if 0
-                                               else if (!strcmp (argv[i], "-pcp")) {
-                                                       char *pcp_fname = argv[++i];
-                                                       pcp_outfile = 
-                                                               ((pcp_fname[0] != '-' || pcp_fname[1] != '\0')
-                                                               ? fopen (pcp_fname, "w")
-                                                               : fdopen (dup (fileno (stdout)), "w"));
-                                                       if (pcp_outfile == 0)
-                                                               cpp_pfatal_with_name (pfile, pcp_fname);
-                                                       no_precomp = 1;
-                                               }
+            else if (!strcmp (argv[i], "-pcp")) {
+              char *pcp_fname = argv[++i];
+              pcp_outfile =
+                ((pcp_fname[0] != '-' || pcp_fname[1] != '\0')
+                ? fopen (pcp_fname, "w")
+                : fdopen (dup (fileno (stdout)), "w"));
+              if (pcp_outfile == 0)
+                cpp_pfatal_with_name (pfile, pcp_fname);
+              no_precomp = 1;
+            }
 #endif
-                                               break;
-                                               
-                                       case 't':
-                                               if (!strcmp (argv[i], "-traditional")) {
-                                                       opts->traditional = 1;
-                                                       if (opts->dollars_in_ident > 0)
-                                                               opts->dollars_in_ident = 1;
-                                               } else if (!strcmp (argv[i], "-trigraphs")) {
-                                                       if (!opts->chill)
-                                                               opts->no_trigraphs = 0;
-                                               }
-                                               break;
-                                               
-                                       case 'l':
-                                               if (! strcmp (argv[i], "-lang-c"))
-                                                       opts->cplusplus = 0, opts->cplusplus_comments = 0, opts->objc = 0;
-                                               if (! strcmp (argv[i], "-lang-c++"))
-                                                       opts->cplusplus = 1, opts->cplusplus_comments = 1, opts->objc = 0;
-                                               if (! strcmp (argv[i], "-lang-c-c++-comments"))
-                                                       opts->cplusplus = 0, opts->cplusplus_comments = 1, opts->objc = 0;
-                                               if (! strcmp (argv[i], "-lang-objc"))
-                                                       opts->objc = 1, opts->cplusplus = 0, opts->cplusplus_comments = 1;
-                                               if (! strcmp (argv[i], "-lang-objc++"))
-                                                       opts->objc = 1, opts->cplusplus = 1, opts->cplusplus_comments = 1;
-                                               if (! strcmp (argv[i], "-lang-asm"))
-                                                       opts->lang_asm = 1;
-                                               if (! strcmp (argv[i], "-lint"))
-                                                       opts->for_lint = 1;
-                                               if (! strcmp (argv[i], "-lang-chill"))
-                                                       opts->objc = 0, opts->cplusplus = 0, opts->chill = 1,
-                                                       opts->traditional = 1, opts->no_trigraphs = 1;
-                                               break;
-                                               
-                                       case '+':
-                                               opts->cplusplus = 1, opts->cplusplus_comments = 1;
-                                               break;
-                                               
-                                       case 'w':
-                                               opts->inhibit_warnings = 1;
-                                               break;
-                                               
-                                       case 'W':
-                                               if (!strcmp (argv[i], "-Wtrigraphs"))
-                                                       opts->warn_trigraphs = 1;
-                                               else if (!strcmp (argv[i], "-Wno-trigraphs"))
-                                                       opts->warn_trigraphs = 0;
-                                               else if (!strcmp (argv[i], "-Wcomment"))
-                                                       opts->warn_comments = 1;
-                                               else if (!strcmp (argv[i], "-Wno-comment"))
-                                                       opts->warn_comments = 0;
-                                               else if (!strcmp (argv[i], "-Wcomments"))
-                                                       opts->warn_comments = 1;
-                                               else if (!strcmp (argv[i], "-Wno-comments"))
-                                                       opts->warn_comments = 0;
-                                               else if (!strcmp (argv[i], "-Wtraditional"))
-                                                       opts->warn_stringify = 1;
-                                               else if (!strcmp (argv[i], "-Wno-traditional"))
-                                                       opts->warn_stringify = 0;
-                                               else if (!strcmp (argv[i], "-Wimport"))
-                                                       opts->warn_import = 1;
-                                               else if (!strcmp (argv[i], "-Wno-import"))
-                                                       opts->warn_import = 0;
-                                               else if (!strcmp (argv[i], "-Werror"))
-                                                       opts->warnings_are_errors = 1;
-                                               else if (!strcmp (argv[i], "-Wno-error"))
-                                                       opts->warnings_are_errors = 0;
-                                               else if (!strcmp (argv[i], "-Wall"))
-                                               {
-                                                       opts->warn_trigraphs = 1;
-                                                       opts->warn_comments = 1;
-                                               }
-                                               break;
-                                               
-                                       case 'M':
-                                       /* The style of the choices here is a bit mixed.
-                                       The chosen scheme is a hybrid of keeping all options in one string
-                                       and specifying each option in a separate argument:
-                                       -M|-MM|-MD file|-MMD file [-MG].  An alternative is:
-                                       -M|-MM|-MD file|-MMD file|-MG|-MMG; or more concisely:
-                                       -M[M][G][D file].  This is awkward to handle in specs, and is not
-                                               as extensible.  */
-                                               /* ??? -MG must be specified in addition to one of -M or -MM.
-                                               This can be relaxed in the future without breaking anything.
-                                               The converse isn't true.  */
-                                               
-                                               /* -MG isn't valid with -MD or -MMD.  This is checked for later.  */
-                                               if (!strcmp (argv[i], "-MG"))
-                                               {
-                                                       opts->print_deps_missing_files = 1;
-                                                       break;
-                                               }
-                                               if (!strcmp (argv[i], "-M"))
-                                                       opts->print_deps = 2;
-                                               else if (!strcmp (argv[i], "-MM"))
-                                                       opts->print_deps = 1;
-                                               else if (!strcmp (argv[i], "-MD"))
-                                                       opts->print_deps = 2;
-                                               else if (!strcmp (argv[i], "-MMD"))
-                                                       opts->print_deps = 1;
-                                               /* For -MD and -MMD options, write deps on file named by next arg.  */
-                                               if (!strcmp (argv[i], "-MD") || !strcmp (argv[i], "-MMD"))
-                                               {
-                                                       if (i+1 == argc)
-                                                               fatal ("Filename missing after %s option", argv[i]);
-                                                       opts->deps_file = argv[++i];
-                                               }
-                                               else
-                                               {
-                                               /* For -M and -MM, write deps on standard output
-                                                       and suppress the usual output.  */
-                                                       opts->no_output = 1;
-                                               }         
-                                               break;
-                                               
-                                       case 'd':
-                                               {
-                                                       char *p = argv[i] + 2;
-                                                       char c;
-                                                       while ((c = *p++) != 0) {
-                                                               /* Arg to -d specifies what parts of macros to dump */
-                                                               switch (c) {
-                                                               case 'M':
-                                                                       opts->dump_macros = dump_only;
-                                                                       opts->no_output = 1;
-                                                                       break;
-                                                               case 'N':
-                                                                       opts->dump_macros = dump_names;
-                                                                       break;
-                                                               case 'D':
-                                                                       opts->dump_macros = dump_definitions;
-                                                                       break;
-                                                               }
-                                                       }
-                                               }
-                                               break;
-                                               
-                                       case 'g':
-                                               if (argv[i][2] == '3')
-                                                       opts->debug_output = 1;
-                                               break;
-                                               
-                                       case 'v':
-                                               fprintf (stderr, "GNU CPP version %s", version_string);
+            break;
+
+          case 't':
+            if (!strcmp (argv[i], "-traditional")) {
+              opts->traditional = 1;
+              if (opts->dollars_in_ident > 0)
+                opts->dollars_in_ident = 1;
+            } else if (!strcmp (argv[i], "-trigraphs")) {
+              if (!opts->chill)
+                opts->no_trigraphs = 0;
+            }
+            break;
+
+          case 'l':
+            if (! strcmp (argv[i], "-lang-c"))
+              opts->cplusplus = 0, opts->cplusplus_comments = 0, opts->objc = 0;
+            if (! strcmp (argv[i], "-lang-c++"))
+              opts->cplusplus = 1, opts->cplusplus_comments = 1, opts->objc = 0;
+            if (! strcmp (argv[i], "-lang-c-c++-comments"))
+              opts->cplusplus = 0, opts->cplusplus_comments = 1, opts->objc = 0;
+            if (! strcmp (argv[i], "-lang-objc"))
+              opts->objc = 1, opts->cplusplus = 0, opts->cplusplus_comments = 1;
+            if (! strcmp (argv[i], "-lang-objc++"))
+              opts->objc = 1, opts->cplusplus = 1, opts->cplusplus_comments = 1;
+            if (! strcmp (argv[i], "-lang-asm"))
+              opts->lang_asm = 1;
+            if (! strcmp (argv[i], "-lint"))
+              opts->for_lint = 1;
+            if (! strcmp (argv[i], "-lang-chill"))
+              opts->objc = 0, opts->cplusplus = 0, opts->chill = 1,
+              opts->traditional = 1, opts->no_trigraphs = 1;
+            break;
+
+          case '+':
+            opts->cplusplus = 1, opts->cplusplus_comments = 1;
+            break;
+
+          case 'w':
+            opts->inhibit_warnings = 1;
+            break;
+
+          case 'W':
+            if (!strcmp (argv[i], "-Wtrigraphs"))
+              opts->warn_trigraphs = 1;
+            else if (!strcmp (argv[i], "-Wno-trigraphs"))
+              opts->warn_trigraphs = 0;
+            else if (!strcmp (argv[i], "-Wcomment"))
+              opts->warn_comments = 1;
+            else if (!strcmp (argv[i], "-Wno-comment"))
+              opts->warn_comments = 0;
+            else if (!strcmp (argv[i], "-Wcomments"))
+              opts->warn_comments = 1;
+            else if (!strcmp (argv[i], "-Wno-comments"))
+              opts->warn_comments = 0;
+            else if (!strcmp (argv[i], "-Wtraditional"))
+              opts->warn_stringify = 1;
+            else if (!strcmp (argv[i], "-Wno-traditional"))
+              opts->warn_stringify = 0;
+            else if (!strcmp (argv[i], "-Wimport"))
+              opts->warn_import = 1;
+            else if (!strcmp (argv[i], "-Wno-import"))
+              opts->warn_import = 0;
+            else if (!strcmp (argv[i], "-Werror"))
+              opts->warnings_are_errors = 1;
+            else if (!strcmp (argv[i], "-Wno-error"))
+              opts->warnings_are_errors = 0;
+            else if (!strcmp (argv[i], "-Wall"))
+            {
+              opts->warn_trigraphs = 1;
+              opts->warn_comments = 1;
+            }
+            break;
+
+          case 'M':
+          /* The style of the choices here is a bit mixed.
+          The chosen scheme is a hybrid of keeping all options in one string
+          and specifying each option in a separate argument:
+          -M|-MM|-MD file|-MMD file [-MG].  An alternative is:
+          -M|-MM|-MD file|-MMD file|-MG|-MMG; or more concisely:
+          -M[M][G][D file].  This is awkward to handle in specs, and is not
+            as extensible.  */
+            /* ??? -MG must be specified in addition to one of -M or -MM.
+            This can be relaxed in the future without breaking anything.
+            The converse isn't true.  */
+
+            /* -MG isn't valid with -MD or -MMD.  This is checked for later.  */
+            if (!strcmp (argv[i], "-MG"))
+            {
+              opts->print_deps_missing_files = 1;
+              break;
+            }
+            if (!strcmp (argv[i], "-M"))
+              opts->print_deps = 2;
+            else if (!strcmp (argv[i], "-MM"))
+              opts->print_deps = 1;
+            else if (!strcmp (argv[i], "-MD"))
+              opts->print_deps = 2;
+            else if (!strcmp (argv[i], "-MMD"))
+              opts->print_deps = 1;
+            /* For -MD and -MMD options, write deps on file named by next arg.  */
+            if (!strcmp (argv[i], "-MD") || !strcmp (argv[i], "-MMD"))
+            {
+              if (i+1 == argc)
+                fatal ("Filename missing after %s option", argv[i]);
+              opts->deps_file = argv[++i];
+            }
+            else
+            {
+            /* For -M and -MM, write deps on standard output
+              and suppress the usual output.  */
+              opts->no_output = 1;
+            }
+            break;
+
+          case 'd':
+            {
+              char *p = argv[i] + 2;
+              char c;
+              while ((c = *p++) != 0) {
+                /* Arg to -d specifies what parts of macros to dump */
+                switch (c) {
+                case 'M':
+                  opts->dump_macros = dump_only;
+                  opts->no_output = 1;
+                  break;
+                case 'N':
+                  opts->dump_macros = dump_names;
+                  break;
+                case 'D':
+                  opts->dump_macros = dump_definitions;
+                  break;
+                }
+              }
+            }
+            break;
+
+          case 'g':
+            if (argv[i][2] == '3')
+              opts->debug_output = 1;
+            break;
+
+          case 'v':
+            fprintf (stderr, "GNU CPP version %s", version_string);
 #ifdef TARGET_VERSION
-                                               TARGET_VERSION;
+            TARGET_VERSION;
 #endif
-                                               fprintf (stderr, "\n");
-                                               // opts->verbose = 1;
-                                               break;
-                                               
-                                       case 'H':
-                                               opts->print_include_names = 1;
-                                               break;
-                                               
-                                       case 'D':
-                                               if (argv[i][2] != 0)
-                                                       push_pending (pfile, "-D", argv[i] + 2);
-                                               else if (i + 1 == argc)
-                                                       fatal ("Macro name missing after -D option");
-                                               else
-                                                       i++, push_pending (pfile, "-D", argv[i]);
-                                               break;
-                                               
-                                       case 'A':
-                                               {
-                                                       char *p;
-                                                       
-                                                       if (argv[i][2] != 0)
-                                                               p = argv[i] + 2;
-                                                       else if (i + 1 == argc)
-                                                               fatal ("Assertion missing after -A option");
-                                                       else
-                                                               p = argv[++i];
-                                                       
-                                                       if (!strcmp (p, "-")) {
-                                                               struct cpp_pending **ptr;
-                                                               /* -A- eliminates all predefined macros and assertions.
-                                                               Let's include also any that were specified earlier
-                                                               on the command line.  That way we can get rid of any
-                                                               that were passed automatically in from GCC.  */
-                                                               int j;
-                                                               opts->inhibit_predefs = 1;
-                                                               for (ptr = &opts->pending; *ptr != NULL; )
-                                                               {
-                                                                       struct cpp_pending *pend = *ptr;
-                                                                       if (pend->cmd && pend->cmd[0] == '-'
-                                                                               && (pend->cmd[1] == 'D' || pend->cmd[1] == 'A'))
-                                                                       {
-                                                                               *ptr = pend->next;
-                                                                               free (pend);
-                                                                       }
-                                                                       else
-                                                                               ptr = &pend->next;
-                                                               }
-                                                       } else {
-                                                               push_pending (pfile, "-A", p);
-                                                       }
-                                               }
-                                               break;
-                                               
-                                       case 'U':               /* JF #undef something */
-                                               if (argv[i][2] != 0)
-                                                       push_pending (pfile, "-U", argv[i] + 2);
-                                               else if (i + 1 == argc)
-                                                       fatal ("Macro name missing after -U option");
-                                               else
-                                                       push_pending (pfile, "-U", argv[i+1]), i++;
-                                               break;
-                                               
-                                       case 'C':
-                                               opts->put_out_comments = 1;
-                                               break;
-                                               
-                                       case 'E':                       /* -E comes from cc -E; ignore it.  */
-                                               break;
-                                               
-                                       case 'P':
-                                               opts->no_line_commands = 1;
-                                               break;
-                                               
-                                       case '$':                       /* Don't include $ in identifiers.  */
-                                               opts->dollars_in_ident = 0;
-                                               break;
-                                               
-                                       case 'I':                       /* Add directory to path for includes.  */
-                                               {
-                                                       struct file_name_list *dirtmp;
-                                                       
-                                                       if (! CPP_OPTIONS(pfile)->ignore_srcdir
-                                                               && !strcmp (argv[i] + 2, "-")) {
-                                                               CPP_OPTIONS (pfile)->ignore_srcdir = 1;
-                                                               /* Don't use any preceding -I directories for #include <...>.  */
-                                                               CPP_OPTIONS (pfile)->first_bracket_include = 0;
-                                                       }
-                                                       else {
-                                                               dirtmp = (struct file_name_list *)
-                                                                       Safe_malloc (sizeof (struct file_name_list));
-                                                               dirtmp->next = 0;               /* New one goes on the end */
-                                                               dirtmp->control_macro = 0;
-                                                               dirtmp->c_system_include_path = 0;
-                                                               if (argv[i][2] != 0)
-                                                                       dirtmp->fname = argv[i] + 2;
-                                                               else if (i + 1 == argc)
-                                                                       fatal ("Directory name missing after -I option");
-                                                               else
-                                                                       dirtmp->fname = argv[++i];
-                                                               dirtmp->got_name_map = 0;
-                                                               append_include_chain (pfile, dirtmp, dirtmp);
-                                                       }
-                                               }
-                                               break;
-                                               
-                                       case 'n':
-                                               if (!strcmp (argv[i], "-nostdinc"))
-                                               /* -nostdinc causes no default include directories.
-                                               You must specify all include-file directories with -I.  */
-                                               opts->no_standard_includes = 1;
-                                               else if (!strcmp (argv[i], "-nostdinc++"))
-                                                       /* -nostdinc++ causes no default C++-specific include directories. */
-                                                       opts->no_standard_cplusplus_includes = 1;
+            fprintf (stderr, "\n");
+            // opts->verbose = 1;
+            break;
+
+          case 'H':
+            opts->print_include_names = 1;
+            break;
+
+          case 'D':
+            if (argv[i][2] != 0)
+              push_pending (pfile, "-D", argv[i] + 2);
+            else if (i + 1 == argc)
+              fatal ("Macro name missing after -D option");
+            else
+              i++, push_pending (pfile, "-D", argv[i]);
+            break;
+
+          case 'A':
+            {
+              char *p;
+
+              if (argv[i][2] != 0)
+                p = argv[i] + 2;
+              else if (i + 1 == argc)
+                fatal ("Assertion missing after -A option");
+              else
+                p = argv[++i];
+
+              if (!strcmp (p, "-")) {
+                struct cpp_pending **ptr;
+                /* -A- eliminates all predefined macros and assertions.
+                Let's include also any that were specified earlier
+                on the command line.  That way we can get rid of any
+                that were passed automatically in from GCC.  */
+                int j;
+                opts->inhibit_predefs = 1;
+                for (ptr = &opts->pending; *ptr != NULL; )
+                {
+                  struct cpp_pending *pend = *ptr;
+                  if (pend->cmd && pend->cmd[0] == '-'
+                    && (pend->cmd[1] == 'D' || pend->cmd[1] == 'A'))
+                  {
+                    *ptr = pend->next;
+                    free (pend);
+                  }
+                  else
+                    ptr = &pend->next;
+                }
+              } else {
+                push_pending (pfile, "-A", p);
+              }
+            }
+            break;
+
+          case 'U':   /* JF #undef something */
+            if (argv[i][2] != 0)
+              push_pending (pfile, "-U", argv[i] + 2);
+            else if (i + 1 == argc)
+              fatal ("Macro name missing after -U option");
+            else
+              push_pending (pfile, "-U", argv[i+1]), i++;
+            break;
+
+          case 'C':
+            opts->put_out_comments = 1;
+            break;
+
+          case 'E':     /* -E comes from cc -E; ignore it.  */
+            break;
+
+          case 'P':
+            opts->no_line_commands = 1;
+            break;
+
+          case '$':     /* Don't include $ in identifiers.  */
+            opts->dollars_in_ident = 0;
+            break;
+
+          case 'I':     /* Add directory to path for includes.  */
+            {
+              struct file_name_list *dirtmp;
+
+              if (! CPP_OPTIONS(pfile)->ignore_srcdir
+                && !strcmp (argv[i] + 2, "-")) {
+                CPP_OPTIONS (pfile)->ignore_srcdir = 1;
+                /* Don't use any preceding -I directories for #include <...>.  */
+                CPP_OPTIONS (pfile)->first_bracket_include = 0;
+              }
+              else {
+                dirtmp = (struct file_name_list *)
+                  Safe_malloc (sizeof (struct file_name_list));
+                dirtmp->next = 0;   /* New one goes on the end */
+                dirtmp->control_macro = 0;
+                dirtmp->c_system_include_path = 0;
+                if (argv[i][2] != 0)
+                  dirtmp->fname = argv[i] + 2;
+                else if (i + 1 == argc)
+                  fatal ("Directory name missing after -I option");
+                else
+                  dirtmp->fname = argv[++i];
+                dirtmp->got_name_map = 0;
+                append_include_chain (pfile, dirtmp, dirtmp);
+              }
+            }
+            break;
+
+          case 'n':
+            if (!strcmp (argv[i], "-nostdinc"))
+            /* -nostdinc causes no default include directories.
+            You must specify all include-file directories with -I.  */
+            opts->no_standard_includes = 1;
+            else if (!strcmp (argv[i], "-nostdinc++"))
+              /* -nostdinc++ causes no default C++-specific include directories. */
+              opts->no_standard_cplusplus_includes = 1;
 #if 0
-                                               else if (!strcmp (argv[i], "-noprecomp"))
-                                                       no_precomp = 1;
+            else if (!strcmp (argv[i], "-noprecomp"))
+              no_precomp = 1;
 #endif
-                                               break;
-                                               
-                                       case 'u':
-                                       /* Sun compiler passes undocumented switch "-undef".
-                                               Let's assume it means to inhibit the predefined symbols.  */
-                                               opts->inhibit_predefs = 1;
-                                               break;
-                                               
-                                       case '\0': /* JF handle '-' as file name meaning stdin or stdout */
-                                               if (opts->in_fname == NULL) {
-                                                       opts->in_fname = "";
-                                                       break;
-                                               } else if (opts->out_fname == NULL) {
-                                                       opts->out_fname = "";
-                                                       break;
-                                               }       /* else fall through into error */
-                                               
-                                       default:
-                                               return i;
+            break;
+
+          case 'u':
+          /* Sun compiler passes undocumented switch "-undef".
+            Let's assume it means to inhibit the predefined symbols.  */
+            opts->inhibit_predefs = 1;
+            break;
+
+          case '\0': /* JF handle '-' as file name meaning stdin or stdout */
+            if (opts->in_fname == NULL) {
+              opts->in_fname = "";
+              break;
+            } else if (opts->out_fname == NULL) {
+              opts->out_fname = "";
+              break;
+            } /* else fall through into error */
+
+          default:
+            return i;
       }
     }
   }
@@ -6758,7 +6758,7 @@ cpp_finish (
      cpp_reader *pfile)
 {
   struct cpp_options *opts = CPP_OPTIONS (pfile);
-  
+
   if (opts->print_deps)
     {
       /* Stream on which to print the dependency information.  */
@@ -6766,20 +6766,20 @@ cpp_finish (
 
       /* Don't actually write the deps file if compilation has failed.  */
       if (pfile->errors == 0)
-       {
-         char *deps_mode = opts->print_deps_append ? "a" : "w";
-         if (opts->deps_file == 0)
-           deps_stream = stdout;
-         else if ((deps_stream = fopen (opts->deps_file, deps_mode)) == 0)
-           cpp_pfatal_with_name (pfile, opts->deps_file);
-         fputs (pfile->deps_buffer, deps_stream);
-         putc ('\n', deps_stream);
-         if (opts->deps_file)
-           {
-             if (ferror (deps_stream) || fclose (deps_stream) != 0)
-               fatal ("I/O error on output");
-           }
-       }
+  {
+    char *deps_mode = opts->print_deps_append ? "a" : "w";
+    if (opts->deps_file == 0)
+      deps_stream = stdout;
+    else if ((deps_stream = fopen (opts->deps_file, deps_mode)) == 0)
+      cpp_pfatal_with_name (pfile, opts->deps_file);
+    fputs (pfile->deps_buffer, deps_stream);
+    putc ('\n', deps_stream);
+    if (opts->deps_file)
+      {
+        if (ferror (deps_stream) || fclose (deps_stream) != 0)
+    fatal ("I/O error on output");
+      }
+  }
     }
 }
 
@@ -6833,19 +6833,19 @@ cpp_cleanup (
     {
       register struct import_file *imp = pfile->import_hash_table[i];
       while (imp)
-       {
-         struct import_file *next = imp->next;
-         free (imp->name);
-         free (imp);
-         imp = next;
-       }
+  {
+    struct import_file *next = imp->next;
+    free (imp->name);
+    free (imp);
+    imp = next;
+  }
       pfile->import_hash_table[i] = 0;
     }
 
   for (i = ASSERTION_HASHSIZE; --i >= 0; )
     {
       while (pfile->assertion_hashtab[i])
-       delete_assertion (pfile->assertion_hashtab[i]);
+  delete_assertion (pfile->assertion_hashtab[i]);
     }
 
   cpp_hash_cleanup (pfile);
@@ -6857,9 +6857,9 @@ do_assert (
      struct directive *keyword,
      U_CHAR *buf, U_CHAR *limit)
 {
-  long symstart;               /* remember where symbol name starts */
+  long symstart;    /* remember where symbol name starts */
   int c;
-  int sym_length;              /* and how long it is */
+  int sym_length;   /* and how long it is */
   struct arglist *tokens = NULL;
 
   if (CPP_PEDANTIC (pfile) && CPP_OPTIONS (pfile)->done_initializing
@@ -6867,10 +6867,10 @@ do_assert (
     cpp_pedwarn (pfile, "ANSI C does not allow `#assert'");
 
   cpp_skip_hspace (pfile);
-  symstart = CPP_WRITTEN (pfile);      /* remember where it starts */
+  symstart = CPP_WRITTEN (pfile); /* remember where it starts */
   parse_name (pfile, GETC());
   sym_length = check_macro_name (pfile, pfile->token_buffer + symstart,
-                                "assertion");
+         "assertion");
 
   cpp_skip_hspace (pfile);
   if (PEEKC() != '(') {
@@ -6907,7 +6907,7 @@ do_assert (
     hp = assertion_lookup (pfile, symname, sym_length, hashcode);
     if (hp == NULL) {
       if (sym_length == 7 && ! strncmp (symname, "defined", sym_length))
-       cpp_error (pfile, "`defined' redefined as assertion");
+  cpp_error (pfile, "`defined' redefined as assertion");
       hp = assertion_install (pfile, symname, sym_length, hashcode);
     }
 
@@ -6930,8 +6930,8 @@ do_unassert (
      struct directive *keyword,
      U_CHAR *buf, U_CHAR *limit)
 {
-  long symstart;               /* remember where symbol name starts */
-  int sym_length;      /* and how long it is */
+  long symstart;    /* remember where symbol name starts */
+  int sym_length; /* and how long it is */
   int c;
 
   struct arglist *tokens = NULL;
@@ -6943,10 +6943,10 @@ do_unassert (
 
   cpp_skip_hspace (pfile);
 
-  symstart = CPP_WRITTEN (pfile);      /* remember where it starts */
+  symstart = CPP_WRITTEN (pfile); /* remember where it starts */
   parse_name (pfile, GETC());
   sym_length = check_macro_name (pfile, pfile->token_buffer + symstart,
-                                "assertion");
+         "assertion");
 
   cpp_skip_hspace (pfile);
   if (PEEKC() == '(') {
@@ -6989,18 +6989,18 @@ do_unassert (
       tail = hp->value;
       prev = 0;
       while (tail) {
-       struct tokenlist_list *next = tail->next;
-       if (compare_token_lists (tail->tokens, tokens)) {
-         if (prev)
-           prev->next = next;
-         else
-           hp->value = tail->next;
-         free_token_list (tail->tokens);
-         free (tail);
-       } else {
-         prev = tail;
-       }
-       tail = next;
+  struct tokenlist_list *next = tail->next;
+  if (compare_token_lists (tail->tokens, tokens)) {
+    if (prev)
+      prev->next = next;
+    else
+      hp->value = tail->next;
+    free_token_list (tail->tokens);
+    free (tail);
+  } else {
+    prev = tail;
+  }
+  tail = next;
       }
     }
   }
@@ -7051,7 +7051,7 @@ check_assertion (
 
     while (tail) {
       if (compare_token_lists (tail->tokens, tokens))
-       return 1;
+  return 1;
       tail = tail->next;
     }
 
@@ -7119,44 +7119,44 @@ read_token_list (
       cpp_skip_hspace (pfile);
 
       c = GETC ();
-         
+
       /* Find the end of the token.  */
       if (c == '(')
         {
-         CPP_PUTC (pfile, c);
-         depth++;
+    CPP_PUTC (pfile, c);
+    depth++;
         }
       else if (c == ')')
         {
-         depth--;
-         if (depth == 0)
-           break;
-         CPP_PUTC (pfile, c);
+    depth--;
+    if (depth == 0)
+      break;
+    CPP_PUTC (pfile, c);
         }
       else if (c == '"' || c == '\'')
         {
-         FORWARD(-1);
-         cpp_get_token (pfile);
+    FORWARD(-1);
+    cpp_get_token (pfile);
         }
       else if (c == '\n')
-       break;
+  break;
       else
         {
-         while (c != EOF && ! is_space[c] && c != '(' && c != ')'
-                && c != '"' && c != '\'')
-           {
-             CPP_PUTC (pfile, c);
-             c = GETC();
-           }
-         if (c != EOF)  FORWARD(-1);
+    while (c != EOF && ! is_space[c] && c != '(' && c != ')'
+     && c != '"' && c != '\'')
+      {
+        CPP_PUTC (pfile, c);
+        c = GETC();
+      }
+    if (c != EOF)  FORWARD(-1);
         }
 
       length = CPP_WRITTEN (pfile) - name_written;
       temp = (struct arglist *)
-         Safe_malloc (sizeof (struct arglist) + length + 1);
+    Safe_malloc (sizeof (struct arglist) + length + 1);
       temp->name = (U_CHAR *) (temp + 1);
       bcopy ((char *) (pfile->token_buffer + name_written),
-            (char *) temp->name, length);
+       (char *) temp->name, length);
       temp->name[length] = 0;
       temp->next = token_ptrs;
       token_ptrs = temp;
@@ -7166,10 +7166,10 @@ read_token_list (
 
       if (c == EOF || c == '\n')
         { /* FIXME */
-         cpp_error (pfile,
-                    "unterminated token sequence following  `#' operator");
-         return 0;
-       }
+    cpp_error (pfile,
+         "unterminated token sequence following  `#' operator");
+    return 0;
+  }
     }
 
   /* We accumulated the names in reverse order.
@@ -7223,10 +7223,10 @@ safe_read (
     if (nchars < 0)
       {
 #ifdef EINTR
-       if (errno == EINTR)
-         continue;
+  if (errno == EINTR)
+    continue;
 #endif
-       return nchars;
+  return nchars;
       }
     if (nchars == 0)
       break;
@@ -7317,13 +7317,13 @@ cpp_read_check_assertion (
       int error_flag;
       struct arglist *token_ptrs = read_token_list (pfile, &error_flag);
       result = check_assertion (pfile,
-                               pfile->token_buffer + name_start, name_length,
-                               1, token_ptrs);
+        pfile->token_buffer + name_start, name_length,
+        1, token_ptrs);
     }
   else
     result = check_assertion (pfile,
-                             pfile->token_buffer + name_start, name_length,
-                             0, NULL_PTR);
+            pfile->token_buffer + name_start, name_length,
+            0, NULL_PTR);
   CPP_ADJUST_WRITTEN (pfile, - name_length);  /* pop */
   return result;
 }
@@ -7339,7 +7339,7 @@ cpp_print_file_and_line (pfile)
       long line, col;
       cpp_buf_line_and_col (ip, &line, &col);
       cpp_file_line_for_message (pfile, ip->nominal_fname,
-                                line, pfile->show_column ? col : -1);
+         line, pfile->show_column ? col : -1);
     }
 }
 
@@ -7461,7 +7461,7 @@ cpp_pedwarn_with_file_and_line (pfile, file, line, msg, arg1, arg2, arg3)
   if (file != NULL)
     cpp_file_line_for_message (pfile, file, line, -1);
   cpp_message (pfile, CPP_OPTIONS (pfile)->pedantic_errors,
-              msg, arg1, arg2, arg3);
+         msg, arg1, arg2, arg3);
 }
 
 /* This defines "errno" properly for VMS, and gives us EACCES. */
@@ -7480,10 +7480,10 @@ extern const char *const sys_errlist[];
 extern char *sys_errlist[];
 #endif
 #endif
-#else  /* HAVE_STRERROR */
+#else /* HAVE_STRERROR */
 char *strerror ();
 #endif
-#else  /* VMS */
+#else /* VMS */
 char *strerror (int,...);
 #endif
 
@@ -7503,7 +7503,7 @@ my_strerror (errnum)
 #else
   result = strerror (errnum);
 #endif
-#else  /* VMS */
+#else /* VMS */
   /* VAXCRTL's strerror() takes an optional second argument, which only
      matters when the first argument is EVMSERR.  However, it's simplest
      just to pass it unconditionally.  `vaxc$errno' is declared in